overview 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 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 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_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 getallcards android os bundle cardfilter, getcardlistener listener api to get all the cards from samsung pay for the given filter 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 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 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 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 following codes with bundle data 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 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 getallcards public void getallcards android os bundle cardfilter, 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 samsung electronics samsung pay sdk 2 19 00 - jun 12 2024