Square
Setup
1
Get your Square Credentials
To use Square, you need an API token. You can get them from the Square Dashboard.
Usage
Confirm Payment
To confirm payment with square, you can use the confirmPayment
function provided by the provider. It takes object with following properties:
import { BetterPay } from "better-pay"
const provider = new BetterPay({
provider: 'square',
apiToken: 'YOUR_SQUARE_API_TOKEN'
})
const response = await provider.confirmPayment({
sourceId: 'YOUR_SQUARE_SOURCE_ID',
amount: 1000,
currency: 'USD'
})
Last updated