mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 05:37:17 -04:00
WePay token billing
This commit is contained in:
parent
ae88b61e8d
commit
ba7ea8bbea
@ -281,12 +281,14 @@ class ACH
|
||||
if(!property_exists($token_meta, 'state') || $token_meta->state != "authorized")
|
||||
return redirect()->route('client.payment_methods.verification', ['payment_method' => $token->hashed_id, 'method' => GatewayType::BANK_TRANSFER]);
|
||||
|
||||
$app_fee = (config('ninja.wepay.fee_ach_multiplier') * $this->wepay_payment_driver->payment_hash->data->amount_with_fee) + config('ninja.wepay.fee_fixed');
|
||||
$amount = array_sum(array_column($this->wepay_payment_driver->payment_hash->invoices(), 'amount')) + $this->wepay_payment_driver->payment_hash->fee_total;
|
||||
|
||||
$app_fee = (config('ninja.wepay.fee_cc_multiplier') * $amount) + config('ninja.wepay.fee_fixed');
|
||||
|
||||
$response = $this->wepay_payment_driver->wepay->request('checkout/create', array(
|
||||
'unique_id' => Str::random(40),
|
||||
'account_id' => $this->wepay_payment_driver->company_gateway->getConfigField('accountId'),
|
||||
'amount' => $this->wepay_payment_driver->payment_hash->data->amount_with_fee,
|
||||
'amount' => $amount,
|
||||
'currency' => $this->wepay_payment_driver->client->getCurrencyCode(),
|
||||
'short_description' => 'Goods and Services',
|
||||
'type' => 'goods',
|
||||
|
@ -285,12 +285,15 @@ https://developer.wepay.com/api/api-calls/checkout
|
||||
public function tokenBilling($cgt, $payment_hash)
|
||||
{
|
||||
|
||||
$app_fee = (config('ninja.wepay.fee_cc_multiplier') * $this->wepay_payment_driver->payment_hash->data->amount_with_fee) + config('ninja.wepay.fee_fixed');
|
||||
$amount = array_sum(array_column($this->wepay_payment_driver->payment_hash->invoices(), 'amount')) + $this->wepay_payment_driver->payment_hash->fee_total;
|
||||
|
||||
|
||||
$app_fee = (config('ninja.wepay.fee_cc_multiplier') * $amount) + config('ninja.wepay.fee_fixed');
|
||||
// charge the credit card
|
||||
$response = $this->wepay_payment_driver->wepay->request('checkout/create', array(
|
||||
'unique_id' => Str::random(40),
|
||||
'account_id' => $this->wepay_payment_driver->company_gateway->getConfigField('accountId'),
|
||||
'amount' => $this->wepay_payment_driver->payment_hash->data->amount_with_fee,
|
||||
'amount' => $amount,
|
||||
'currency' => $this->wepay_payment_driver->client->getCurrencyCode(),
|
||||
'short_description' => 'Goods and services',
|
||||
'type' => 'goods',
|
||||
|
@ -159,6 +159,7 @@ class WePayPaymentDriver extends BaseDriver
|
||||
|
||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
||||
{
|
||||
$this->init();
|
||||
$this->setPaymentMethod($cgt->gateway_type_id);
|
||||
$this->setPaymentHash($payment_hash);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user