#m0uka_api

1 messages · Page 1 of 1 (latest)

hearty tundraBOT
#

👋 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/1355193893708238909

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sly pewter
native meadow
#

hi, no, but i set billingAddressRequired to true

#
<ExpressCheckoutElement
        className={'w-full'}
        options={stripeCheckoutElementOptions}
        onClick={(e) => {
          let recurringIntervalUnit =
            checkout?.lines[0].subscription_interval_scale!

          let recurringIntervalCount =
            checkout?.lines[0].subscription_interval_value

          if (recurringIntervalUnit === 'week') {
            recurringIntervalUnit = 'day'
            recurringIntervalCount = recurringIntervalCount! * 7
          }

          e.resolve({
            emailRequired: true,
            billingAddressRequired: true,
            applePay: checkout?.subscription
              ? {
                  recurringPaymentRequest: {
                    paymentDescription: `${checkout.store.name} ${checkout.lines[0].product_name} subscription`,
                    managementURL: 'https://checkout.paynow.gg/subscriptions',
                    regularBilling: {
                      amount: checkout.recurring_total_amount,
                      label: `${checkout.lines[0].product_name}`,
                      recurringPaymentIntervalUnit:
                        recurringIntervalUnit as ApplePayRecurringPaymentRequestIntervalUnit,
                      recurringPaymentIntervalCount: recurringIntervalCount!,
                    },
                  },
                }
              : undefined,
          })
        }}
        onReady={(e) => {
          setExpressCheckoutReady(true)

          // 1 for Link
          let avail = 1
          if (e.availablePaymentMethods?.applePay) {
            avail++
          }
          if (e.availablePaymentMethods?.googlePay) {
            avail++
          }

          setAvailableCheckoutMethods(avail)
        }}
        onConfirm={(e) => changePaymentMethodMutation.mutate()}
      />```
sly pewter
#

Can you share what elements.create()looks like?

native meadow
#
<StripeElementsWrapper
        methodId={'card'}
        customElementsOptions={{
          mode: checkout?.subscription
            ? isSetupIntent
              ? 'setup'
              : 'subscription'
            : 'payment',
          amount: isSetupIntent ? undefined : checkout?.total_amount,
          currency: isSetupIntent ? undefined : checkout?.currency,
          captureMethod: 'automatic',
          payment_method_types: availableGatewaysQuery.data
            ?.filter(
              (x) =>
                x.gateway === 'stripe' &&
                x.gateway_entity_identifier ===
                  cardMethodGatewayEntityIdentifier &&
                checkout?.currency &&
                x.supported_currencies?.includes(checkout.currency)
            )
            ?.filter((x) =>
              checkout?.subscription ? x.subscriptions_supported : true
            )
            .map((x) => x.gateway_method_type_id),
        }}
      >
        <ExpressCheckoutStripeButton />
      </StripeElementsWrapper>```

customElementsOptions is the `options` field passed to ```jsx
<Elements options={options} stripe={stripePromise}>
      {children}
    </Elements>```
(which should be calling `elements.create()` internally afaik)
sly pewter
#

I just tested my integration with the following and it works as expected.

const options = {
mode: 'payment',
amount: 1099,
currency: 'eur',
};

I do not fully follow your code. From your code, customElementsOptions looks similar to what I'm passing.

What does your confirm call look like?

native meadow
#
const billingDetails = {
          name: details.name,
          email: details.email,
          address: {
            country: details.address!.country!,
            postal_code: details.address!.postal_code!,
            state: details.address!.state!,
            line1: details.address!.line_1!,
            line2: details.address!.line_2!,
            city: details.address!.city!,
          },
        }

        if (clientSecret.startsWith('pi_')) {
          const paymentIntentResult = await stripe!.confirmPayment({
            elements: elements!,
            clientSecret,
            confirmParams: {
              return_url: getCompleteURL(),
              payment_method_data: {
                billing_details: billingDetails,
              },
            },
          })

          if (paymentIntentResult?.error) {
            handleStripeError(paymentIntentResult.error)
          }
        } else {
          const setupIntentResult = await stripe!.confirmSetup({
            elements: elements!,
            clientSecret,
            confirmParams: {
              return_url: getCompleteURL(),
              payment_method_data: {
                billing_details: billingDetails,
              },
            },
          })```
sly pewter
native meadow
#

the problem is that we cannot reproduce this too, looks like it only occurred for some customers

#

i can send you the whole code but i've shared everything regarding the stripe integration already

#

i've noticed this only happens for Apple Pay

sly pewter
#

Hmm, that is weird that it only happened to some customers. I tried many ways and I can't repro this.

#

Can you share another requets where it works as expected?

native meadow
#

couldn't it be due to me passing the special fields for applePay during the confirmation?

e.resolve({
            emailRequired: true,
            billingAddressRequired: true,
            applePay: checkout?.subscription
              ? {
                  recurringPaymentRequest: {
                    paymentDescription: `${checkout.store.name} ${checkout.lines[0].product_name} subscription`,
                    managementURL: 'https://checkout.paynow.gg/subscriptions',
                    regularBilling: {
                      amount: checkout.recurring_total_amount,
                      label: `${checkout.lines[0].product_name}`,
                      recurringPaymentIntervalUnit:
                        recurringIntervalUnit as ApplePayRecurringPaymentRequestIntervalUnit,
                      recurringPaymentIntervalCount: recurringIntervalCount!,
                    },
                  },
                }
              : undefined,
          })```
sly pewter
#

That seems a bit suspicious

native meadow
#

here's a working google pay req_D0hTcFU591PmhT

#

using express checkout

#

let me see if i can find an apple pay one

#

here's an apple pay req_Br23GF5rj9pcE5

sly pewter
#

Let me test this with ApplePay, hang tight.

hearty tundraBOT
sly pewter
#

I could not reproduce this with Apple Pay either

idle kite
#

Hi hi! I’m going to be taking over for my colleague here. Give me a minute to read back and understand things.

idle kite
#

Just to make sure I don't go chasing geese, can you one-sentence your issue for me so I can confirm my understanding?

native meadow
#

the shipping fields get set by the SDK for some reason in some cases, but that is undesirable - i do not want to pass in shipping at all

idle kite
#

I don't think this has anything to do with your integation; my tummy tells me the user's Apple Pay Wallet didn't include their shipping details.

#

This is a very infrequent thing, ya?

#

I also wonder if this is because you're creating Tokens here rather than one of the newer ways to deal with capturing card details.

#

Can you tell me more about the whole flow you're using here? You seem to be using createToken on your own, and then somehow making use of the Express Checkout Element to finalize things?

native meadow
#

i am not using createToken anywhere explicitly as far as i know

native meadow
idle kite
#

You're not creating a Token, it's internal.

#

My tummy tells me this is missing information on an Apple Wallet that we're not handling correctly.

#

Can I move you over to our Developer Support case system so I can pull in the folks that work on this?

native meadow
#

sure

hearty tundraBOT
#

Hello @native meadow, we have sent you a direct message, please check it at https://discord.com/channels/@me/1355193634508509348

  • 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.