Hi,
I’ve watched the video but just not sure how to implement it. I’m more of a video person than a coding person. I’ve had some great people help me along the way in this journey.
I always get confused on knowing where in the code to place things. The video seems to be aimed at people that already know coding and not an instructional, but maybe it’s just me that doesn’t get it.
I’ve read over the documentation and I see sections of coding:
function DoRecovery()
request = {}
request.command = "DoRecovery"
m.store = CreateObject("roSGNode", "ChannelStore")
m.store.observeField("requestStatus", "onRequestStatus")
m.store.request = request
end function
function onRequestStatus()
print "onRequestStatus"
requestStatus = m.store.requestStatus
if requestStatus = Invalid
print "Invalid requestStatus"
print "DoRecovery failed"
else if requestStatus.status <> 1
print "DoRecovery failed: status:", requestStatus.status
else
print "command", requestStatus.command
print "requestStatus.statusMessage", requestStatus.statusMessage
print "requestStatus.result.recoveryStatus", requestStatus.result.recoveryStatus
for each product in requestStatus.result.recoveryProducts
print "productInRecovery:", product
end for
end if
end function
{
"customerId": "9aa37bd6f970578294cea4783af08560",
"transactionType": "GraceInitiated",
"transactionId": "024d4e1f-c7b6-11ee-afbe-0a58a9feaca8",
"channelId": "3605562",
"productCode": "0fCsu09EGS5C6OHlEUnz_MonthlySub",
"productName": "0fCsu09EGS5C6OHlEUnz_MonthlySub",
"originalTransactionId": "024d4e1f-c7b6-11ee-afbe-0a58a9feaca8",
"originalPurchaseDate": "2024-01-12T01:45:36Z",
"eventDate": "2024-02-10T01:45:39Z",
"expirationDate": "2024-02-10T01:45:36Z",
"comments": "Subscription is in dunning state",
"responseKey": "163792dbc7b611eeafbe0a58a9feaca8",
"isFreeTrial": false
}
{
"customerId": "9d425957549250dcba71e03dacf426b5",
"transactionType": "GraceRecovered",
"transactionId": "f0864331-c7b6-11ee-a3c4-0a58a9fead9c",
"channelId": "3193830",
"productCode": "PPfCfuZMf3TOXBBl3Ttu_MonthlySub",
"productName": "PPfCfuZMf3TOXBBl3Ttu_MonthlySub",
"originalTransactionId": "d4c4da85-c7b6-11ee-a3c4-0a58a9fead9c",
"originalPurchaseDate": "2024-01-12T01:51:39Z",
"eventDate": "2024-02-10T01:51:46Z",
"expirationDate": "2024-03-10T01:51:39Z",
"comments": "Subscription recovered from dunning state.",
"responseKey": "d915ab762a3752e7bf112e7903958f52",
"isFreeTrial": false
}
{
"customerId": "8446ceff30e952349bcd9d3b78bc94a0",
"transactionType": "OnHoldInitiated",
"transactionId": "ed0ca6b7348411ed84a30a58a9feaec5",
"channelId": "1688604",
"productCode": "VR8IqPLBJ7VeWD7bvIHH_MonthlySub",
"productName": "VR8IqPLBJ7VeWD7bvIHH_MonthlySub",
"originalTransactionId": "df10f029-3484-11ed-b4bf-0a58a9feacbc",
"originalPurchaseDate": "2022-08-14T23:28:23Z",
"eventDate": "2022-09-14T23:28:24Z",
"expirationDate": "2022-09-13T23:28:23Z",
"comments": "Subscription is in Passive OnHold state",
"responseKey": "ed0ca6b7348411ed84a30a58a9feaec5",
"isFreeTrial": false
}
{
"customerId": "8446ceff30e952349bcd9d3b78bc94a0",
"transactionType": "OnHoldRecovered",
"transactionId": "b466213697aa59a4ac53804daa1272bc",
"channelId": "1688604",
"productCode": "VR8IqPLBJ7VeWD7bvIHH_MonthlySub",
"productName": "VR8IqPLBJ7VeWD7bvIHH_MonthlySub",
"originalTransactionId": "df10f029-3484-11ed-b4bf-0a58a9feacbc",
"originalPurchaseDate": "2022-08-14T23:28:23Z",
"eventDate": "2022-09-14T23:28:29Z",
"expirationDate": "2022-10-14T23:28:09Z",
"comments": "Subscription recovered from Passive OnHold state.",
"responseKey": "b466213697aa59a4ac53804daa1272bc",
"isFreeTrial": false
}
But knowing where these get added to is one of my problems in comprehending how-to get it done. Would these go into a single brs file and the function go in the main.brs? Forgive my lack of knowing as I navigate this.
Thanks in advance for any and all input.