#michael_code

1 messages ¡ Page 1 of 1 (latest)

cunning frostBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1253247672887021569

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

white nebula
#

Hi, taking a look here

gaunt fable
tropic spear
#

Thanks, but we would like to keep our fully customized payment flow for now. Do you know when the API support for Twint will be added to the Android SDK? It already works for the ios SDK as well.

gaunt fable
#

How did you do it with iOS? I don't see STPPaymentMethodParams has a paramsWith(twint:

tropic spear
#

I'm not the iOS developer, but as far as I know they do something like this:
let paymentIntentParams = STPPaymentIntentParams(clientSecret: clientSecret)
let paymentMethodParams = STPPaymentMethodParams()
paymentMethodParams.type = STPPaymentMethodType.twint
paymentIntentParams.paymentMethodParams = paymentMethodParams

cunning frostBOT
noble nimbus
#

let paymentIntentParams = STPPaymentIntentParams(clientSecret: clientSecret)
let paymentMethodParams = STPPaymentMethodParams()
paymentMethodParams.type = STPPaymentMethodType.twint
paymentIntentParams.paymentMethodParams = paymentMethodParams
You can do the same with Android, use PaymentMethod.Type.Twint

#

Between, why you are creating the PaymentIntent from the frontend (Mobile)?

tropic spear
#

I cannot access the PaymentMethodCreateParams.type from my Java code.
I've tried this: ConfirmPaymentIntentParams paymentIntentParams = ConfirmPaymentIntentParams.create(paymentIntent.getClient_secret(), PaymentMethod.Type.Twint);

But it throws an error when I try to call paymentLauncher.confirm(paymentIntentParams);

#

"You cannot confirm this PaymentIntent because it's missing a payment method."

#

We do create the PaymentIntent on the backend. On the fronted I still need to confirm it with ConfirmPaymentIntentParams right?

noble nimbus
#

On the fronted I still need to confirm it with ConfirmPaymentIntentParams right?
How are you collecting the Payment Method? What Stripe product are you using ? PaymentSheet ?

tropic spear
#

For credit cards we use the CardElement for all other payment methods we collect the necessary infos in our own custom UI. We send the selected payment method type to the server. Server creates paymentIntent and we confirm the payment intent on the client (stripe redirect happens eg. to banking app or website)

noble nimbus
#

For credit cards we use the CardElement for all other payment methods we collect the necessary infos in our own custom UI.
Are you PCI DSS compliant merchant ?

#

After you collect tthe payment info how are you passing these details to the ConfirmPayment function ?

#

If you aren't PCI Dss compliant, then you should use PaymentSheet (Stripe mobile Elements)

tropic spear
#

This is what we do for Klarna for example after we receive the paymentIntent from our backend:

PaymentMethod.BillingDetails billingDetails =
new PaymentMethod.BillingDetails.Builder()
.setEmail(email)
.setAddress(new Address.Builder().setCountry(selectedPaymentType.getCountry().getCode()).build())
.build();

PaymentMethodCreateParams paymentMethodCreateParams = PaymentMethodCreateParams.createKlarna(billingDetails);

ConfirmPaymentIntentParams paymentIntentParams = ConfirmPaymentIntentParams
.createWithPaymentMethodCreateParams(
paymentMethodCreateParams,
paymentIntent.getClient_secret()
);

paymentIntentParams.setReturnUrl("xxx");
paymentLauncher.confirm(paymentIntentParams);

#

As I said it works for all other payment methods, so I was wondering if it's possible for Twint as well.

We would like to use the new PaymentSheet soon, but resources are limited right now, so we were trying to implement twint faster.

But I will take a look at the PaymentSheet, thanks for all your help!

noble nimbus
#

I see, thanks for sharing these details

noble nimbus