Start Payment Flow
Now that you have both order details and transaction notification endpoints, you are ready to start showing the payment flow on your checkout page.
Prerequisites
- Order details API is setup and working.
- Notification API is setup and working.
- Your merchant ID.
- Order ID.
Showing the popup
On your checkout page/payment screen, when a user chooses to pay with Credify just inject the following script to the page:
<script>
window.EfIntegration = {
checkout: {
order_id: number // the order id
}
// the url to redirect to on success
successUrl: string
// the url to redirect to in case of the user cancels the payment
cancelUrl: string
}
</script>
<script
id="crd-chkt-scrpt"
src="https://splitpay.credify.live/_app/immutable/chunks/shopify-script.js"
data-store-id=${store_id}
data-platform="custom"
></script>
by providing a unique orderId and your merchantId to this URL, a payment flow will be initiated and if order details API is working user should be able to see a screen with the order info before proceeding to payment.
Troubleshooting
- 404 page when opening a payment flow: ensure that order details API is working, if it is working, please get in touch with Credify support to invistigate the error.
- User made a payment but it doesn't mark the order as Paid: ensure that notification API is working and reciving requests, if problem still presists contact Credify.