#_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1404662661433786389
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Currently, the IOS client can display PayNow using the same method and in the same environment, but the Android client is unable to display PayNow. Is there a solution to this issue?
here
This was obtained temporarily from the production side. Currently, I can successfully open the payment page. However, the only issue is that PayNow cannot be displayed because this clientSecret was created in the Singapore environment.
Thanks. Please keep in mind that sharing key (even PublishableKey) is discouraged
I recommend remove your Live PublishableKey above
ok thanks
It's not secret key so not end of the world, but please be mindful! This is a public forum
Alright you PI does have paynow enabled
Yes, I also repeatedly confirmed. The official documentation states that "allowsDelayedPaymentMethods(true)" is sufficient for normal operation. However, the result was not satisfactory.
Currently, it only shows GrabPay and Card.
Could you please tell me the solution?
Sorry, actually I saw it on the forum. GitHub
The version I am currently using is 'com.stripe:stripe-android:21.22.1'
Can you share your current code for initializing PaymentSheet and showing it? Around this place: https://docs.stripe.com/payments/mobile/accept-payment?platform=android&type=payment#present-the-paymentsheet
// Create Stripe SDK
PaymentConfiguration.init(getApplicationContext(), publishableKey);
// Create PaymentSheet
paymentSheet = new PaymentSheet(this, this::onPaymentSheetResult);
Button btnPay = findViewById(R.id.btn_pay);
btnPay.setOnClickListener(v -> presentPaymentSheet());
}
/**
* Pay Result
*/
private void onPaymentSheetResult(PaymentSheetResult paymentSheetResult) {
if (paymentSheetResult instanceof PaymentSheetResult.Completed) {
Toast.makeText(this, "pay succeed ✅", Toast.LENGTH_SHORT).show();
} else if (paymentSheetResult instanceof PaymentSheetResult.Canceled) {
Toast.makeText(this, "pay cancel ❌", Toast.LENGTH_SHORT).show();
} else if (paymentSheetResult instanceof PaymentSheetResult.Failed) {
PaymentSheetResult.Failed failedResult = (PaymentSheetResult.Failed) paymentSheetResult;
Toast.makeText(this, "pay fail ❌: " + failedResult.getError().getMessage(), Toast.LENGTH_LONG).show();
}
}
/**
* Config
*/
private PaymentSheet.Configuration createPaymentSheetConfiguration() {
return new PaymentSheet.Configuration.Builder("NovoGee Market")
.allowsDelayedPaymentMethods(true) // 允许异步支付方式(GrabPay、PayNow)
.build();
}
/**
* PaymentSheet
*/
private void presentPaymentSheet() {
PaymentSheet.Configuration configuration = createPaymentSheetConfiguration();
paymentSheet.presentWithPaymentIntent(clientSecret, configuration);
}
this
The method I used was through the Payment Intents API combined with the Stripe Android SDK (PaymentSheet)
Hmm looks pretty much normal to me...
How about the working iOS code?
And do you setup return URL in iOS/Android?
This is the code for IOS..
It seems that there is no way to set the returnURL in my Android client.
<activity
android:name=".page.StripePayActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="novogee"
android:host="stripe-redirect" />
</intent-filter>
</activity> Previously, I had attempted to set the callback URL in the manifest file in a manner similar to this.
Currently, when the IOS client is invoked, the functions "paynow", "gradpay" and "card" are displayed normally. However, in my Android client, the "paynow" function is missing. The same environment applies.
I see...
Can you download the QuickStart project here and change the backend to your backend?
I checked the code in the link you provided and attempted to execute it. The result was consistent with what I have at the moment. However, the "paynow" function still cannot be displayed.
This is a screenshot that has been called up.
hi there 👋 taking over the thread from my colleague, give me a moment to catch up
@tired kite Just want to acknowledge that I'm still looking into this.
In the meantime, could you share with me the Stripe acccount ID being used in your integration? You can find your account id by logging in to https://dashboard.stripe.com/settings/account . It'll have the prefix acct_
wait
No worries, also just to confirm, the intention here is to show PayNow on mobile payment sheet with Android devices right? This is a feature we don't currently support right now: https://docs.stripe.com/payments/payment-methods/payment-method-support#real-time-payments-product-support
See the second row of the table, PayNow is only supported on mobile payment sheet for iOS only.
Yes. Currently, the intention is to display PayNow on the Android client. Currently, it has been integrated and is being used on the iOS platform.
Yup we don't support displaying PayNow on Android right now.
Where is the second line of the document?
sorry, could you clarify the "second line" you're referring to?
See the second row of the table, PayNow is only supported on mobile payment sheet for iOS only. Where is this?
Is the current latest SDK also not supported?
no it is not
OK, I saw it.
Do you mean that currently, the official Android version on mobile devices does not support it?
Paynow
I am referring to Stripe's Mobile Payment Sheet not supporting PayNow for Android devices right now. I'm not sure what you meant by "official Android version"
But there is a workaround you might want to consider: https://github.com/stripe/stripe-android/issues/6840#issuecomment-1584511698
Although PaymentSheet doesn't support Paynow, you can still support it by creating a PaymentIntent using the params explained in the Direct API Integration guide, obtain the PayNow QR code from PaymentIntent's next_action.paynow_display_qr_code.image_url_png, and use this information to render it in your mobile app.
Oh, I see. So currently, PaymentSheet doesn't support PayNow on Android mobile devices, right?
yes