A payment gateway facilitates a payment transaction by the transfer of information between a payment portal (such as a website, mobile phone, or interactive voice response service) and the frontend processor or acquiring bank.
Crystallize is agnostic when it comes to payments and you can work with any payment gateways you’d like.
The way it works is that you can save payment information on the order or on a subscription contract.
Common Flow
Payment flow is most likely the same with any gateway, please refer to the documentation to each of them, but it goes like this:
And an invisible, asynchronous, server-to-server, crucial step: the payment gateway will call your service layer to notify the payment status.
To make it even more secure, most payment gateways will sign their server-to-server requests.
Flow with Crystallize
Crystallize integrates smoothly at any point within this process, because you just need to mutate the payment information.
The mutation type includes specific payment gateways for semantic purposes, and we’ll be adding more of these over time. If your payment gateway does not have yet its corresponding type, you can use the Custom payment type, which is a key-value store.
When to Save the Order
This is a different topic, as it may require storage for the cart, but you have two main options:
Payment is the end of the checkout process and the beginning of the post-paid order lifecycle. Crystallize has a powerful fulfilment mechanism that you need to check out (or watch our livestream).
What happens is totally up to how you run your business. We advise you to set up proper fulfilment pipelines to orchestrate the orders, which you can use to manage order fulfilment in a structured and automated way.
While you are developing on your local machine, payment gateways won’t be able to reach your computer. Using ngrok is usually the simplest and most efficient trick.