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