diff --git a/.env.example b/.env.example index 9f378a6d67f8..ec281e283601 100644 --- a/.env.example +++ b/.env.example @@ -91,7 +91,8 @@ WEPAY_ENVIRONMENT=production # production or stage WEPAY_AUTO_UPDATE=true # Requires permission from WePay WEPAY_ENABLE_CANADA=true WEPAY_FEE_PAYER=payee -WEPAY_APP_FEE_MULTIPLIER=0.002 +WEPAY_APP_FEE_CC_MULTIPLIER=0 +WEPAY_APP_FEE_ACH_MULTIPLIER=0 WEPAY_APP_FEE_FIXED=0 WEPAY_THEME='{"name":"Invoice Ninja","primary_color":"0b4d78","secondary_color":"0b4d78","background_color":"f8f8f8","button_color":"33b753"}' # See https://www.wepay.com/developer/reference/structures#theme diff --git a/app/Ninja/PaymentDrivers/WePayPaymentDriver.php b/app/Ninja/PaymentDrivers/WePayPaymentDriver.php index 1ebdc69e79e9..7398844c1404 100644 --- a/app/Ninja/PaymentDrivers/WePayPaymentDriver.php +++ b/app/Ninja/PaymentDrivers/WePayPaymentDriver.php @@ -56,12 +56,14 @@ class WePayPaymentDriver extends BasePaymentDriver $data['transaction_id'] = $transactionId; } - $data['applicationFee'] = (env('WEPAY_APP_FEE_MULTIPLIER') * $data['amount']) + env('WEPAY_APP_FEE_FIXED'); $data['feePayer'] = env('WEPAY_FEE_PAYER'); $data['callbackUri'] = $this->accountGateway->getWebhookUrl(); if ($this->isGatewayType(GATEWAY_TYPE_BANK_TRANSFER, $paymentMethod)) { $data['paymentMethodType'] = 'payment_bank'; + $data['applicationFee'] = (env('WEPAY_APP_FEE_ACH_MULTIPLIER') * $data['amount']) + env('WEPAY_APP_FEE_FIXED'); + } else { + $data['applicationFee'] = (env('WEPAY_APP_FEE_CC_MULTIPLIER') * $data['amount']) + env('WEPAY_APP_FEE_FIXED'); } $data['transaction_rbits'] = $this->invoice()->present()->rBits; diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 5dc6bbc5e08d..4cec37d4a2d8 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2055,7 +2055,7 @@ $LANG = array( 'changes_take_effect_immediately' => 'Note: changes take effect immediately', 'wepay_account_description' => 'Payment gateway for Invoice Ninja', 'payment_error_code' => 'There was an error processing your payment [:code]. Please try again later.', - 'standard_fees_apply' => 'Standard fees apply: 2.9% + $0.30 per successful charge.', + 'standard_fees_apply' => 'Fee: 2.9%/1.2% [Credit Card/Bank Transfer] + $0.30 per successful charge.', 'limit_import_rows' => 'Data needs to be imported in batches of :count rows or less', 'error_title' => 'Something went wrong', 'error_contact_text' => 'If you\'d like help please email us at :mailaddress',