#Isantaniello - checkout issue
1 messages · Page 1 of 1 (latest)
I don't understand the flow
I need to implement also 3dsecure flow
I implementend on web app, html/js/css website
but I need to implement also in my ionic app
Is "https://stripe.com/docs/payments/checkout/how-checkout-works" correct flow for me?
Unfortunately we don't have a Stripe library for Ionic. You can see the list of supported libraries here: https://stripe.com/docs/libraries
You can still call out API without a library though
There just won't be a native integration that we support
ye, I seen
But if you opt to still call the Stripe API to create a Checkout Session, you could redirect the customer to their mobile browser or something to complete payment
Is there an example or demo?
There isn't one, since Ionic isn't a framework we currently have an SDK for. However, the process of creating a checkout session and redirecting would be the same as it is for ReactNative, which is outlined in this StackOverflow post: https://stackoverflow.com/questions/71910605/how-to-create-a-stripe-checkout-session-react-native
Essentially your Ionic app will need to call to your server to create the Checkout session
Then, you will need to redirect to it somehow (Webview or Browser)
in this session, I must create products on stripe platform?
Tried to create
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => '{{PRICE_ID}}',
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/success.html',
'cancel_url' => $YOUR_DOMAIN . '/cancel.html',
]);
Fatal error: Uncaught (Status 400) (Request req_TU9vLGe5EnSW2B) The price parameter should be the ID of a price object, rather than the literal numerical price. Please see https://stripe.com/docs/billing/prices-guide#create-prices
Yeah you'll have to create the price objects, or if you want to just specify the amount directly, you can pass price_data instead: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
have you an example of price_data?
I linked the docs above
$checkout_session = \Stripe\Checkout\Session::create ( [
'line_items' => [
[
'price_data' => [
'unit_amount' => 1000,
'currency' => 'eur'
],
'quantity' => 1
]
],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '/success.html',
'cancel_url' => $YOUR_DOMAIN . '/cancel.html'
] );
In order to use Checkout, you must set an account or business name at https://dashboard.stripe.com/account
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Can you share the request ID?
But yeah, you must set a business name in your account settings at that link to use Checkout
now created but: You must specify either product or product_data when creating a price.
That's correct. Read the docs I sent about what needs to go in price_data
Yeah I'm not familiar with Ionic, but after fetching the Checkout URL from your backend server, you will need to redirect to it somehow (like in a Webview)
ok for webview but my problem is come back to mobile
Hi,
I need to implement payment flow in my ionic 5 (cordova). I’m using checkout stripe flow.
- Ionic app open webview and Redirect user to stripe payment page
- User insert data payment
- Stripe redirect to my web domain (success of error page)
- I want to create button on success/error page and onclick close webwiew and pass result (ok/ko)
How I can implement this scenario?
As I'm not familiar with Ionic, I'm not sure how to implement 4) I want to create button on success/error page and onclick close webwiew and pass result (ok/ko)
That's also not a Stripe question, so it's outside the scope of what we can support in here
Hello 👋
Taking over for @vague haven here as they have to step away soon
You would want to look into App links that would allow your website to launch a mobile app
However, as my colleague mentioned earlier it is outside the scope of what we can support here