Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Blockchain
apipackage class tree deprecated index help com.samsung.android.sdk.coldwallet class scwservice java.lang.object com.samsung.android.sdk.coldwallet.scwservice public class scwservice extends java.lang.object class for the proxy to use the samsung blockchain keystore service. the keystore's hd wallet seed is bip-39 compatible see also: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki nested class summary nested classes modifier and type class and description static class scwservice.scwcheckformandatoryappupdatecallback callback for checkformandatoryappupdate api static class scwservice.scwgetaddresslistcallback callback for getaddresslist api static class scwservice.scwgetextendedpublickeylistcallback callback for getextendedpublickeylist api static class scwservice.scwsignbtctransactioncallback callback for signbtctransaction api static class scwservice.scwsignethpersonalmessagecallback callback for signethpersonalmessage api static class scwservice.scwsignethtransactioncallback callback for signethtransaction api static class scwservice.scwsignklaytransactioncallback callback for signklaytransaction api method summary all methods static methods instance methods concrete methods modifier and type method and description void checkformandatoryappupdate(scwservice.scwcheckformandatoryappupdatecallback callback) checks whether a mandatory update of samsung blockchain keystore is needed or not. void getaddresslist(scwservice.scwgetaddresslistcallback callback, java.util.arraylist<java.lang.string> hdpath) request to get a list of addresses that corresponds to a list of hd paths void getextendedpublickeylist(scwservice.scwgetextendedpublickeylistcallback callback, java.util.arraylist<java.lang.string> hdpath) request to get a list of extended public keys that corresponds to a list of hd paths static scwservice getinstance() return the instance of the keystore proxy object int getkeystoreapilevel() get api level which the keystore in the device supports java.lang.string getseedhash() get the pseudo seed hash which is randomly generated when the hd wallet created whenever the seed for the wallet is changed, this key shall be changed. int[] getsupportedcoins() get coin types supported by samsung blockchain keystore void signbtctransaction(scwservice.scwsignbtctransactioncallback callback, byte[] transaction, java.util.list<java.lang.string> hdpathlist, java.util.list<byte[]> utxotxlist, java.lang.string changehdpath) request to sign bitcoin transaction void signethpersonalmessage(scwservice.scwsignethpersonalmessagecallback callback, byte[] msg, java.lang.string hdpath) request to sign ethereum typed structured data void signethtransaction(scwservice.scwsignethtransactioncallback callback, byte[] transaction, java.lang.string hdpath) request to sign ethereum transaction void signklaytransaction(scwservice.scwsignklaytransactioncallback callback, byte[] transaction, java.lang.string hdpath, int networkid) request to sign klay transaction methods inherited from class java.lang.object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait method detail getinstance public static scwservice getinstance() return the instance of the keystore proxy object returns: the instance, or null if samsung blockchain keystore is not available on the device getkeystoreapilevel public int getkeystoreapilevel() get api level which the keystore in the device supports caution : you should check the api level before invoking any apis. otherwise, it will return scwapilevelexception. if keystore api level is lower than the required level, update the keystore app first via scwdeeplink.galaxy_store returns: api level since: api level 1 getseedhash public java.lang.string getseedhash() get the pseudo seed hash which is randomly generated when the hd wallet created whenever the seed for the wallet is changed, this key shall be changed. returns: null if keystore does not support wallet key, zero-length string if the wallet is not created. otherwise, wallet is created. since: api level 1 getsupportedcoins public int[] getsupportedcoins() get coin types supported by samsung blockchain keystore returns: array of coin types, scwcointype throws: scwapilevelexception - api level exception since: api level 1 see also: https://github.com/satoshilabs/slips/blob/master/slip-0044.md checkformandatoryappupdate public void checkformandatoryappupdate(@nonnull scwservice.scwcheckformandatoryappupdatecallback callback) checks whether a mandatory update of samsung blockchain keystore is needed or not. do not call this method in the background thread. if there is a mandatory update, you need to open the app update link, scwdeeplink.galaxy_store parameters: callback - result callback since: api level 1 getextendedpublickeylist public void getextendedpublickeylist(@nonnull scwservice.scwgetextendedpublickeylistcallback callback, @nonnull java.util.arraylist<java.lang.string> hdpath) request to get a list of extended public keys that corresponds to a list of hd paths parameters: callback - result callback hdpath - the hd path list to bring the public keys. the depth of a path should be between 3 and 6. for example, "m/44'/60'", "m/44'/60'/0'/0/0" since: api level 1 see also: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki getaddresslist public void getaddresslist(@nonnull scwservice.scwgetaddresslistcallback callback, @nonnull java.util.arraylist<java.lang.string> hdpath) request to get a list of addresses that corresponds to a list of hd paths parameters: callback - result callback hdpath - the hd path list to bring the addresses. the depth of a path should be between 3 and 6. for example, "m/44'/60'", "m/44'/60'/0'/0/0" since: api level 1 see also: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki signethtransaction public void signethtransaction(@nonnull scwservice.scwsignethtransactioncallback callback, @nonnull byte[] transaction, @nonnull java.lang.string hdpath) request to sign ethereum transaction parameters: callback - result callback transaction - a byte array of a rlp-encoded unsigned ethereum transaction hdpath - hd path that corresponds to public key needed for signing since: api level 1 signethpersonalmessage public void signethpersonalmessage(@nonnull scwservice.scwsignethpersonalmessagecallback callback, @nonnull byte[] msg, @nonnull java.lang.string hdpath) request to sign ethereum typed structured data parameters: callback - result callback msg - a byte array of raw message to be signed. the keystore will add "ethereum signed message:\n" prefix, so it should not be included in msg. hdpath - hd path that corresponds to public key needed for signing since: api level 1 see also: https://github.com/ethereum/eips/blob/master/eips/eip-712.md signklaytransaction public void signklaytransaction(@nonnull scwservice.scwsignklaytransactioncallback callback, @nonnull byte[] transaction, @nonnull java.lang.string hdpath, @nonnull int networkid) request to sign klay transaction parameters: callback - result callback transaction - a byte array of a raw transaction to be signed by samsung blockchain keystore. the transaction is same as the sigrlp value mentioned in klaytn's official document. hdpath - hd path that corresponds to public key needed for signing networkid - the klaytn network id, or the integer to identify the network. "8217" is klaytn cypress mainnet and "1001" is klaytn baobab testnet. since: api level 2 see also: https://docs.klaytn.com/node/en/installation/config signbtctransaction public void signbtctransaction(@nonnull scwservice.scwsignbtctransactioncallback callback, @nonnull byte[] transaction, @nonnull java.util.list<java.lang.string> hdpathlist, @nonnull java.util.list<byte[]> utxotxlist, @nonnull java.lang.string changehdpath) request to sign bitcoin transaction parameters: callback - result callback transaction - a byte array of a serialized unsigned bitcoin transaction to be signed by samsung blockchain keystore hdpathlist - a list of hd paths that corresponds to utxo's public key utxotxlist - a list of byte array of the serialized transaction which contain the utxo used in this transaction changehdpath - hd path that corresponds to the change address since: api level 2 see also: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki, https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki, https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
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 interface apptoappconstants all known implementing classes cardmanager, watchmanager public interface apptoappconstants this interface provides the common values of watchmanager and cardmanager since api level 2 5 field summary fields modifier and type field description static final int error_auth_code_expired this error indicates that auth code is expired this is returned as spaysdk extra_error_reason for error_verify_card error static final int error_auth_code_invalid this error indicates that auth code is invalid this is returned as spaysdk extra_error_reason for error_verify_card error static final int error_auth_code_max_try_reached this error indicates that maximum idnv try reached this is returned as spaysdk extra_error_reason for error_verify_card error static final int error_auth_code_type_invalid this error indicates that auth code type is invalid this is returned as spaysdk extra_error_reason for error_verify_card error static final int error_authentication_closed this error indicates that authentication is force closed during update card service static final int error_authentication_failed this error indicates that authentication is failed during update card service static final int error_authentication_not_ready this error indicates that authentication is not ready state during update card service static final int error_authentication_timed_out this error indicates that authentication is closed due to timeout during update card service static final int error_card_already_registered this error indicates that the requested operation is already done and this operation cannot be performed again this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_card_idv_not_supported this error indicates that the card does not support any idnv this is returned as spaysdk extra_error_reason for error_verify_card error static final int error_card_not_supported this error indicates that card is not supported this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_framework_internal this error indicates that an error occurred in payment framework while processing the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error for example, unable to load certificate from ta, unable to access payment framework db, and so on static final int error_invalid_card this error indicates that the card is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_invalid_cardinput this error indicates that the user entered invalid card information this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_max_card_num_reached this error indicates that the maximum number of card limit has reached and user cannot add more card to samsung pay this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_max_pan_provision_num_reached this error indicates that the limit number of enrollments of this pan has reached and user cannot add this pan this time static final int error_server_reject this error indicates that the server declined the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_tsm_fail this error indicates that tsm error is reported during card downloading static final int error_verify_card this error indicates that server was unable to verify the card operation this may be due to invalid verification code static final int error_wallet_id_mismatch this error indicates that wallet id is mismatch this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final string extra_app2app_intent key to represent app2app intent name defined by issuer server static final string extra_app2app_payload key to represent app2app payload sent by issuer server static final string extra_card_balance key to represent card balance static final string extra_card_status_reason key to represent extra card status for issuer app static final string extra_issuer_app_card_linked key to represent extra card information for card link field details error_verify_card static final int error_verify_card this error indicates that server was unable to verify the card operation this may be due to invalid verification code since api level 1 2 see also constant field values error_card_already_registered static final int error_card_already_registered this error indicates that the requested operation is already done and this operation cannot be performed again this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_framework_internal static final int error_framework_internal this error indicates that an error occurred in payment framework while processing the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error for example, unable to load certificate from ta, unable to access payment framework db, and so on since api level 1 2 see also constant field values error_invalid_card static final int error_invalid_card this error indicates that the card 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 error_invalid_cardinput static final int error_invalid_cardinput this error indicates that the user entered invalid card information this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_server_reject static final int error_server_reject this error indicates that the server declined the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_max_card_num_reached static final int error_max_card_num_reached this error indicates that the maximum number of card limit has reached and user cannot add more card to samsung pay this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_tsm_fail static final int error_tsm_fail this error indicates that tsm error is reported during card downloading this is for tsm solution only since api level 1 4 see also constant field values error_authentication_not_ready static final int error_authentication_not_ready this error indicates that authentication is not ready state during update card service since api level 1 8 see also constant field values error_authentication_failed static final int error_authentication_failed this error indicates that authentication is failed during update card service since api level 1 8 see also constant field values error_authentication_closed static final int error_authentication_closed this error indicates that authentication is force closed during update card service since api level 1 8 see also constant field values error_authentication_timed_out static final int error_authentication_timed_out this error indicates that authentication is closed due to timeout during update card service since api level 1 8 see also constant field values error_card_not_supported static final int error_card_not_supported this error indicates that card is not supported 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_max_pan_provision_num_reached static final int error_max_pan_provision_num_reached this error indicates that the limit number of enrollments of this pan has reached and user cannot add this pan this time user needs to contact issuer to resolve this issue 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_wallet_id_mismatch static final int error_wallet_id_mismatch this error indicates that wallet id is mismatch 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_auth_code_invalid static final int error_auth_code_invalid this error indicates that auth code is invalid this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_expired static final int error_auth_code_expired this error indicates that auth code is expired this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_max_try_reached static final int error_auth_code_max_try_reached this error indicates that maximum idnv try reached this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_type_invalid static final int error_auth_code_type_invalid this error indicates that auth code type is invalid this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_card_idv_not_supported static final int error_card_idv_not_supported this error indicates that the card does not support any idnv this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values extra_app2app_intent static final string extra_app2app_intent key to represent app2app intent name defined by issuer server since api level 1 1 see also constant field values extra_app2app_payload static final string extra_app2app_payload key to represent app2app payload sent by issuer server since api level 1 1 see also constant field values extra_card_balance static final string extra_card_balance key to represent card balance since api level 1 8 see also constant field values extra_card_status_reason static final string extra_card_status_reason key to represent extra card status for issuer app since api level 1 4 see also constant field values extra_issuer_app_card_linked static final string extra_issuer_app_card_linked key to represent extra card information for card link since api level 2 2 see also constant field values 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.