#evan_api

1 messages ยท Page 1 of 1 (latest)

hazy axleBOT
#

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

๐Ÿ“ 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.

keen heron
thorn forge
#

hi there!

#

can you share a PaymentIntent ID (pi_xxx) with this issue?

keen heron
#

the approach we have is not loading a payment intent on page load

#

is bascially providing paymentMethodId for the selected PM of the user

thorn forge
#

got it. do you have a link where I can reproduce the issue?

keen heron
#

I do not think I can share link publicly here.

But this a subscription ID i did

#

sub_1PxT18D9sYh65PYttsxcbWCz

#

I did it using normal cards because wechat, alipay were not showing

thorn forge
#

then can you share the frontend code used for the PaymentElement?

keen heron
#

pi_3PxT19D9sYh65PYt0x2oxNzR

thorn forge
#

so if you don't see wechat or alipay for subscription payments, that's expected.

keen heron
#

this is the payment intent for that subscription

thorn forge
#

you cannot use wechat pay for subscriptions. and for alipay you would need to contact support to request access.

keen heron
#
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

#

so since the mode in the options here is

 mode: 'subscription',

Then it will not show

thorn forge
#

correct

keen heron
#

do you suggest any other workarounds if we want to use alipay or wechat on subscription basis for our users?

thorn forge
keen heron
#

I understand

#

thanks for helping out, appreciate it

thorn forge
#

happy to help ๐Ÿ™‚

keen heron
#

one thing

#

sorry before closing

#

regarding the image you sent

#

it shows that alipay and wechat are available for the payment element

#

which is the component I am using

#

and there is another column for subscriptions

#

which seems confusing to me

thorn forge
#

if you are using the Payment Element for one-time payment, wechat and alipay will work.
if you are using the Payment Element for Subscriptions, wechat and alipay won't work

keen heron
#

I see

#

thanks for clarifying