Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

PaymentSystem getExistingPurchases failure

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?

Please use plain text.
BlackBerry Development Advisor
twindsor
Posts: 288
Registered: 07-15-2008
My Carrier: Bell

Re: PaymentSystem getExistingPurchases failure

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?

Tim Windsor
Application Development Consultant
Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: PaymentSystem getExistingPurchases failure

I did not set true or false, using the default value of false. I will try it later today with it set to true and let you know.

Yes, the device is connected to internet and yes App World is there.

2.0 beta for the OS.
Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: PaymentSystem getExistingPurchases failure

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?

Please use plain text.
BlackBerry Development Advisor
twindsor
Posts: 288
Registered: 07-15-2008
My Carrier: Bell

Re: PaymentSystem getExistingPurchases failure

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/documentation/ww_air_services/Testing_your_application_AIR_m...

Tim Windsor
Application Development Consultant
Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: PaymentSystem getExistingPurchases failure

the instructions are good, but my draft app does not show up in App World. Is it suppose to be under the category defined for the app?
Please use plain text.
BlackBerry Development Advisor
twindsor
Posts: 288
Registered: 07-15-2008
My Carrier: Bell

Re: PaymentSystem getExistingPurchases failure

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?

Tim Windsor
Application Development Consultant
Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: PaymentSystem getExistingPurchases failure

Yes, I am in the sandbox and I typed in the fill content URL in the browser. It popped over to App World, but nothing showed up. This is after typing in 'tst' in AppWorld.
Please use plain text.
Developer
jtegen
Posts: 4,247
Registered: 10-27-2010
My Carrier: Verizon

Re: PaymentSystem getExistingPurchases failure

Has anyone got the payment system to work under 2.0?

Please use plain text.
Contributor
julian_d
Posts: 33
Registered: 10-16-2011
My Carrier: none

Re: PaymentSystem getExistingPurchases failure

[ Edited ]

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(PaymentSuccessEvent.GET_EXISTING_PURCHASES_SUCCESS, getPurchasesSuccessHandler);
_paymentSystem.addEventListener(PaymentErrorEvent.GET_EXISTING_PURCHASES_ERROR, getPurchasesErrorHandler); 
_paymentSystem.getExistingPurchases(true); //MUST BE TRUE for network connection

 

----------------------------------------------------------
Tapptil creates interactive books and apps for children and families.
Recent released apps:First Words Animals, Lil Painter, Lil Painter Winter Edition
Please use plain text.