Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- $payment_intent_id = \Stripe\PaymentIntent::create([
- 'payment_method_types' => ['card'],
- 'amount' => 1099,
- 'currency' => 'gbp',
- 'customer' => "$customer_card_id",
- 'payment_method' => "$payment_card",
- "description" => "Invoice No: $invoice_number",
- ]);
- }
- catch (\Stripe\Exception\CardException $e) {
- // Error code will be authentication_required if authentication is needed
- echo 'Error code is:' . $e->getError()->code;
- $payment_intent_id = $e->getError()->payment_intent->id;
- $payment_intent = \Stripe\PaymentIntent::retrieve($payment_intent_id);
- }
- print $e;
- $payment_intent = \Stripe\PaymentIntent::retrieve($payment_intent_id);
- $payment_intent->capture();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement