The Standard or Automatic Checkout method provides a default Pay with Razorpay button that invokes the checkout form. The checkout form options are passed as data attributes inside a <script>
tag. You can add any additional, hidden or visible, fields to the form. These fields will be submitted along with the form.
Follow the below steps to integrate the automatic checkout:
- Create a checkout form using Razorpay Standard Checkout Integration.
- Accept
razorpay_payment_id
parameter in the form submission.
- Run the capture code to capture the payment.
Note:
If you want to re-use this as your final code, follow the below steps:
- Edit the
key_id
inside automatic-checkout/index.html. Use the live keys when using the application to accept live payments.
- Edit the [KEY_ID] and [KEY_SECRET] in automatic-checkout/charge.php.
In the Custom or the Manual Checkout method, the Checkout form is invoked by the custom button
on your site and the form options are passed as variables in a key-value pair format within a <script>
tag. Once the payment is successfully authorized, a handler
function is called automatically. This function returns a response object containing razorpay_payment_id
. This handler
function must be called back to your server-side to capture the payment.
Follow the below steps to integrate the manual checkout:
- Create an order using Razorpay Orders API.
- Accept
razorpay_payment_id
parameter and razorpay_signature
in the form submission.
- Store the razorpay_order_id as a sessions variable.
- Verify the signature emitted from Razorpay server based on the algorithm given here.
Notes:
If you want to re-use this as your final code, follow the below steps:
- Edit the [KEY_ID] and [KEY_SECRET] inside orders-api/order.php.
- Edit the
[KEY_SECRET]
in orders-api/verify-signature.php.