Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -13,6 +13,8 @@
|
||||
require_once '../../../../init.php';
|
||||
\IPS\Session\Front::i();
|
||||
|
||||
\IPS\Output::i()->pageCaching = FALSE;
|
||||
|
||||
/**
|
||||
* Stripe Webhook Handler
|
||||
*/
|
||||
@@ -113,7 +115,7 @@ class stripeWebhookHandler
|
||||
private function chargeSucceeded()
|
||||
{
|
||||
/* Check the status */
|
||||
if ( $this->transaction->status !== \IPS\nexus\Transaction::STATUS_GATEWAY_PENDING )
|
||||
if ( !\in_array( $this->transaction->status, [ \IPS\nexus\Transaction::STATUS_GATEWAY_PENDING, IPS\nexus\Transaction::STATUS_PENDING ] ) )
|
||||
{
|
||||
if ( $this->transaction->status === \IPS\nexus\Transaction::STATUS_PAID )
|
||||
{
|
||||
@@ -183,7 +185,7 @@ class stripeWebhookHandler
|
||||
private function chargeSucceededNew()
|
||||
{
|
||||
/* Check the status */
|
||||
if ( $this->transaction->status !== \IPS\nexus\Transaction::STATUS_PENDING )
|
||||
if ( !\in_array( $this->transaction->status, [ \IPS\nexus\Transaction::STATUS_GATEWAY_PENDING, IPS\nexus\Transaction::STATUS_PENDING ] ) )
|
||||
{
|
||||
if ( $this->transaction->status === \IPS\nexus\Transaction::STATUS_PAID )
|
||||
{
|
||||
@@ -195,6 +197,12 @@ class stripeWebhookHandler
|
||||
}
|
||||
}
|
||||
|
||||
/* If the invoice this is for is already paid, this may be a duplicate charge, so don't capture */
|
||||
if ( $this->transaction->invoice->status === \IPS\nexus\Invoice::STATUS_PAID )
|
||||
{
|
||||
throw new \Exception('INVOICE_ALREADY_PAID');
|
||||
}
|
||||
|
||||
/* Validate the charge with Stripe */
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user