Supported and Custom Payment Gateways in Crystallize
Crystallize support a number of major payment providers including Stripe and PayPal. You can also add a custom payment method easily.
Create your Order mutation body
The payment field includes information about the payment provider which could be Stripe, PayPal, Klarna or even a custom one. The information it contains depends on the payment provider. For example, for Stripe it would contain details such as - payment method, payment method ID, customer ID, order ID, etc.
The example below is for when the payment provider is Stripe.
The following code snippet displays the payment field when the provider is set to PayPal.
This is how the payment field would look like if the provider is Klarna.
If you give your customer the option to pay via cash, simply set the provider to cash and add in the amount.
In case, you would like to add a custom payment provider, set provider to custom and add the necessary information as key-value pairs.
Querying Payment Field
The above example queries are for when you use the payment field while creating an order via mutations. What about fetching payment details? The query below is fetching the payment details for a particular order where the payment provider is Stripe.
Keep in mind that every payment provider has its own type that contains fields specific to that particular provider.