#faaz_link-card-billing-details

1 messages ยท Page 1 of 1 (latest)

spring meadowBOT
#

๐Ÿ‘‹ 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/1488654058645360790

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

proper parcel
#

hello! gimme just a bit, working through some other questions atm

#

can you share an example payment where you expected to receive it and didn't, as well as one where everything was as expected?

merry rapids
#

Sure. I've been using the test link login. test@link.com. pm_1TChgRCMpnBh61hXoimVX is an example where I saw it come with a California address by default. pm_1TH9eOCMpnBh61hXjkpNTV3i is where I had to provide it manually

proper parcel
#

can you double check that you didn't miss any characters on pm_1TChgRCMpnBh61hXoimVX? i'm not finding that one anywhere

#

also looks like it's a few characters shorter (not impossible but unlikely)

merry rapids
#

hmm, can you try pi_3TCiRFCMpnBh61hX0ZvxaXjT

#

it has the same address

spring meadowBOT
uncut sedge
#

HI ๐Ÿ‘‹

I'm stepping in as my colleague has to go. I'm looking at the PI you shared and I can see the billing_details.address is populated. How are you attempting to access this information?

merry rapids
#

i'm currently using paymentMethod.billing_details

uncut sedge
#

How are you retrieving this information, in what context?

merry rapids
#

Via the Stripe Payment Element. I set the configuration to { address: 'auto', name: 'never', email: 'never', phone: 'auto' }. The flow is: 1. User completes Link in the Payment Element
2. On submit: elements.submit() is called (client-side)
3. Then stripe.createPaymentMethod({ elements, params: billingDetailsForPaymentMethod }) is called (client-side)
4.Stripe returns paymentMethod โ€” including billing_details.address populated from what the Payment Elemen
5. Then the form is submitted to the server with just the payment method ID

uncut sedge
#

Okay and at what point are you attempting to access the address information?

merry rapids
#

Client side, on form submit by user, we try to access it right after creating the payment method and submitting the payment form to the server. The confirmation and validation of the payment, payment intent creation with payment method, etc, all happens server side

uncut sedge
#

Sorry but can you show me in examples of your code? What is the exact code you are using to retrieve these values and what is the value returned?

merry rapids
#

sure. ```
#createStripePaymentElement() {
NB.payments.stripeElementsObject.create('payment', {
layout: { type: this.layoutType, defaultCollapsed: false },
wallets: { googlePay: 'auto', applePay: 'auto', link: 'auto' },
fields: {
billingDetails: { address: 'auto', name: 'never', email: 'never', phone: 'auto' },
},
paymentMethodOrder: ['bacs_debit', 'link', 'card', 'apple_pay', 'google_pay'],
});
}
``

uncut sedge
#

This is just creating the Payment Element, how are you creating the Payment Method and where are you attempting to retrive the billing address?

merry rapids
#

async #handleWalletPayment() {
    const paymentMethodResult = await this.stripeClient.createPaymentMethod({
      elements: NB.payments.stripeElementsObject,
      params: this.#billingDetailsForEpo(), // name/email/phone from our form
    });

    const paymentMethod = paymentMethodResult.paymentMethod;
    this.#applyPaymentMethodToForm(paymentMethod);
    this.#addPaymentMethodInput(paymentMethod.id);
  }
uncut sedge
#

Okay, that creates the Payment Method but I do not see any attempt to read the billing address.

#

Where is that occurring?

merry rapids
#
#populateFormFieldsFromPaymentMethod(paymentMethod) {
    const billing = paymentMethod.billing_details;

    // name, email, phone
    this.#setField(firstNameInput, firstName);
    this.#setField(lastNameInput, lastName);
    this.#setField(emailInput, billing.email);
    this.#setField(phoneInput, billing.phone);

    // address
    if (billing.address) {
      this.#setField(address1Input, billing.address.line1);
      this.#setField(cityInput,     billing.address.city);
      this.#setField(stateInput,    billing.address.state);
      this.#setField(zipInput,      billing.address.postal_code);
      this.#setField(countryInput,  billing.address.country);
    }
  }
uncut sedge
#

Okay but where is this code snippet occurring, in relation to the other code snippets? Are you logging the value of the const billing?

#

Is that last code snippet where you attempt to access the data but do not see it returned?

merry rapids
#

yes that is where I attempt to access it

uncut sedge
#

Can you log the current value of the paymentMethod and also the const billing to determine what the current values are?

merry rapids
#

sure. going to take me a few minutes