mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 19:37:30 -04:00 
			
		
		
		
	Extend webhook delay for mollie
This commit is contained in:
		
							parent
							
								
									f59006aedd
								
							
						
					
					
						commit
						0777c6e43c
					
				| @ -241,7 +241,6 @@ class BraintreePaymentDriver extends BaseDriver | ||||
|         ]); | ||||
| 
 | ||||
|         if ($result->success) { | ||||
|             $this->confirmGatewayFee(); | ||||
| 
 | ||||
|             $data = [ | ||||
|                 'payment_type' => PaymentType::parseCardType(strtolower($result->transaction->creditCard['cardType'])), | ||||
| @ -250,6 +249,8 @@ class BraintreePaymentDriver extends BaseDriver | ||||
|                 'gateway_type_id' => GatewayType::CREDIT_CARD, | ||||
|             ]; | ||||
|              | ||||
|             $this->confirmGatewayFee($data); | ||||
| 
 | ||||
|             $payment = $this->createPayment($data, Payment::STATUS_COMPLETED); | ||||
| 
 | ||||
|             SystemLogger::dispatch( | ||||
|  | ||||
| @ -242,7 +242,12 @@ class CreditCard implements MethodInterface | ||||
|             } | ||||
| 
 | ||||
|             if ($response['status'] == 'Pending') { | ||||
|                 $this->checkout->confirmGatewayFee(); | ||||
| 
 | ||||
|                 $data = [ | ||||
|                     'gateway_type_id' => GatewayType::CREDIT_CARD, | ||||
|                 ]; | ||||
| 
 | ||||
|                 $this->checkout->confirmGatewayFee($data); | ||||
| 
 | ||||
|                 return $this->processPendingPayment($response); | ||||
|             } | ||||
|  | ||||
| @ -406,15 +406,17 @@ class CheckoutComPaymentDriver extends BaseDriver | ||||
|             $response = $this->gateway->getPaymentsClient()->requestPayment($paymentRequest); | ||||
| 
 | ||||
|             if ($response['status'] == 'Authorized') { | ||||
|                 $this->confirmGatewayFee($request); | ||||
|                  | ||||
|                 $data = [ | ||||
|                     'payment_method' => $response['source']['id'], | ||||
|                     'payment_type' => PaymentType::parseCardType(strtolower($response['source']['scheme'])), | ||||
|                     'amount' => $amount, | ||||
|                     'transaction_reference' => $response['id'], | ||||
|                     'gateway_type_id' => GatewayType::CREDIT_CARD, | ||||
|                 ]; | ||||
| 
 | ||||
|                 $this->confirmGatewayFee($data); | ||||
| 
 | ||||
|                 $payment = $this->createPayment($data, Payment::STATUS_COMPLETED); | ||||
| 
 | ||||
|                 SystemLogger::dispatch( | ||||
|  | ||||
| @ -165,7 +165,6 @@ class GoCardlessPaymentDriver extends BaseDriver | ||||
|             ]); | ||||
| 
 | ||||
|             if (in_array($payment->status, ['submitted', 'pending_submission'])) { | ||||
|                 $this->confirmGatewayFee(); | ||||
|                  | ||||
|                 $data = [ | ||||
|                     'payment_method' => $cgt->hashed_id, | ||||
| @ -175,6 +174,8 @@ class GoCardlessPaymentDriver extends BaseDriver | ||||
|                     'gateway_type_id' => GatewayType::BANK_TRANSFER, | ||||
|                 ]; | ||||
| 
 | ||||
|                 $this->confirmGatewayFee($data); | ||||
| 
 | ||||
|                 $payment = $this->createPayment($data, Payment::STATUS_PENDING); | ||||
| 
 | ||||
|                 SystemLogger::dispatch( | ||||
|  | ||||
| @ -171,7 +171,7 @@ class MolliePaymentDriver extends BaseDriver | ||||
|             ]; | ||||
|         } catch (ApiException $e) { | ||||
|             SystemLogger::dispatch( | ||||
|                 ['server_response' => $refund, 'data' => request()->all()], | ||||
|                 ['server_response' => $e->getMessage(), 'data' => request()->all()], | ||||
|                 SystemLog::CATEGORY_GATEWAY_RESPONSE, | ||||
|                 SystemLog::EVENT_GATEWAY_FAILURE, | ||||
|                 SystemLog::TYPE_MOLLIE, | ||||
| @ -223,7 +223,7 @@ class MolliePaymentDriver extends BaseDriver | ||||
|             ]); | ||||
| 
 | ||||
|             if ($payment->status === 'paid') { | ||||
|                 $this->confirmGatewayFee($request); | ||||
|                  | ||||
| 
 | ||||
|                 $data = [ | ||||
|                     'payment_method' => $cgt->token, | ||||
| @ -233,6 +233,8 @@ class MolliePaymentDriver extends BaseDriver | ||||
|                     'gateway_type_id' => GatewayType::CREDIT_CARD, | ||||
|                 ]; | ||||
| 
 | ||||
|                 $this->confirmGatewayFee($data); | ||||
| 
 | ||||
|                 $payment = $this->createPayment($data, Payment::STATUS_COMPLETED); | ||||
| 
 | ||||
|                 SystemLogger::dispatch( | ||||
| @ -284,7 +286,7 @@ class MolliePaymentDriver extends BaseDriver | ||||
|     public function processWebhookRequest(PaymentWebhookRequest $request) | ||||
|     { | ||||
|         // Allow app to catch up with webhook request.
 | ||||
|         sleep(2); | ||||
|         sleep(4); | ||||
| 
 | ||||
|         $validator = Validator::make($request->all(), [ | ||||
|             'id' => ['required', 'starts_with:tr'], | ||||
| @ -335,6 +337,8 @@ class MolliePaymentDriver extends BaseDriver | ||||
|                         'transaction_reference' => $payment->id, | ||||
|                     ]; | ||||
| 
 | ||||
|                     $this->confirmGatewayFee($data); | ||||
| 
 | ||||
|                     $record = $this->createPayment( | ||||
|                         $data, | ||||
|                         $codes[$payment->status] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user