#ben-bnpl-test

1 messages · Page 1 of 1 (latest)

lyric swiftBOT
mellow cosmos
#

Can you share an example of this error?

#

What koopa mentioned earlier was my understanding as well

timber cliff
#

unfortunately not, Affirm doesn’t allow proceeding without shipping info

#

hold on, let me show you the error

mellow cosmos
#

Sure, that'd be helpful

#

Especially if you have a specific request ID like req_123

timber cliff
#

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

mellow cosmos
#

Reading through this and seeing what i can see, just a minute

#

I agree the validation at the confirm time is not the best place for this to be surfaced

timber cliff
#

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

mellow cosmos
#

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

timber cliff
#

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

mellow cosmos
#

Can you try that again with a test mode payment inent and show me what you see, how the payment sheet is initialized etc?

timber cliff
#

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

mellow cosmos
#

They should be, though.

timber cliff
#

🙂

#

yep

#

I agree with you, but they're not

mellow cosmos
#

Ok, and how are you initializing the payment sheet in RN?

timber cliff
#

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

mellow cosmos
#

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?

timber cliff
#

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

mellow cosmos
#

It could be related to location, yes, if you're in a country that doesnt support these for customers

timber cliff
#

but why would it then appear on the web?

#

though I know mobile handles location differently

mellow cosmos
#

Unclear, still trying to figure that out

timber cliff
#

thank you

#

I appreciate that

mellow cosmos
#

I'm trying with my own account now with those payment methods enabled, to see what payment sheet shows

timber cliff
#

k

mellow cosmos
#

Ok, entirely confusing, but i am seeing the same behaviour you describe.

timber cliff
#

awesome!

#

I'm not alone then 🙂

mellow cosmos
#

Can you confirm that adding the state=ontario to your PI at least resolves the confirmation error you were hitting?

timber cliff
#

I have to use state='ON'

#

but yes, that error disappears if I add it

mellow cosmos
#

Still looking into this with colleagues fyi

timber cliff
#

thanks for keeping my up to date

lyric swiftBOT
timber cliff
#

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

remote mural
#

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

timber cliff
#

so the screenshot with the Affirm sandbox screen is expected to show like this?

#

that's what you mean I should bring to support?

remote mural
#

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

timber cliff
#

web does the same thing

remote mural
#

yeah so looks like something weird with your setup/account and the best option is to reach out to support unfortunately

timber cliff
#

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

remote mural
#

that part I have no idea but a colleague is looking cc @strong dagger

timber cliff
#

thank you

strong dagger
#

👋 are you setting billingDetailsCollectionConfiguration here?

timber cliff
#

nope

#

should I?

strong dagger
#

No you shouldn't need to. Just checking

#

Still looking, one sec

timber cliff
#

k

strong dagger
#

Okay it is working for me

#

So let's figure out what is different

timber cliff
#

ok

strong dagger
#

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

timber cliff
#

yup

strong dagger
#

Don't think that should matter

timber cliff
#

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

strong dagger
#

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)

timber cliff
#

that's an iOS screenshot, but Android behaves the same

strong dagger
#

Are you testing with the same Customer ID every time?

timber cliff
#

yes

strong dagger
#

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?

timber cliff
#

sure

strong dagger
#

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.

timber cliff
#

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

strong dagger
#

Yeah I do think you need to rebuild

timber cliff
#

ok, building both platforms now

strong dagger
#

While waiting can you do a quick check for your podfile.lock and confirm what Stripe version it is on now?

timber cliff
#

Stripe (23.16.0)

#

Android still the same, but iOS now has Affirm only (no Afterpay)

strong dagger
#

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?

timber cliff
#

also, clicking Affirm will not open the address form, like Afterpay did, it just redirects to that broken sandbox - is that expected?

strong dagger
#

Yeah that's expected afaik

#

(Though not great obviously)

timber cliff
#

so the payment sheet cannot automatically collect the address data?

#

...for Affirm only...

strong dagger
#

Payment Sheet does not collect shipping

#

No

#

You can force it to collect full billing details

timber cliff
#

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

strong dagger
#

You can't force it in Web without using Address Element

timber cliff
#

how about mobile?

strong dagger
#

You can force it on PaymentSheet via your billingDetailsCollectionConfiguration

#

Basically by setting ```billingDetailsCollectionConfiguration: {
address: 'full',
},

timber cliff
#

can I set that per payment method or only generally for the whole sheet?

#

eg. i don't need the address for card payment

strong dagger
#

Ah no whole sheet

timber cliff
#

dang it

strong dagger
#

Okay so looking further into Affirm stuff and it looks like unfortunately there isn't good parity here with the underlying SDKs

#

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.

timber cliff
#

on the PI, you mean, right?

strong dagger
#

Yes

timber cliff
#

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

strong dagger
#

Yeah afaik we don't show it unless a full shipping address is provided

timber cliff
#

and full name

#

ok, I understand

#

might not be something I'll activate right now, will speak with the customer

strong dagger
#

👍

timber cliff
#

thanks a lot for your help, really appreciate it!