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

Native Development

Reply
Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

payment service system busy

Hello,

 

I have implemented payment service for my game and test it with the local mode. All seems ok but when I test through the network I received always the error code 2. The system is busy means that a purchase is pending.

 

How to sovle this issue? My items are consumable.

Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

Re: payment service system busy

I found this topic that speak about this issue: http://supportforums.blackberry.com/t5/Payment-Service/paymentservice-functions-failing/m-p/1972083/...

 

He solve by avoiding to call payment_get_price very soon of a get extisting purchase call. But I do not call nothing else than the paymentservice_purchase_request

 

What I do is:

 

at Init time

 paymentservice_request_events(0);

 

in game loop when user want to buy an item

if (paymentservice_purchase_request(_params, _params,
                    NULL, NULL, NULL, NULL,
                    get_window_group_id(), &request_id) != BPS_SUCCESS)
        {
            STD_Printf("Error: purchase request failed.\n");
        }

 

Where _params is my item id

 

I handle the purchase event in the event test loop and do this

 

static void handlePurchaseEvent(bps_event_t *event)
{
  cPersistantDatasManager* pPDM = cPersistantDatasManager::GetInstancePtr();

  if (SUCCESS_RESPONSE == paymentservice_event_get_response_code(event))
  {
    if (PURCHASE_RESPONSE == bps_event_get_code(event))
    {
        // Handle a successful purchase here
        const char* digital_good = paymentservice_event_get_digital_good_id(event, 0);
        const char* digital_sku = paymentservice_event_get_digital_good_sku(event, 0);
                // ...
        pPDM->GetUserDatasManager()->Purchase(digital_sku);

        unsigned request_id = 0;
        if (paymentservice_get_existing_purchases_request(false, get_window_group_id(), &request_id) != BPS_SUCCESS)
        {
            STD_Printf("Error: get existing purchases failed.\n");
        }
    }
    else
    {    // Handle a successful query for past purchases here

         onGetExistingPurchasesSuccess(event);

    }
  }
  else
  {

      failureCommon(event);

  }

}

 

 

The paymentservice_event_get_response_code(event) return error code.

 

Error code is 2  : Payment System error. Request ID: 2  Error ID: 2  Text: Payment system is busy, please complete your other transaction and try again.

 

I try to call first the get existing purchase but I have the same response code.

 

What to do?

 

I added a release to my vendor portal, I try side-loaded with the IDE, I try loading from the sandbox. Nothing solve my issue.

Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

Re: payment service system busy

I have found I think. paymentservice_get_existing_purchase set to true to allow refresh from server side. I will upload a new release to test live from app world
Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

Re: payment service system busy

NOOOOOO. Does not work. I am lost, my in-app does not work.

Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

Re: payment service system busy

Yes, I found. You must avoid 2 very soon call of purchase. Then I will add a flag to avoid it.