#issambd

1 messages ยท Page 1 of 1 (latest)

daring beacon
#

Do you have a request ID I can take a look at? Can you also add some logging to your code to confirm that postal_code is valid before you pass it to us

hexed iris
#

Yes, I have input validation implemented, postal_code is valid. I don't understand what you mean with a request ID? can I find it in Stripe's logs?

daring beacon
#

You would be able to find it in your dashboard, alternatively if you have the Setup Intent ID that would also work!

hexed iris
#

alright, lemme register a new payment methode and get the setupIntent

#

id: "seti_1K1wi8LzSPzAEiPDyVsjDt09"

daring beacon
#

That's so strange - let me try a couple of things out on my end

hexed iris
#

alright

daring beacon
#

Hmm... I'm not able to replicate it in my test setup - let me try out a few additional things

hexed iris
#

alright

#

thank you

daring beacon
#

Ah! I think I'm on to something - what does you code look like that is creating the Payment Element?

hexed iris
#

Lemme send you a screenshot

#

options contains ClientSecret and appearences

daring beacon
hexed iris
#

I am sorry I don't understand. I am actually trying to cllect it, how does specifing this helps?

daring beacon
#

If you're trying to collect it through the Payment Element, why are you passing it in with your confirm_params?

hexed iris
#

I am trying to collect it through confirm_params bc that's what the docs say, I pass it along the other adress attributes

#

all other attributes are saved but the postal code

#

Take a look at this

daring beacon
#

Yeah so setting postalCode: never means that you don't want to collect postal code through the UI, but it should still keep the postal code that you're pass in to your confirm_params

hexed iris
#

aha, the UI does not ask for postal_code anyways, lemme explicitly disable it then and test it again

#

I have a problem, the options object does not contain a fields property as specified in the docs, take a look at those definitions

#

wait, I am not using a payment element that's why

#

which I guess is different from the javascript version

#

I am sorry that doesn't sound coherent, but my point is the react Element does not have fields property like the vanilla javascript one

rich moat
#

that's expected

#

Sorry, we have many different integration paths, so step 1 would be to understand what exact flow and integration path you use, and then that path has its own params/logic really

hexed iris
#

Alright, this is my important statement import { Elements } from "@stripe/react-stripe-js";

#

this is the version : "@stripe/react-stripe-js": "^1.6.0",

rich moat
#

Do you have a screenshot of what it looks like?

hexed iris
rich moat
#

no that's code

#

I mean what you see on your page

hexed iris
#

oh, one second

#

This is the stripe iframe

rich moat
#

hum

hexed iris
#

those fields are chosen automatically

rich moat
#

yeah sorry, trying to grasp your context and you seem quite lost too yourself ๐Ÿ˜…

hexed iris
#

Yes I am sorry, lemme know if I can give you any further infos about my code

rich moat
#

Like the code you shared seems to be the normal card element, but the screenshot you shared looks like PaymentElement, and I am totally lost with your context and what you are asking.

#

Do you have a page I can look at?

hexed iris
#

I don't think you can, I am working on a teams app, which is not accessible outside of MS teams, but I can quickly go through my code, to help you understand the context

#

This is my Element

#
//import
import { Elements } from "@stripe/react-stripe-js";
import { loadStripe } from "@stripe/stripe-js";


//element 
<Elements stripe={stripePromise} options={options} >
   <SetupForm setInd={setInd} noTenant={noTenant} order={order} setNavIndex={setNavIndex} />
</Elements>

//options
 const options = {
    clientSecret,
    appearance: {
      variables: {
        colorPrimary: "#616161",
        colorBackground: "#F0F0F0",
        colorText: "#616161",
        colorDanger: "#df1b41",
        fontFamily: "Ideal Sans, system-ui, sans-serif",
        spacingUnit: "5px",
        // borderRadius: "4px",
        fontSizeBase: "14px",
      },
      rules: {
        ".Label": {
          padding: "0  0 10px 0",
        },
        ".Input": {
          border: "none",
          marginBottom: "20px",
          padding: "10px",
          fontSize: "14px",
        },
        ".Input:focus": {
          outline: "none",
          border: "red bold 5px !important",
        },
      },
    },
  };

rich moat
#

Is there any chance you could move away from your entire app and just build a really simple and basic example to debug this further?

hexed iris
#

Humm, could you quickly look at my code first?

rich moat
#

I can try but I worry we're talking past each other ๐Ÿ˜ฆ

#

and the channel is quite busy with lots of questions

hexed iris
#

Oh sorry, lemme try to build a separate project for this then

#

this will take a moment

rich moat
#

ahhh wait

#

what's <SetupForm?

#

that's what is inside that should matter

hexed iris
#

it's the component that is warpped by the Element

#

lemme show you what's indie

#

import : import { useStripe, useElements, PaymentElement } from "@stripe/react-stripe-js";

#

this : <PaymentElement />

rich moat
#

see you clearly use PaymentElement there ๐Ÿ˜…

#

Okay, so now that I know that. What's your question? I'm a bit confused overall by what is even blocking you

hexed iris
#

I am passing the billing data inside stripe.confirmSetup

rich moat
#

can you re-share that exact code?

hexed iris
#

yes sir

#
      elements,
      redirect: "if_required",
      confirmParams: {
        payment_method_data: {
          billing_details: {
            address: {
              city,
              line1,
              line2,
              postal_code,
            },
            email,
            name,
          },
        },
      },
    }); ```
#

all the billing data is saved but the postal code

#

this is my problem

#

should I procceed with building a seperate project?

rich moat
#

nah, can you try and hardcode exact values first?

#
      elements,
      redirect: "if_required",
      confirmParams: {
        payment_method_data: {
          billing_details: {
            address: {
              city: 'city',
              line1: 'line1',
              line2: 'line2',
              postal_code: '90210',
            },
            email: 'myemail@example.com',
            name: 'my name'
          },
        },
      },
    });```
#

like try this and see if postal code works

hexed iris
#

okay

#

unsuccessful, this is the stripe confirm request

#

Request ID : req_UYKnGoJbclFi3H

rich moat
#

thanks let me try I have an inkling what this might be

hexed iris
#

req_P6BDABV6ILKV1J

#

Im sorry that was the wrong ID

rich moat
#

all of those are wrong ids ๐Ÿ˜…

hexed iris
#

Ah shit, I am really sorry, lemme check

rich moat
#

but it's fine I found it

#

I'm trying to repro to see if it's a bug

hexed iris
#

alright, thank you

#

pretty sure it's this one : req_Pd2IuDOzVKD6Q4

rich moat
#

yep that's the one I found!

#

which country are you based in? Are you in the US/CA/UK or elsewhere?

hexed iris
#

in DE

rich moat
#

ah okay so I have a feeling there's a bug where we don't show the postal code but we still don't treat your postal code in the params, but struggling to reproduce, give me a bit more time

hexed iris
#

take your time

rich moat
#

okay I can't repro with non React just yet. Can you try one quick thing for me?

#

Can you disable country and postal code collection entirely?

hexed iris
#

I can disable postal code, but country comes with thr iframe, I have no idea how to disable it

#

country is part of the UI generated by the payment element

rich moat
#

nah you're misunderstanding how all of this works :p

#

country and postal code are part of our default UI! Just we only collect postal code in some countries (US/UK/CA) and you're in one where we don't so you don't see it

#

but I think something is thinking we collect it and ignoring your own param

#
            fields: { 
              billingDetails: { 
                address: { 
                  country: 'never',
                  postalCode: 'never',
                },
              } 
            },
          }}
        />```
#

that's how you disable both (I'm testing too, just less good with React myself)

hexed iris
#

I meant that I litrally have an input field where the user inputs their postal code, then the value is sent with the setupintent

#

lemme try your code

#

I get this error

#

You specified "never" for fields.billing_details.address.country when creating the payment Element, but did not pass confirmParams.payment_method_data.billing_details.address.country when calling stripe.confirmPayment or stripe.confirmSetup. If you opt out of collecting data via the payment Element using the fields option, the data must be passed at confirm-time.

rich moat
#

okay then pass country in that confirm call where you pass the address details

#

sorry slowly fixing my React install to get to the same state

hexed iris
#

Look at that

#

"postal_code": "90210",
"country": "DE"

#

now the postal code is saved when the country is also passed in the intent object

rich moat
#

okay so I do think there's a real bug. Now all I need is to figure out how to repro myself but React and me don't mesh well lol

#

but you should be unblocked since you don't want Elements to collect the postal code or country for you

hexed iris
rich moat
#

make it do what?

hexed iris
#

collect both country and postal code

#

as you have seen the UI only collects the country and ignores the postal code

rich moat
#

it doesn;t

#

country and postal code are part of our default UI! Just we only collect postal code in some countries (US/UK/CA) and you're in one where we don't so you don't see it

#

that's what I said earlier

#

we only collect postal code in specific countries where it really helps with conversion/increase in authorization/decrease in fraud

#

so it works, but it doesn't do what you want, so you need to disable country and postal code and explicitly pass those yourself which you already collect as part of the full address

#

would be weird to put the postal code in Elements and line 1 earlier in your form

hexed iris
#

I see, well this is good enough for me, I really appreciate your help

#

have a good day ๐Ÿ™‚

rich moat
#

sure thing, sorry for the long back and forth, there's clearly something wrong here so I'm also working to repro and make sure we get a fix out