One-off - Web-button
When the merchant wants to receive a payment by displaying a QrCode or by letting the consumer type the mobile phone number on a screen.
The interface to display the QrCode or the mobile phone number field is handled by the Web Button that is an embeddable JavaScript that loads the Satispay Payment option on your client.
The consumer can scan the Dynamic Code or type the mobile phone number and confirm the payment to complete it.
Web-button vs Web-redirect
The Web-button is more suited for integration into websites that are mostly used on desktop computers.
The Web-redirect is more suited for integration into websites that are mostly used on mobile devices as it automatically manages the switch between the mobile-browser and the Satispay app.
APIs required for this flow
- Create a payment (MATCH_CODE flow)
- Get payment details
When creating a payment for the Web-button the
callback_url
is required.
Sequence diagram
Web-button
Once the payment has been created, the Web-button can be initialised.
Standard
<script
src="https://online.satispay.com/web-button.js"
data-payment-id="8f27fbbc-ff4b-45eb-98d0-1cadb3a0afaa"
></script>
<script
src="https://staging.online.satispay.com/web-button.js"
data-payment-id="8f27fbbc-ff4b-45eb-98d0-1cadb3a0afaa"
></script>
Advanced
The advanced version of the Web-button allows UX customisation of the payment button.
<script src="https://online.satispay.com/web-button.js"></script>
<img src="https://online.satispay.com/images/en-pay-red.svg" alt="Pay with Satispay" id="pay-with-satispay" style="height: 50px; cursor: pointer;" />
<script>
var satispay = SatispayWebButton.configure({
paymentId: '8f27fbbc-ff4b-45eb-98d0-1cadb3a0afaa',
completed: function() {
// executed on payment success or failure
},
userClosed: function() {
// executed when the consumer clicks on the X on the top right
}
})
document.getElementById('pay-with-satispay').addEventListener('click', function(e) {
e.preventDefault()
satispay.open()
})
</script>
<script src="https://staging.online.satispay.com/web-button.js"></script>
<img src="https://staging.online.satispay.com/images/en-pay-red.svg" alt="Pay with Satispay" id="pay-with-satispay" style="height: 50px; cursor: pointer;" />
<script>
var satispay = SatispayWebButton.configure({
paymentId: '8f27fbbc-ff4b-45eb-98d0-1cadb3a0afaa',
completed: function() {
// executed on payment success or failure
},
userClosed: function() {
// executed when the consumer clicks on the X on the top right
}
})
document.getElementById('pay-with-satispay').addEventListener('click', function(e) {
e.preventDefault()
satispay.open()
})
</script>
SatispayWebButton.configure()
can be used to create an instance of web button. Once done then call open()
or close()
functions in response to any event. The paymentId
parameter must be passed to configure()
function.
The script must be loaded directly from https://online.satispay.com/web-button.js. Using a local copy is unsupported, and may result in errors.
Try the UX
Updated about 22 hours ago