#Isantaniello - checkout issue

1 messages · Page 1 of 1 (latest)

vague haven
#

Hi there. What's the issue you are facing?

red anchor
#

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

vague haven
#

Unfortunately we don't have a Stripe library for Ionic. You can see the list of supported libraries here: https://stripe.com/docs/libraries

Stripe has official libraries for different programming languages and mobile platforms. There are also many more third-party libraries and plugins created by the Stripe community.

#

You can still call out API without a library though

#

There just won't be a native integration that we support

red anchor
#

ye, I seen

vague haven
#

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

red anchor
#

Is there an example or demo?

vague haven
#

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)

red anchor
#

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',
]);

vague haven
red anchor
#

have you an example of price_data?

vague haven
#

I linked the docs above

red anchor
#

$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'
] );

vague haven
#

Can you share the request ID?

#

But yeah, you must set a business name in your account settings at that link to use Checkout

red anchor
#

now created but: You must specify either product or product_data when creating a price.

vague haven
#

That's correct. Read the docs I sent about what needs to go in price_data

red anchor
#

ok solved

#

but now I need to understand How integrate this flow into mobile app

vague haven
#

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)

red anchor
#

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.

  1. Ionic app open webview and Redirect user to stripe payment page
  2. User insert data payment
  3. Stripe redirect to my web domain (success of error page)
  4. I want to create button on success/error page and onclick close webwiew and pass result (ok/ko)

How I can implement this scenario?

vague haven
#

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

minor jacinth
#

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