@matic.co/sdk v0.4.4
Matic Payments SDK
Make it easy for your clients to pay you by giving them every payment option under one roof.
See documentation at: https://docs.matic.io
Installation
Matic offers two ways to install our SDK. Our users can choose to install as a Node.js package or from a CDN.
Using Node.js Package:
npm install @matic.co/sdk
If you use Yarn as a package manager:
yarn add @matic.co/sdk
Using CDN:
<script src="https://cdn.matic.io/sdk/matic-sdk.min.js"></script>
Quick Example
- Auth
The openAuth function allows you to execute a pop-up window to verify payment methods in a simple and fast way.
import MaticSDK from '@matic.co/sdk'
const Sdk = MaticSDK.init('your pubkey')
const data = {
merchant_id: '', // your Merchant ID
}
// open popup
Sdk.openAuth(data)
.then((response) => {
// ...
})
.catch((error) => {
// ...
})
- Speed
The openSpeed function allows you to execute a pop-up window to make payments in a simple and fast way.
import MaticSDK from '@matic.co/sdk'
const Sdk = MaticSDK.init('your pubkey')
const data = {
merchant_id: '', // your Merchant ID
total: 100, // The total to pay
apply_cfee: true, // Whether apply cfee to payment
cfee_included: true, // Wheter cfee is included in the amount
merchant_gateway_id: '', // your Gateway ID
}
// open popup
Sdk.openSpeed(data)
.then((response) => {
// ...
})
.catch((error) => {
// ...
})
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago