mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:04:41 -04:00
Fix for wepay fee
This commit is contained in:
parent
6d7b25bcf5
commit
c6bf1d5fcc
@ -53,7 +53,7 @@ class WePayPaymentDriver extends BasePaymentDriver
|
|||||||
$data['transaction_id'] = $transactionId;
|
$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['feePayer'] = WEPAY_FEE_PAYER;
|
||||||
$data['callbackUri'] = $this->accountGateway->getWebhookUrl();
|
$data['callbackUri'] = $this->accountGateway->getWebhookUrl();
|
||||||
|
|
||||||
@ -191,13 +191,6 @@ class WePayPaymentDriver extends BasePaymentDriver
|
|||||||
return $response->getCode() == 4004;
|
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)
|
public function handleWebHook($input)
|
||||||
{
|
{
|
||||||
$accountGateway = $this->accountGateway;
|
$accountGateway = $this->accountGateway;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user