Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Filter
Develop Samsung Wallet
docboarding pass, ticket, coupon, and digital id ※ for rp partners select "relying party type > other sub type" to set the relying party wallet card partners can select the type of wallet card needed to register from the 'select wallet card template' pop-up first, select the wallet card type and then select the wallet card sub type to select one of the templates belonging to it wallet card custom setting you must set the attributes of the "wallet card custom setting" according to the wallet card type you selected ※ for rp partners the "authentication issuer" attribute is a unique property of the relying party card the identity provider of the authentication issuer is supported depending on the "service location" set e g if service location is in the us, the authentication issuer field only supports an identity provider belonging to the us when the parent hierarchy value is checked, its children values created later are automatically checked in the united states, the authentication issuer is the state government, and the driver's license can be understood as an mdl mobile driver's license view wallet card partners can view all the registered information, edit and delete the wallet card launch wallet cards verifying status partners can launch and activate cards you can activate a card by clicking the launch button once a card is launched, the button text changes to 'launched' the activation cannot be canceled when a card is launched, its status changes to 'verifying', and then to ‘active’ after administrator approval launch wallet cards rejected status if the wallet card is rejected after launching, partners can modify and re-launch the administrator registers the reason for rejection when rejecting a launched wallet card partners will receive an email from the system, including the reason for rejection partners can apply for launching again by checking the reason for rejection and modifying the wallet card information testing mode partners can test a card internally to make sure everything works before officially release to the users by default, the ‘testing mode’ option is enabled all data generated in testing mode is periodically deleted card exposure is not affected even when the testing mode is enabled be sure to turn off the testing mode after the test is over testing mode on → testing mode off admin approval active status all launched cards are activated after the administrator's approval when a card is launched, its status changes to 'verifying' and then to ‘active’ after administrator approval when the card is activated, it becomes visible to the user verify with samsung wallet integration to integrate the wallet, you need to run the ‘verify with samsung wallet’ script into your system the verify with samsung wallet script is available for both web and android platforms each system has a different composition to implement the verify with samsung wallet button, follow the steps below in order create tokenized card data cdata card data is the actual content data of wallet card and it has several formats based on card type please refer to generate_cdata sample code for detail copy the sample verify with samsung wallet script from partner portal’s wallet card page and replace cdata with the data token created above apply the script to your system please see web_integration sample code and app_integration sample code for detail below is ‘verify with samsung wallet’ script guide in partner portal to integrate the ‘verify with samsung wallet’ you may need some base data you can find this base data and other necessary information on the partner portal and the wallet api spec you can also add image beacon in the script for tracking effect analysis
Develop Samsung Wallet
docboarding pass { "count" 3, "info" [ { "title" "baggage allowance", "content" [ "15 kg" ] }, { "title" "boarding priority", "content" [ "yes" ] }, { "title" "seat class", "content" [ "economy plus" ] } ] } * example case of long content being allowed movie ticket policy { "count" 2, "info" [ { "title" "refunds and exchanges", "content" [ "refunds and exchanges of movie ticket s are available in certain limited circumstances ", "movie tickets purchased through the services include a non-refundable convenience fee before purchasing your movie ticket s we urge you to confirm the title, time, location and quantity of tickets for the movie you wish to see " ] }, { "title" "changes to ticket policy", "content" [ "from time to time, we may revise this ticket policy you can determine when this ticket policy was last revised by referring to the top of this page any changes to this ticket policy will become effective upon posting of the revised ticket policy on the internet, accessible through the services " ] } ] } * example case of more information included reservation-rentalcars { "count" 2, "info" [ { "title" "included", "content" [ "car rental rates ldw-loss damage waiver tax & surcharge" ], "more" [ { "title" "what's included", "content" [ "options which is checked --- ", "please note that additional insurance ---" ] } ] }, { "title" "options", "content" [ "n/a" ] } ] } * example usage of charts { "count" 1, "info" [{ "title" "paygo price guide for usage", "chart" { "headers" ["grade", "round", "one-way"], "body" [ ["platinum", "$25", "$10"], ["gold", "$30", "$15"], ["silver", "$40", "$20"] ], "metadata" "unit /h" } }] } * example usage of html { "count" 2, "info" [ { "title" "<b>this is bold text</b> <font color='red'>this is red text</font> <a href='https //www example com'>this is a link</a>", "content" [ "1 wear a mask", "2 temperature check before entering the theater", "3 electronic entry registration for all customers using the performance", "please cooperate even if it takes some time before entering ", "we kindly ask for your cooperation " ] }, { "title" "[parking information]", "content" [ "<b>this is bold text</b> <font color='red'>this is red text</font> <a href='https //www example com'>this is a link</a>" ] } ] } paygo price guide for usage members grade round one-way platinum $25 $10 gold $30 $15 silver $40 $20 unit /h the above example may differ from what is actually displayed classification classification defines different kinds of people who can use the cards vlaue description person[]array of object required container of person list who can use the card person[] categorystring required category name person[] countstring required number of persons example example * 3 persons with a ticket { "person" [ { "category" "adult", "count" 2 }, { "category" "child", "count" 1 } ] } * 1 person with a ticket { "person" [ { "category" "adult", "count" 1 } ] } transactions transactions to be delivered to customers can be defined in the following format be careful of the content string length if an attribute does not allow long content, it will not be displayed on the device json format vlaue description [] datestring required transaction date [] amountstring optional amount value [] descriptionstring optional description example * an example for payasyougo-evcharge-transactions [ { "date" "2023-09-10 12 00 00", "amount" "50,000 won", "description" "suwon station branch" }, { "date" "2023-09-20 18 00 00", "amount" "70,000 won", "description" "gangnam central branch" } ] links links is a standard data structure that represents a list of actionable links provided by a content provider json format value description orderinteger 1~5 optional display order of the link smaller values are displayed first if omitted, the array order is used titlestring 32 required primary text shown to the user subtitlestring 32 optional secondary descriptive text shown below the title linkstring 2000 required url to access the provider’s additional information max 2000 characters de-facto limit example { "links" [ { "order" 1, "title" "medical consultation", "subtitle" "see more information", "link" "https //samsung external info link" } ] } locations locations refer to place information that denotes where a card can be used using this information, samsung wallet can show a map, place name, and address additionally, location information can be used to provide location-based services lbs location information can be represented by a json array and up to 10 locations can be specified note map services are only available in certain countries json format vlaue description [] latdouble optional latitude [] lngdouble optional longitude [] addressstring required string containing the full address [] namestring required branch name example * location information for the entrance to oracle park [ { "lat" 37 779337, "lng" -122 388755, "address" "24 willie mays plaza, san francisco, ca 94107", "name" "willie mays plaza" }, { "lat" 37 77814, "lng" -122 390836, "address" "king st, san francisco, ca 94107", "name" "king st" } ] itinerary information json format vlaue description itineraryinformation[] idstring 32 optional unique id assigned to each segment of the journey itineraryinformation[] orderstring 4 optional order of each segment within the overall itinerary itineraryinformation[] providernamestring 32 conditional provider name * required if subtype is etickets itineraryinformation[] providerlogostring 256 conditional url of the logo image * required if subtype is etickets itineraryinformation[] providerlogo darkurlstring 256 conditional url of the logo image in dark mode * required if subtype is etickets itineraryinformation[] providerlogo lighturlstring 256 conditional url of the logo image in light mode * required if subtype is etickets itineraryinformation[] departureobject conditional information about the place of departure itineraryinformation[] departure namestring 32 conditional name of the departure point * required if subtype is etickets itineraryinformation[] departure codestring 32 conditional iata code for the departure point * required if subtype is etickets itineraryinformation[] departure airportstring 100 conditional airport name of the departure point * required if subtype is etickets itineraryinformation[] departure terminalstring 100 conditional terminal name of the departure point * required if subtype is etickets itineraryinformation[] departure platformstring 100 optional platform name of the departure point itineraryinformation[] departure time xtimestamplong 13 conditional departure time epoch timestamp in milliseconds i e , the estimated time the aircraft plans to pull from the gate, or the actual time the aircraft already pulled from the gate * required if subtype is etickets itineraryinformation[] departure utcoffsetstring 8 conditional utc offset of time at the departure point * required if subtype is etickets itineraryinformation[] departure zoneidstring 64 optional unique identifier for a timezone as defined by the iana time zone database it represents a specific region's timezone, including rules for daylight saving time dst and historical changes ex "america/new_york", "europe/london" itineraryinformation[] departure literalvaluestring 32 optional the departure time that should be indicated on the screen is formatted valueformat yyyy-mm-ddthh mm ssex 2025-10-30t14 35 00 itineraryinformation[] departure latitudedouble optional the latitude of where the event is start* input when timestamp and zoneid information is not known itineraryinformation[] departure longitudedouble optional the longitude of where the event is start* input when timestamp and zoneid information is not known itineraryinformation[] departure addressstring 256 optional the address of where the event is start* input when timestamp and zoneid information is not known itineraryinformation[] arrivalobject conditional information about the place of arrival itineraryinformation[] arrival namestring 32 conditional name of the arrival point * required if subtype is etickets itineraryinformation[] arrival codestring 32 conditional iata code for the arrival point * required if subtype is etickets itineraryinformation[] arrival airportstring 100 conditional airport name of the arrival point * required if subtype is etickets itineraryinformation[] arrival terminalstring 100 conditional terminal name of the arrival point * required if subtype is etickets itineraryinformation[] arrival platformstring 100 optional platform name of the arrival point itineraryinformation[] arrival timelong 13 conditional arrival time epoch timestamp in milliseconds i e , the estimated time the aircraft plans to pull from the gate, or the actual time the aircraft already pulled from the gate * required if subtype is etickets itineraryinformation[] arrival utcoffsetstring 8 conditional utc offset of time at the arrival point * required if subtype is etickets itineraryinformation[] arrival zoneidstring 64 optional unique identifier for a timezone as defined by the iana time zone database it represents a specific region's timezone, including rules for daylight saving time dst and historical changes ex "america/new_york", "europe/london" itineraryinformation[] arrival literalvaluestring 32 optional the departure time that should be indicated on the screen is formatted value format yyyy-mm-ddthh mm ssex 2025-10-30t14 35 00 itineraryinformation[] arrival latitudedouble optional the latitude of where the event is start* input when timestamp and zoneid information is not known itineraryinformation[] arrival longitudedouble optional the longitude of where the event is start * input when timestamp and zoneid information is not known itineraryinformation[] arrival addressstring 256 optional the address of where the event is start * input when timestamp and zoneid information is not known itineraryinformation[] boardingtimelong 13 optional boarding time epoch timestamp in milliseconds itineraryinformation[] vehiclenumberstring 32 conditional transit or route numberi e , flight number on airlines * required if subtype is etickets itineraryinformation[] coachnumberstring 16 optional identifier assigned to each individual carriage e g , b4 itineraryinformation[] seatclassstring 32 conditional seat class * required if subtype is etickets itineraryinformation[] seatnumberstring 16 optional individual number of the passenger seat e g , a-9, free itineraryinformation[] seatfacingstring 16 optional direction in which the seat is oriented within a carriage it indicates whether the seat is positioned to face the direction of travel or face the opposite direction e g , forward, backward itineraryinformation[] baggageallowancestring 20 optional baggage allowance itineraryinformation[] flighttimestring 8 optional the time required for a flight itineraryinformation[] checkinlinkstring 256 optional link to check in itineraryinformation[] usertypestring 32 optional passenger typei e , classification of passengers like child, adult example { "itineraryinformation" [ { "id" "itineraryid", "order" 1, "departure" { "name" "departurename", "code" "departurecode", "platform" "departureplatform", "time" 1749624040000, "utcoffset" "utc+09 00" }, "arrival" { "name" "arrivalname", "code" "arrivalcode", "platform" "arrivalplatform", "time" 1749624040000, "utcoffset" "utc+09 00" }, "vehiclenumber" "vehiclenumber", "coachnumber" "coachnumber", "seatclass" "seatclass", "seatnumber" "seatnumber", "seatfacing" "seatfacing", "usertype" "usertype" } ] } card art guide loyalty description type bgimage + bgcolor bgimage only description display the bgimage and the bgcolor in a predefined ratio display bgimage fully description
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 class samsungpay java lang object samsungpaybase com samsung android sdk samsungpay v2 samsungpay public final class samsungpay extends samsungpaybase this class provides apis to get the samsung pay status on the device also, this class provides apis to activate samsung pay on the device partner apps must check the samsung pay status on the device before performing any card management or payment operation since api level 1 1 constructor summary constructors constructor description samsungpay android content context context, partnerinfo partnerinfo constructor to get the samsungpay instance the caller should set the valid serviceid in partnerinfo method summary all methodsinstance methodsconcrete methods modifier and type method description void activatesamsungpay api to bring the samsung pay app to a state in which cards can be added samsung pay might be either in stub only state or samsung account is not signed in state partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay and user can sign in to the app void getsamsungpaystatus statuslistener listener api to get the samsung pay status on the device partner issuers, merchants, and so on applications must call this api to check the current state of samsung pay before doing any operation void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay partner app can use this information to uniquely identify the user and samsung pay app on a particular device void gotoupdatepage api to go to samsung pay update page partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay app if samsung pay app version is same or bigger than 2 1 00, it goes to "about samsungpay" menu if samsung pay app version is lower than 2 1 00 or kr device, it launches samsung pay app main screen methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait constructor details samsungpay public samsungpay android content context context, partnerinfo partnerinfo constructor to get the samsungpay instance the caller should set the valid serviceid in partnerinfo partnerinfo is passed to samsung pay for partner verification context ct = activity; // or context ct = service; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 1 1 method details getsamsungpaystatus public void getsamsungpaystatus statuslistener listener api to get the samsung pay status on the device partner issuers, merchants, and so on applications must call this api to check the current state of samsung pay before doing any operation // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay getsamsungpaystatus new statuslistener { @override public void onsuccess int status, bundle data { // success case if status == spay_ready { log d tag, "samsung pay is ready on the device" ; // perform your operation } else if status == spay_not_ready { // samsung pay is supported but not fully ready // if extra_error_reason is error_spay_app_need_to_update, // call gotoupdatepage // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay } else if status == spay_not_allowed_temporally { log d tag, "samsung pay is not allowed temporally" ; // if extra_error_reason is error_spay_connected_with_external_display, // guide user to disconnect it } else { // samsung pay is not supported on this device log d tag, "device does not support samsung pay" ; } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, samsung pay status code is provided via statuslistener onsuccess int status, bundle data if samsung pay is ready to be used, samsungpay#spay_ready will be returned otherwise, samsungpay#spay_not_ready or samsungpay#spay_not_supported or samsungpay#spay_not_allowed_temporally can be returned with samsungpay#extra_error_reason from bundle also, partner can get extra information from bundle data bundle keys if provided bundle values #extra_country_code device country code iso 3166-1 alpha-2 #extra_member_id string memberid for korean issuers only on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if the callback passed is null since api level 1 1 gotoupdatepage public void gotoupdatepage api to go to samsung pay update page partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay app if samsung pay app version is same or bigger than 2 1 00, it goes to "about samsungpay" menu if samsung pay app version is lower than 2 1 00 or kr device, it launches samsung pay app main screen // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay gotoupdatepage ; since api level 1 2 activatesamsungpay public void activatesamsungpay api to bring the samsung pay app to a state in which cards can be added samsung pay might be either in stub only state or samsung account is not signed in state partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay and user can sign in to the app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay activatesamsungpay ; since api level 1 1 getwalletinfo public void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay partner app can use this information to uniquely identify the user and samsung pay app on a particular device // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay extra_issuer_name, "issuer name" ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; // bundle keys added to get wallet information from samsung pay // this information can be delivered to the partner server for eligibility check arraylist<string> keys = new arraylist<> ; keys add samsungpay wallet_user_id ; keys add samsungpay device_id ; samsungpay getwalletinfo keys, new statuslistener { @override public void onsuccess int status, bundle walletdata { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa string deviceid = walletdata get samsungpay device_id ; // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa string walletuserid = walletdata get samsungpay wallet_user_id ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } parameters keys - key list to get wallet information if the list is empty, all possible key values are returned the possible keys are #wallet_dm_id #device_id #wallet_user_id listener - callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked with wallet information the success code can be one of the following codes with bundle data status bundle keys bundle values usage vts mdes #error_none samsungpay#wallet_dm_id string device management id n/a paymentappinstanceid = device_id + padding "00" + wallet_dm_id *if you need 'paymentappinstanceid', you can generate it as above samsungpay#device_id string device id clientdeviceid samsungpay#wallet_user_id string wallet user id clientwalletaccountid on any failure, the error code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 1 2 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop TV Seller Office
docsamsung apps tv seller office the samsung apps tv seller office is the official system for smart tv applications certification and management it provides all the features needed to submit your application for verification testing, get feedback from the samsung team, as well as manage application versions, usage statistics, and metadata it also contains automatic pre-test tools for immediate feedback about your application and a dedicated 1 1 q&a board for direct assistance from samsung engineers application distribution workflow step 1 partnership step 2 application registration step 3 certification step 4 management sign up request partnership group management application info registration application upload & pre-test submit application version testing defect resolution statistics application service change 1 1 q&a essentials partnership you can request a partnership online if a prior agreement has been made with your samsung content manager after registering the basic company information and getting it approved by the content manager, your company becomes a partner group partner groups can provide services in all countries, including the united states learn more auto pre-test tool you can perform a pre-test while uploading application package before the actual certification step this helps in detecting critical defects before submitting the application all test cases for this tool are provided in the launch checklist the guide contains an essential checklist of basic functionality and service policies it will help increase the validation pass rate of your application and ensure the application quality before submission learn more tech support once you’ve become a samsung smart tv partner, you can have a dedicated technical support from samsung engineering team in developing applications learn more alpha & beta testing before you publish an application to samsung apps tv, you can first distribute the beta to users to receive usability assessments for new features and conduct beta tests to identify problems especially for samsung smart tv partners, you can distribute the alpha version in the application development process to the developer's tvs, downloading/installing it in real environments, and testing it to work as for intended learn more samsung checkout samsung checkout provides a seamless purchase experience on smart tv where consumers can register their payment methods safely and make payments with minimal number of clicks in a tv environment samsung checkout also provides a comprehensive global monetization platform empowering developers and content providers to integrate various business models and promotional campaigns into their services learn more
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 class watchmanager java lang object samsungpaybase com samsung android sdk samsungpay v2 watchmanager all implemented interfaces apptoappconstants public final class watchmanager extends samsungpaybase implements apptoappconstants this class provides apis for watch management partner apps must check the samsung pay watch status on the device before performing any card management also, this class provides apis getting cards information, adding new card to samsung pay on watch, and so on since api level 2 5 field summary fields modifier and type field description static final string device_serial_num key to represent device serial number to generate the paymentappinstanceid static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_spay_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay gear static final int error_spay_watch_connection this error indicates that samsung pay watch plug-in can not connect with samsung pay watch partner app should ask user to check bluetooth connection or pairing static final int error_spay_watch_pay_progress this error indicates that samsung pay watch is in a process of payment static final int error_spay_watch_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay watch static final int spay_watch_taking_log_for_report this error indicates that samsung pay watch is taking log for error report static final int spay_watch_update_is_ongoing this error indicates that samsung pay watch being updated fields inherited from interface com samsung android sdk samsungpay v2 apptoappconstants error_auth_code_expired, error_auth_code_invalid, error_auth_code_max_try_reached, error_auth_code_type_invalid, error_authentication_closed, error_authentication_failed, error_authentication_not_ready, error_authentication_timed_out, error_card_already_registered, error_card_idv_not_supported, error_card_not_supported, error_framework_internal, error_invalid_card, error_invalid_cardinput, error_max_card_num_reached, error_max_pan_provision_num_reached, error_server_reject, error_tsm_fail, error_verify_card, error_wallet_id_mismatch, extra_app2app_intent, extra_app2app_payload, extra_card_balance, extra_card_status_reason, extra_issuer_app_card_linked constructor summary constructors constructor description watchmanager android content context context, partnerinfo partnerinfo api to get the watchmanager instance the caller should set valid serviceid method summary all methodsinstance methodsconcrete methods modifier and type method description void activatesamsungpay api to bring the samsung pay on watch app to a state in which cards can be added samsung pay on watch might be samsung account is not signed in state partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay on watch and user can sign in to the app void addcard addcardinfo addcardinfo, addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay on watch partner app uses this api to add card to samsung pay on watch by providing the required card details void getallcards android os bundle cardfilter, getcardlistener listener api to get all the cards from samsung pay on watch for the given filter void getsamsungpaystatus statuslistener listener api to get the samsung pay on watch status on the device partner issuers applications must call this api to check the current state of samsung pay on watch before doing any operation void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay on watch partner app can use this information to uniquely identify the user and samsung pay on watch app on a particular device void gotoupdatepage api to go to samsung pay on watch update page partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay on watch app methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details device_serial_num public static final string device_serial_num key to represent device serial number to generate the paymentappinstanceid since api level 2 5 see also constant field values error_spay_pin_lock_setup_canceled public static final int error_spay_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay gear since api level 2 5 see also constant field values error_invalid_parameter public static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 2 5 see also constant field values error_spay_watch_pin_lock_setup_canceled public static final int error_spay_watch_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay watch since api level 2 5 see also constant field values spay_watch_update_is_ongoing public static final int spay_watch_update_is_ongoing this error indicates that samsung pay watch being updated since api level 2 5 see also constant field values spay_watch_taking_log_for_report public static final int spay_watch_taking_log_for_report this error indicates that samsung pay watch is taking log for error report since api level 2 5 see also constant field values error_spay_watch_pay_progress public static final int error_spay_watch_pay_progress this error indicates that samsung pay watch is in a process of payment since api level 2 5 see also constant field values error_spay_watch_connection public static final int error_spay_watch_connection this error indicates that samsung pay watch plug-in can not connect with samsung pay watch partner app should ask user to check bluetooth connection or pairing since api level 2 5 see also constant field values constructor details watchmanager public watchmanager android content context context, partnerinfo partnerinfo api to get the watchmanager instance the caller should set valid serviceid partnerinfo is passed to samsung pay on watch for caller verification context ct = activity; // or context ct = service; string issuername = "mybank"; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager extra_issuer_name, issuername ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 2 5 method details getsamsungpaystatus public void getsamsungpaystatus @nonnull statuslistener listener api to get the samsung pay on watch status on the device partner issuers applications must call this api to check the current state of samsung pay on watch before doing any operation // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager getsamsungpaystatus new statuslistener { @override public void onsuccess int status, bundle data { // success case if status == spay_ready { log d tag, "samsung pay on watch is ready on the device" ; // perform your operation } else if status == spay_not_ready { // samsung pay on watch is supported but not fully ready // if extra_error_reason is error_spay_app_need_to_update, // call gotoupdatepage // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay } else { // samsung pay on watch is not supported on this device log d tag, "device does not support samsung pay on watch" ; } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, samsung pay on watch status code is provided via statuslistener onsuccess int status, bundle data if samsung pay on watch is ready to be used, #spay_ready will be returned otherwise, #spay_not_ready or #spay_not_supported can be returned with #extra_error_reason from bundle also, partner can get extra information from bundle data bundle keys if provided bundle values spaysdk extra_country_code device country code iso 3166-1 alpha-2 on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if the callback passed is null since api level 2 5 gotoupdatepage public void gotoupdatepage api to go to samsung pay on watch update page partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay on watch app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager gotoupdatepage ; since api level 2 5 activatesamsungpay public void activatesamsungpay api to bring the samsung pay on watch app to a state in which cards can be added samsung pay on watch might be samsung account is not signed in state partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay on watch and user can sign in to the app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager activatesamsungpay ; since api level 2 5 getwalletinfo public void getwalletinfo list<string> keys, @nonnull statuslistener listener api to get the requested wallet information from samsung pay on watch partner app can use this information to uniquely identify the user and samsung pay on watch app on a particular device // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager extra_issuer_name, "issuer name" ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; // bundle keys added to get wallet information from samsung pay on watch // this information can be delivered to the partner server for eligibility check arraylist<string> keys = new arraylist<> ; keys add watchmanager wallet_user_id ; keys add watchmanager device_id ; watchmanager getwalletinfo keys, new statuslistener { @override public void onsuccess int status, bundle walletdata { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa string deviceid = walletdata get watchmanager device_id ; // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa string walletuserid = walletdata get watchmanager wallet_user_id ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } parameters keys - key list to get wallet information if the list is empty, all possible key values are returned the possible keys are #wallet_dm_id #device_id #wallet_user_id device_serial_num listener - callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked with wallet information the success code can be one of the following codes with bundle data status bundle keys bundle values usage vts mdes #error_none #wallet_dm_id string device management id n/a paymentappinstanceid = device_serial_num + wallet_dm_id *if you need 'paymentappinstanceid', you can generate it as above #device_id string device id clientdeviceid #wallet_user_id string wallet user id clientwalletaccountid device_serial_num string device serial number n/a on any failure, the error code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 2 5 addcard public void addcard @nonnull addcardinfo addcardinfo, @nonnull addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay on watch partner app uses this api to add card to samsung pay on watch by providing the required card details this helps user to add their cards to samsung pay on watch directly from partner app watchmanager watchmanager = new watchmanager ct, pinfo ; string cardtype = card card_type_credit; string tokenizationprovider = addcardinfo provider_abcd; // get it from issuer app // samsung pay on watch does not provide detailed payload information // generate provisioning payload in accordance with your card network specifications string testpayload = "thisistestpayloadcardinfo1234567890"; bundle carddetail = new bundle ; carddetail putstring addcardinfo extra_provision_payload, testpayload ; addcardinfo addcardinfo = new addcardinfo cardtype, tokenizationprovider, carddetail ; watchmanager addcard addcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle // such as watchmanager extra_error_reason or watchmanager extra_request_id if provided } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ; parameters addcardinfo - detail card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with #error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the following codes with bundle data status bundle keys bundle values #error_registration_fail -104 #extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 error_spay_watch_pin_lock_setup_canceled -701 spay_watch_update_is_ongoing -702 spay_watch_taking_log_for_report -703 error_spay_watch_pay_progress -704 error_spay_watch_connection -705 #extra_request_id string value returned from server note please refer spaysdk common_status_table for other error status throws nullpointerexception - thrown if parameters are null since api level 2 17 getallcards public void getallcards @nullable android os bundle cardfilter, @nonnull getcardlistener listener api to get all the cards from samsung pay on watch for the given filter since api level 2 5, partner must define issuer names as a card filter on samsung pay developers while on-boarding bundle cardfilter = new bundle ; watchmanager getallcards cardfilter, new getcardlistener { @override public void onsuccess list<card> cards { // getting card status is success if cards == null || cards isempty { log e tag,"no card is found" ; return; } else { // perform operation with card data for card s cards { log d tag, "cardid " + s getcardid + "cardstatus" + s getcardstatus ; // get extra card data if s getcardinfo != null { string last4fpan = s getcardinfo getstring watchmanager extra_last4_fpan ; string last4dpan = s getcardinfo getstring watchmanager extra_last4_dpan ; string cardtype = s getcardinfo getstring watchmanager extra_card_type ; string cardissuername = s getcardinfo getstring watchmanager extra_issuer_name ; log d tag, "last4fpan " + last4fpan + "last4dpan" + last4dpan + "app2apppayload " + app2apppayload ; } } } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, getcardlistener onsuccess list is invoked with list of cards on any failure, the error code is provided via getcardlistener onfail int, bundle note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if listener is null since api level 2 13 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Wallet
docboarding passes, coupons, tickets, and more—directly to samsung wallet the adding samsung wallet card templates section defines interfaces for providers to conveniently create wallet cards in samsung wallet the generated wallet card templates can be updated by following the instructions on the updating wallet card templates section authorized partners can add wallet cards to users directly from the partner server by following the instructions on the adding wallet cards section below service domain environment domain public domain https //tsapi-card walletsvc samsung com adding wallet card templates this section describes how to create a wallet card in samsung wallet [request] type value description method post url /partner/v1/card/template headers authorization string 1024 required credential token the token can have prefix "bearer" as an authorization type i e , bearer <credentials>* see json web token x-smcs-partner-id string 32 required partner id x-request-id string 32 required request identifier random generated uuid string body parameters ctemplate object required actual payload data in basic json format to establish the communication between partners and samsung wallet this must be in the secure jwt json web token format * see the chapter security for more details payload object titlestring 32 required wallet card name countrycodestring 2 required the main headquarters location code refer to iso-3166-1 alpha-2 for the country code cardtypestring 100 required template card typefor details, refer to wallet cards subtypestring 100 required template card sub typefor details, refer to wallet cards designtypestring 100 optional the value that definesthe design type of the wallet card for details, refer to wallet cards applogoimgstring 200 optional the banner logo image url the maximum size of the image is 1024*1024 e g ttp //www yourdomain com/banner_logo_image png saveinserverynstring 1 optional sets whether to save the card data this value can only be set for the ‘id card’ type prtnrapppckgnamestring 128 optional the application package name nonetworksupportynstring 1 optional sets whether to support opening the wallet card under 'no network' status this feature cannot be modified after the wallet card is approved this must be set to either 'y' or 'n' * default 'n' sharebuttonexposureynstring 1 optional sets whether to support the sharing function this feature cannot be modified after the wallet card is approved this must be set to either 'y' or 'n' * default 'y' privacymodeynstring 1 optional if this value is set, the user authentication is required when using the card to protect the user's sensitive information this must be set to either 'y' or 'n' * default 'n' preventcaptureynstring 1 optional this value is a screen capture prevention flag that defines whether the content view prevents screen capture categorystring 20 optional this item can only be set if the card type is “generic” set the category to get more detailed statistical information for instance, parking pass, membership, reservations, insurance, health, receipt, coupon stamp, note, photo, and others prtnrcarddatastring 1000 optional [get card data] partner url check the url format below and implement the api according to the url refer to partner server api specification for instance, you can use https //yourdomain prtnrcardstatestring 1000 optional [get card state] partner url check the url format below and implement api according to url refer to partner server api specification for instance, you can use https //yourdomain prtnrmempointstring 1000 optional [get membership point] partner url cardmetacpstring 1000 optional [get card meta cp] partner url getfulfillmentliststring 1000 optional [get fulfillment list] partner url prtnrbalancestring 1000 optional [get card balance] partner url statestring 15 optional when creating a card, you can transition the card's state from “draft” to “verifying” you can only choose “draft” or “verifying” * default 'draft' descstring 500 optional description example /** example card template object **/ { "title" "coupon", "countrycode" "kr", "cardtype" "coupon", "subtype" "others", "nonetworksupportyn" "n", "sharebuttonexposureyn" "y" } /** example **/ post /partner/v1/card/template [headers] authorization eyjjdhkioijbvvriiiwidmvyijoxlcjwyxj0bmvyswqioiixmjg1o x-smcs-partner-id partner-id-0001 x-request-id req-202303140003 x-request-cc2 kr /** payload **/ { "ctemplate" "eyjjdhkioijkv1qilcjhbgcioijsinrpbwvzdgftcci6imnyzwf0z…" } [response] type value description http status 200 ok payload cardid wallet card id [example] 200 ok { "cardid" "3hdpejr6qi380", "resultcode" "0", "resultmessage" "success" } [result] http status code description 200 200 ok 400 400 bad request requests cannot or will not be processed the request due to something that is perceived to be a client error 401 401 unauthorized authorization token is invalid or expired 500 500 internal server error 503 503 service unavailable updating wallet card templates wallet card templates updated through api can also be checked and managed in the same way on the ‘wallet partners portal' partners can manage all wallet cards they have created [request] type value description method post url /partner/v1/card/template/{card id} headers authorization string 1024 required credential token the token can have prefix "bearer" as an authorization type i e , bearer <credentials>* see json web token x-smcs-partner-id string 32 required partner id x-request-id string 32 required request identifier random generated uuid string path parameters card id string 32 required the wallet card identifier granted through the partner portal * the identifier is needed when updating a specific card template body parameters ctemplate object required actual payload data in basic json format to establish the communication between partners and samsung wallet this must be in the secure jwt json web token format * see the chapter security for more details payload object titlestring 32 required wallet card name countrycodestring 2 optional the main headquarters location code refer to iso-3166-1 alpha-2 for the country code prtnrapppckgnamestring 128 optional the application package name applogoimgstring 200 optional the banner logo image url the maximum size of that image is 1024*1024 saveinserverynstring 1 optional sets whether to save the card data this value can only be set for the ‘id card’ type nonetworksupportynstring 1 optional sets whether to support opening the wallet card under 'no network' status this feature cannot be modified after the wallet card is approved this must be set to either 'y' or 'n' * default 'n' sharebuttonexposureynstring 1 optional sets whether to support the sharing function this feature cannot be modified after the wallet card is approved this must be set to either 'y' or 'n' * default 'y' privacymodeynstring 1 optional if this value is set, user authentication is required when using the card to protect the user's sensitive information this must be set to either 'y' or 'n' * default 'n' preventcaptureynstring 1 optional this value is a screen capture prevention flag that defines whether the content view prevents screen capture categorystring 20 optional this item can only be set if the card type is “generic” set the category to get more detailed statistical information for instance parking pass, membership, reservations, insurance, health, receipt, coupon stamp, note, photo, and others prtnrcarddatastring 1000 optional [get card data] partner url check the url format below and implement the api according to the url refer to partner server api specification for instance, you can use https //yourdomainn prtnrcardstatestring 1000 optional partner url check the url format below and implement the api according to the url refer to partner server api specification for instance, you can use https //yourdomain prtnrmempointstring 1000 optional [get membership point] partner url cardmetacpstring 1000 optional [get card meta cp] partner url getfulfillmentliststring 1000 optional [get fulfillmet list] partner url prtnrbalancestring 1000 optional [get card balance] partner url statestring 15 optional if the card status is “draft”, you can only select “verifying” testingmodeoffstring 1 optional this value can be set only when the card status is active normal service is possible only when the testing mode is changed to off * default ‘n’ descstring 500 optional description [example] /* *example card template object **/ { "title" "coupon", "countrycode" "kr", "nonetworksupportyn" "n", "sharebuttonexposureyn" "y" } /** example **/ post /partner/v1/card/template/cardid=3hdpejr6qi380 [headers] authorization eyjjdhkioijbvvriiiwidmvyijoxlcjwyxj0bmvyswqioiixmjg1o x-smcs-partner-id partner-id-0001 x-request-id req-202303140003 x-request-cc2 kr /** payload **/ { "ctemplate" "eyjjdhkioijkv1qilcjhbgcioijsinrpbwvzdgftcci6imnyzwf0z…" } [response] type value description http status 200 ok payload cardid wallet card id [example] 200 ok { "cardid" "3hdpejr6qi380", "resultcode" "0", "resultmessage" "success" } [result] http status code description 200 200 ok 400 400 bad request requests cannot or will not be processed the request due to something that is perceived to be a client error 401 401 unauthorized authorization token is invalid or expired 500 500 internal server error 503 503 service unavailable get wallet card templates wallet card templates created through the api can be retrieved via the template list api and are also visible and manageable through the wallet partners portal partners can view and manage all wallet card templates they have created [request] type value description method get url /partner/v1/card/templates headers authorizationstring 1024 required credential token the token can have prefix "bearer" as an authorization type i e , bearer * see json web token x-smcs-partner-idstring 32 required partner id x-request-idstring 32 required request identifier random generated uuid string [example] /** example **/ get /partner/v1/card/templates [headers] authorization eyjjdhkioijbvvriiiwidmvyijoxlcjwyxj0bmvyswqioiixmjg1o x-smcs-partner-id partner-id-0001 x-request-id req-202303140003 x-request-cc2 kr [response] type value description http status 200 ok [example] 200 ok { "resultcode" "0", "resultmessage" "success", "templates" [ { "cardid" "3hdpejr6qi380", "title" "wallet card title 01", "countrycode" "us", "cardtype" "loyalty", "subtype" "others", "nonetworksupportyn" "n", "testingmodeoff" "y", "provisioningtype" "na", "usemoreserviceyn" "n", "preventcaptureyn" "n", "prtnrapppckgname" null, "privacymodeyn" "n", "sharebuttonexposureyn" "y", "state" "verifying", "applogoimg" “”, "desc" “” }, { "cardid" "3ctei2riqi9iq", "title" "wallet card title 02", "countrycode" "us", "cardtype" "generic", "subtype" "others", "nonetworksupportyn" "n", "testingmodeoff" "y", "provisioningtype" "na", "usemoreserviceyn" "n", "preventcaptureyn" "n", "prtnrapppckgname" “”, "privacymodeyn" "n", "state" "verifying", "category" "membership", "applogoimg" “”, "desc" "ntf_us_generic" } ] } [result] http status code description 200 200 ok 400 400 bad request requests cannot or will not be processed the request due to something that is perceived to be a client error 401 401 unauthorized authorization token is invalid or expired 500 500 internal server error 503 503 service unavailable adding wallet cards a typical addition to the wallet card is triggered by user interaction, such as pressing the add to wallet button or link the api also supports adding a wallet card automatically to the user for a special purpose with user’s consent this api allows partners to provide wallet cards to users the request payload must contain information about the target to which the card is added this information may be related to the user’s account, or it may contain information about a card that is already registered a push notification is sent to the user’s device to confirm successful card registration the success of card registration must be determined that the card is registered normally when it is updated to added of send card state an administrator must grant permission for partners to use this api card data specification card id {card id} is an id issued when the partner manager signs up for partner services and register the wallet card they want to service refer to partner onboarding guide document for details cdata actual payload data in basic json format to establish the communication between partners and samsung wallet see the details in the table below card data token the specific wallet card data mentioned as cdata must be secured in jwt json web token format see a chapter security for details [request] type value description method post url /atw/v1/cards/{card id} headers authorization string 1024 required credential token the token can have prefix "bearer" as an authorization type i e , bearer <credentials>* see json web token x-smcs-partner-id string 32 required partner id x-request-id string 32 required request identifier random generated uuid string path parameters card id string 32 required wallet card identifier granted through the partner portal body parameters cdata object required actual payload data in basic json format to establish the communication between partners and samsung wallet this must be in the secure jwt json web token format * see the chapter security for more details payload object card object required wallet card object card type string 16 required wallet card type *see wallet cards card subtype string 16 required wallet card sub type *see wallet cards card data[] array of object required wallet card data container data[] refid string 32 required a unique content identifier defined by the content provider data[] createdat long 13 required data creation timestamp epoch timestamp in milliseconds *utc±00 00 data[] updatedat long 13 required data update timestamp epoch timestamp in milliseconds *utc±00 00 data[] language string 8 required default card language code e g en, ko data[] attributes object required attributes container data[] attributes {fields} required attributes fields by card type*see wallet cards data[] localization[] array of object optional localized language container *see wallet cards localization[] language string 8 required multilingual content language code, e g en, ko localization[] attributes {fields} for displaying a given language, ‘data[] attributes’ can be replaced by localized versions *see wallet cards account object conditional user account object account type string 16 required type of user identifier, e g phonenumber, email account value string 64 required user identifier [example] /** example card object **/ { "card" { "type" "ticket", "subtype" "movies", "data" [{ "refid" "ref-20230304-001", "createdat" 1612660039000, "language" "en", "attributes" { "title" "samsung wallet", "mainimg" "https // /main png" *refer to wallet cards }, "localization" [{ "language" "ko", "attributes" { "title" "삼성 월렛" } }] }] }, "account" { "type" "phonenumber", "value" "+821012345678” } } /** example **/ post /atw/v1/cards/1656147182764415319 [headers] authorization eyjjdhkioijbvvriiiwidmvyijoxlcjwyxj0bmvyswqioiixmjg1o x-smcs-partner-id partner-id-0001 x-request-id req-202303140003 x-request-cc2 kr /** payload **/ { "cdata" "eyjjdhkioijkv1qilcjhbgcioijsinrpbwvzdgftcci6imnyzwf0z…" } [response] type value description http status 200 ok payload n/a example 200 ok [result] http status code description 200 200 ok 400 400 bad request requests cannot or will not be processed the request due to something that is perceived to be a client error 401 401 unauthorized authorization token is invalid or expired 500 500 internal server error 503 503 service unavailable
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 card class cardmanager java lang object com samsung android sdk samsungpay v2 spaysdk com samsung android sdk samsungpay v2 card cardmanager all implemented interfaces apptoappconstants public final class cardmanager extends spaysdk implements apptoappconstants this class provides apis for card management the apis include getting card status, adding new card to samsung pay, and so on note whenever a new instance of cardmanager is created, all pending requests which were sent by another instances will be discarded it would be helpful when partner application attempt to send a request again however, in a single session of partner application, you should maintain only one instance of this class and use it to send requests to samsung pay application since api level 1 1 nested class summary nested classes/interfaces inherited from class com samsung android sdk samsungpay v2 spaysdk spaysdk brand, spaysdk servicetype, spaysdk transactiontype field summary fields modifier and type field description static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final string push_provision_error this table shows the status codes used commonly status bundle keys bundle values spaysdk error_registration_fail -104 spaysdk extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 spaysdk extra_request_id string value returned from server apptoappconstants error_tsm_fail -507 spaysdk extra_error_reason string error message for tsm solution fields inherited from class com samsung android sdk samsungpay v2 spaysdk common_status_table, cryptogram_type_icc, cryptogram_type_ucaf, device_id, device_type_gear, device_type_phone, error_android_platform_check_fail, error_device_integrity_check_fail, error_device_not_samsung, error_duplicated_sdk_api_called, error_expired_or_invalid_debug_key, error_initiation_fail, error_missing_information, error_no_network, error_none, error_not_allowed, error_not_found, error_not_supported, error_partner_app_blocked, error_partner_app_signature_mismatch, error_partner_app_version_not_supported, error_partner_info_invalid, error_partner_not_approved, error_partner_sdk_api_level, error_partner_sdk_version_not_allowed, error_partner_service_type, error_registration_fail, error_sdk_not_supported_for_this_region, error_server_internal, error_server_no_response, error_service_id_invalid, error_service_not_approved_for_release, error_service_unavailable_for_this_region, error_spay_app_integrity_check_fail, error_spay_app_need_to_update, error_spay_connected_with_external_display, error_spay_fmm_lock, error_spay_internal, error_spay_pkg_not_found, error_spay_sdk_service_not_available, error_spay_setup_not_completed, error_unable_to_verify_caller, error_unauthorized_request_type, error_user_canceled, error_user_not_registered_for_debug, extra_accept_combo_card, extra_card_type, extra_country_code, extra_cpf_holder_name, extra_cpf_number, extra_cryptogram_type, extra_device_card_limit_reached, extra_device_type, extra_error_reason, extra_error_reason_message, extra_issuer_name, extra_issuer_pkgname, extra_last4_dpan, extra_last4_fpan, extra_member_id, extra_merchant_ref_id, extra_online_transaction_type, extra_partner_name, extra_request_id, extra_require_cpf, extra_resolved_1, extra_resolved_2, extra_resolved_3, extra_resolved_4, extra_resolved_5, extra_resolved_6, extra_resolved_7, partner_service_type, spay_has_no_transit_card, spay_has_transit_card, spay_not_allowed_temporally, spay_not_ready, spay_not_supported, spay_ready, wallet_dm_id, wallet_user_id fields inherited from interface com samsung android sdk samsungpay v2 apptoappconstants error_auth_code_expired, error_auth_code_invalid, error_auth_code_max_try_reached, error_auth_code_type_invalid, error_authentication_closed, error_authentication_failed, error_authentication_not_ready, error_authentication_timed_out, error_card_already_registered, error_card_idv_not_supported, error_card_not_supported, error_framework_internal, error_invalid_card, error_invalid_cardinput, error_max_card_num_reached, error_max_pan_provision_num_reached, error_server_reject, error_tsm_fail, error_verify_card, error_wallet_id_mismatch, extra_app2app_intent, extra_app2app_payload, extra_card_balance, extra_card_status_reason, extra_issuer_app_card_linked constructor summary constructors constructor description cardmanager android content context context, partnerinfo partnerinfo api to get the cardmanager instance the caller should set valid serviceid method summary all methodsinstance methodsconcrete methods modifier and type method description void addcard addcardinfo addcardinfo, addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay partner app uses this api to add card to samsung pay by providing the required card details void addcobadgecard addcardinfo primaryaddcardinfo, addcardinfo secondaryaddcardinfo, addcardlistener listener api to add a co-badge card from partner app example issuer/bank app to samsung pay partner app uses this api to add co-badge card to samsung pay by providing the required card details void getallcards android os bundle cardfilter, getcardlistener listener api to get all the cards from samsung pay for the given filter void verifycardidv idvverifyinfo idvverifyinfo, statuslistener listener api to verify and activate a card in samsung pay issuer app uses this api to send verification code back to token network to activate a card on samsung pay when adding a card to samsung pay, the issuer/card network may request secondary authentication idv the user can verify idv via issuer app and after user verification by logging to issuer app , issuer app sends some information back to issuer/card network via samsung pay to activate the card methods inherited from class com samsung android sdk samsungpay v2 spaysdk getversioncode, getversionname methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details error_invalid_parameter public static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values push_provision_error public static final string push_provision_error this table shows the status codes used commonly status bundle keys bundle values spaysdk error_registration_fail -104 spaysdk extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 spaysdk extra_request_id string value returned from server apptoappconstants error_tsm_fail -507 spaysdk extra_error_reason string error message for tsm solution see also constant field values constructor details cardmanager public cardmanager android content context context, partnerinfo partnerinfo api to get the cardmanager instance the caller should set valid serviceid partnerinfo is passed to samsung pay for caller verification context ct = activity; // or context ct = service; string issuername = "mybank"; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay extra_issuer_name, issuername ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; cardmanager cardmanager = new cardmanager ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 1 1 method details addcard public void addcard @nonnull addcardinfo addcardinfo, @nonnull addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay partner app uses this api to add card to samsung pay by providing the required card details this helps user to add their cards to samsung pay directly from partner app cardmanager cardmanager = new cardmanager ct, pinfo ; string cardtype = card card_type_credit; string tokenizationprovider = addcardinfo provider_abcd; // get it from issuer app // samsung pay does not provide detailed payload information // generate provisioning payload in accordance with your card network specifications string testpayload = "thisistestpayloadcardinfo1234567890"; bundle carddetail = new bundle ; carddetail putstring addcardinfo extra_provision_payload, testpayload ; addcardinfo addcardinfo = new addcardinfo cardtype, tokenizationprovider, carddetail ; cardmanager addcard addcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle // such as samsungpay extra_error_reason or samsungpay extra_request_id if provided } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ; parameters addcardinfo - detail card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with spaysdk error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the codes from the push_provision_error with bundle data note please refer spaysdk common_status_table for other error status in case of tsm, please refer addcardlistener onprogress int, int, bundle throws nullpointerexception - thrown if parameters are null since api level 1 2 addcobadgecard public void addcobadgecard @nonnull addcardinfo primaryaddcardinfo, @nonnull addcardinfo secondaryaddcardinfo, @nonnull addcardlistener listener api to add a co-badge card from partner app example issuer/bank app to samsung pay partner app uses this api to add co-badge card to samsung pay by providing the required card details this helps user to add their cards to samsung pay directly from partner app parameters primaryaddcardinfo - detail primary card information to add secondaryaddcardinfo - detail secondary card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with spaysdk error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the codes from the push_provision_error with bundle data note please refer spaysdk common_status_table for other error status in case of tsm, please refer addcardlistener onprogress int, int, bundle throws nullpointerexception - thrown if parameters are null since api level 2 22 getallcards public void getallcards @nullable android os bundle cardfilter, @nonnull getcardlistener listener api to get all the cards from samsung pay for the given filter since api level 2 13, getallcards bundle, getcardlistener would return a card list in which a card of spaysdk brand visa brand would hold a token reference id as its card getcardid instead of a provisioned token id in earlier api level since api level 1 4, partner must define issuer names as a card filter on samsung pay developers while on-boarding bundle cardfilter = new bundle ; // since api level 1 4, card filter is retrieved from samsung pay developers // no need to set from partner app cardfilter putstring cardmanager extra_issuer_name, issuername ; cardmanager getallcards cardfilter, new getcardlistener { @override public void onsuccess list<card> cards { // getting card status is success if cards == null || cards isempty { log e tag,"no card is found" ; return; } else { // perform operation with card data for card s cards { log d tag, "cardid " + s getcardid + "cardstatus" + s getcardstatus ; // get extra card data if s getcardinfo != null { string last4fpan = s getcardinfo getstring cardmanager extra_last4_fpan ; string last4dpan = s getcardinfo getstring cardmanager extra_last4_dpan ; string app2apppayload = s getcardinfo getstring cardmanager extra_app2app_payload ; string cardtype = s getcardinfo getstring cardmanager extra_card_type ; string cardissuername = s getcardinfo getstring cardmanager extra_issuer_name ; log d tag, "last4fpan " + last4fpan + "last4dpan" + last4dpan + "app2apppayload " + app2apppayload ; } } } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters cardfilter - filter to limit the card list since api level 1 4, issuer name filter is retrieved from samsung pay developers cardfilter bundle key-value pairs are defined as follows keys values spaysdk extra_issuer_name string issuername issuercode for korean issuers listener - callback through which the result is provided on success, getcardlistener onsuccess list is invoked with list of cards on any failure, the error code is provided via getcardlistener onfail int, bundle note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if listener is null since api level 2 15 verifycardidv public void verifycardidv @nonnull idvverifyinfo idvverifyinfo, @nonnull statuslistener listener api to verify and activate a card in samsung pay issuer app uses this api to send verification code back to token network to activate a card on samsung pay when adding a card to samsung pay, the issuer/card network may request secondary authentication idv the user can verify idv via issuer app and after user verification by logging to issuer app , issuer app sends some information back to issuer/card network via samsung pay to activate the card cardmanager cardmanager = new cardmanager ct, pinfo ; // issuer can get cardid from getallcards api result string cardid = "card_id_example_dummy" ; // issuer app gets card status from samsung pay and talks to issuer server // and gets authentication code string authcode = "auth_code_example_dummy"; // if any extra information issuer wants to pass to card network/issuer server bundle cardinfodata = new bundle ; idvverifyinfo idvverifyinfo = new idvverifyinfo cardid, authcode, cardinfodata ; // in case auth code is generated for sms or email, // set authcodetype as idvverifyinfo idv_type_sms or idvverifyinfo idv_type_email // if you don't specify any value for authcodetype, idv_type_app2app will be used by default idvverifyinfo setidnvtype idvverifyinfo idv_type_app2app ; cardmanager verifycardidv idvverifyinfo, new statuslistener { @override public void onsuccess int status, bundle data { // log d tag, "verification code successfully send to server" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters idvverifyinfo - card verification information from issuer listener - verification status callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked when request operation is success on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata the failure code can be one of the following codes with bundle data status bundle keys bundle values apptoappconstants error_verify_card -8 spaysdk extra_error_reason apptoappconstants error_auth_code_invalid -517 apptoappconstants error_auth_code_expired -518 apptoappconstants error_auth_code_max_try_reached -519 apptoappconstants error_auth_code_type_invalid -520 apptoappconstants error_card_idv_not_supported -521 note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 payment class paymentmanager java lang object com samsung android sdk samsungpay v2 spaysdk com samsung android sdk samsungpay v2 payment paymentmanager public final class paymentmanager extends spaysdk this class provides apis for payment related operations example in-app payment partner merchants and other third party applications can use these apis to perform variety of payment operations for instance, partner apps can - request in-app payment - start simple pay on samsung pay - fetch available cards on samsung pay for payment since api level 1 1 nested class summary nested classes modifier and type class description static interface paymentmanager cardinfolistener this interface is for listening requestcardinfo callback events static interface paymentmanager customsheettransactioninfolistener this interface is for listening callback events of online in-app custom sheet payment this is invoked when card is changed by the user on the custom payment sheet, and also with the success or failure of online in-app payment this listener is registered when startinapppaywithcustomsheet customsheetpaymentinfo, customsheettransactioninfolistener api is called caution amountboxcontrol must be returned in oncardinfoupdated on sheetupdatedlistener to remove progress bar on custom payment sheet class paymentmanager inapppaymentcallback class paymentmanager inappuserinfocallback nested classes/interfaces inherited from class com samsung android sdk samsungpay v2 spaysdk spaysdk brand, spaysdk servicetype, spaysdk transactiontype field summary fields modifier and type field description static final int custom_message the merchant can call the updatesheet customsheet, int, string api with this error when it wants to display a custom error message on customsheet static final int error_address_updated_time_out indicates that online payment address updating is timed out static final int error_billing_address_invalid the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the billing address shared by samsung pay to the merchant is invalid static final int error_billing_address_not_exist the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the billing address shared by samsung pay does not exist static final int error_card_not_supported_online_pay indicates that this card does not support online pay static final int error_internal_address_updated indicates address update internal error static final int error_making_sheet_failed indicates that making sheet has failed static final int error_not_ready_payment indicates that online payment is not ready to complete because of various types of errors for example, internal error, unexpected error from samsung pay app, and so on static final int error_shipping_address_invalid the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay to the merchant is invalid static final int error_shipping_address_not_exist the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay does not exist static final int error_shipping_address_unable_to_ship the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay is not available for delivery by the merchant static final int error_spay_reset indicates that spay will be reset static final int error_transaction_closed indicates that transaction ui has closed static final int error_transaction_timed_out indicates that online payment processing has timed out static final string extra_key_additional_data key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_key_card_brand_filter key to represent request card filter list partner can use this key to put filter into bundle for requestcardinfo bundle, cardinfolistener static final string extra_key_test_mode key to represent pg test mode to prevent payment transaction being processed if the value is true, samsung-pg interface server redirects payment info to test pg server this is only for pg-indirect model static final string extra_logo_image_url key to represent the url of partner logo image on simple pay image width max static final string extra_pay_operation_type key to represent start simple pay operation type the possible values are pay_operation_type_payment pay_operation_type_refund static final string extra_transaction_date key to represent transaction date value when start simple pay to refund this is for korean issuers only example value mapped with this key 201906211428 yyyymmddhhmm static final string extra_transaction_number key to represent transaction number value when start simple pay to refund this is for korean issuers only maximum length is 14 static final string extra_transaction_type key to represent transaction type the possible values are transaction_type_mst transaction_type_nfc static final string pay_operation_type_payment indicates start simple pay option to make payment static final string pay_operation_type_refund indicates start simple pay option to make refund this is for korean issuers only static final int transaction_type_mst indicates that transaction type is mst static final int transaction_type_nfc indicates that transaction type is nfc fields inherited from class com samsung android sdk samsungpay v2 spaysdk common_status_table, cryptogram_type_icc, cryptogram_type_ucaf, device_id, device_type_gear, device_type_phone, error_android_platform_check_fail, error_device_integrity_check_fail, error_device_not_samsung, error_duplicated_sdk_api_called, error_expired_or_invalid_debug_key, error_initiation_fail, error_invalid_parameter, error_missing_information, error_no_network, error_none, error_not_allowed, error_not_found, error_not_supported, error_partner_app_blocked, error_partner_app_signature_mismatch, error_partner_app_version_not_supported, error_partner_info_invalid, error_partner_not_approved, error_partner_sdk_api_level, error_partner_sdk_version_not_allowed, error_partner_service_type, error_registration_fail, error_sdk_not_supported_for_this_region, error_server_internal, error_server_no_response, error_service_id_invalid, error_service_not_approved_for_release, error_service_unavailable_for_this_region, error_spay_app_integrity_check_fail, error_spay_app_need_to_update, error_spay_connected_with_external_display, error_spay_fmm_lock, error_spay_internal, error_spay_pkg_not_found, error_spay_sdk_service_not_available, error_spay_setup_not_completed, error_unable_to_verify_caller, error_unauthorized_request_type, error_user_canceled, error_user_not_registered_for_debug, extra_accept_combo_card, extra_card_type, extra_country_code, extra_cpf_holder_name, extra_cpf_number, extra_cryptogram_type, extra_device_card_limit_reached, extra_device_type, extra_error_reason, extra_error_reason_message, extra_issuer_name, extra_issuer_pkgname, extra_last4_dpan, extra_last4_fpan, extra_member_id, extra_merchant_ref_id, extra_online_transaction_type, extra_partner_name, extra_request_id, extra_require_cpf, extra_resolved_1, extra_resolved_2, extra_resolved_3, extra_resolved_4, extra_resolved_5, extra_resolved_6, extra_resolved_7, partner_service_type, spay_has_no_transit_card, spay_has_transit_card, spay_not_allowed_temporally, spay_not_ready, spay_not_supported, spay_ready, wallet_dm_id, wallet_user_id constructor summary constructors constructor description paymentmanager android content context context, partnerinfo partnerinfo constructor of paymentmanager class the caller should set a valid serviceid in partnerinfo method summary all methodsinstance methodsconcrete methods modifier and type method description void requestcardinfo android os bundle requestfilter, paymentmanager cardinfolistener listener api to request card information of the available cards for payment using samsung pay the partner app can use this api to query available cards user already has registered in samsung pay and decide whether to display samsung pay button or not on their application for example, if merchant app supports only one specific card brand, but the user has not registered any card with the brand, then merchant app decides not to display the samsung pay button with this query void startinapppaywithcustomsheet customsheetpaymentinfo customsheetpaymentinfo, paymentmanager customsheettransactioninfolistener listener api to request online in-app payment with samsung pay void startsimplepay cardinfo cardinfo, statuslistener listener api to request payment with simple pay using this api, partner app can start the samsung pay payment screen for a specific card for example, user can login to partner app example bank app , view the list of cards, and select a card which is already registered in samsung pay to make in-store payment void updatesheet customsheet sheet api to update sheet on the custom payment sheet void updatesheet customsheet sheet, int errorcode, string customerrormessage api to update sheet on the custom payment sheet and display a custom error message methods inherited from class com samsung android sdk samsungpay v2 spaysdk getversioncode, getversionname methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details extra_pay_operation_type public static final string extra_pay_operation_type key to represent start simple pay operation type the possible values are pay_operation_type_payment pay_operation_type_refund see also constant field values pay_operation_type_payment public static final string pay_operation_type_payment indicates start simple pay option to make payment see also constant field values pay_operation_type_refund public static final string pay_operation_type_refund indicates start simple pay option to make refund this is for korean issuers only see also constant field values extra_transaction_date public static final string extra_transaction_date key to represent transaction date value when start simple pay to refund this is for korean issuers only example value mapped with this key 201906211428 yyyymmddhhmm see also constant field values extra_transaction_number public static final string extra_transaction_number key to represent transaction number value when start simple pay to refund this is for korean issuers only maximum length is 14 see also constant field values extra_transaction_type public static final string extra_transaction_type key to represent transaction type the possible values are transaction_type_mst transaction_type_nfc see also constant field values transaction_type_mst public static final int transaction_type_mst indicates that transaction type is mst see also constant field values transaction_type_nfc public static final int transaction_type_nfc indicates that transaction type is nfc see also constant field values error_not_ready_payment public static final int error_not_ready_payment indicates that online payment is not ready to complete because of various types of errors for example, internal error, unexpected error from samsung pay app, and so on see also constant field values extra_logo_image_url public static final string extra_logo_image_url key to represent the url of partner logo image on simple pay image width max 330 pixels image height 72 pixels see also constant field values extra_key_test_mode public static final string extra_key_test_mode key to represent pg test mode to prevent payment transaction being processed if the value is true, samsung-pg interface server redirects payment info to test pg server this is only for pg-indirect model since api level 2 3 see also constant field values extra_key_additional_data public static final string extra_key_additional_data key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_key_card_brand_filter public static final string extra_key_card_brand_filter key to represent request card filter list partner can use this key to put filter into bundle for requestcardinfo bundle, cardinfolistener since api level 2 7 see also constant field values error_transaction_timed_out public static final int error_transaction_timed_out indicates that online payment processing has timed out see also constant field values error_transaction_closed public static final int error_transaction_closed indicates that transaction ui has closed see also constant field values error_address_updated_time_out public static final int error_address_updated_time_out indicates that online payment address updating is timed out see also constant field values error_internal_address_updated public static final int error_internal_address_updated indicates address update internal error see also constant field values error_making_sheet_failed public static final int error_making_sheet_failed indicates that making sheet has failed see also constant field values error_spay_reset public static final int error_spay_reset indicates that spay will be reset see also constant field values error_shipping_address_invalid public static final int error_shipping_address_invalid the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay to the merchant is invalid see also constant field values error_shipping_address_unable_to_ship public static final int error_shipping_address_unable_to_ship the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay is not available for delivery by the merchant see also constant field values error_shipping_address_not_exist public static final int error_shipping_address_not_exist the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the shipping address shared by samsung pay does not exist see also constant field values error_billing_address_invalid public static final int error_billing_address_invalid the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the billing address shared by samsung pay to the merchant is invalid see also constant field values error_billing_address_not_exist public static final int error_billing_address_not_exist the merchant can call the updateamountfailed int or updatesheet customsheet, int, string api with this error when the billing address shared by samsung pay does not exist see also constant field values custom_message public static final int custom_message the merchant can call the updatesheet customsheet, int, string api with this error when it wants to display a custom error message on customsheet see also constant field values error_card_not_supported_online_pay public static final int error_card_not_supported_online_pay indicates that this card does not support online pay since api level 2 5 see also constant field values constructor details paymentmanager public paymentmanager android content context context, partnerinfo partnerinfo constructor of paymentmanager class the caller should set a valid serviceid in partnerinfo partnerinfo is passed to samsung pay for caller verification context ct = activity; // or context ct = service; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid" ; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; paymentmanager paymentmanager = new paymentmanager ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - if the context or partnerinfo is null since api level 1 1 method details requestcardinfo public void requestcardinfo android os bundle requestfilter, @nonnull paymentmanager cardinfolistener listener api to request card information of the available cards for payment using samsung pay the partner app can use this api to query available cards user already has registered in samsung pay and decide whether to display samsung pay button or not on their application for example, if merchant app supports only one specific card brand, but the user has not registered any card with the brand, then merchant app decides not to display the samsung pay button with this query // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; paymentmanager paymentmanager = new paymentmanager context, pinfo ; boolean enablepaybutton = false; paymentmanager cardinfolistener cardinfolistener = new paymentmanager cardinfolistener { @override public void onresult list<cardinfo> cardlist { // cardinfo list for available cards if cardlist != null && cardlist size > 0 { // this means registered card s found in samsung pay for cardinfo cardinfo cardlist { if cardinfo getbrand == spaysdk brand abcd { enablepaybutton = true; break; } } } } @override public void onfailure int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } }; bundle filter = new bundle ; arraylist<paymentmanager brand> list = new arraylist<> ; list add paymentmanager brand visa ; list add paymentmanager brand mastercard ; filter putparcelablearraylist paymentmanager extra_key_card_brand_filter, list ; paymentmanager requestcardinfo filter, cardinfolistener ; parameters requestfilter - filter to limit return cardinfo list this is optional parameter if the caller does not set any value, all the cards which are available for online in-app payment on samsung pay are returned listener - callback through which the result is provided on success, paymentmanager cardinfolistener onresult list is invoked with cardinfo list on any failure, the failure code is provided via paymentmanager cardinfolistener onfailure int, bundle note please refer spaysdk common_status_table in detail throws nullpointerexception - if the cardinfolistener is null since api level 1 1 updatesheet public void updatesheet customsheet sheet api to update sheet on the custom payment sheet @override public void oncardinfoupdated cardinfo selectedcardinfo, customsheet customsheet { amountboxcontrol amountboxcontrol = amountboxcontrol customsheet getsheetcontrol amount_control_id ; if amountboxcontrol == null { log d tag, "transaction failed / amountboxcontrol is null " ; return; } // you can set updated amount amountboxcontrol updatevalue product_item_id, 1000 ; amountboxcontrol updatevalue product_tax_id, 50 ; amountboxcontrol updatevalue product_shipping_id, 10 ; amountboxcontrol updatevalue product_fuel_id, 0, "pending" ; amountboxcontrol setamounttotal 1060, amountconstants format_total_price_only ; customsheet updatecontrol amountboxcontrol ; // call updatesheet api method with amountboxcontrol this is mandatory paymentmanager updatesheet customsheet ; } parameters sheet - customsheet is to be updated throws illegalstateexception - thrown if service is disconnected nullpointerexception - thrown if the sheetcontrol is null since api level 1 3 updatesheet public void updatesheet customsheet sheet, int errorcode, string customerrormessage api to update sheet on the custom payment sheet and display a custom error message @override public void oncardinfoupdated cardinfo selectedcardinfo, customsheet customsheet { amountboxcontrol amountboxcontrol = amountboxcontrol customsheet getsheetcontrol amount_control_id ; if amountboxcontrol == null { log d tag, "transaction failed / amountboxcontrol is null " ; return; } // you can set updated amount amountboxcontrol updatevalue product_item_id, 1000 ; amountboxcontrol updatevalue product_tax_id, 50 ; amountboxcontrol updatevalue product_shipping_id, 10 ; amountboxcontrol updatevalue product_fuel_id, 0, "pending" ; amountboxcontrol setamounttotal 1060, amountconstants format_total_price_only ; customsheet updatecontrol amountboxcontrol ; // if merchant want to display error message, call updatesheet api method with custom_message error code and text message paymentmanager updatesheet customsheet, paymentmanager custom_message, "phone number is not valid please change your phone number!" ; } parameters sheet - customsheet is to be updated errorcode - this code should be custom_message if merchant wants to use its own message customerrormessage - if errorcode is set to custom_message then this parameter will be used to display the message on the payment sheet, else it will be ignored throws illegalstateexception - thrown if service is disconnected nullpointerexception - thrown if the sheetcontrol is null since api level 1 5 startsimplepay public void startsimplepay @nonnull cardinfo cardinfo, @nonnull statuslistener listener api to request payment with simple pay using this api, partner app can start the samsung pay payment screen for a specific card for example, user can login to partner app example bank app , view the list of cards, and select a card which is already registered in samsung pay to make in-store payment samsung pay is launched with the selected card for payment the user can authenticate and start the payment partner app needs to obtain an usage permission of startsimplepay api in server-side without the permission, calling of startsimplepay api would be failed // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; paymentmanager paymentmanager = new paymentmanager context, pinfo ; string cardid = "cardid_test"; bundle metadata = new bundle ; // // set values in metadata bundle // cardinfo cardinfo = new cardinfo builder setcardid cardid setcardmetadata metadata build ; paymentmanager startsimplepay cardinfo, new statuslistener { @override public void onsuccess int status, bundle data { // called when start samsung pay simple pay is showed to user with specified card log d tag, "simple pay is shown" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; how to set metadata in cardinfo - case 1 requesting in-store payment metadata putstring paymentmanager extra_pay_operation_type, paymentmanager pay_operation_type_payment ; metadata putstring paymentmanager extra_issuer_name, "issuername_test" ; metadata putint paymentmanager extra_transaction_type, paymentmanager transaction_type_mst | paymentmanager transaction_type_nfc ; // set logo image and background color for simple pay screen metadata putstring paymentmanager extra_logo_image_url, "http //testbank com/logo png" ; - case 2 requesting refund for in-store payment for korean issuers only metadata putstring paymentmanager extra_pay_operation_type, paymentmanager pay_operation_type_refund ; metadata putstring paymentmanager extra_issuer_name, "issuername" ; metadata putstring paymentmanager extra_transaction_date, "yyyymmddhhmm" ; metadata putstring paymentmanager extra_transaction_number, "1234567890" ; metadata putint paymentmanager extra_transaction_type, paymentmanager transaction_type_mst | paymentmanager transaction_type_nfc ; parameters cardinfo - card information to pay cardmetadata bundle key-value pairs can be defined as follows keys values samsungpay#extra_issuer_name string issuername issuercode for korean issuers extra_pay_operation_type pay_operation_type_payment pay_operation_type_refund for korean issuers only extra_transaction_type - for korean issuers effective as requested - for other country issuers effective depends on device configuration i e in uk, only nfc supported or card meta-data token profile from card network transaction_type_mst transaction_type_nfc transaction_type_mst | transaction_type_nfc extra_transaction_date string transaction date for refund for korean issuers only extra_transaction_number string transaction number for refund for korean issuers only extra_logo_image_url string issuer logo image url listener - statuslistener instance callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked with spaysdk error_none status code on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if cardinfo or statuslistener is null illegalargumentexception - thrown if cardinfo getcardmetadata does not have extra_pay_operation_type and extra_transaction_type since api level 1 1 startinapppaywithcustomsheet public void startinapppaywithcustomsheet @nonnull customsheetpaymentinfo customsheetpaymentinfo, @nonnull paymentmanager customsheettransactioninfolistener listener api to request online in-app payment with samsung pay partner app can use this api to make in-app purchase using samsung pay from their application with custom payment sheet you can refer to startinapppay paymentinfo, transactioninfolistener in case of normal payment sheet // create {@link customsheet} to contain sheetcontrols customsheet sheet = new customsheet ; // make sheetcontrols you want and add to custom sheet // each sheetcontrol is located in sequence // there must be a amountboxcontrol and it must be located on last // add {@link addresscontrol} on custom payment sheet sheet addcontrol new addresscontrol ; // add {@link plaintextcontrol} on custom payment sheet sheet addcontrol new plaintextcontrol ; // add {@link spinnercontrol} on custom payment sheet sheet addcontrol new spinnercontrol ; // add {@link amountboxcontrol} on custom payment sheet sheet addcontrol new amountboxcontrol ; // create {@link customsheetpaymentinfo} with in-app details customsheetpaymentinfo custompaymentreq = new customsheetpaymentinfo builder setmerchantid merchantid setmerchantname merchantname setordernumber ordernumber // the allowed characters are [a-z][a-z][0-9,-] & up to 36 characters setpaymentprotocol protocol setaddressinpaymentsheet addressinpaymentsheet setallowedcardbrands brandlist setcardholdernameenabled iscardholdernameenabled setcustomsheet sheet // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; // create {@link paymentmanager#paymentmanager context, partnerinfo } paymentmanager paymentmanger = new paymentmanager this, pinfo ; // set {@link customsheettransactioninfolistener} paymentmanager customsheettransactioninfolistener transactionlistener = new paymentmanager customsheettransactioninfolistener { @override public void oncardinfoupdated cardinfo selectedcardinfo, customsheet customsheet { log d tag, "oncardinfoupdated" ; // called when the user changes the card in samsung pay // newly selected cardinfo is passed and partner app // can update transaction amount based on new card if needed } @override public void onsuccess customsheetpaymentinfo customsheetpaymentinfo, string paymentcredential, bundle extrapaymentdata { log d tag, "transaction successfully received paymentcredential from samsung pay" ; // called when samsung pay able to create in-app cryptogram successfully // partner app will send this cryptogram to partner server/payment gateway and complete // in-app payment } @override public void onfailure int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } // execute startinapppaywithcustomsheet to show custom payment sheet try { paymentmanger startinapppaywithcustomsheet custompaymentreq, transactionlistener ; } catch nullpointerexception e | illegalstateexception e | illegalargumentexception e { e printstacktrace ; } parameters customsheetpaymentinfo - custom sheet and payment information from partner app merchant app listener - callback through which the result is provided on success, paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle is invoked with payment credential paymentmanager customsheettransactioninfolistener oncardinfoupdated cardinfo, customsheet is invoked when user changes the card on the payment sheet in samsung pay on any failure, the failure error code and error data are provided via paymentmanager customsheettransactioninfolistener onfailure int, bundle the failure code can be one of the following codes with bundle data status spaysdk error_user_canceled -7 spaysdk error_duplicated_sdk_api_called -105 error_not_ready_payment -108 error_transaction_timed_out -111 error_transaction_closed -112 error_card_not_supported_online_pay -402 error_address_updated_time_out -113 error_making_sheet_failed -115 note please refer spaysdk common_status_table for other status throws nullpointerexception - thrown if parameters are null illegalstateexception - thrown if samsung pay sdk service is not available illegalargumentexception - thrown if mandatory custom sheet information and payment information values are not set since api level 1 3 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Distribute Samsung IAP for Galaxy Watch (Tizen)
docweb iap for galaxy watch samsung in-app purchase iap for galaxy watch is a galaxy store service that allows third-party watch applications to sell in-app items iap for galaxy watch only works if your galaxy watch is paired with your phone the iap client for watch communicates with the iap client for phone which internally manages communication with supporting iap services and the samsung ecosystem such as samsung account, samsung checkout, and samsung rewards in other words, it acts as an intermediary between watch app and samsung iap system of the phone you can concentrate on integrating iap api calls and iap server api calls into your watch app to integrate iap for galaxy watch using tizen extension sdk, iap web apis enable you to easily integrate iap functionality into your watch app, such as configuring iap, getting item details, offering and selling items, and managing purchased items using galaxy watch studio formerly galaxy watch designer , you can make your own watch face that prompts for payment after a free trial period, without the complexity of coding for more details, see the galaxy watch studio online tutorial by integrating iap features, your watch apps can sell these types of in-app items item type description consumable app users can use items only one time for example, coins, special powers, or gems non-consumable app users can use items any number of times for example, e-books or game boards items cannot be repurchased note during iap integration testing, if your application sets to test mode, the purchase record is initialized every 60 minutes to allow repurchase auto-recurring subscription these items are purchased automatically at specific intervals app users can access items such as magazines, e-zines, or newspapers any number of times during a free trial or while their paid subscriptions are active app users can cancel at any time after purchase during subscription period app users can repurchase items after cancellation note during iap integration testing, if your application is set to test mode, the subscription cycle is automatically renewed every 10 minutes and the subscription is automatically canceled after 12 renewals integrate iap into your watch app this section explains how to prepare your app to sell in-app items using tizen extension sdk you can use galaxy watch studio to make a watch face that prompts for payment after a free trial period, without the complexity of coding to prepare for integrating iap features and testing the integration, do the following 1 create a project create a project in tizen studio the required_version must be at least 2 3 2 in the config xml file <?xml version="1 0" encoding="utf-8"?> <widget xmlns tizen="http //tizen org/ns/widgets" xmlns="http //www w3 org/ns/widgets" id="http //yourdomain/webiap" version="1 0 6" viewmodes="maximized"> <tizen application id="wxwmxrcelo webiap" package="wxwmxrcelo" required_version="4 0 0"/> </widget> 2 add permissions to config xml <tizen privilege name="http //tizen org/privilege/billing"/> 3 register an app and in-app items in seller portal during iap integration, you may need to test iap features samsung iap needs information about your app and in-app items registered in seller portal note your app does not need to have iap features integrated in order to register the app and its in-app items as iap integration proceeds, you can upload new versions of your app and new in-app items as needed to register an app and its in-app items sign in to seller portal https //seller samsungapps com using your samsung account click add new application click galaxy watch, select the default language, and click next in the binary tab, upload your app tpk in the app information tab, enter fundamental app details in the country / region & price tab, specify a free or paid app, a paid app price, and countries to sell your items in the in app purchase tab, register one or more in-app items caution don't click *submit beta test * or *submit * in this step for more app registration details, see the app registration guide for more in-app item registration details, see the item registration guide 4 integrate iap features get in-app items available for purhcase purchase an in-app item get a list of purchased items operation mode iap supports three operational modes one is for enabling billing for item purchases and the other two are for testing iap functions without billing app users for item purchases mode description iap_commercial_mode financial transactions do occur for successful requests, and actual results are returned successful or failed the app gets in-app item information of the app whose status in seller portal is for sale iap_success_test_mode financial transactions do not occur app users are not billed for item purchases , and successful results are always returned the app gets in-app item information of the app whose status in seller portal is registering or updating iap_failure_test_mode all iap requests fail negative testing to ensure that your app can handle errors such as improper input and user actions note the tizen emulator only supports these two modes iap_success_test_mode iap_failure_test_mode if you set the mode to iap_commercial_mode, it is automatically changed to iap_success_test_mode get in-app items available for purchase to get all registered in-app items from galaxy store, use the getitemlist method pass in the index of the first and last item, the item type, service mode, callback function, and user data as parameters when the reply is delivered, the getitemsuccesscallback or errorcallback callback is invoked with the jsonobject that stores the query results request for details, see the getitemlist void getitemlist long startnumber, long endnumber, itemtype type, iapmode mode, getitemsuccesscallback successcallback, optional errorcallback? errorcallback ; response [callback=functiononly, nointerfaceobject] interface getitemsuccesscallback { void onsuccess jsonobject result ; }; [callback=functiononly, nointerfaceobject] interface errorcallback { void onerror webapierror error ; }; common result key value type description merrorcode int error code number merrorstring string error message _items array item list item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller portal mitemprice string item price in a local currency mitempricestring string currency code + pricefor example €7 99 mcurrencyunit string device user currency unit for example $, won, or pound mcurrencycode string currency codefor example eur or gbp mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during the item registration mtype string item type 00 consumable01 non-consumable02 non-recurring subscription03 auto-recurring subscription 10 all msubscriptiondurationunit string subscription duration unit, defined as an upper case string month msubscriptiondurationmultiplier string if the item type mtype is 02 or 03, this is the item duration combined with msubscriptiondurationunit, it expresses the subscription duration, for example, 1month code snippet request the available items, and retrieve the item details in the reply callback webapis inapppurchase getitemlist 1, 15, "consumable", "iap_commercial_mode",successcallback, errorcallback ; /* success callback */ function successcallback result { if result _items length == 0 { console log "no item" ; } else { for var i = 0; i < result _items length; i++ { console log "item id " + result _items[i] mitemid ; console log "item name " + result _items[i] mitemname ; console log "item price " + result _items[i] mitemprice ; } } } /* error callback */ function errorcallback error { /* error handling */ } purchase an in-app item to purchase items from galaxy store, use the startpayment method pass in the index of the item id, service mode, callback function, and user data as parameters when the reply is delivered, the paymentsuccesscallback or errorcallback callback is invoked with the jsonobject that stores the query results request for details, see the startpayment void startpayment domstring itemid, iapmode mode, paymentsuccesscallback successcallback, optional errorcallback? errorcallback ; response [callback=functiononly, nointerfaceobject] interface paymentsuccesscallback { void onsuccess jsonobject item ; }; [callback=functiononly, nointerfaceobject] interface errorcallback { void onerror webapierror error ; }; common result key value type description merrorcode int error code number merrorstring string error message purchased item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller office mitemprice double item price in a local currency mitempricestring string currency code + pricefor example €7 99 mcurrencyunit string device user currency unitfor example $, won, or pound mcurrencycode string currency codefor example eur or gbp mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during the item registration mpaymentid string id of the payment mpurchaseid string purchase ticket id used to verify the purchase with the store iap server mpurchasedate string date of purchasefor example "2013-11-15 10 31 23" mverifyurl string server's url, which can be used in combination with other parameters to verify the purchase with the iap server code snippet webapis inapppurchase startpayment "item_id", "iap_commercial_mode", successcallback, errorcallback ; /* success callback */ function successcallback item { console log "item id " + item mitemid ; console log "item name " + item mitemname ; console log "item price " + item mitemprice ; } /* error callback */ function errorcallback error { /* error handling */ } get a list of purchased items to get all purchased items from galaxy stroe, use the getpurchaseditemlist or getpurchaseditemlistbyids method for getpurchaseditemlist , pass in the index of the first and last item, the item type, the start and end date, the callback function, and user data as parameters for getpurchaseditemlistbyids , pass in the item ids separated by comma , , the callback function, and user data as parameters when the reply is delivered, the getitemsuccesscallback or errorcallback callback is invoked with the jsonobject that stores the query results request for details, see the getpurchaseditemlist and getpurchaseditemlistbyids void getpurchaseditemlist long startnumber, long endnumber, tzdate startdate, tzdate enddate, getitemsuccesscallback successcallback, optional errorcallback? errorcallback void getpurchaseditemlistbyids domstring[] itemids, getitemsuccesscallback successcallback, optional errorcallback? errorcallback response [callback=functiononly, nointerfaceobject] interface getitemsuccesscallback { void onsuccess jsonobject result ; }; [callback=functiononly, nointerfaceobject] interface errorcallback { void onerror webapierror error ; }; common result key value type description merrorcode int error code number merrorstring string error message _items array item list purchased item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller portal mitemprice string item price in a local currency mitempricestring string currency code + price mcurrencyunit string device user currency unit mcurrencycode string currency code mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during item registration mtype string item type 00 consumable01 non-consumable02 non-recurring subscription03 auto-recurring subscription10 all mpaymentid string id of the payment mpurchaseid string id of the purchase mpurchasedate string date of purchasefor example "2013-11-15 10 31 23" msubscriptionenddate string if the item type mtype is 02 or 03, this is the due date mjsonstring string original json string code snippet webapis inapppurchase getpurchaseditemlist 1, 10, new tizen tzdate 2020, 01, 01 , new tizen tzdate 2022, 12,31 , successcallback, errorcallback ; // item ids can be obtained by seperating the values returned by the getitemlist with comma , webapis inapppurchase getpurchaseditemlistbyids "item1,item2,item3", successcallback, errorcallback ; /* success callback */ function successcallback result { if result _items length == 0 { console log "no item" ; } else { for var i = 0; i < result _items length; i++ { console log "item id " + result _items[i] mitemid ; console log "item name " + result _items[i] mitemname ; console log "item price " + result _items[i] mitemprice ; } } } /* error callback */ function errorcallback error { /* error handling */ } handling errors during the iap process, various errors can occur, for example, due to an unstable network, connection error, invalid account, or invalid product if an error occurs, your application receives the webapierror error type in the errorcallback callback handle all errors appropriately error code error name description paymentiscancelederror payment canceled networkerror network is not available ioerror ioexception timeouterror timeout exception initializationerror failure during iap initialization needappupgradeerror samsung iap upgrade is required alreadypurchasederror error when a non-consumable product is repurchased or a subscription product is repurchased before the product expiration date whilerunningerror error when payment is requested without bundle information productdoesnotexisterror error when the requested item list is not available confirminboxerror the payment result is not received after requesting payment from the server, and the purchased item list is not confirmed notexistlocalpriceerror the item is not for sale in the country notavailableshoperror iap is not supported in the country invalidvalueserror invalid parameter notsupportederror the device does not support iap securityerror this functionality is not allowed unknownerror any other error case verify a purchase this server api enables your server and client app to verify that a specified in-app item purchase and payment transaction were successfully completed the api returns a json object with a successful status and details about a successful transaction and the item or with a failure status this api can help to prevent malicious purchases and ensure that purchase and payment transactions were successful when the client app experiences network interruptions after an item purchase and payment transaction request https //iap samsungapps com/iap/appsitemverifyiapreceipt as?protocolversion=2 0&purchaseid={purchaseid} the purchaseid is assigned by samsung iap your app receives it in the jsonobject of paymentsuccesscallback and the variable name is mpurchaseid response note response parameters may be added, changed, and deleted success { "itemid" "item01", "paymentid" "zpmtid20131122gbi0015292", "orderid" "s20200106kra1908790", "itemname" "test pack", "itemdesc" "iap test item best value!", "purchasedate" "2020-11-22 04 22 36", "paymentamount" "9 000", "status" "true", "paymentmethod" "credit card", "mode" "real", } fail { "status" "false" } note besides verifying a purchase, samsung iap server api also obtains service token information and gets detailed information of auto recurring subscription ars item purchase submit the app to galaxy store 1 check the operation mode after iap integration, you must check the operation mode before submitting the app if you submit the app with iap_success_test_mode, the users will get all the items for free so, before beta release or normal publication, confirm if the operation mode is iap_commercial_mode 2 submit the app when you have created an app version that is ready for review testing and normal publication, register the app and its in-app item, and then click submit for more details, see the app registration guide
Distribute Samsung IAP for Galaxy Watch (Tizen)
docnative iap for galaxy watch samsung in-app purchase iap for galaxy watch is a galaxy store service that allows third-party watch applications to sell in-app items iap for galaxy watch only works if your galaxy watch is paired with your phone the iap client for watch communicates with the iap client for phone, which internally manages communication with supporting iap services and the samsung ecosystem such as samsung account, samsung checkout, and samsung rewards in other words, it acts as an intermediary between the watch app and samsung iap phone system you can concentrate on integrating iap api calls and iap server api calls into your watch app to integrate iap for galaxy watch using tizen extension sdk, iap native apis enables you to easily integrate iap functionality into your watch app, such as configuring iaps, getting item details, offering and selling items, and managing purchased items using galaxy watch studio formerly galaxy watch designer , you can make your own watch face that prompts for payment after a free trial period, without the complexity of coding for more details, see the galaxy watch studio online tutorial by integrating iap features, your watch apps can sell these types of in-app items item type description consumable app users can use items only one time for example, coins, special powers, or gems nonconsumable app users can use items any number of times for example, e-books or game boards items cannot be repurchased noteduring iap integration testing, if your application is set to test mode, the purchase record is initialized every 60 minutes to allow repurchase autorecurring subscription these items are purchased automatically at specific intervals app users can access items such as magazines, e-zines, or newspapers any number of times during a free trial or while their paid subscriptions are active app users can cancel at any time after purchase during subscription period app users can repurchase items after cancellation noteduring iap integration testing, if your application is set to test mode, the subscription cycle is automatically renewed every 10 minutes, and the subscription is automatically canceled after 12 renewals integrate iap into your watch app this section explains how to prepare your app to sell in-app items using tizen extension sdk you can use galaxy watch studio to make a watch face that prompts for payment after a free trial period, without the complexity of coding see the galaxy watch studio online tutorial for more information to prepare for integrating iap features and testing the integration, perform the following steps 1 create a project create a project in tizen studio the application api version must be at least 2 3 2 in the tizen-manifest xml file <?xml version="1 0" encoding="utf-8" standalone="no"?> <manifest xmlns="http //tizen org/ns/packages" api-version="4 0 0" package="org tizen nativeiap" version="1 0 0"> </manifest> 2 add permissions to tizen-manifest xml <privileges> <privilege>http //tizen org/privilege/billing</privilege> </privileges> 3 register app and in-app items in seller portal during iap integration, you may need to test iap features samsung iap needs information about your app and in-app items registered in seller portal noteyour app does not need to have iap features integrated in order to register the app and its in-app items as iap integration proceeds, you can upload new versions of your app and new in-app items as needed to register an app and its in-app items sign in to seller portal https //seller samsungapps com using your samsung account click add new application click galaxy watch, select the default language, and click next in the binary tab, upload your app tpk in the app information tab, enter fundamental app details in the country / region & price tab, specify a free or paid app, a paid app price, and countries to sell your items in the in app purchase tab, register one or more in-app items cautiondon't click *submit beta test * or *submit * in this step 4 integrate iap features #include <iap-galaxyapps h> get in-app items available for purchase purchase an in-app item get a list of purchased items operation mode iap supports three operational modes one is for enabling billing for item purchases, and the other two are for testing iap functions without billing app users for item purchases mode description iap_galaxyapps_commercial_mode financial transactions do occur for successful requests, and actual results are returned successful or failed the app gets in-app item information of the app whose status in seller portal is for sale iap_galaxyapps_success_test_mode financial transactions do not occur app users are not billed for item purchases , and successful results are always returned the app gets in-app item information of the app whose status in seller portal is registering or updating iap_galaxyapps_failure_test_mode all iap requests fail negative testing to ensure that your app can handle errors such as improper input and user actions notethe tizen emulator only supports these two modes iap_galaxyapps_success_test_mode iap_galaxyapps_failure_test_mode if you set the mode to iap_galaxyapps_commercial_mode, it is automatically changed to iap_galaxyapps_success_test_mode get in-app items available for purchase to get all registered in-app items from galaxy store, use the iap_galaxyapps_get_item_list method pass in the index of the first and last item, the item type, service mode, callback function, and user data as parameters when the reply is delivered, the iap_galaxyapps_reply_cb callback is invoked with the iap_galaxyapps_h object that stores the query results to get the request result from the iap_galaxyapps_h object, use the iap_galaxyapps_get_value method if the request was successful, you can get all the item details from the iap_galaxyapps_h object using the iap_galaxyapps_foreach_item_info method request for details, see the iap_galaxyapps_get_item_list int iap_galaxyapps_get_item_list int start_number, int end_number, const char *item_type, iap_galaxyapps_mode_e mode, iap_galaxyapps_reply_cb reply_cb, void *user_data response typedef void * iap_galaxyapps_reply_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data common result key value type description merrorcode int error code number merrorstring string error message mextrastring string extra result mstartnumber int index of the first item on the list mendnumber int index of the last item on the list mtotalcount int total number of items based on the first and last item index item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller portal mitemprice string item price in a local currency mitempricestring string currency code + pricefor example €7 99 mcurrencyunit string device user currency unit for example $, won, or pound mcurrencycode string currency codefor example eur or gbp mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during the item registration mtype string item type 00 consumable01 non-consumable02 non-recurring subscription03 auto-recurring subscription 10 all msubscriptiondurationunit string subscription duration unit, defined as an upper case string month msubscriptiondurationmultiplier string if the item type mtype is 02 or 03, this is the item duration combined with msubscriptiondurationunit, it expresses the subscription duration, for example, 1month mjsonstring string original json string code snippet to handle the request output data, define a structure for it struct output_data { char* merrorcode; char* merrorstring; char* mextrastring; char* mstartnumber; char* mendnumber; char* mtotalcount; char* mitemid; char* mitemname; char* mitemprice; char* mitempricestring; char* mcurrencyunit; char* mcurrencycode; char* mitemdesc; char* mitemimageurl; char* mitemdownloadurl; char* mpaymentid; char* mpurchaseid; char* mpurchasedate; char* mverifyurl; char* mtype; char* msubscriptiondurationunit; char* msubscriptiondurationmultiplier; char* msubscriptionenddate; char* mjsonstring; }; typedef struct output_data_s; request the available items, and retrieve the item details in the reply callback /* request the available item list */ int ret = iap_galaxyapps_get_item_list 1, 10, "10", iap_galaxyapps_commercial_mode, __get_item_list_cb, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } static bool __foreach_item iap_galaxyapps_h handle, void *user_data { output_data value = {0,}; /* get item properties */ iap_galaxyapps_get_value handle, "mitemid", &value mitemid ; iap_galaxyapps_get_value handle, "mitemname", &value mitemname ; iap_galaxyapps_get_value handle, "mitempricestring", &value mitempricestring ; iap_galaxyapps_get_value handle, "mitemdesc", &value mitemdesc ; /* handle properties */ return true; } /* callback */ static void __get_item_list_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data { if result != iap_galaxyapps_error_none { char *merrorstring = null; iap_galaxyapps_get_value reply, "merrorstring", &merrorstring ; /* error handling */ return; } /* retrieve all items contained in the handle */ int ret = iap_galaxyapps_foreach_item_info reply, __foreach_item, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } return; } purchase an in-app item to purchase items from galaxy store, use the iap_galaxyapps_start_payment method pass in the index of the item id, service mode, callback function, and user data as parameters when the reply is delivered, the iap_galaxyapps_reply_cb callback is invoked with the iap_galaxyapps_h object that stores the query results to get both the request result and the purchased item details from the iap_galaxyapps_h object, use the iap_galaxyapps_get_value method request for details, see the iap_galaxyapps_start_payment int iap_galaxyapps_start_payment const char *item_id, iap_galaxyapps_mode_e mode, iap_galaxyapps_reply_cb reply_cb, void *user_data response typedef void * iap_galaxyapps_reply_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data common result key value type description merrorcode int error code number merrorstring string error message mextrastring string extra result purchased item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller office mitemprice double item price in a local currency mitempricestring string currency code + pricefor example €7 99 mcurrencyunit string device user currency unitfor example $, won, or pound mcurrencycode string currency codefor example eur or gbp mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during the item registration mpaymentid string id of the payment mpurchaseid string purchase ticket id used to verify the purchase with the store iap server mpurchasedate string date of purchasefor example "2020-11-15 10 31 23" mverifyurl string server's url, which can be used in combination with other parameters to verify the purchase with the iap server mjsonstring string original json string code snippet /* purchase an item */ int ret = iap_galaxyapps_start_payment "item_id", iap_galaxyapps_commercial_mode, __purchase_cb, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } /* callback */ static void __purchase_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data { output_data value = {0,}; if result != iap_galaxyapps_error_none { iap_galaxyapps_get_value reply, "merrorstring", &value merrorstring ; /* error handling */ return; } /* get properties of the purchased item */ iap_galaxyapps_get_value reply, "mitemid", &value mitemid ; iap_galaxyapps_get_value reply, "mitemname", &value mitemname ; iap_galaxyapps_get_value reply, "mitempricestring", &value mitempricestring ; iap_galaxyapps_get_value reply, "mitemdesc", &value mitemdesc ; /* handle properties */ return; } get a list of purchased items to get a list of all items purchased from galaxy store, use the iap_galaxyapps_get_purchased_item_list or iap_galaxyapps_get_purchased_item_list_by_item_ids method for iap_galaxyapps_get_purchased_item_list , pass in the index of the first and last item, the item type, the start and end date, the callback function, and user data as parameters for iap_galaxyapps_get_purchased_item_list_by_item_ids , pass in the item ids separated by comma , , the callback function, and user data as parameters when the reply is delivered, the iap_galaxyapps_reply_cb callback is invoked with the iap_galaxyapps_h object that stores the query results to get the request result from the iap_galaxyapps_h object, use the iap_galaxyapps_get_value method if the request was successful, you can get all the item details from the iap_galaxyapps_h object using the iap_galaxyapps_foreach_item_info method request for details, see the iap_galaxyapps_get_purchased_item_list and iap_galaxyapps_get_purchased_item_list_by_item_ids int iap_galaxyapps_get_purchased_item_list int start_number, int end_number, const char *start_date, const char *end_date, iap_galaxyapps_reply_cb reply_cb, void *user_data int iap_galaxyapps_get_purchased_item_list_by_item_ids const char *item_ids, iap_galaxyapps_reply_cb reply_cb, void *user_data response typedef void * iap_galaxyapps_reply_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data common result key value type description merrorcode int error code number merrorstring string error message mextrastring string extra result mstartnumber int index of the first item on the list mendnumber int index of the last item on the list mtotalcount int total number of items based on the first and last item index purchased item details key value type description mitemid string item id numberthis is the same as the item id used in the request mitemname string name provided during the item registration in the seller portal mitemprice string item price in a local currency mitempricestring string currency code + price mcurrencyunit string device user currency unit mcurrencycode string currency code mitemdesc string item description provided during the item registration mitemimageurl string item image url provided during the item registration mitemdownloadurl string item download url provided during item registration mtype string item type 00 consumable01 nonconsumable02 nonrecurring subscription03 autorecurring subscription10 all mpaymentid string id of the payment mpurchaseid string id of the purchase mpurchasedate string date of purchasefor example "2020-11-15 10 31 23" msubscriptionenddate string if the item type mtype is 02 or 03, this is the due date mjsonstring string original json string code snippet int ret = iap_galaxyapps_get_purchased_item_list 1, 10, "20200101", "20221231", __get_purchased_item_list_cb, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } // item ids can be obtained by seperating the values returned by the iap_galaxyapps_get_item_list with comma , int ret = iap_galaxyapps_get_purchased_item_list_by_item_ids "item1,item2,item3", __get_purchased_item_list_cb, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } static bool __foreach_purchased_item iap_galaxyapps_h handle, void *user_data { output_data value = {0,}; /* get properties of the item */ iap_galaxyapps_get_value handle, "mitemid", &value mitemid ; iap_galaxyapps_get_value handle, "mitemname", &value mitemname ; iap_galaxyapps_get_value handle, "mitempricestring", &value mitempricestring ; iap_galaxyapps_get_value handle, "mitemdesc", &value mitemdesc ; /* handle properties */ return true; } /* callback */ static void __get_purchased_item_list_cb iap_galaxyapps_h reply, iap_galaxyapps_error_e result, void *user_data { if result != iap_galaxyapps_error_none { char *merrorstring = null; iap_galaxyapps_get_value reply, "merrorstring", &merrorstring ; /* error handling */ return; } /* retrieve all items contained in the handle */ int ret = iap_galaxyapps_foreach_item_info reply, __foreach_purchased_item, null ; if ret != iap_galaxyapps_error_none { /* error handling */ return; } return; } handling errors during the iap process, various errors can occur, for example, due to an unstable network, connection error, invalid account, or invalid product if an error occurs, your application receives the iap_galaxyapps_error_e error type in the iap_galaxyapps_reply_cb callback handle all errors appropriately error code error code description iap_galaxyapps_error_none successful iap_galaxyapps_error_payment_is_canceled payment canceled iap_galaxyapps_error_network_not_available network is not available iap_galaxyapps_error_io_error ioexception iap_galaxyapps_error_timed_out timeout exception iap_galaxyapps_error_initialization failure during iap initialization iap_galaxyapps_error_need_app_upgrade samsung iap upgrade is required iap_galaxyapps_error_common error while running iap iap_galaxyapps_error_already_purchased error when a non-consumable product is repurchased or a subscription product is repurchased before the product expiration date iap_galaxyapps_error_request_payment_without_info error when payment is requested without bundle information iap_galaxyapps_error_product_does_not_exist error when the requested item list is not available iap_galaxyapps_error_confirm_inbox the payment result is not received after requesting payment from the server, and the purchased item list is not confirmed iap_galaxyapps_error_not_exist_local_price the item is not for sale in the country iap_galaxyapps_error_not_available_shop iap is not supported in the country iap_galaxyapps_error_invalid_parameter invalid parameter iap_galaxyapps_error_key_not_found specified key is not found iap_galaxyapps_error_not_supported_device the device does not support iap iap_galaxyapps_error_out_of_memory out of memory iap_galaxyapps_error_permission_denied permission denied verify a purchase this server api enables your server and client app to verify that a specified in-app item purchase and payment transaction were successfully completed the api returns a json object with a successful status and details about a successful transaction and the item or with a failure status this api can help to prevent malicious purchases and ensure that purchase and payment transactions were successful when the client app experiences network interruptions after an item purchase and payment transaction request https //iap samsungapps com/iap/appsitemverifyiapreceipt as?protocolversion=2 0&purchaseid={purchaseid} the purchaseid is assigned by samsung iap your app receives it in the iap_galaxyapps_h object as response of iap_galaxyapps_start_payment and the key is mpurchaseid response noteresponse parameters may be added, changed, and deleted success { "itemid" "item01", "paymentid" "zpmtid20131122gbi0015292", "orderid" "s20200106kra1908790", "itemname" "test pack", "itemdesc" "iap test item best value!", "purchasedate" "2020-11-22 04 22 36", "paymentamount" "9 000", "status" "true", "paymentmethod" "credit card", "mode" "real", } fail { "status" "false" } notebesides verifying a purchase, samsung iap server api also obtains service token information and gets detailed information of an autorecurring subscription item purchase submit the app to galaxy store 1 check the operation mode after iap integration, you must check the operation mode before submitting the app if you submit the app with iap_galaxyapps_success_test_mode, the users will get all the items for free so, before beta release or normal publication, confirm if the operation mode is iap_galaxyapps_commercial_mode 2 submit the app when you have created an app version that is ready for review testing and normal publication, register the app and its in-app item, and then click submit for more details, see the app registration guide
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
You have successfully updated your cookie preferences.