Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)


jcentricity wrote:

Confirmation issue will be fixed but our code works in Google Play without the confirmation.

 

My team is stating the payment service is returning a response indicating no purchases have been

 

made even thought a Purchase has been made I even removed my sandbox id and my credit card was charged

 

Please investigate why payment service is returning a response with purchase that were made.

 

See video again with responses. I think the team that support Payment Service needs to be involved in

 

the discussion

 

http://www.forecastica.com/inAppVideo.mpg


When testing in Sandbox mode no transactions are logged so when you request a list of previous purchases from BlackBerry World there are none to provide. After you make a purchase and receive confirmation of that purchase you should not need to immediately request past purchases from the server.

 

In Production your app should be able to retrieve past purchases that were made with real transactions. If you would like to test this, remove your BBID from the sandbox and make a purchase within your app. This will cost real money but will also log a transaction to the database so you can retrieve the past purchases.

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

But in Production we got response that there were no purchases

 

This is the issue we are trying to fix.

 


Same code works in Google Play

Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

We have items in our app marked as Paid or Buy if user installs app on new tablet or phone we need to remark

 

items as Paid.  Restore button goes out to Store to finds past purchase and marks them

 

as Paid

Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

In Production I removed by sandbox account

 

Bought item

 

My credit card was charged

 

BlackBerry Payment response return no purchases

 

Again same code works in GooglePlay

Please use plain text.
BlackBerry Development Advisor (Retired)
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

Could you provide the snippet of code being used to check for past purchases as well as the snippet used to read the response?

Garett
@garettBeuk
--
Goodbye everybody!
Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

Look at RESTORE_TRANSACTIONS operation

 

http://developer.android.com/google/play/billing/v2/api.html#billing-request

 

Here is our code

 

/**
     *
     * Can be used for when a user has reinstalled the app to give back prior
     * purchases. if an item for sale's purchase type is
     * "managed per user account" this means google will have a record ofthis
     * transaction
     *
     * A RESTORE_TRANSACTIONS request also triggers two asynchronous responses
     * (broadcast intents). First, the Android Market application sends a
     * RESPONSE_CODE broadcast intent, which provides status and error
     * information about the request. Next, if the request was successful, the
     * Android Market application sends a PURCHASE_STATE_CHANGED broadcast
     * intent. This message contains the detailed transaction information. The
     * transaction information is contained in a signed JSON string
     * (unencrypted). The message includes the signature so you can verify the
     * integrity of the signed string
     *
     * @param nonce
     */
    protected static void restoreTransactionInformation(Long nonce)
    {
        if (amIDead())
        {
            return;
        }
        Log.i(TAG, "confirmTransaction()");
        Bundle request = makeRequestBundle("RESTORE_TRANSACTIONS");
        // The REQUEST_NONCE key contains a cryptographically secure nonce
        // (number used once) that you must generate
        request.putLong("NONCE", nonce);
        try
        {
            Bundle response = mService.sendBillingRequest(request);

            // The REQUEST_ID key provides you with a unique request identifier
            // for the request
            Long requestIndentifier = (Long) response.get("REQUEST_ID");
            Log.i(TAG, "current request is:" + requestIndentifier);

            // The RESPONSE_CODE key provides you with the status of the request
            Integer responseCodeIndex = (Integer) response.get("RESPONSE_CODE");
            C.ResponseCode responseCode = C.ResponseCode.valueOf(responseCodeIndex);
            Log.i(TAG, "RESTORE_TRANSACTIONS Sync Response code: " + responseCode.toString());
        }
        catch (RemoteException e)
        {
            Log.e(TAG, "Failed, internet error maybe", e);
            Log.e(TAG, "Billing supported: " + isBillingSupported());
        }
    }

Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

See MakeRequestBundle method

 

private static Bundle makeRequestBundle(String method)
    {
        Bundle request = new Bundle();
        request.putString("BILLING_REQUEST", method);
        request.putInt("API_VERSION", 1);
        request.putString("PACKAGE_NAME", mContext.getPackageName());
        return request;
    }

Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

the blackberry payments sdk has a java sdk can i use it

and android app since google inapp api is not working?
Please use plain text.
Regular Contributor
jcentricity
Posts: 62
Registered: ‎09-28-2012
My Device: BlackBerry Bold
My Carrier: Verizon

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

Can I use the BlackBerry Payment SDK for Java in the Android App at https://developer.blackberry.com/java/documentation/overview_1935031_11.html? Please confirm
Please use plain text.
New Developer
ncioara
Posts: 19
Registered: ‎02-14-2013
My Device: -
My Carrier: -

Re: Debugging Playbook Beta 2.1 In App Purchase (IAP)

Please use plain text.