From e48a5fe8c4daf3fb7d748c1f4534e9deba0d6b18 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Mon, 4 Oct 2021 17:49:18 +0200 Subject: [PATCH] Update SEPA.php --- app/PaymentDrivers/Stripe/SEPA.php | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/PaymentDrivers/Stripe/SEPA.php b/app/PaymentDrivers/Stripe/SEPA.php index 74b564f6ed14..58ff1c879378 100644 --- a/app/PaymentDrivers/Stripe/SEPA.php +++ b/app/PaymentDrivers/Stripe/SEPA.php @@ -56,32 +56,32 @@ class SEPA public function paymentResponse(PaymentResponseRequest $request) { - // $this->stripe_driver->init(); + $this->stripe_driver->init(); - // $state = [ - // 'server_response' => json_decode($request->gateway_response), - // 'payment_hash' => $request->payment_hash, - // ]; + $state = [ + 'server_response' => json_decode($request->gateway_response), + 'payment_hash' => $request->payment_hash, + ]; - // $state['payment_intent'] = \Stripe\PaymentIntent::retrieve($state['server_response']->id, $this->stripe_driver->stripe_connect_auth); + $state['payment_intent'] = \Stripe\PaymentIntent::retrieve($state['server_response']->id, $this->stripe_driver->stripe_connect_auth); - // $state['customer'] = $state['payment_intent']->customer; + $state['customer'] = $state['payment_intent']->customer; - // $this->stripe_driver->payment_hash->data = array_merge((array) $this->stripe_driver->payment_hash->data, $state); - // $this->stripe_driver->payment_hash->save(); + $this->stripe_driver->payment_hash->data = array_merge((array) $this->stripe_driver->payment_hash->data, $state); + $this->stripe_driver->payment_hash->save(); - // $server_response = $this->stripe_driver->payment_hash->data->server_response; + $server_response = $this->stripe_driver->payment_hash->data->server_response; - // $response_handler = new CreditCard($this->stripe_driver); + $response_handler = new SEPAAccount($this->stripe_driver); - // if ($server_response->status == 'succeeded') { + if ($server_response->status == 'succeeded') { - // $this->stripe_driver->logSuccessfulGatewayResponse(['response' => json_decode($request->gateway_response), 'data' => $this->stripe_driver->payment_hash], SystemLog::TYPE_STRIPE); + $this->stripe_driver->logSuccessfulGatewayResponse(['response' => json_decode($request->gateway_response), 'data' => $this->stripe_driver->payment_hash], SystemLog::TYPE_STRIPE); - // return $response_handler->processSuccessfulPayment(); - // } + return $response_handler->processSuccessfulPayment(); + } - // return $response_handler->processUnsuccessfulPayment($server_response); + return $response_handler->processUnsuccessfulPayment($server_response); }