mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-05 11:10:16 -04:00
Mark WePay ACH token as verfied once used
This commit is contained in:
parent
7b20db256e
commit
862205d89f
@ -128,6 +128,16 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
}
|
||||
*/
|
||||
|
||||
public function createPayment($ref = false, $paymentMethod = null)
|
||||
{
|
||||
parent::createPayment($ref, $paymentMethod);
|
||||
|
||||
if ($paymentMethod->payment_type_id = PAYMENT_TYPE_ACH) {
|
||||
$paymentMethod->status = PAYMENT_METHOD_STATUS_VERIFIED;
|
||||
$paymentMethod->save();
|
||||
}
|
||||
}
|
||||
|
||||
protected function creatingPaymentMethod($paymentMethod)
|
||||
{
|
||||
$source = $this->tokenResponse;
|
||||
@ -141,10 +151,10 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
switch ($source->state) {
|
||||
case 'new':
|
||||
case 'pending':
|
||||
$paymentMethod->status = 'new';
|
||||
$paymentMethod->status = PAYMENT_METHOD_STATUS_NEW;
|
||||
break;
|
||||
case 'authorized':
|
||||
$paymentMethod->status = 'verified';
|
||||
$paymentMethod->status = PAYMENT_METHOD_STATUS_VERIFIED;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<center>
|
||||
{!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo($invitation->getLink()) !!}
|
||||
|
||||
@if(isset($amount) && empty($paymentMethodPending))
|
||||
@if (isset($amount))
|
||||
{!! Button::success(request()->update ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) ))
|
||||
->submit()
|
||||
->large() !!}
|
||||
|
Loading…
x
Reference in New Issue
Block a user