cancel
Showing results for 
Search instead for 
Did you mean: 

What should be the success callback url in magento 2.x

What should be the success callback url in magento 2.x

I need to send the input parameters in the POST method to the payment gateway along with the callback URL. But not understanding what should be the callback URL here.

 

<form method="POST" action="https://api.razorpay.com/v1/checkout/embedded">
  <input type="hidden" name="key_id" value="YOUR_KEY_ID">
  <input type="hidden" name="order_id" value="razorpay_order_id">
  <input type="hidden" name="name" value="Acme Corp">
  <input type="hidden" name="description" value="A Wild Sheep Chase">
  <input type="hidden" name="image" value="https://cdn.razorpay.com/logos/BUVwvgaqVByGp2_large.png">
  <input type="hidden" name="prefill[name]" value="Gaurav Kumar">
  <input type="hidden" name="prefill[contact]" value="9123456780">
  <input type="hidden" name="prefill[email]" value="gaurav.kumar@example.com">
  <input type="hidden" name="notes[shipping address]" value="L-16, The Business Centre, 61 Wellfield Road, New Delhi - 110001">
  <input type="hidden" name="callback_url" value="https://example.com/payment-callback">
<input type="hidden" name="cancel_url" value="https://example.com/payment-cancel">
  <button>Submit</button>
</form>
3 REPLIES 3

Re: What should be the success callback url in magento 2.x

Hi @chetangtec0196 

 

As far as i know call back url is the one once your transaction is completed so to redirect from 3rd party to come back your website with some additional parameter is call back url. So i think it should be your website base url.

 

Hope this helps.

 

Problem Solved? Give Kudos & Accept as Solution.

Re: What should be the success callback url in magento 2.x

Thanks for your help here @shubham_khandelwal1. Yes, you are right, but once the payment is done, the payment gateway will return the response like payment id, signature, order id, etc. Based on this I need to validate the response at our end and redirect to respective pages like success in case of payment success and cart page in case of any error. I had written the code in the Model directory to validate the signature. So my question is how to handle it? how to redirect to success page once the payment is done.

Re: What should be the success callback url in magento 2.x

Hi @chetangtec0196 

 

Glad it's work Smiley Happy 

 

Problem Solved? Give Kudos & Accept as Solution.