Reputation: 876
When creating a subscription, I log the orderID
that gets created in the database intending to reference it later to handle a cancellation postback
. My cancellation postback
never seems to work however.
My postback
stores the original order when it's created and then it tries to reference it on cancellation and update the database but the orderID
is slightly different and cannot update properly.
This is the orderID
that got stored directly from the decoded JWT in the database:
GWDG_S.886160e8-49b6-4f92-b485-9787c4cb4c06.0..0
This is the orderID
that gets sent according to firebug in the console during the subscription cancellation:
GWDG_S.886160e8-49b6-4f92-b485-9787c4cb4c06.0.
This is the orderID
that gets sent in the email to the user cancelling the subscription:
GWDG_S.886160e8-49b6-4f92-b485-9787c4cb4c06
I'm not sure what's going on here. How do I go about accounting for these changes?
Any input is welcome! Thanks!
Upvotes: 0
Views: 147
Reputation: 12341
Can't seem to reproduce...in my sandbox :
At test web page:
Buyer's sandbox wallet:
This is the debug email I send to myself showing purchase and subsequent cancellation postbacks
Buyers do get receipts with what I believe is the "incrementing" transaction number you are seeing (unless I'm corrected by a Googler) each time their subscription is renewed -
e.g. on 5th renewal [...]6a6c4.0..5
Upvotes: 1
Reputation: 12772
Looks you need to normalize the orderID to the last format. For this particular one, the following regex will do.
preg_match('([^\.]+\.[^\.])\.', $orderID, $matches);
$orderID = $matches[1];
Upvotes: 0