#inderjeet-checkout

1 messages · Page 1 of 1 (latest)

coarse bolt
#

May I know what you are trying to do on mobile app? Do you mean you are expecting to return to the declared URL after payment succeeds in the app?

polar grove
#

Thank for the response. Basically I want to make payment on mobile app.

#

for this I have created laravel api however here I found the sucess/cancel parameter.. Does it require to mention during payment

coarse bolt
#

What kind of integration do you use in mobile app? Do you use Stripe iOS or Android SDK, or react native?

polar grove
#

We are using Flutter.

Code in below for web.
if(isset($stripeCustomerId) && $amount>0){
$secret_key= env('STRIPE_SECRET_KEY');
\Stripe\Stripe::setApiKey($secret_key);
$checkout_session = \Stripe\Checkout\Session::create([
'payment_method_types' => ['card'],
'customer' => $stripeCustomerId,
'client_reference_id' => 'Wallet Refill',
'line_items' => [[
'price_data' => [
'currency' => 'usd',
'unit_amount' => $amount * 100,
'product_data' => [
'name' => 'Wallet Refill',
],
],
'quantity' => 1,
]],
'payment_intent_data' => [
'setup_future_usage' => 'off_session',
],
'mode' => 'payment',
'success_url' => url('/wallet-success?sessionId={CHECKOUT_SESSION_ID}&amount='.$amount),
'cancel_url' => url('/checkout-cancel'),
]);
return ['id' => $checkout_session->id];
}else{
return false;
}

#

How can i get the response and make payment ?

surreal hare
#

Hi @polar grove are you embedding a mobile webpage inside the flutter app?

polar grove
#

Yes Jack

surreal hare
#

OK, can you explain more on stuck in success/cancel url param ? is the redirection working?

polar grove
#

Jack, Redirection will work only on web. Am I right? However, I am creating apis to achieve this. I'm bit confused how can I send response to app if I run the same api

surreal hare
#

redirection can work in mobile as well, but you need to handle it yourself.

polar grove
#

Does above code will work for payment creation in mobile api ?

#

Or Do i need to create the payment intent only ?

#

we will take card details in mobile app popup after initiation stripe. so that we can secure the details. Please help me out

surreal hare
#

Have you tested out loading the checkout page in your flutter app?

polar grove
#

Basically, We want to implement checkout on flutter app.Checkout pop is opening

severe tartan
#

Hi! I'm taking over Jack Tan.

#

Can you summarize your question while I catch up?

polar grove
#

Hello Soma, Sure I will explain you briefly what i want to do ?

#

I want to using payment intent api in postmen for mobile app how can i do it through postmen can you let me know ?

severe tartan
polar grove
#

Yes

severe tartan
#

You can send request to Stripe with Postman, but it's for testing purposes. I don't think you can't create a mobile app with this.

#

FYI here's how to create a PaymentIntent with Postman

polar grove
#

Actually I want to build the payment api for mobile app so for this purpose I need to create a payment intent api

#

Can you share me any link for payment intent in postman ?

severe tartan
#

I'm not sure I understand what you are trying to do. But to create a PaymentIntent in postman, just look at the screenshot I shared above. And if you want to know all the parameters to create a PaymentIntent, it's here: https://stripe.com/docs/api/payment_intents/create