#evan_api

1 messages ยท Page 1 of 1 (latest)

junior latchBOT
#

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

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

faint dirge
#

I can see that the Payment element is picking the right region with the help of the VPN as well and automatically selects China

whole walrus
#

Hi, let me help you with this.

#

Could you please share the PaymentIntent ID pi_xxx?

#

First idea: the amount might be too small.

junior latchBOT
faint dirge
#

paymentMethodId
pm_1Px6LMD9sYh65PYtBPehkW2V

drifting plume
#

can you share the code you use to initialise the Stripe library create and mount the PaymentElement on the frontend?
do you have a link to the page you're testing on so I can try it?

faint dirge
#

const SubscriptionForm = () => {
  const { checkoutData, selectedPlan } = useAppSelector((state) => ({
    checkoutData: state.checkoutView,
    selectedPlan: state.subscription.selectedPlan
  }))

  const options: StripeElementsOptions = {
    mode: 'subscription',
    amount: parseInt((selectedPlan.price * 100).toFixed(0)),
    currency: selectedPlan.currency.toLowerCase(),
    paymentMethodCreation: 'manual',
    appearance: {
      theme: 'stripe',
      variables: {
        colorPrimaryText: '#EAAA00',
        colorPrimary: '#EAAA00'
      }
    }
  }

  return (
    <Elements stripe={stripePromise} options={options}>
      <ElementsConsumer>
        {({ stripe, elements }) => (
          <CheckoutForm
            stripe={stripe as Stripe}
            elements={elements as StripeElements}
            checkoutData={checkoutData}
            selectedPlan={selectedPlan}
          />
        )}
      </ElementsConsumer>
    </Elements>
  )
}

export default SubscriptionForm


#

Unfortuantly I can not share the test platform here

drifting plume
#

what currency is selectedPlan.currency.toLowerCase(),?

faint dirge
#

this resolves to usd

#

the currency of the subscription plan the user Selects

#

and after double checking I can see that it resolved to usd which should be compatiable

drifting plume
#

it's local currency, or cny

faint dirge
#

under Supported Curriencies in the link you shared

#

I can see usd in the list ?

drifting plume
#

yes โ€” for Stripe accounts located in the US

faint dirge
drifting plume
#

that rule doesn't override the general restiction that these methods only work with your Stripe account's local currency or cny

#

if you want to quickly test, modify your code to pass gbp and see if Wechat/alipay appear

faint dirge
#

Alright thanks will do that now

#

Thank you

#

for helpiing out