diff --git a/app/Livewire/Flow2/ProcessPayment.php b/app/Livewire/Flow2/ProcessPayment.php index a761b8440dab..dd9b8641afe1 100644 --- a/app/Livewire/Flow2/ProcessPayment.php +++ b/app/Livewire/Flow2/ProcessPayment.php @@ -30,6 +30,18 @@ class ProcessPayment extends Component public $isLoading = true; + private string $component_view = ''; + + private array $payment_data_payload = []; + + public $isLoading = true; + + + // public function toJSON() + // { + // nlog("why"); + // } + public function mount() { diff --git a/app/PaymentDrivers/Stripe/CreditCard.php b/app/PaymentDrivers/Stripe/CreditCard.php index eab1a98c3262..4f9d565a7fed 100644 --- a/app/PaymentDrivers/Stripe/CreditCard.php +++ b/app/PaymentDrivers/Stripe/CreditCard.php @@ -57,8 +57,16 @@ class CreditCard return redirect()->route('client.payment_methods.index'); } - public function paymentView(array $data) + public function paymentData(array $data) { + $data = $this->getData($data); + + return $data; + } + + private function getData(array $data): array + { + $description = $this->stripe->getDescription(false); $payment_intent_data = [ @@ -77,6 +85,13 @@ class CreditCard $data['intent'] = $this->stripe->createPaymentIntent($payment_intent_data); $data['gateway'] = $this->stripe; + return $data; + } + + public function paymentView(array $data) + { + $data = $this->getData($data); + return render('gateways.stripe.credit_card.pay', $data); } diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index d91e39fc3763..7ec32c7111dd 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -419,6 +419,11 @@ class StripePaymentDriver extends BaseDriver return $this->payment_method->paymentView($data); } + public function processPaymentViewData(array $data): array + { + return $this->payment_method->paymentData($data); + } + public function processPaymentResponse($request) { return $this->payment_method->paymentResponse($request); diff --git a/resources/views/portal/ninja2020/gateways/stripe/credit_card/livewire_pay.blade.php b/resources/views/portal/ninja2020/gateways/stripe/credit_card/livewire_pay.blade.php new file mode 100644 index 000000000000..9e6385828435 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/stripe/credit_card/livewire_pay.blade.php @@ -0,0 +1,94 @@ + + +