Using with React
This page describes how you can install and use the Stable Pay widget on your code from a React project.
Usage
Installing
npm install stablepay-widget yarn add stablepay-widgetExample
import React from 'react';
import { WidgetButton } from 'stablepay-widget';
const Checkout = () => {
const payload = {
type: 'Payment',
source: {
name: 'Your Store',
address: '0x0...'
},
amount: {
total: '9.99'
},
callbackURL: 'https://yourstore.com/checkout',
theme: 'standard'
};
return <WidgetButton {...payload} />;
};
export default Checkout;Last updated
Was this helpful?