mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 17:28:55 +00:00
Upgrade account only if payment is settled
This commit is contained in:
@@ -97,7 +97,7 @@ class BtcPaymentController extends BasePageController
|
||||
}
|
||||
$payload = json_decode($request->getContent(), true);
|
||||
// We have received a payment for an invoice and user should be upgraded to a paid plan based on order
|
||||
if ($payload['type'] === 'InvoiceReceivedPayment' || $payload['type'] === 'InvoicePaymentSettled') {
|
||||
if ($payload['type'] === 'InvoicePaymentSettled') {
|
||||
preg_match('/(?P<role>\w+(\s\+\+)?)[\s](?P<addYears>\d+)/i', $payload['metadata']['itemDesc'], $matches);
|
||||
if (empty($matches)) {
|
||||
Log::error('Could not parse BTCPay webhook: '.$payload['metadata']['itemDesc']);
|
||||
|
||||
Reference in New Issue
Block a user