From ad73273a480b70e0eaf4d3ed94ba9b566e3c9a90 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 21 Aug 2021 22:22:22 +1000 Subject: [PATCH] Fixes for Square --- app/Models/Gateway.php | 16 ++++++++-------- app/PaymentDrivers/SquarePaymentDriver.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index 573ac39c5f8f..0b974598a93c 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -92,13 +92,6 @@ class Gateway extends StaticModel return [GatewayType::PAYPAL => ['refund' => true, 'token_billing' => false]]; //Paypal break; case 20: - case 56: - return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true], - GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable','charge.succeeded']], - GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false], - GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false], - GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']]]; //Stripe - break; case 39: return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true]]; //Checkout break; @@ -114,9 +107,16 @@ class Gateway extends StaticModel GatewayType::PAYPAL => ['refund' => true, 'token_billing' => true] ]; break; + case 56: + return [GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true], + GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable','charge.succeeded']], + GatewayType::ALIPAY => ['refund' => false, 'token_billing' => false], + GatewayType::APPLE_PAY => ['refund' => false, 'token_billing' => false], + GatewayType::SOFORT => ['refund' => true, 'token_billing' => true, 'webhooks' => ['source.chargeable', 'charge.succeeded']]]; //Stripe + break; case 57: return [ - GatewayType::CREDIT_CARD => ['refund' => true, 'token_billing' => true], //Square + GatewayType::CREDIT_CARD => ['refund' => false, 'token_billing' => true], //Square ]; break; break; diff --git a/app/PaymentDrivers/SquarePaymentDriver.php b/app/PaymentDrivers/SquarePaymentDriver.php index b1f3c6eaee48..43d16b30089e 100644 --- a/app/PaymentDrivers/SquarePaymentDriver.php +++ b/app/PaymentDrivers/SquarePaymentDriver.php @@ -29,7 +29,7 @@ class SquarePaymentDriver extends BaseDriver { use MakesHash; - public $refundable = true; //does this gateway support refunds? + public $refundable = false; //does this gateway support refunds? public $token_billing = true; //does this gateway support token billing? @@ -240,7 +240,7 @@ class SquarePaymentDriver extends BaseDriver return $fields; } - public function convertAmount($amount): bool + public function convertAmount($amount) { $precision = $this->client->currency()->precision;