Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 class partnerinfo java lang object com samsung android sdk samsungpay v2 partnerinfo all implemented interfaces android os parcelable public class partnerinfo extends object implements android os parcelable this class holds the partner information any third party application using the samsung pay sdk is considered as partner app the third party application can be an issuer app bank app , merchant app, and so on since api level 1 1 nested class summary nested classes/interfaces inherited from interface android os parcelable android os parcelable classloadercreator<t extends object>, android os parcelable creator<t extends object> field summary fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value constructor summary constructors constructor description partnerinfo string serviceid constructor to create partner information partnerinfo string serviceid, android os bundle data constructor to create partner information method summary all methodsinstance methodsconcrete methods modifier and type method description android os bundle getdata api to get partner information extra extra data differs from partners string getserviceid api to get service id void setdata android os bundle data api to set partner information extra methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, wait, wait, wait constructor details partnerinfo public partnerinfo string serviceid constructor to create partner information parameters serviceid - unique id to represent the service partner should on-board with samsung pay developers to receive this id // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; partnerinfo pinfo = new partnerinfo serviceid ; // partner must set proper service type - since api level 1 4 bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; pinfo setdata bundle ; since api level 1 1 partnerinfo public partnerinfo string serviceid, android os bundle data constructor to create partner information parameters serviceid - unique id to represent the service partner should on-board with samsung pay developers to receive this id data - extra data which partner wants to pass to samsung pay if partner app integrates sdk v1 4 00 or higher, service type must be set in data bundle refer to the usage sample below extra data bundle key-value pairs are defined as follows keys values samsungpay#extra_issuer_name string issuername issuercode for korean issuers issuer mandatory merchant not required samsungpay#partner_service_type string samsungpay servicetype abc tostring since api level 1 4 this value is mandatory because it will be used to verify if the service type is allowed or not // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; string issuername = "mybank"; bundle bundle = new bundle ; // set issuername in case of issuers bundle putstring samsungpay extra_issuer_name, issuername ; // set service type - since api level 1 4 bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; since api level 1 1 method details getserviceid public string getserviceid api to get service id since api level 1 4, productid is replaced by serviceid returns service id since api level 1 4 getdata public android os bundle getdata api to get partner information extra extra data differs from partners for example, issuer app can set the samsungpay#extra_issuer_name with bundle returns extra data bundle passed to samsung pay since api level 1 1 setdata public void setdata android os bundle data api to set partner information extra extra data differs from partners for example, issuer app can set the samsungpay#extra_issuer_name with bundle if partner app integrates sdk v1 4 00 or higher, samsungpay#partner_service_type must be set in data bundle parameters data - extra data bundle passed to samsung pay 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 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 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 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
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.
These cookies gather information about your browser habits. They remember that you've visited our website and share this information with other organizations such as advertisers.
You have successfully updated your cookie preferences.