02-08-2012 06:36 PM
Finally trying to integrate in-app purchase, but I get an error when getExistingPurchases() is called.
this.payment_system = new PaymentSystem(); this.payment_system.addEventListener( PaymentSuccessEvent.PURCHASE_SUCCESS, PurchaseSuccess ); this.payment_system.addEventListener( PaymentErrorEvent.PURCHASE_ERROR, PurchaseError); this.payment_system.addEventListener( PaymentSuccessEvent.GET_EXISTING_PURCHASES_SUCCESS, ExistingPurchaseSuccess ); this.payment_system.addEventListener( PaymentErrorEvent.GET_EXISTING_PURCHASES_ERROR, ExistingPurchaseError );
then
this.payment_system.getExistingPurchases();
On:
///////////////////////////////////////////////////////////////////////// private function ExistingPurchaseError( event : PaymentErrorEvent ) : void { }
I get
"Unable to access Payment Service on this device."
with errorID = 2
Is there anything that needs to be done to get the current purchases?
02-14-2012 03:09 PM
That method expects a parameter: True or False. Have you run it once with the True value?
Is the device connected to the network and does it have App World installed?
What OS are you running?
02-14-2012 03:16 PM
02-14-2012 04:59 PM
Setting getExistingPurchases to true gets a different error:
The application must be installed using AppWorld in order to access the payment system.
I side loaded it for development purposes. It currently has a different app-id then what is registered in the vendor portal. Any thoughts on why this error is being returned?
02-15-2012 11:21 AM
That's exactly the problem. You need to install the app through App World, in order for the payment system to work. We have some documentation on how you can test applications using payment here: https://bdsc.webapps.blackberry.com/air/documentat
02-16-2012 06:17 PM
02-17-2012 03:34 PM
You will need to use the direct link with the ID of the content. You added your BlackBerry ID email as a SandBox user, right?
02-17-2012 05:01 PM
02-20-2012 06:16 PM
Has anyone got the payment system to work under 2.0?
02-20-2012 06:36 PM - last edited on 02-20-2012 06:37 PM
I've successfully implemented in-app purchase in one of my apps, few weeks ago. It's working under 2.0, I can see from the reports that some users are on the OS 2.0. I've made only local tests, testing in sandbox wasn't working for me neither...
Here is my code:
_paymentSystem = new PaymentSystem(); _paymentSystem.setConnectionMode(PaymentSystem.CONNECTION_MODE_NETWORK); //MUST BE NETWORK _paymentSystem.addEventListener(PaymentSuccessEven t.GET_EXISTING_PURCHASES_SUCCESS, getPurchasesSuccessHandler); _paymentSystem.addEventListener(PaymentErrorEvent. GET_EXISTING_PURCHASES_ERROR, getPurchasesErrorHandler); _paymentSystem.getExistingPurchases(true); //MUST BE TRUE for network connection