Reputation: 416
i am using Bluesnap hosted payments page inside an iframe.
I want to update my backend DB after the successful transaction from that checkout page. I don't see any callback like onSuccess or similar that i can use in js and i know that i can use IPNS (webhooks), but the problem is that i want to pass some custom data to be available inside my IPN. how do i do that?
This is the url that creates the checkout hosted payments page in which i can pass custom url values.
const url = `${sandboxURL}/buynow/checkout?enc=xxx&merchantid=xxx&custom1=xxx&custom2=xxx
Can i somehow get my custom url parameters be available inside IPN? Or if i can use the reporting api to get these custom parameters somehow, i can't figure a way to get them.
Is there really no good way to do custom logic after the transaction succeeds with hosted payments page? I would like to use it compared to coding the form from scratch. Thanks in
Upvotes: 0
Views: 157
Reputation: 258
I just faced the same problem and here's how you can pass in custom parameters that are returned by the IPN.
For each product you have, you will have to set up a hidden custom parameter, following the instructions in this doc - https://support.bluesnap.com/docs/custom-fields.
The Title
that you give the parameter will be the name that is returned in the IPN call, and the Reference Name
that BlueSnap sets for the parameter will be what you pass in.
For instance, if you create a custom param with Reference Name
set to userId
and BlueSnap gives this param a Title
of custom1
, you will pass in the user id to your checkout url like so - https://www.dummycheckout.com?custom1=1234
. In the IPN response, there will be a field called userId=1234
.
Upvotes: 0