From c6bf1d5fcc7cba5d65c8e7a23829908e7a1bb8e7 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 15 Jul 2016 10:41:16 +0300 Subject: [PATCH] Fix for wepay fee --- app/Ninja/PaymentDrivers/WePayPaymentDriver.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Ninja/PaymentDrivers/WePayPaymentDriver.php b/app/Ninja/PaymentDrivers/WePayPaymentDriver.php index a88cc1ac51af..74f2f05d3bf0 100644 --- a/app/Ninja/PaymentDrivers/WePayPaymentDriver.php +++ b/app/Ninja/PaymentDrivers/WePayPaymentDriver.php @@ -53,7 +53,7 @@ class WePayPaymentDriver extends BasePaymentDriver $data['transaction_id'] = $transactionId; } - $data['applicationFee'] = $this->calculateApplicationFee($data['amount']); + $data['applicationFee'] = (WEPAY_APP_FEE_MULTIPLIER * $data['amount']) + WEPAY_APP_FEE_FIXED; $data['feePayer'] = WEPAY_FEE_PAYER; $data['callbackUri'] = $this->accountGateway->getWebhookUrl(); @@ -191,13 +191,6 @@ class WePayPaymentDriver extends BasePaymentDriver return $response->getCode() == 4004; } - private function calculateApplicationFee($amount) - { - $fee = (WEPAY_APP_FEE_MULTIPLIER * $amount) + WEPAY_APP_FEE_FIXED; - - return floor(min($fee, $amount * 0.2));// Maximum fee is 20% of the amount. - } - public function handleWebHook($input) { $accountGateway = $this->accountGateway;