Originally posted by betdynamics
View Post
Vendor Services - subscription activation, best practice
Collapse
X
-
Yes that's the way I'm going to go I think. It's a pity there isn't a function like isSubscribedToApplication which would be much neater. But calling a function and checking for an error is effectively the same thing I guess. Thanks for your reply.
-
What I do is allow the user to log in. Then I attempt to load some markets. If that fails (I can't remember the error code off-hand) then I prompt them to enter an activation code.
The activation code is generated at the time they subscribe to the app and is sent to them via email, so they should already have it to hand when the app prompts them for the code.
Leave a comment:
-
Hi NeilOriginally posted by Betfair Developers Program View PostHi Kevin,
Thanks for your feedback.
We have now made some changes to the Vendor Services API documentation via https://api.developer.betfair.com/se...ices+in+API-NG
Please can you review this and let me know if anything is still unclear?
Thanks
Neil
Thanks for replying so soon.
Hmmmmmmmmmm so it's actually even more complicated than I first thought!
So the Customer starts the Vendor's app, logs into Betfair and a session token is returned.
At this point the Vendor's app needs to determine whether or not the Customer should be prompted to enter his Subscription Token for activation (i.e. it does not know if the Customer has already activated a subscription or not).
To do that the app must go through a process to obtain the Customer's Application Subscription History via the Vendor's App Server. Yuk! I don't think my Vendor is going to be particularly overjoyed at having to set up an app server! Even if he does so, then what if his app server is down for some reason? This situation shouldn't prevent the Customer from using the app, so presumably the only way forward in this case is for the app to try calling an API function (getAccountFunds for example) and see if it returns an error indicating that the Customer is not subscribed to that app? That's messy but is probably the easiest way to deal with the application start-up process and avoids requiring a Vendor app server.
Some parts of API-NG I absolutely love and have made life so much easier. But the vendor subscription process is another matter!
Regards
Kevin
Leave a comment:
-
Hi Kevin,
Thanks for your feedback.
We have now made some changes to the Vendor Services API documentation via https://api.developer.betfair.com/se...ices+in+API-NG
Please can you review this and let me know if anything is still unclear?
Thanks
Neil
Leave a comment:
-
Vendor Services - subscription activation, best practice
Hi,
I am a developer who is currently in the process of updating an application for a vendor from API6 to API-NG.
One area I need to cover is that of subscription activation. I am a little confused as to what is the best practice for implementing this process in the app.
The description of the process is outlined on the Betfair developer site here:
https://api.developer.betfair.com/se...ices+in+API-NG
This states that "The activateApplicationSubscription service should be used in conjunction with the interactive login method. See sample code here"
The sample code does not include any reference or call to activateApplicationSubscription so I don't see how it is demonstrating the process at all!
That aside, let's say my app starts up and the user logs in to Betfair via the webpage and the app obtains the session token. That's fine. Now how does the app know that the user is not subscribed to the app's APPKEY and therefore should be prompted to enter his subscription token? Should it make a call to a function like getAccountFunds and check for error DSC-0037? Thats's messy. Or should it call listAccountSubscriptionTokens and check that the user has one for the associated applicationName that is ACTIVATED? Or am I missing something else?
Any advice on best practice would be much appreciated.
Thanks
KevinTags: None


Leave a comment: