How to accept payments in a React or Vue app from Pakistan
To accept payments in a React or Vue app from Pakistan, use a Ruba checkout link and open it inside your page with the embedded checkout. You add one attribute to a button, load one script. Ruba takes the card, handles supported taxes and pays you to your own bank. You need no Stripe account.
You may not need a backend
Ruba has SDKs for TypeScript, Python, PHP and Go, and a plain checkout link needs no code at all. Hassan in Peshawar built a React app that cleans up CSV files. He is a front-end developer, and he does not want to build a billing server. Good news: a fixed product needs no backend at all. A reusable checkout link does the work.
Stripe does not support Pakistan, so most of the tutorials you find will not apply to you. This one does.
Three levels of depth
There are three ways. Start with the lightest one that does the job.
Great for A button that opens checkout on top of your page.
Watch for You cannot react to events in code.
Great for Apps that already bundle their code.
Watch for Call init once after the app mounts.
Great for Flows where your code decides when and how to open checkout.
Watch for Trust webhooks for anything that matters, not only browser events.
The lightest way: HTML
Copy your product’s checkout link from the dashboard. Put it in this snippet on any page that accepts HTML. In Vue, you can place it in a template or in your index file.
<a
href="__CHECKOUT_LINK__"
data-ruba-checkout
data-ruba-checkout-theme="light"
>
Purchase
</a>
<script
defer
data-auto-init
src="https://cdn.jsdelivr.net/npm/@getruba/checkout@latest/dist/embed.global.js"
></script>React, with the package
Install @getruba/checkout, then call RubaEmbedCheckout.init() once after the component mounts. It attaches to the same data-ruba-checkout attribute.
import { RubaEmbedCheckout } from '@getruba/checkout/embed'
import { useEffect } from 'react'
export function PurchaseLink() {
useEffect(() => {
RubaEmbedCheckout.init()
}, [])
return (
<a href="__CHECKOUT_LINK__" data-ruba-checkout>
Purchase
</a>
)
}If you need to open it from your own code, use create(). It resolves when the iframe is ready.
const checkout = await RubaEmbedCheckout.create('__CHECKOUT_LINK__', {
theme: 'light',
onLoaded: () => console.log('Checkout is ready'),
})Do not trust the browser alone
For the server side, see the Next.js guide.
What to do next
Apply for Ruba early access, create a product and copy its checkout link. Ruba charges 4% + $0.50 per sale, with no monthly fee, and pays individuals in Pakistan in PKR to their own bank. A payout costs $2 up to $200, then 1%, and starts at $10 after the fee.
A checkout link can sit in any front end. No monthly bill, and no company to register before your first sale. Get approved in early access and your React or Vue app keeps 4% + $0.50 per sale, locked while the account stays open and in good standing. The $100 promise: a fee Ruba never told you about comes back to you, and Ruba pays you $100. Terms apply. See the early-access deal.
Questions people ask
Do I need a backend to accept payments in a React app?
Not for a fixed product. A reusable checkout link needs no backend, and the embed opens it inside your page. If you need customer-specific values, create a Checkout Session from your server instead.
Does it work in Vue?
An HTML trigger works on any page that accepts HTML, and there is an example for React. The HTML trigger with the global script works in any framework’s template. Test the package init in your own setup.
How do I know when the payment succeeded?
The embed emits four events: loaded, close, confirmed and success. For anything that matters, such as unlocking access, trust your server and webhooks, not only the browser.
What about the iframe origin?
For a dynamically created session, set embed_origin to the exact origin that hosts the iframe, for example https://example.com.
Do I need Stripe keys in my app?
No. Your app only uses Ruba’s checkout link or API. Ruba is the Merchant of Record and pays you to your own bank.
Sources
We check these when we update this guide. Rules can change, so check them yourself before you decide.
- Ruba: embedded checkoutChecked 26 Nov 2026
- Ruba: checkout pagesChecked 26 Nov 2026
- Ruba: pricing and feesChecked 26 Nov 2026
- Ruba: payoutsChecked 26 Nov 2026
- Stripe: global availabilityChecked 26 Nov 2026