Hi guys! I'm using a webhook in order to get a JSON from a payment service's server that I'm using. My question is: What would be the best course of action in order to receive this JSON.
To be more specific, this is the process: When a client buys something from my Opencart store, he receives (and prints) a receipt that he has to pay at the bank. For the webhook to work I need to assign a URL... then when the client pays this receipt in the bank, the service I'm using sends the response to this URL I assigned. Then I need to use POST to catch this response (that is asctually a JSON) in my URL. Right now for testing purposes I just want to var_dump this JSON, what would be the best course of action to see this? I'm kid of confused with all the carpets. Should I create a Controller that receives the info? and how would I assign this controller to a Opencart URL so that I can use it as the webhook receiver?
Thank you so much for the help!
The above statement is a very theorical one. Your question would be strictly based on what the provider may demand in order for your to successfully send a request and receive a response via their API with JSON. If you wish to have a more accurate solution, the API documentation would definitely be amended as well as your Opencart version.wallythg wrote:Hi guys! I'm using a webhook in order to get a JSON from a payment service's server that I'm using. My question is: What would be the best course of action in order to receive this JSON.
To be more specific, this is the process: When a client buys something from my Opencart store, he receives (and prints) a receipt that he has to pay at the bank. For the webhook to work I need to assign a URL... then when the client pays this receipt in the bank, the service I'm using sends the response to this URL I assigned. Then I need to use POST to catch this response (that is asctually a JSON) in my URL. Right now for testing purposes I just want to var_dump this JSON, what would be the best course of action to see this? I'm kid of confused with all the carpets. Should I create a Controller that receives the info? and how would I assign this controller to a Opencart URL so that I can use it as the webhook receiver?
Thank you so much for the help!
One example you could use, in the mean time, would be to refer to the catalog/controller/payment and the catalog/model/shipping folder and see how various classes relies on the JSON method that was used towards different providers.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: Amazon [Bot] and 5 guests