Languages

Menu
Sites
Language
In App Payment Failed

I am implementing in app purchases in my tizen project. Items are created on tizen seller dashboard and appmanager.launch permission is added in manifest.

The problem is that I am getting  Payment Failed error popup with message "Your payment request has been declined by the payment gateway." after adding my credentials in Tizen account popup. I am attaching my code snippet and debug logs here for reference.

app_control_h app_control;
    int ret = -1;
    ret = app_control_create(&app_control);
    if (ret == APP_CONTROL_ERROR_NONE){
        
        transactionId++;
        __String * transactionIdStr = __String::createWithFormat("%d",transactionId);
        ret = app_control_set_app_id(app_control, "org.tizen.inapppurchase.iapclient");
        ret = app_control_set_operation(app_control, "http://tizen.org/appcontrol/operation/iapv2/purchase";
        ret = app_control_add_extra_data(app_control, "_mode", "1");
        ret = app_control_add_extra_data(app_control, "_transactionId", transactionIdStr->getCString());
        ret = app_control_add_extra_data(app_control, "_itemId", itemKey);
        ret = app_control_add_extra_data(app_control, "_itemGroupId", "12345678999"); // not my real group id
        ret = app_control_send_launch_request(app_control, get_purchase_cb, NULL);
        if(ret != APP_CONTROL_ERROR_NONE) // error occured in launching the store/acount app
        {
            MessageBox("Error occurred while trying to launch tizen store.", "Error");
        }
        
    }

Logs:

11-03 13:57:19.268 : ERROR / IAP_Client ( 5700 : 5700 ) :  >>> iapApi.c: iap_apiClose(149)  :: ############# IAP Service Error Info #########################

11-03 13:57:19.268 : ERROR / IAP_Client ( 5700 : 5700 ) :  >>> iapApi.c: iap_apiClose(150)  :: Result Code :: 1000

11-03 13:57:19.268 : ERROR / IAP_Client ( 5700 : 5700 ) :  >>> iapApi.c: iap_apiClose(151)  :: Error Code :: 2000

11-03 13:57:19.268 : ERROR / IAP_Client ( 5700 : 5700 ) :  >>> iapApi.c: iap_apiClose(152)  :: Error Message ::  :: Api Server Error ::   error_code="2000"

11-03 13:57:19.268 : ERROR / IAP_Client ( 5700 : 5700 ) :  >>> iapApi.c: iap_apiClose(153)  :: ########################################################

Edited by: Sher Ali on 03 Nov, 2015

Responses

8 Replies
daniel kim

Hi,

According to below description, mode value need to be 1 for developing your application.

    Mode type. This information is optional. The default value is 0. 0 is normal (commercial) mode. This mode need to be used in application submitted to Tizen Store. 1 is developer mode (always success). This mode can be used while development of the application for testing purpose. Payment will always succeed

Regards

 

Sher Ali

Hi Daniel,

Thanks for the quick response. Sorry for creating confusion But I've tried with both mode values ( 0 and 1 ). I was trying with mode value 1  (as mentioned in inApp programming guide) but the same problem occurrs. I'll edit my question here to show mode value 1.

daniel kim

Hi,

I would suggest you to refer to sample of below as I could see process error in case of value 0 only.

    https://developer.tizen.org/downloads/add-on-sdks

Regards

Sher Ali

Hi,

Thats the guide I followed. Can you suggest something about the reason of error. I am getting 1000 as result string in purchase callback which is a Process Error but I am unable to translate the result description string 6107|10904|2000 .

 

Sher Ali

@Daniel 

It looks like the /get_item_list is working fine with same implementationI am guessing that this problem can be related to tizen store client app. As /get_item_list and /get_country_list etc are called on org.tizen.inapppurchase.iapservice in /purchase operation is called on org.tizen.inapppurchase.iapclient

daniel kim

Hi,

I would suggest you to refer to native sample code inside of below link as I could observe Password Confirmation pop-up when I tried to purchase an item in developer mode. 

    https://developer.tizen.org/downloads/add-on-sdks

Regards

Jean Yang

Hi,

    Have u check if the items with itemKey you want to purchase by your codes has been created successfully and if the itemKey is just the item ID you already created?

    You can print out these information in your codes and compare it to the item in the Tizen store sales.

Regards

Sher Ali

Hi guys thanks for the input. Problem is solved now. The problem is that _mcc is not optional when working in developer mode and the dcoumentation/guide was a bit confusing. Moreover, The link https://developer.tizen.org/downloads/add-on-sdks contained a library code at first as sample native code with no code. Now this link has the working(partialluy) sample native code.