coupon or gift card it is a dictionary in json format, so you have to parse it to use for more information, please refer to "promotionalcodedetail" at the below 1 21 promotionalcodedetail this defines data set of promotionalcodedetail parameter that contains showregisterpromotionalcodedata dictionary dictionary promotionalcodedetail { domstring appliedcouponcount; domstring[] appliedcouponlist; domstring registedbenefitcount; domstring[] registedbenefitlist; }; the following values are supported appliedcouponcount it returns the number of applied coupon count appliedcouponlist it returns the list of applied coupon registedbenefitcount it returns the number of benefit registedbenefitlist it returns the list of benefit code 1 22 showregistercreditcarddata this defines data set that is coming from showregistercreditcard api dictionary showregistercreditcarddata { domstring opendeeplinkresult; domstring? opendeeplinkdetail; }; the following values are supported opendeeplinkresult it returns "success" in success, "fail" in failure opendeeplinkdetail [optional] it is optional and not used now 1 23 showpurchasehistorydata this defines data set that is coming from showpurchaseshistory api dictionary showpurchasehistorydata { domstring opendeeplinkresult; domstring opendeeplinkdetail; }; the following values are supported opendeeplinkresult it returns "success" in success, "fail" in failure opendeeplinkdetail it returns the detail information of refund or cancel it is a dictionary in json format, so you have to parse it to use for more information, please refer to "purchasehistorydetail" at the below 1 24 purchasehistorydetail this defines data set of purchasehistorydetail parameter that contains showpurchasehistorydata dictionary dictionary purchasehistorydetail { domstring invoicerefundcount; domstring[] invoicerefundlist; domstring subscriptioncancelcount; domstring[] subscriptioncancellist; }; the following values are supported invoicerefundcount it returns the number of product that user make refunded invoicerefundlist it returns array that contains the list of refunded invoice id subscriptioncancelcount it returns the number of subscription product that user make cancelled subscriptioncancellist it returns array that contains the list of cancelled subscription 1 25 serviceavailabledata defines a dictionary for data returned by the isserviceavailable api dictionary serviceavailabledata { domstring apiresult; }; the following values are supported apiresult isserviceavailable api result dictionary in json format this value is json string type data, so please use it by json parsing after you parse this value, you can use it in serviceavailableapiresult format at the below 1 26 serviceavailableapiresult defines a dictionary for the serviceavailabledata dictionary 'apiresult' parameter dictionary serviceavailableapiresult { domstring status; domstring result; domstring serviceyn; }; the following values are supported status returns "100000" on success and other codes on failure result returns "success" on success serviceyn returns "y" if the service is available 2 interfaces 2 1 billingmanagerobject defines a webapi object instance of the tizen samsung product api the webapis billing object enables access to billing api functionality [nointerfaceobject] interface billingmanagerobject { readonly attribute billingmanager billing; }; webapi implements billingmanagerobject; since 2 4 attributes readonly billingmanager billing billing api namespace 2 2 billingmanager provides methods for billing functionalities [nointerfaceobject] interface billingmanager { void buyitem domstring appid, tvservertype servertype, domstring paymentdetails, billingbuydatasuccesscallback onsuccess, optional errorcallback? onerror ; void getproductslist domstring appid, domstring countrycode, domstring pagesize, domstring pagenumber, domstring checkvalue, tvservertype servertype, billingproductslistcallback onsuccess, optional errorcallback? onerror ; void applyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingapplyinvoicecallback onsuccess, optional errorcallback? onerror ; void verifyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingverifyinvoicecallback onsuccess, optional errorcallback? onerror ; void getservicecountryavailability domstring appid, domstring[] countrycodes, domstring checkvalue, tvservertype servertype, billinggetservicecountryavailabilitycallback onsuccess, optional errorcallback? onerror ; void getuserpurchaselist domstring appid, domstring customid, domstring countrycode, domstring pagenumber, domstring checkvalue, tvservertype servertype, billinggetuserpurchaselistcallback onsuccess, optional errorcallback? onerror ; void cancelsubscription domstring appid, domstring invoiceid, domstring customid, domstring countrycode, tvservertype servertype, billingcancelsubscriptioncallback onsuccess, optional errorcallback? onerror ; void isserviceavailable tvservertype servertype, billingisserviceavailablecallback onsuccess, optional errorcallback? onerror ; domstring getversion ; }; methods buyitem enables implementing the samsung checkout client module within the application after authenticating the purchase information through the application, the user can proceed to purchase payment void buyitem domstring appid, tvservertype servertype, domstring paymentdetails, billingbuydatasuccesscallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id servertype billing server type paymentdetails payment parameters orderitemid[mandatory]/ordertitle[mandatory]/ordertotal[mandatory]/ordercurrencyid[mandatory]/orderid[optional]/ordercustomid[mandatory] onsuccess returns "payresult" and "paydetail" if there is no internal error occurs until client to server data communication payresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it paydetail, can have additional data when it's returned, such as invoiceid please refer to the development guide of "buyitem" for details onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if other error occur, such as internal error or "billing client already running" error exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 2 4 code example var strappid = ""; var struid = webapis sso getloginuid ; var paymentdetails = new object ; paymentdetails orderitemid="pid_2_consum_cupn"; paymentdetails ordertitle="hello consum us coupon"; paymentdetails ordertotal="2"; paymentdetails ordercurrencyid="usd"; paymentdetails ordercustomid=struid; var stringifyresult = json stringify paymentdetails ; var onsuccess = function data {}; var onerror = function error {}; webapis billing buyitem strappid, "dev", stringifyresult, onsuccess, onerror ; getproductslist retrieves the list of products registered on the billing dpi server void getproductslist domstring appid, domstring countrycode, domstring pagesize, domstring pagenumber, domstring checkvalue, tvservertype servertype, billingproductslistcallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id countrycode tv country code pagesize number of products retrieved per page maximum 100 pagenumber requested page number 1 ~ n checkvalue security check value required parameters = "appid" + "countrycode" the check value is used by the dpi service to verify api requests it is a base64 hash generated by applying the hmac sha256 algorithm on a concatenated string of parameters using the dpi security key you can see the example how to generate checkvalue from the following code example you can use any open library to generate the hmac sha256 hash the following example uses the cryptojs library servertype billing server type onsuccess returns the product list if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 4 0 code example var strsecuritykey = ""; // the dpi security key is issued at the dpi portal var strappid = ""; var strcountrycode = webapis productinfo getsystemconfig webapis productinfo productinfoconfigkey config_key_service_country ; var reqparams = strappid + strcountrycode; var hash = cryptojs hmacsha256 reqparams, strsecuritykey ; var strcheckvalue = cryptojs enc base64 stringify hash ; var onsuccess = function data {}; var onerror = function error {}; webapis billing getproductslist strappid, strcountrycode, "100", "1", strcheckvalue, "dev", onsuccess, onerror ; applyinvoice updates the apply status of purchase item to dpi server void applyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingapplyinvoicecallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id customid same value as "ordercustomid" parameter for the buyitem api samsung account uid invoiceid invoice id of purchased item that you want to update apply status countrycode tv country code servertype billing server type onsuccess returns purchase apply status if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 4 0 code example var strappid = ""; var struid = webapis sso getloginuid ; var invoiceid = ""; // issued by getproductslist var strcountrycode = webapis productinfo getsystemconfig webapis productinfo productinfoconfigkey config_key_service_country ; var onsuccess = function data {}; var onerror = function error {}; webapis billing applyinvoice strappid, struid, invoiceid, strcountrycode, "dev", onsuccess, onerror ; verifyinvoice checks whether a purchase, corresponding to a specific "invoiceid", was successful void verifyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingverifyinvoicecallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id customid same value as "ordercustomid" parameter for the buyitem api samsung account uid invoiceid invoice id that you want to verify whether a purchase was successful countrycode tv country code servertype billing server type onsuccess returns the payment status if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 4 0 code example var strappid = ""; var struid = webapis sso getloginuid ; var invoiceid = ""; // issued by getproductslist var strcountrycode = webapis productinfo getsystemconfig webapis productinfo productinfoconfigkey config_key_service_country ; var onsuccess = function data {}; var onerror = function error {}; webapis billing verifyinvoice strappid, struid, invoiceid, strcountrycode, "dev", onsuccess, onerror ; getservicecountryavailability get service country availability for samsung checkout void getservicecountryavailability domstring appid, domstring[] countrycodes, domstring checkvalue, tvservertype servertype, billinggetservicecountryavailabilitycallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id countrycodes to check multiple countrycodes available add as array, only uppercase allowed ex countrycodes=["de","us","kr"] checkvalue security check value required parameters = "appid" + "countrycodes" the check value is used by the dpi service to verify api requests it is a base64 hash generated by applying the hmac sha256 algorithm on a concatenated string of parameters using the dpi security key you can see the example how to generate checkvalue from the following code example you can use any open library to generate the hmac sha256 hash the following example uses the cryptojs library servertype billing server type onsuccess returns the service availability status of each country if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 5 5 code example var strsecuritykey = ""; // the dpi security key is issued at the dpi portal var strappid = ""; var countrycodes = ["de","us","kr"]; var reqparams = strappid + "deuskr"; var hash = cryptojs hmacsha256 reqparams, strsecuritykey ; var strcheckvalue = cryptojs enc base64 stringify hash ; var onsuccess = function data {}; var onerror = function error {}; webapis billing getservicecountryavailability strappid, countrycodes, strcheckvalue, "dev", onsuccess, onerror ; getuserpurchaselist retrieves the user's purchase list void getuserpurchaselist domstring appid, domstring customid, domstring countrycode, domstring pagenumber, domstring checkvalue, tvservertype servertype, billinggetuserpurchaselistcallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id customid same value as "ordercustomid" parameter for the buyitem api samsung account uid countrycode tv country code pagenumber requested page number 1 ~ n checkvalue security check value required parameters = "appid" + "customid" + "countrycode" + "itemtype" + "pagenumber" itemtype, must use 2 as value "all items" the check value is used by the dpi service to verify api requests it is a base64 hash generated by applying the hmac sha256 algorithm on a concatenated string of parameters using the dpi security key you can see the example how to generate checkvalue from the following code example you can use any open library to generate the hmac sha256 hash the following example uses the cryptojs library servertype billing server type onsuccess returns the purchase list if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 4 0 code example var strsecuritykey = ""; // the dpi security key is issued at the dpi portal var strappid = ""; var struid = webapis sso getloginuid ; var strcountrycode = webapis productinfo getsystemconfig webapis productinfo productinfoconfigkey config_key_service_country ; var strpagenumber = "1"; var reqparams = strappid + struid + strcountrycode + "2" + strpagenumber; var hash = cryptojs hmacsha256 reqparams, strsecuritykey ; var strcheckvalue = cryptojs enc base64 stringify hash ; var onsuccess = function data {}; var onerror = function error {}; webapis billing getuserpurchaselist strappid, struid, strcountrycode, strpagenumber, strcheckvalue, "dev", onsuccess, onerror ; cancelsubscription cancels a subscription product void cancelsubscription domstring appid, domstring invoiceid, domstring customid, domstring countrycode, tvservertype servertype, billingcancelsubscriptioncallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters appid application id invoiceid invoice id of subscription that you want to cancel customid same value as "ordercustomid" parameter for the buyitem api samsung account uid countrycode tv country code servertype billing server type onsuccess returns the subscription cancellation status if there is no internal error occurs until client to server data communication apiresult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it when cpstatus value from apiresult is "100000", it means server communication is done properly and other values are valid in returns onerror [optional][nullable] optional callback method to invoke if an error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if servertype contains an invalid value since 4 0 code example var strappid = ""; var struid = webapis sso getloginuid ; var invoiceid = ""; // issued by getproductslist var strcountrycode = webapis productinfo getsystemconfig webapis productinfo productinfoconfigkey config_key_service_country ; var onsuccess = function data {}; var onerror = function error {}; webapis billing cancelsubscription strappid, invoiceid, struid , strcountrycode , "dev", onsuccess, onerror ; isserviceavailable checks whether the billing server is available however, this api will be replaced by getservicecountryavailability after deprecation void isserviceavailable tvservertype servertype, billingisserviceavailablecallback onsuccess, optional errorcallback? onerror ; product tv privilege level public privilege http //developer samsung com/privilege/billing parameters servertype billing server onsuccess returns the server availability onerror [optional][nullable] optional callback method to invoke if an internal error occurs before the client to server data communication securityerror, if the application does not have the privilege to call this method unknownerror, if any other error occurs exceptions webapiexception with error type typemismatcherror, if any of input parameter is not compatible with its expected type with error type invalidvalueserror, if any input parameter contains an invalid value since 4 0 deprecated 5 5 code example var onsuccess = function data {}; var onerror = function error {}; webapis billing isserviceavailable "dev", onsuccess, onerror getversion retrieves the billing api version domstring getversion ; product tv privilege level public privilege http //developer samsung com/privilege/billing return value domstring billing api version exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type unknownerror, for any other error since 4 0 code example var version = webapis billing getversion ; 2 3 billingbuydatasuccesscallback defines the payment success callback [callback = functiononly, nointerfaceobject] interface billingbuydatasuccesscallback { void onsuccess billingbuydata data ; }; methods onsuccess callback method returning the payment status void onsuccess billingbuydata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data payment status code example void onsuccess data { if data payresult == 'success' { // implement success logic } else { // implement cancel or fail logic } } 2 4 billingbuydata defines the payment result and information [nointerfaceobject] interface billingbuydata { attribute domstring payresult; attribute domstring paydetail; }; attributes domstring payresult payment result domstring paydetail payment information it is same with paymentdetails param of buyitem 2 5 billingproductslistcallback defines the product list success callback [callback = functiononly, nointerfaceobject] interface billingproductslistcallback { void onsuccess productslistdata data ; }; methods onsuccess callback method returning the product list request status void onsuccess productslistdata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes getproductlist api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { var resproductslist = json parse data apiresult ; if resproductslist cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 6 billingapplyinvoicecallback defines the apply invoice success callback [callback = functiononly, nointerfaceobject] interface billingapplyinvoicecallback { void onsuccess applyinvoicedata data ; }; methods onsuccess callback method returning the apply invoice request status void onsuccess applyinvoicedata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes applyinvoice api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { resapplyproduct = json parse data apiresult ; if resapplyproduct cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 7 billingverifyinvoicecallback defines the payment verification success callback [callback = functiononly, nointerfaceobject] interface billingverifyinvoicecallback { void onsuccess verifyinvoicedata data ; }; methods onsuccess callback method returning the payment verification request status void onsuccess verifyinvoicedata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes verifyinvoice api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { resverifypurchase = json parse data apiresult ; if resverifypurchase cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 8 billinggetuserpurchaselistcallback defines the purchase history success callback [callback = functiononly, nointerfaceobject] interface billinggetuserpurchaselistcallback { void onsuccess userpurchasedata data ; }; methods onsuccess callback method returning the purchase history request status void onsuccess userpurchasedata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes getuserpurchaselist api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { respurchaseslist = json parse data apiresult ; if respurchaseslist cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 9 billinggetservicecountryavailabilitycallback defines the get service country availability callback [callback = functiononly, nointerfaceobject] interface billinggetservicecountryavailabilitycallback { void onsuccess servicecountryavailabilitydata data ; }; methods onsuccess callback method returning availability of country list status void onsuccess servicecountryavailabilitydata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes getservicecountryavailability api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { resservicecountryavailability = json parse data apiresult ; if resservicecountryavailability cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 10 billingcancelsubscriptioncallback defines the subscription cancel success callback [callback = functiononly, nointerfaceobject] interface billingcancelsubscriptioncallback { void onsuccess cancelsubscriptiondata data ; }; methods onsuccess callback method returning the subscription cancel request status void onsuccess cancelsubscriptiondata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes cancelsubscription api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { rescancelsubscription = json parse data apiresult ; if rescancelsubscription cpstatus == "100000" { // implement success logic } else { // implement cancel or fail logic } } 2 11 billingisserviceavailablecallback defines the service availability check success callback [callback = functiononly, nointerfaceobject] interface billingisserviceavailablecallback { void onsuccess serviceavailabledata data ; }; deprecated 5 5 methods onsuccess callback method returning the service availability check status void onsuccess serviceavailabledata data ; privilege level public privilege http //developer samsung com/privilege/billing parameters data it includes isserviceavailable api result but you can't use it as it is you have to parse it as json format data code example void onsuccess data { resjson = json parse data apiresult if resjson serviceyn == "y" { // implement success logic } else { // implement cancel or fail logic } } 3 full webidl module billing { enum tvservertype { "dev", "prd" }; enum historytype { "all", "subscription", "non-subscription" }; dictionary productslistdata { domstring apiresult; }; dictionary productslistapiresult { domstring cpstatus; domstring? cpresult; long totalcount; domstring checkvalue; itemdetails[]? itemdetails; }; dictionary itemdetails { long seq; domstring itemid; domstring itemtitle; long itemtype; long? period; long price; domstring currencyid; productsubscriptioninfo? subscriptioninfo; }; dictionary productsubscriptioninfo { domstring paymentcycleperiod; long paymentcyclefrq; long paymentcycle; }; dictionary applyinvoicedata { domstring apiresult; }; dictionary applyinvoiceapiresult { domstring cpstatus; domstring? cpresult; domstring appliedtime; }; dictionary verifyinvoicedata { domstring apiresult; }; dictionary verifyinvoiceapiresult { domstring cpstatus; domstring? cpresult; domstring appid; domstring invoiceid; }; dictionary userpurchasedata { domstring apiresult; }; dictionary getuserpurchaselistapiresult { domstring cpstatus; domstring? cpresult; long totalcount; domstring checkvalue; invoicedetails[]? invoicedetails; }; dictionary invoicedetails { long seq; domstring invoiceid; domstring itemid; domstring itemtitle; long itemtype; domstring ordertime; long? period; long price; domstring ordercurrencyid; boolean cancelstatus; boolean appliedstatus; domstring? appliedtime; domstring? limitendtime; domstring? remaintime; purchasesubscriptioninfo? subscriptioninfo; }; dictionary purchasesubscriptioninfo { domstring subscriptionid; domstring subsstarttime; domstring subsendtime; domstring subsstatus; }; dictionary servicecountryavailabilitydata { domstring apiresult; }; dictionary getservicecountryavailabilityapiresult { domstring cpstatus; domstring? cpresult; countries[]? countryavailability; }; dictionary countries { domstring countrycode; boolean isbillingsupported; }; dictionary cancelsubscriptiondata { domstring apiresult; }; dictionary cancelsubscriptionapiresult { domstring cpstatus; domstring? cpresult; domstring invoiceid; domstring? subscanceltime; domstring? subsstatus; }; dictionary showregisterpromotionalcodedata { domstring opendeeplinkresult; domstring opendeeplinkdetail; }; dictionary promotionalcodedetail { domstring appliedcouponcount; domstring[] appliedcouponlist; domstring registedbenefitcount; domstring[] registedbenefitlist; }; dictionary showregistercreditcarddata { domstring opendeeplinkresult; domstring? opendeeplinkdetail; }; dictionary showpurchasehistorydata { domstring opendeeplinkresult; domstring opendeeplinkdetail; }; dictionary purchasehistorydetail { domstring invoicerefundcount; domstring[] invoicerefundlist; domstring subscriptioncancelcount; domstring[] subscriptioncancellist; }; dictionary serviceavailabledata { domstring apiresult; }; dictionary serviceavailableapiresult { domstring status; domstring result; domstring serviceyn; }; [nointerfaceobject] interface billingmanagerobject { readonly attribute billingmanager billing; }; webapi implements billingmanagerobject; [nointerfaceobject] interface billingmanager { void buyitem domstring appid, tvservertype servertype, domstring paymentdetails, billingbuydatasuccesscallback onsuccess, optional errorcallback? onerror ; void getproductslist domstring appid, domstring countrycode, domstring pagesize, domstring pagenumber, domstring checkvalue, tvservertype servertype, billingproductslistcallback onsuccess, optional errorcallback? onerror ; void applyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingapplyinvoicecallback onsuccess, optional errorcallback? onerror ; void verifyinvoice domstring appid, domstring customid, domstring invoiceid, domstring countrycode, tvservertype servertype, billingverifyinvoicecallback onsuccess, optional errorcallback? onerror ; void getservicecountryavailability domstring appid, domstring[] countrycodes, domstring checkvalue, tvservertype servertype, billinggetservicecountryavailabilitycallback onsuccess, optional errorcallback? onerror ; void getuserpurchaselist domstring appid, domstring customid, domstring countrycode, domstring pagenumber, domstring checkvalue, tvservertype servertype, billinggetuserpurchaselistcallback onsuccess, optional errorcallback? onerror ; void cancelsubscription domstring appid, domstring invoiceid, domstring customid, domstring countrycode, tvservertype servertype, billingcancelsubscriptioncallback onsuccess, optional errorcallback? onerror ; void isserviceavailable tvservertype servertype, billingisserviceavailablecallback onsuccess, optional errorcallback? onerror ; domstring getversion ; }; [callback = functiononly, nointerfaceobject] interface billingbuydatasuccesscallback { void onsuccess billingbuydata data ; }; [nointerfaceobject] interface billingbuydata { attribute domstring payresult; attribute domstring paydetail; }; [callback = functiononly, nointerfaceobject] interface billingproductslistcallback { void onsuccess productslistdata data ; }; [callback = functiononly, nointerfaceobject] interface billingapplyinvoicecallback { void onsuccess applyinvoicedata data ; }; [callback = functiononly, nointerfaceobject] interface billingverifyinvoicecallback { void onsuccess verifyinvoicedata data ; }; [callback = functiononly, nointerfaceobject] interface billinggetuserpurchaselistcallback { void onsuccess userpurchasedata data ; }; [callback = functiononly, nointerfaceobject] interface billinggetservicecountryavailabilitycallback { void onsuccess servicecountryavailabilitydata data ; }; [callback = functiononly, nointerfaceobject] interface billingcancelsubscriptioncallback { void onsuccess cancelsubscriptiondata data ; }; [callback = functiononly, nointerfaceobject] interface billingisserviceavailablecallback { void onsuccess serviceavailabledata data ; }; };