Hi @Brighttank,
Thanks for the feedback — and great question.
The Web Billing SDK (purchases-js
) uses Stripe Elements under the hood to handle payment collection, so you don’t need to build your own form or manually collect credit card details. When you call the purchase method, a payment sheet is rendered on your site where the customer can securely enter their information. The SDK manages this flow for you.
So in most cases, you don’t need to do anything special to collect the payment method — it’s all handled by the SDK. That said, if you’re trying to reuse payment data you’ve already collected outside of RevenueCat, that isn’t currently supported.
We also have a demo app in the repository that shows how this works end-to-end: https://github.com/RevenueCat/purchases-js/tree/main/examples/webbilling-demo
If you’re looking to configure Apple Pay or Google Pay, you can find the relevant setup steps in our documentation:
https://www.revenuecat.com/docs/web/web-billing/payment-methods#configuring-apple-pay–google-pay
Hope this helps — let us know if anything’s still unclear or if you’re working with a specific setup we can help with.
Thanks for the response. I would suggest adding the part about the form being rendered by the sdk to the documentation along with a note that the purchase method contains an htmlElement parameter that can be used to configure where it is rendered.