#Shivam Kumar

1 messages · Page 1 of 1 (latest)

fickle elmBOT
green scroll
#

Can you share more what you meant by not making payment? What do you expect it to work?

waxen breach
#

I want to make payment using stripe payment element this is my server side code
public function projectUpgradePayment(Request $request){
$stripe_secret_key = PaymentGateway::value('stripe_secret_key');
$stripe_publish_key = PaymentGateway::value('stripe_publish_key');
Stripe::setApiKey($stripe_secret_key);
$stripe = new \Stripe\StripeClient($stripe_secret_key);

    $payment_intent = $stripe->paymentIntents->create([
        'amount' => $request->total_price*100,
        'currency' => 'usd',
        'customer' => auth()->user()->stripe_customer_id,
        'payment_method_types' => ['link', 'card', 'us_bank_account'],
    ]);
    return view('account.projects.project.modals.project_upgrades_payment', compact('request', 'payment_intent', 'stripe_publish_key'));
}

How I check payment will be successed?

#

And my second question is how I display already added payment method.

green scroll
#

How I check payment will be successed?
You can check the payment intent status. If the payment is successful, the status will be succeeded

#

And my second question is how I display already added payment method.
Your integration has to support saving payment method first. I'd recommend following this guide to save a payment method details when making a payment: https://stripe.com/docs/payments/save-during-payment, then retrieve the customer's saved payment methods and display them