Hi @Jax.Yang, this is a Dynamic working sample with jquery/ajax and php
Here is how it works.
When a User Click on the Purchase button, An Ajax Call is used to Post the Purchased items to dynamically generate a Payment Checkout Page Id on the fly by passing the data to Process_checkout.php. If the Checkout Page is successfully created, Then Rapyd Payment System is loaded for user to complete Payments.
Upon Visa or Master Card Payments, An Ajax Call is automatically made to Rapyd Checkout Retrieval API to update and get Payments ID, Payment Status etc.
If Other Payments method other than Card is used, Upon Payments, The User will be redirected to Rapyd Payments Completion Page to complete his Payments and payments status and other details are automatically fetched…
Here is the steps for testing:
1.)Edit settings.php to configure your Rapyd Payments API details, Languages, Payment methods etc. where appropriates.
2.) Edit Rapyd_access_keys.php to configure your Sandbox Rapyd Access Keys and Secret.
To use it in production, You can also change the API URL to point to productions API Endpoint and also remember to enter access credentials for Productions.
3.) Whatever Payment method that you configure in setting.php must correspond dynamically with the one coded in the process_checkout.php. please see this line of code
"payment_method_types_include" => [
$payment_method_types_include_grabpay,
"$payment_method_types_include_visacard",
"$payment_method_types_include_mastercard",
]
];
You can call up browser and test your code at
http://localhost/rapyd_ajax/index.php
You can download sample from my google drive Drive Sample
If have any further problem, let me know. Thanks