panel icon indicating copy to clipboard operation
panel copied to clipboard

feat: CryptoBot payments

Open gru2007 opened this issue 10 months ago • 15 comments

I’m just adding new optional payment method

what is it? - https://help.crypt.bot/crypto-pay-api

gru2007 avatar Apr 11 '24 05:04 gru2007

Hi! It looks very cool, but could you change the Russian localization to English? Thank you for helping to improve cpgg ❤️

MrWeez avatar Apr 11 '24 05:04 MrWeez

Only one thing, for some reason money doesn’t add after sending event with payment. So I added this construction:

try {
            $user->increment('credits', $payment->amount);
        } catch (Exception $exception) {
            throw $exception;
        }

I’m sure, that it is not right way to do that. I don’t know what happens in your code.

gru2007 avatar Apr 11 '24 05:04 gru2007

Hi! It looks very cool, but could you change the Russian localization to English? Thank you for helping to improve cpgg ❤️

Oh sorry, I have missed that. Couple minutes.

gru2007 avatar Apr 11 '24 05:04 gru2007

awesome!

1day2die avatar Apr 11 '24 08:04 1day2die

Only one thing, for some reason money doesn’t add after sending event with payment. So I added this construction:

try {
            $user->increment('credits', $payment->amount);
        } catch (Exception $exception) {
            throw $exception;
        }

I’m sure, that it is not right way to do that. I don’t know what happens in your code.

@IceToast mind checking this?

1day2die avatar Apr 11 '24 08:04 1day2die

So i see you've created a extension with all the necessary information. I will sketch out the payment workflow:

User payment request -> URL fetching from extension -> Redirecting to payment URL -> ... -> Success redirection to success route of extension -> done

Gateway Webhook -> request to extension webhook route -> sets a payment as "paid" -> emits a user payment event -> payment listener updates user credits and possibly any new limits -> done

The first thing i noticed is that you might want to validate that the webhook request actually wants to update a payment to the PAID status. In your PR it will set it to PAID under any circumstances? Maybe im missing something about the gateway.

For your problem: You should debug into CryptoBotExtension.php:110 to see whether the event really gets triggered and what da parameters are. If everything is processed correctly the event will be listened to in here: Listeners/UserPayment.php

IceToast avatar Apr 11 '24 08:04 IceToast

@IceToast Thanks, I will come back with result soon.

gru2007 avatar Apr 11 '24 11:04 gru2007

@gru2007 Is there any news about fixes?

MrWeez avatar May 22 '24 20:05 MrWeez

@gru2007 Is there any news about fixes?

Excuse me for afk, I just haven’t enough time to solve that right now. I’ll do it in near future.

gru2007 avatar May 22 '24 21:05 gru2007

@gru2007 Is there any news about fixes?

Excuse me for afk, I just haven’t enough time to solve that right now. I’ll do it in near future.

Ok, no problem

MrWeez avatar May 22 '24 21:05 MrWeez

updated the branch @gru2007 any news ? :)

S0ly avatar Jul 24 '24 14:07 S0ly

damn good review

S0ly avatar Jul 25 '24 12:07 S0ly

damn good review

I decided to double-check this PR so that there would be no problems in the future

MrWeez avatar Jul 25 '24 12:07 MrWeez

any update ?

S0ly avatar Sep 06 '24 14:09 S0ly

if there is no update soon this PR will be closed

S0ly avatar Sep 24 '24 03:09 S0ly