0

I am trying to implement a payment on my website and I have done so successfully using the http://doc.slydepay.com/ But I need to implement a callback url and expect JSON upon successful transaction. My callback url is supposed to look like this: http://localhost:port/awesomeapp/callback?status=0&transac_id=someguid&cust_ref=youruniqueorderid&pay_token=PayTokenGUID&special_delivery=true&gift_packaging=true

But my challenge is I do not understand what should go into a callback url. What am I supposed to put in there and is there a sample code I can get to give me the big picture? I have been trying to figure this out for the past three days and I can't seem to wrap my head around it since I have never worked with rest APIs before. In the default page for my callback url, what kind of code should go in there?

 "payToken\":
\"slydepay-payment-guid-token\", \"confirmTransaction\": true }"
Cold Pen
  • 21
  • 4

1 Answers1

0

The callback url is returned from your Gateway host (Slydepay) with information on status, transaction id, etc..., it will not be in JSON.

You can then do something like;

$status= $_GET['status'];
$transac_id= $_GET['transac_id'];
$cust_ref= $_GET['cust_ref'];
$pay_token= $_GET['pay_token'];
$special_delivery= $_GET['special_delivery'];
$gift_packaging= $_GET['gift_packaging'];

You'll still need to call a confirmTransaction or cancelTransaction after this based on what happens at your end of things, both of which will now return JSON

masoftheund
  • 57
  • 10