#ben-bnpl-test
1 messages · Page 1 of 1 (latest)
Can you share an example of this error?
What koopa mentioned earlier was my understanding as well
unfortunately not, Affirm doesn’t allow proceeding without shipping info
hold on, let me show you the error
does this help? request_log_url: 'https://dashboard.stripe.com/test/logs/req_1Qkr16RrTcctA5?t=1697045877'
I'm guessing you needed req_1Qkr16RrTcctA5
sorry, that's not the one
that's where I missed to include the name in the shipping details
but it proves it's actually required, otherwise neither affirm, nor afterpay would appear
pi_3O07poDfS3kVhDxi2VcO31b5
"Missing required param: shipping[address][state]."
but the point is, all that info is coming from what I have set in PaymentIntent create shipping param, the element (web) paymentsheet (mobile) would not ask for it in case of Affirm
Afterpay does automatically open the form even if I provide shipping - to be clear, I do NOT want to provide shipping in advance, as I don't normally have the address of my customers
so I prefer the behaviour of Afterpay that asks for it
Reading through this and seeing what i can see, just a minute
Something else seems to be happening her,e since our docs say shipping is optional (but recommended) for Affirm:
https://stripe.com/docs/payments/affirm/accept-a-payment?platform=web#web-collect-payment-method-details
Improve payment success rates with additional details
We recommend passing shipping and billing details to improve conversion rates, although these are not required.
If you optionally providing shipping for Affirm, then yea you need to collect this and provide a complete address. Here the issue is that you've set an incomplete address hash (missing state)
https://dashboard.stripe.com/test/logs/req_olWbUAoGW5Kuug
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I agree the validation at the confirm time is not the best place for this to be surfaced
the problem is that on mobile, I MUST provide shipping, otherwise neither Affirm, nor Afterpay appear (this works fine on web), and I would be ok with that, but Affirm never actually asks for the details, it just takes what I indicated in shipping...
so it's a catch 22
this is how Afterpay looks like if I tap it
this is affirm
there is no form
to take the address info
it never appears, even if I have missing fields in shipping
Sure, why would it be there?
You provided the address manually on the PI
the problem is that on mobile, I MUST provide shipping, otherwise neither Affirm, nor Afterpay appear
I don't understand, how does that happen?
It sounds like you;re saying to expect the payment sheet (or payment element) to automatically collect the missing fields in your optinally/manually provided shipping address
sorry, this isn't a clear cut case, so not easy to explain
my goal is to allow people to use either Afterpay or Affirm
this is working perfectly fine on web WITHOUT the shipping param for paymentIntent
but as I mentioned above (and a kind colleague of yours helped me with that) mobile appears to require that I provide shipping
otherwise neither of the BNPL options would appear
they would not be showing as a tab at all, only the Apple Pay and Card option would be there
but only on mobile
for some reason
I'm using the react-native library, might be an issue with that only, I'm not sure
This is surprising, since shipping is not required for Affirm (according to what I see)
Can you try that again with a test mode payment inent and show me what you see, how the payment sheet is initialized etc?
you mean remove shipping from paymentIntent.create and initiate a payment?
I have plenty of those already
pi_3O0218DfS3kVhDxi36lVVjO8
you will see that
"payment_method_types": [
"card",
"afterpay_clearpay",
"affirm",
"link"
],
they are all there, but they are not visible on the paymentSheet on mobile
They should be, though.
Ok, and how are you initializing the payment sheet in RN?
do you want me to paste the full code or what exactly are you curious about?
const defaultCountryCode = 'CA'
const initializePaymentSheet = async itemData => {
const { clientSecret, ephemeralKey, customer } =
await fetchPaymentSheetParams(itemData)
const { error } = await initPaymentSheet({
customerId: customer,
merchantDisplayName: companyName,
customerEphemeralKeySecret: ephemeralKey,
paymentIntentClientSecret: clientSecret,
returnURL: 'traininglanemobile://payment-success',
applePay: {
merchantCountryCode: defaultCountryCode
},
googlePay: {
merchantCountryCode: defaultCountryCode
},
defaultBillingDetails: {
email,
address: {
country: defaultCountryCode
}
},
appearance: {
// bla bla
}
})
if (error) {
// handle error
}
}
let me know if you need anything more
I'm just trying to figure out how to repro this and see what you're seeing
If you omit the defaultBillingDetails does anything change?
let me try that
one more min
both the BNPL options are gone, even if I remove the defaultBillingDetails
is it possible that it would not appear because I'm not physically in Canada?
or the US, for that matter
it's still interesting that on web this is not a problem
which is why I excluded that possibility
It could be related to location, yes, if you're in a country that doesnt support these for customers
but why would it then appear on the web?
though I know mobile handles location differently
Unclear, still trying to figure that out
I'm trying with my own account now with those payment methods enabled, to see what payment sheet shows
k
Ok, entirely confusing, but i am seeing the same behaviour you describe.
Can you confirm that adding the state=ontario to your PI at least resolves the confirmation error you were hitting?
Still looking into this with colleagues fyi
thanks for keeping my up to date
btw, a similar thing is happening on web (react-stripe) (PaymentElement) for Affirm, if I don't provide anything for shipping, it will redirect to Affirm's (sandbox) but display an error - should I report this separately?
it's only similar in that not providing shipping would lead to an error, but it's different in that the option will still be available even if no shipping is provided in PI
but even remaining on mobile, providing the full shipping address and full name, I get redirected to this screen:
I wouldn't expect this to be normal, even if it's a sandbox, Afterpay would show a test screen to approve or deny
not all payment methods work the same in Test mode
some partners have their own test mode environment and so we redirect to them in that case
ben-bnpl-test
If I had a magic wand, I'd never allow this and we would always show that fake test page with approve/decline. Sadly this isn't something we've been able to convince the product teams of doing 😦
The error you end up on on Affirm is definitely weird but would be better debugged 1:1 with our support team in that case
so the screenshot with the Affirm sandbox screen is expected to show like this?
that's what you mean I should bring to support?
no it's not expected to show a weird error. Step 1 would be to try on the web for a bit and understand what's happening
web does the same thing
yeah so looks like something weird with your setup/account and the best option is to reach out to support unfortunately
ok, that's fine, so I guess we can focus this thread on my original query
why bnpl's are not appearing if the PI has no shipping param specified, and only on mobile
that part I have no idea but a colleague is looking cc @strong dagger
thank you
👋 are you setting billingDetailsCollectionConfiguration here?
k
ok
So let's cut things down
All I'm doing on the client is const {error} = await initPaymentSheet({ customerId: customer, customerEphemeralKeySecret: ephemeralKey, paymentIntentClientSecret: paymentIntent, allowsDelayedPaymentMethods: true, returnURL: 'https://www.example.com123', })
What version of our React Native SDK are you using?
Ah looks like you are on 0.28.0
yup
Don't think that should matter
yeah, I didn't see anything relevant changed or added in the newer versions
btw, @mellow cosmos could reproduce it, so we must be sharing something we did similarly
could it be a physical location thing? I'm outside the US or Canada
but the web (react) has no problems with that
Nah that shouldn't matter
Are you testing on Android or iOS here? (I assume iOS but not sure if the screenshots above are from web)
that's an iOS screenshot, but Android behaves the same
Are you testing with the same Customer ID every time?
yes
That customer looks very old. Can you create a new one and run a fresh test with just the initPaymentSheet params I gave you above?
sure
Ah okay
I think it actually is your React Native version
Going to verify
But seeing that we removed shipping being required from the underlying iOS SDK in June.
pi_3O0A0ODfS3kVhDxi4LGmqsqX
oh, ok
let me upgrade then
ok, just upgraded to 0.33.0, unfortunately no change
but I have just reloaded the app, so let me try with rebuilding it completely
Yeah I do think you need to rebuild
ok, building both platforms now
While waiting can you do a quick check for your podfile.lock and confirm what Stripe version it is on now?
Okay that is what I see too on iOS.
You will need shipping for Afterpay
But sounds like this did fix it on iOS
However you still don't see it on Android, yes?
also, clicking Affirm will not open the address form, like Afterpay did, it just redirects to that broken sandbox - is that expected?
so the payment sheet cannot automatically collect the address data?
...for Affirm only...
Payment Sheet does not collect shipping
No
You can force it to collect full billing details
if I click Afterpay (if it appears at all), it does open a form asking for user email, name and address
I'd expect Affirm to do the same thing
can I force it? how?
I was looking for that
something I'm actually missing in react (web) as well
that would solve a series of my problems
You can't force it in Web without using Address Element
how about mobile?
You can force it on PaymentSheet via your billingDetailsCollectionConfiguration
Basically by setting ```billingDetailsCollectionConfiguration: {
address: 'full',
},
can I set that per payment method or only generally for the whole sheet?
eg. i don't need the address for card payment
Ah no whole sheet
dang it
Okay so looking further into Affirm stuff and it looks like unfortunately there isn't good parity here with the underlying SDKs
With Android there are some ways to directly handle showing Affirm without setting shipping server-side: https://github.com/stripe/stripe-android/blob/master/CHANGELOG.md#paymentsheet-32
Versus with the iOS SDK we removed the shipping requirement: https://github.com/stripe/stripe-ios/blob/master/CHANGELOG.md#2393-2023-06-26
I'll file some feedback internally about this lack of parity... since you can't use those Android methods in the React Native SDK
But for now my recommendation would be to enter a shipping address server-side.
on the PI, you mean, right?
Yes
and then I'd have to update that later down the line before the actual payment is submitted
because it looks like it only takes full addresses with street and everything
line1, postal_code, city, country, as far as I could tell, all of it has to be there otherwise Afterpay hasn't appeared for me
Yeah afaik we don't show it unless a full shipping address is provided
and full name
ok, I understand
might not be something I'll activate right now, will speak with the customer
👍
thanks a lot for your help, really appreciate it!