Payment token fixes

This commit is contained in:
Hillel Coren 2016-06-26 13:45:50 +03:00
parent 7c0875841a
commit 15781ff895
3 changed files with 6 additions and 2 deletions

View File

@ -74,7 +74,7 @@ class BraintreePaymentDriver extends BasePaymentDriver
$data['ButtonSource'] = 'InvoiceNinja_SP';
}
if ( ! empty($this->input['sourceToken'])) {
if ( ! $paymentMethod && ! empty($this->input['sourceToken'])) {
$data['token'] = $this->input['sourceToken'];
}

View File

@ -72,6 +72,10 @@ class StripePaymentDriver extends BasePaymentDriver
{
$data = parent::paymentDetails($paymentMethod);
if ($paymentMethod) {
return $data;
}
if ( ! empty($this->input['sourceToken'])) {
$data['token'] = $this->input['sourceToken'];
unset($data['card']);

View File

@ -74,7 +74,7 @@ class WePayPaymentDriver extends BasePaymentDriver
$data['feePayer'] = WEPAY_FEE_PAYER;
$data['callbackUri'] = $this->accountGateway->getWebhookUrl();
if ($this->isGatewayType(GATEWAY_TYPE_BANK_TRANSFER)) {
if ($this->isGatewayType(GATEWAY_TYPE_BANK_TRANSFER, $paymentMethod)) {
$data['paymentMethodType'] = 'payment_bank';
}