diff --git a/app/PaymentDrivers/Braintree/PayPal.php b/app/PaymentDrivers/Braintree/PayPal.php new file mode 100644 index 0000000000..747ce562cc --- /dev/null +++ b/app/PaymentDrivers/Braintree/PayPal.php @@ -0,0 +1,36 @@ +braintree = $braintree; + + $this->braintree->init(); + } + + /** + * Credit card payment page. + * + * @param array $data + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function paymentView(array $data) + { + $data['gateway'] = $this->braintree; + $data['client_token'] = $this->braintree->gateway->clientToken()->generate(); + + return render('gateways.braintree.paypal.pay', $data); + } +} diff --git a/app/PaymentDrivers/BraintreePaymentDriver.php b/app/PaymentDrivers/BraintreePaymentDriver.php index 18abc1c8fa..719a44ae07 100644 --- a/app/PaymentDrivers/BraintreePaymentDriver.php +++ b/app/PaymentDrivers/BraintreePaymentDriver.php @@ -23,6 +23,7 @@ use App\Models\PaymentHash; use App\Models\PaymentType; use App\Models\SystemLog; use App\PaymentDrivers\Braintree\CreditCard; +use App\PaymentDrivers\Braintree\PayPal; use Illuminate\Http\Request; class BraintreePaymentDriver extends BaseDriver @@ -59,7 +60,7 @@ class BraintreePaymentDriver extends BaseDriver { $class = self::$methods[$payment_method_id]; - $this->payment_method = new $class($this); + $this->payment_method = new PayPal($this); return $this; } diff --git a/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php new file mode 100644 index 0000000000..8103930fc3 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/braintree/paypal/pay.blade.php @@ -0,0 +1,98 @@ +@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.paypal'), 'card_title' => ctrans('texts.paypal')]) + +@section('gateway_head') + + + + +@endsection + +@section('gateway_content') +
+ @csrf + + + + + + + + + +
+ + + + @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')]) + {{ ctrans('texts.paypal') }} + @endcomponent + + @include('portal.ninja2020.gateways.includes.payment_details') + + @component('portal.ninja2020.components.general.card-element-single') +
+ @endcomponent +@endsection + +@section('gateway_footer') + +@endsection