From 03ec5e042d156fc71923af09e75a12d9d59836b2 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 9 Sep 2021 21:46:03 +1000 Subject: [PATCH] Stripe Connect Compatible refunds --- app/PaymentDrivers/StripePaymentDriver.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 7deb0b433dcb..891bb9697a80 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -362,9 +362,14 @@ class StripePaymentDriver extends BaseDriver $response = null; try { - $response = $this->stripe - ->refunds - ->create(['charge' => $payment->transaction_reference, 'amount' => $this->convertToStripeAmount($amount, $this->client->currency()->precision, $this->client->currency())], $meta); + // $response = $this->stripe + // ->refunds + // ->create(['charge' => $payment->transaction_reference, 'amount' => $this->convertToStripeAmount($amount, $this->client->currency()->precision, $this->client->currency())], $meta); + + $response = \Stripe\Refund::create([ + 'charge' => $payment->transaction_reference, + 'amount' => $this->convertToStripeAmount($amount, $this->client->currency()->precision, $this->client->currency()) + ], $meta); if ($response->status == $response::STATUS_SUCCEEDED) { SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all(),], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->client, $this->client->company);