Merge branch 'v2' into v2-2606-user-confirmation-page

This commit is contained in:
David Bomba 2020-06-27 07:48:43 +10:00 committed by GitHub
commit 65b524bc13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 39 deletions

View File

@ -44,8 +44,12 @@ class PaymentMethodController extends Controller
{ {
$gateway = auth()->user()->client->getCreditCardGateway(); $gateway = auth()->user()->client->getCreditCardGateway();
return $gateway->driver(auth()->user()->client)->authorizeView(GatewayType::CREDIT_CARD); $data['gateway'] = $gateway;
return $gateway
->driver(auth()->user()->client)
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->authorizeView($data);
} }
/** /**
@ -58,8 +62,10 @@ class PaymentMethodController extends Controller
{ {
$gateway = auth()->user()->client->getCreditCardGateway(); $gateway = auth()->user()->client->getCreditCardGateway();
return $gateway->driver(auth()->user()->client)->authorizeResponseView($request->all()); return $gateway
->driver(auth()->user()->client)
->setPaymentMethod(GatewayType::BANK_TRANSFER)
->authorizeResponse($request);
} }
/** /**
@ -104,7 +110,7 @@ class PaymentMethodController extends Controller
return $gateway return $gateway
->driver(auth()->user()->client) ->driver(auth()->user()->client)
->setPaymentMethod('App\\PaymentDrivers\\Stripe\\ACH') ->setPaymentMethod(GatewayType::BANK_TRANSFER)
->verificationView($payment_method); ->verificationView($payment_method);
} }
@ -114,7 +120,7 @@ class PaymentMethodController extends Controller
return $gateway return $gateway
->driver(auth()->user()->client) ->driver(auth()->user()->client)
->setPaymentMethod('App\\PaymentDrivers\\Stripe\\ACH') ->setPaymentMethod(GatewayType::BANK_TRANSFER)
->processVerification($payment_method); ->processVerification($payment_method);
} }

View File

@ -172,7 +172,7 @@ class StripePaymentDriver extends BasePaymentDriver
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/ */
public function authorizeCreditCardResponse($request) public function authorizeResponse($request)
{ {
return $this->payment_method->authorizeResponse($request); return $this->payment_method->authorizeResponse($request);
} }

View File

@ -3225,4 +3225,5 @@ return [
'if_you_need_help' => 'If you need help you can either post to our', 'if_you_need_help' => 'If you need help you can either post to our',
'update_password_on_confirm' => 'After updating password, your account will be confirmed.', 'update_password_on_confirm' => 'After updating password, your account will be confirmed.',
'bank_account_not_linked' => 'To pay with bank account, first you have to add it as payment method.',
]; ];

View File

@ -2,6 +2,7 @@
@section('meta_title', ctrans('texts.ach')) @section('meta_title', ctrans('texts.ach'))
@section('body') @section('body')
@if($token)
<form action="{{ route('client.payments.response') }}" method="post" id="server-response"> <form action="{{ route('client.payments.response') }}" method="post" id="server-response">
@csrf @csrf
@foreach($invoices as $invoice) @foreach($invoices as $invoice)
@ -14,6 +15,7 @@
<input type="hidden" name="currency" value="{{ $currency }}"> <input type="hidden" name="currency" value="{{ $currency }}">
<input type="hidden" name="customer" value="{{ $customer->id }}"> <input type="hidden" name="customer" value="{{ $customer->id }}">
</form> </form>
@endif
<div class="container mx-auto"> <div class="container mx-auto">
<div class="grid grid-cols-6 gap-4"> <div class="grid grid-cols-6 gap-4">
@ -29,6 +31,7 @@
</p> </p>
</div> </div>
<div> <div>
@if($token)
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center"> <div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4"> <dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.payment_type') }} {{ ctrans('texts.payment_type') }}
@ -50,6 +53,14 @@
{{ ctrans('texts.pay_now') }} {{ ctrans('texts.pay_now') }}
</button> </button>
</div> </div>
@else
<div class="bg-gray-50 px-4 py-5 sm:px-6 flex items-center">
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<span>{{ ctrans('texts.bank_account_not_linked') }}</span>
<a class="button button-link" href="{{ route('client.payment_methods.index') }}">{{ ctrans('texts.add_payment_method') }}</a>
</dd>
</div>
@endif
</div> </div>
</div> </div>
</div> </div>