-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CryptoBot payments #940
base: development
Are you sure you want to change the base?
Conversation
Hi! It looks very cool, but could you change the Russian localization to English? |
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. |
Oh sorry, I have missed that. Couple minutes. |
awesome! |
@IceToast mind checking this? |
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 Thanks, I will come back with result soon. |
{ | ||
|
||
public bool $enabled = false; | ||
public ?string $api_key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set the api_key as encrypted in the migration it needs to be markes as encrypted in here too:
https://github.com/spatie/laravel-settings?tab=readme-ov-file#encrypting-properties
@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 |
I’m just adding new optional payment method
what is it? - https://help.crypt.bot/crypto-pay-api