#asifarub_docs

1 messages ยท Page 1 of 1 (latest)

uncut doveBOT
#

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

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

runic spruce
hollow mason
#

i dont see anything on my page

runic spruce
#

There are errors in your console - you need to sort those out first.

hollow mason
#

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stripe Express Checkout</title>
<script src="https://js.stripe.com/v3/"></script>
</head>
<body>
<h1>Stripe Express Checkout</h1>
<div id="express-checkout-element"></div>

<script type="text/javascript">
    const expressCheckoutElement = checkout.createElement('expressCheckout');
    expressCheckoutElement.on('confirm', (event) => {
        checkout.confirm({expressCheckoutConfirmEvent: event})
    });
    expressCheckoutElement.mount('#express-checkout-element');
</script>

</body>
</html>

#

this is all what i have in the code which i dont think is right

runic spruce
hollow mason
#

ok great, let me try this out

#

thank you

#

another question, will this work with subscription price model?

runic spruce
#

What do you mean?

uncut doveBOT
hollow mason
#

i was able to see the google pay

#

but 1) it is not the right product

#
  1. i have set up the product as recurring pay, which i dont see when I open the payment
runic spruce
#

You didn't tell it anything about using a recurring product.

#
const elements = stripe.elements({
    mode: 'payment',
    amount: 1099,
     currency: 'usd',
     appearance,
  })
  const expressCheckoutElement = elements.create('expressCheckout', options)
  expressCheckoutElement.mount('#express-checkout-element')
hollow mason
#

we have to manually specify this. Is there any wayto pick it up from stripe product page automatically

wanton dust
#

fyi i'm taking over for timebox, caching up now. the discord is a little busy so it might take me a bit to respond.

hollow mason
#

no worries

#

I am trying to set up recurring payment using expressCheckout

wanton dust
hollow mason
#

but i dont want the credit card form

#

reason i was using express checkout

wanton dust
#

let me sanity check something real quick

hollow mason
#

sure

wanton dust
#

yeah you should be able to follow that guide i linked earlier and then when you get to step 5, just add the express element in place of the payment element

#

have you tried that yet?

hollow mason
#

that will require some backend integration. will need some time

#

what i tried is this

const elements = stripe.elements({
mode: 'subscription',
amount: 199,
currency: 'usd',
setupFutureUsage : 'on_session',
appearance,
})
const expressCheckoutElement = elements.create('expressCheckout', options)
expressCheckoutElement.mount('#express-checkout-element')

#

according to the doc, i can set mode but it didn't work

wanton dust
#

sorry my integration was having issues so i wasn't able to test things but i just got it working again

#

but yeah no matter what route you go at some point you're going to need to create a subscription from the backend

#

aaand i was just able to set up what you want. so yes, the recommended approach for this is to follow that guide, but just swap the payment element out for express element in step 5.

hollow mason
#

ok thank you

wanton dust
#

yep! feel free to give that a shot and if you have any issues you're welcome to come back for more support ๐Ÿ™‚

hollow mason
#

will this chat be open after you leave?

#

for my reference