Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Pay
apisamsung 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
Learn Code Lab
websamsung pay samsung wallet integrate samsung pay web checkout with merchant sites 30 mins start sdc24 samsung pay samsung wallet integrate samsung pay sdk flutter plugin into merchant apps for in-app payment 30 mins start sdc24 samsung wallet utilize add to samsung wallet service for digital cards 30 mins start sdc24 samsung wallet verify your id with samsung wallet 30 mins start sdc24 automotive create an android automotive operating system (aaos) app with payments via samsung checkout 30 mins start watch face studio apply gyro effects to a watch face using watch face studio 20 mins start sdc23 smartthings matter: create a virtual device and make an open source contribution 25 mins start sdc23 smartthings matter: build a matter iot app with smartthings home api 25 mins start sdc23 galaxy z develop a widget for flex window 25 mins start sdc23 samsung pay samsung wallet integrate in-app payment into merchant apps using samsung pay sdk 30 mins start sdc23 gamedev optimize game performance with adaptive performance in unity 30 mins start sdc23 gamedev galaxy z implement flex mode into a unity game 30 mins start sdc23 watch face studio customize styles of a watch face with watch face studio 30 mins start sdc23 watch face studio galaxy z customize flex window using good lock plugin on watch face studio 20 mins start sdc23 health measure skin temperature on galaxy watch 20 mins start sdc23 health transfer heart rate data from galaxy watch to a mobile device 30 mins start watch face studio design a watch face using mask and moon phase tags 30 mins start sdc22 bixby smartthings control a smart bulb 30 mins start sdc22 watch face studio apply conditional lines on watch faces 20 mins start sdc22 health measure blood oxygen level on galaxy watch 30 mins start sdc22 health measure blood oxygen level and heart rate on galaxy watch 40 mins start sdc22 galaxy z implement multi-window picture-in-picture on a video player 20 mins start sdc22 samsung blockchain transfer erc20 token with blockchain app 45 mins start sdc22 galaxy ar emoji gamedev use ar emoji on games and 3d apps 60 mins start sdc22 gamedev galaxy z implement flex mode on an unreal engine game 120 mins start sdc22 smartthings integrate iot devices into the smartthings ecosystem 45 mins start health create a daily step counter on galaxy watch 40 mins start health track deadlift exercise on galaxy watch 40 mins start watch face studio create a watch face using tag expressions 60 mins start galaxy z implement flex mode on a video player 30 mins start galaxy z implement app continuity and optimize large screen ui of a gallery app 40 mins start galaxy z configure an app to enable copy and paste in multi-window 30 mins start galaxy z configure an app to enable drag and drop in multi-window 30 mins start galaxy s pen remote implement keyevent.callback by mapping air actions 30 mins start galaxy s pen remote handle s pen's raw data 30 mins start samsung blockchain develop a secure blockchain app 40 mins start samsung blockchain develop a blockchain shopping app 40 mins start
Develop Samsung Pay
docsamsung pay service once setup is complete, you’re ready to add the sdk code within your partner app for calling the sdk’s apis and receiving callbacks api common flow when a partner app calls one of the sdk’s apis, the following interaction flow is processed to check whether the caller is authenticated and authorized before responding to the request the steps of the interaction are enumerated below the partner app calls an sdk api the sdk checks the call’s validity - is samsung wallet installed on the device? - is there any problem with the integrity of samsung pay on the device? sdk calls the samsung wallet app using aidl check the current status of the samsung wallet app - is samsung pay provisioning complete? - does samsung pay need a mandatory update? - is the samsung pay sdk api level higher than the sdk api level in the partner app? request verification of partner app eligibility status from the samsung pay server verify that the partner app matches the information registered in samsung pay developers samsung wallet app responds to the sdk request using aidl the sdk calls the callback function of the partner app checking samsung pay status the first step in implementing the samsung pay sdk within your partner app is to create the samsungpay instance and check the samsung pay status on the device to determine its support for samsung pay or lack thereof , and whether or not to display the samsung pay button to the user for selection as a payment option the samsung pay button also lets issuer apps add a card to samsung pay in both instances, the partner app must have valid partnerinfo to pass to samsungpay for caller verification to set its partnerinfo, the partner app passes its serviceid sid and servicetype, both of which are assigned by the samsung pay developers portal when you create the service used for checking blocked list and version control between the samsung pay sdk and the samsung wallet app on the device, you must set the servicetype in partnerinfo to call other samsung pay apis val serviceid = "partner_app_service_id" val bundle = bundle bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle after setting partnerinfo, your partner app can now call getsamsungpaystatus this method of the samsungpay class must be called before using any other feature in the samsung pay sdk noteif you want to get the status of samsung pay watch, you have to use the watchmanager class instead of the samsungpay class fun getsamsungpaystatus callback statuslistener the result is delivered to statuslistener and provides the following events onsuccess ‒ called when the requested operation is successful it provides the status of the request, as well as extra bundle data related to the request onfail ‒ called when the request operation fails it returns the error code and extra bundle data related to the request the samsung pay status code returned is one of the following spay_not_supported - indicates samsung wallet is not supported on this device; typically returned if the device is incompatible with samsung pay or if the samsung wallet app is not installed spay_not_ready - indicates samsung wallet is not completely activated; usually returned if the user did not complete a mandatory update or if the user has not signed in with a valid samsung account in which case, the partner app can activate or update the samsung wallet app on the device according to the 'extra_error_reason' bundle keys below error_spay_setup_not_complete - tells the partner app to display a popup message asking if the user wishes to activate samsung pay if the user agrees, the partner app calls activatesamsungpay to activate the samsung wallet app error_spay_app_need_to_update - tells the partner app to display a popup message asking if the user wishes to update samsung pay if user agrees, the partner app calls gotoupdatepage to open the app update page error_partner_info_invalid - indicates that partner app information is invalid; typically the partner app is using a sdk version that is not allowed, an invalid service type, or the wrong api level error_partner_sdk_api_level - tells the partner app it is using the wrong api level to resolve the error condition, the partner app must set a valid api level error_partner_service_type - tells the partner app that it did not set a service type, or that the service type it did set is invalid service type is set in partnerinfo spay_ready - indicates that samsung pay is activated and ready to use; typically returned after the user completes all mandatory updates and signs in extra bundle data can have the following values extra_country_code - for both onsuccess and onfailure , this is the current device’s country code iso 3166-1 alpha-2 set by samsung pay if the partner app is not supported in this particular country, the partner app can decide not to display samsung pay button extra_error_reason - for onfailure , this is the reason for failure set by samsung pay when the returned status code is spay_ready, the partner app can safely display the samsung pay button for user selection as a payment option, card provisioning, and so on the following sample code shows how to use the getsamsungpaystatus api method val serviceid = "partner_app_service_id" val bundle = bundle bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle val samsungpay = samsungpay context, partnerinfo /* * method to get the samsung pay status on the device * partner issuers, merchants applications must call this method to * check the current status of samsung pay before doing any operation */ samsungpay getsamsungpaystatus object statuslistener { override fun onsuccess status int, bundle bundle { when status { samsungpay spay_not_supported -> // samsung pay is not supported samsungpaybutton setvisibility view invisible samsungpay spay_not_ready -> { // activate samsung pay or update samsung pay, if needed samsungpaybutton setvisibility view invisible val errorreason = bundle getint samsungpay extra_error_reason if errorreason == samsungpay error_setup_not_completed { // display an appropriate popup message to the user samsungpay activatesamsungpay } else if errorreason == samsungpay error_spay_app_need_to_update { // display an appropriate popup message to the user samsungpay gotoupdatepage } else { toast maketext context, "error reason $errorreason", toast length_long show } } samsungpay spay_ready -> // samsung pay is ready samsungpaybutton setvisibility view visible else -> // not expected result samsungpaybutton setvisibility view invisible } } override fun onfail errorcode int, bundle bundle { samsungpaybutton setvisibility view invisible log d tag, "checksamsungpaystatus onfail $errorcode" } } activating the samsung wallet app the samsungpay class provides the following api method to activate the samsung wallet app on a device fun activatesamsungpay activatesamsungpay is called to activate the samsung wallet app on the same device on which the partner app is running first, however, the partner app must check the samsung pay status with a getsamsungpaystatus call see section 4 2 above if the status is spay_not_ready and extra_error_reason is error_spay_setup_not_complete, the partner app needs to display an appropriate message to user, then call activatesamsungpay to launch the samsung wallet app so the user can sign in here’s an example of how to code this val serviceid = "partner_app_service_id" val bundle = bundle bundle putstring samsungpay partner_service_type, spaysdk servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle val samsungpay = samsungpay context, partnerinfo samsungpay activatesamsungpay updating the samsung wallet app the samsungpay class provides the following api method to update the samsung wallet app on the device fun gotoupdatepage gotoupdatepage is called to update samsung wallet app on the same device on which the partner app is running as with all api calls, the partner app must first check the samsung pay status with getsamsungpaystatus if this returns spay_not_ready and extra_error_reason is error_spay_app_need_to_update, then the partner app needs to display an appropriate message to the user and call gotoupdatepage , which launches the samsung pay update page the following code sample reflects how to update samsung pay val serviceid = "partner_app_service_id" val bundle = bundle bundle putstring samsungpay partner_service_type, spaysdk servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle val samsungpay = samsungpay context, partnerinfo samsungpay gotoupdatepage
Develop Samsung Pay
docsamsung pay sdk and services for purposes of integrating the samsung wallet app with partner apps developed by both merchants and payment card issuers for samsung devices and is intended for no other purpose the accompanying use cases and related code samples are simply meant to serve as representative examples and not as recommendations or requirements please be aware that certain samsung pay apk behavior may not be exactly the same in different countries due to regulatory restrictions in each one use the samsung and samsung pay documentation specific to the market you are working in and test your integrated project in accordance with the instructions given for that market/country samsung pay sdk the android sdk offers an easy-to-use api application programming interface that you may use to integrate payment functionality into your apps push provisioning, processing payment requests, obtaining payment data, and managing payment transactions are all services available through the api web checkout sdk online applications can use the straightforward and user-friendly interface provided by the samsung web checkout sdk to accept payments the sdk's adaptability enables web application developers to modify the checkout procedure to meet their own requirements save to pay provides integration interface for end users to provision payment cards from website into the samsung wallet app using desktop computer, tablet device or mobile minimal partner effort and a very straightforward integration interface are two design objectives of save to pay overall, the samsung pay offers developers strong and adaptable platforms to integrate payment functionality into their apps the samsung pay is a great option for developers who want to provide their users with a smooth payment experience inside of their apps because it supports a broad variety of payment methods, has a secure payment processing system, and is simple to use samsung pay integration life cycle integrating samsung pay to your application has following five steps step-1 register as a member to develop a samsung pay sdk service, merchants and issuers need to register for an account with samsung pay developers in order to create the appropriate service type for their applications here is the guide on becoming a member become a member step-2 configure your project configure your project by creating services and registering application in the samsung pay developers portal according to your chosen sdk create services https //pay samsung com/developers/tour/memberguide register apps https //pay samsung com/developers/tour/appsguide manage services and apps https //pay samsung com/developers/tour/svcnappsguide step-3 integrate with samsung pay follow the below guidelines for specific sdk integration process android sdk https //developer samsung com/pay/native/common-api html web checkout sdk https //developer samsung com/pay/web/overview html save to pay https //developer samsung com/pay/save2pay/overview html step -4 test and validate testing your application is critical to validating samsung pay push provisioning performance or samsung pay transaction performance this will ensure a positive user experience for your users and an effective business channel for your company in fact, the goal of testing is not merely to find errors but to fully understand the quality of the samsung pay integration step-5 release you need to get release version approval from samsung via samsung pay developers portal once you are approved, you can proceed to make your application live and monitor user satisfaction
Develop Samsung Pay
docsamsung pay sdk is an application framework for integrating selected samsung wallet features with android-based partner apps on samsung devices the following major operations are supported in-app payment gives customers the option of paying for products and services with samsung wallet push provisioning allows customers add a bank card to samsung wallet from the issuer app by providing the required card details to integrate your partner application with the samsung pay sdk, the following components are included your sdk download samsungpay jar contains classes and interfaces of the samsung pay sdk which need to be integrated to partner apps javadoc provides descriptions of the apis included in the samsung pay sdk, along with sample code showing how to use them sample merchant app and sample issuer app showing how samsung pay apis can be coded in a finished android project all major operations of samsung pay sdk are implemented for demonstration purposes samsung pay sdk architecture the following diagram shows a high-level architecture revealing the general interactions between the samsung pay sdk and a partner app viewed at this level, the partner apps leverage the samsung pay sdk to perform the operations shown ― push provisioning and opening favorite cards for issuers; online payments for merchants ― with samsung pay the key components involved are partner app - merchant- or issuer-developed app for making online/offline payments and provisioning payment cards through samsung wallet samsung pay sdk - sdk integrated into the partner app for direct communication with samsung wallet samsung wallet app - wallet app that the samsung pay sdk communicates with financial network - comprises the payment gateways, acquirers, card associations, and issuers that participate in transaction processing under agreement with the merchant the main classes comprising the samsung pay sdk include samsungpay – used by the partner app to get the samsung pay sdk information and the status of samsung wallet app on the device paymentmanager – provides payment/transaction functionality cardmanager – manages card list get, add, update functionality watchmanager – manages all functions related to samsung pay watch cardinfolistener – interface for requestcardinfo result from samsung wallet customsheettransactioninfolistener – interface for transaction success/failure callbacks from samsung wallet use case in-app payment the most common in-app online payment use cases take the following form merchant app presents user with the option of making payment with samsung wallet upon the user selecting the samsung pay option, the merchant app calls the apis included in the samsung pay sdk to initiate a transaction with samsung wallet app samsung wallet app responds with the tokenized payment information necessary to complete the transaction merchant app forwards this payment information to the designated payment gateway pg , either directly through the merchant's web server, or indirectly via the samsung-pg interface server for normal transaction processing use case app-to-app push provisioning the push provisioning use case ― adding payment cards to samsung wallet from the card issuer’s app ― typically takes this form the user logs into the issuer app the issuer app checks if samsung wallet is activated on the device and ready to use if it is in the ready status, the issuer app displays an add button for cards not currently registered/enrolled with the samsung wallet app if the add card option is selected, the issuer app calls an api to push the proper payload data to samsung wallet while the card is being provisioned, samsung wallet stays in background setting up sdk development environment the importance of maintaining a good development environment cannot be overstated for integrating the samsung pay sdk with your partner app, the following prerequisites and recommendations help ensure a successful sdk implementation system requirements the samsung pay sdk is designed exclusively for samsung mobile devices supporting samsung pay and running android lollipop 5 1 android api level 22 or later versions of the android os the sdk’s in-app payments functionality requires android 6 0 m android api level 23 or later versions of the android os note as of sdk version 1 5, if the device runs android lollipop 5 1 android api level 22 or an earlier version, the getsamsungpaystatus api method returns a spay_not supported status code merchant apps still using samsung pay sdk 1 4 or earlier not recommended must check the android version running their app use the following snippet to determine the os version running on a device and whether or not to display the samsung pay button in your partner app import android os build; // in-app payment supported on android m or above // check android version of the device if build version sdk_int < build version_codes m { //hide samsung pay button } service registration to develop a samsung pay sdk service, merchants and issuers need to register for an account with samsung pay developers in order to create the appropriate service type for their applications here are some helpful links inside the portal become a member https //pay samsung com/developers/tour/memberguide create services https //pay samsung com/developers/tour/svcguide register apps https //pay samsung com/developers/tour/appsguide manage services and apps https //pay samsung com/developers/tour/svcnappsguide add samsung pay sdk to your project be sure to do the following before attempting to use the sdk if not already part of your environment, download and install an ide android studio is recommended download the samsung pay sdk the sdk package has the following directory structure folder contents docs javadoc – api reference documentation libs samsungpay jar sdk java archive file – contains the samsung pay apis to be used by your partner app samples sample apps configure your ide to integrate the samsung pay sdk with your partner app a add samsungpay jar to the libs folder of your android project b go to gradle scripts > build gradle and enter the following dependency dependencies { compile files 'libs/samsungpay jar' } c import the sdk package into your code import com samsung android sdk samsungpay v2; proguard rules if your app s have any issue with proguard, the following rules are recommended dontwarn com samsung android sdk samsungpay ** -keep class com samsung android sdk ** { *; } -keep interface com samsung android sdk ** { *; } when dexguard is employed, the following additional rules apply -keepresourcexmlelements manifest/application/meta-data@name=spay_sdk_api_level android r os targetsdkversion 30 informationfrom android r os if the target sdk version is 30 , you must include the following <queries> element in the androidmanifest <?xml version="1 0" encoding="utf-8"?> <manifest xmlns android="http //schemas android com/apk/res/android" xmlns tools="http //schemas android com/tools" package="xxx xxx xxx xxx"> <queries> <package android name="com samsung android spay" /> <package android name="com samsung android samsungpay gear" /> </queries> configuring api level api level attributes as of sdk version 1 4, enhanced version control management has been introduced to improve backward compatibility and handle api dependency from country and service type for example, if a partner integrates the latest sdk―for instance, api level 2 22―but continues to use apis based in level 1 4, the partner app remains compatible with samsung wallet apps supporting api level 1 4 without the necessity of upgrading the samsung pay app the chief characteristics and properties of the api level include every api starting from version 1 4 has an api level assigned based on the sdk version number in which it is introduced the sdk’s javadoc reference can be filtered by api level so you can determine the minimum api level you need to configure in the metadata section of your app’s androidmanifest file the earliest possible version is 1 4 this lets you use the api level defined in your androidmanifest without having to trigger an upgrade of the samsung wallet app on the user’s device implement the following usage in your androidmanifest <application <meta-data android name="spay_sdk_api_level" android value="2 22" /> // most recent sdk version is recommended to leverage the latest apis but it need to be set to 2 17 for russia </application> partner app verification in partner verification process samsung pay sdk verify your registered app, version in samsung pay portal and service it also determines device and app compatibility your app needs to verify the presence of the samsung wallet app on the device, its status, and whether or not its version is sufficient to support your implementation of the sdk appendix a common terminology terminology description aavs automatic add value service aidl android interface definition language for communication merchant a business entity engaged in retail e-commerce that provides an online checkout service for purchasing its products and/or services to registered end users issuer financial institution empowered to issue credit and/or debit payment cards to qualified consumers and businesses payment gateway pg e-commerce app service provider equipped to authorize credit card payments for e-businesses, online retailers, bricks and clicks, or traditional brick and mortar payment token secure method for payment ensuring that a cardholder’s information is not exploited by unauthorized parties samsung pay samsung’s proprietary mobile wallet app and payment system samsung pay service the server and service components of samsung pay samsung pay watch samsung pay app on samsung galaxy watches to support payment system eligibility check a query by third-party apps to check whether or not samsung pay is supported/activated/ready-to-use on a samsung device mst magnetic secure transmission tui trusted user interface
Develop Samsung Pay
apisamsung pay from merchant since api level 1 1 see also paymentmanager startsimplepay cardinfo, statuslistener constructor summary constructors constructor description builder method summary all methodsinstance methodsconcrete methods modifier and type method description cardinfo build builds the cardinfo object cardinfo builder setcardid string cardid api to set unique identification of a card in samsung pay cardinfo builder setcardmetadata android os bundle cardmetadata api to set extra card information if any related to the card methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait constructor details builder public builder method details setcardid @nonnull public cardinfo builder setcardid string cardid api to set unique identification of a card in samsung pay parameters cardid - unique id to refer a card in samsung pay returns cardinfo details builder since api level 1 1 see also paymentmanager startsimplepay cardinfo, statuslistener setcardmetadata @nonnull public cardinfo builder setcardmetadata android os bundle cardmetadata api to set extra card information if any related to the card returns extra card information since api level 1 1 see also paymentmanager startsimplepay cardinfo, statuslistener build @nonnull public cardinfo build builds the cardinfo object returns cardinfo object since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apisamsung pay app dies abnormally void onresult list<cardinfo> cardresponse this callback is received when the card information is received successfully method details onresult void onresult list<cardinfo> cardresponse this callback is received when the card information is received successfully parameters cardresponse - cardinfo list null, if samsung pay does not have any card for online payment otherwise, card list of supported card brands is returned since api level 1 1 onfailure void onfailure int errorcode, android os bundle errordata this callback is received when the card information cannot be retrieved for example, when sdk service in the samsung pay app dies abnormally parameters errorcode - error code, the reason for failure errordata - extra error data provided by samsung pay since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apisamsung pay for payment show both address lists on the payment sheet need_billing_send_shipping merchant requires billing address from samsung pay and sends the shipping address for payment show both billing and shipping address on the payment sheet need_billing_spay merchant requires billing address from samsung pay for payment show only billing address list on the payment sheet need_shipping_spay merchant requires shipping address from samsung pay for payment send_shipping merchant will send the shipping address for payment show only shipping address shared by merchant as fixed value on the payment sheet field summary fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value method summary all methodsstatic methodsconcrete methods modifier and type method description static customsheetpaymentinfo addressinpaymentsheet valueof string name returns the enum constant of this class with the specified name static customsheetpaymentinfo addressinpaymentsheet[] values returns an array containing the constants of this enum class, in the order they are declared methods inherited from class java lang enum compareto, describeconstable, equals, getdeclaringclass, hashcode, name, ordinal, tostring, valueof methods inherited from class java lang object getclass, notify, notifyall, wait, wait, wait enum constant details do_not_show public static final customsheetpaymentinfo addressinpaymentsheet do_not_show shipping and billing address are not required for payment do not display address on the payment sheet need_billing_spay public static final customsheetpaymentinfo addressinpaymentsheet need_billing_spay merchant requires billing address from samsung pay for payment show only billing address list on the payment sheet user could select one on the payment sheet need_shipping_spay public static final customsheetpaymentinfo addressinpaymentsheet need_shipping_spay merchant requires shipping address from samsung pay for payment show only shipping address list on the payment sheet user could select one on the payment sheet send_shipping public static final customsheetpaymentinfo addressinpaymentsheet send_shipping merchant will send the shipping address for payment show only shipping address shared by merchant as fixed value on the payment sheet unlike need_billing_spay or need_shipping_spay, user will not be able to change the shipping address on the payment sheet need_billing_send_shipping public static final customsheetpaymentinfo addressinpaymentsheet need_billing_send_shipping merchant requires billing address from samsung pay and sends the shipping address for payment show both billing and shipping address on the payment sheet unlike need_billing_spay or need_shipping_spay, user will not be able to change the shipping address on the payment sheet need_billing_and_shipping public static final customsheetpaymentinfo addressinpaymentsheet need_billing_and_shipping merchant requires billing and shipping address from samsung pay for payment show both address lists on the payment sheet user could select billing and shipping address from the list on the payment sheet method details values public static customsheetpaymentinfo addressinpaymentsheet[] values returns an array containing the constants of this enum class, in the order they are declared returns an array containing the constants of this enum class, in the order they are declared valueof public static customsheetpaymentinfo addressinpaymentsheet valueof string name returns the enum constant of this class with the specified name the string must match exactly an identifier used to declare an enum constant in this class extraneous whitespace characters are not permitted parameters name - the name of the enum constant to be returned returns the enum constant with the specified name throws illegalargumentexception - if this enum class has no constant with the specified name nullpointerexception - if the argument is null samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
docsamsung pay logo toolkit samsungpaylogotoolkit v3 0 0 7 6mb april 07, 2025 buttons assets samsung pay buttons assets 2025 8 1mb april 07, 2025 android sdk samsung pay sdk samsung pay android sdk v2 22 00 1 5 mb jan 14, 2024 open source announcement open source announcement samsung pay sdk 231 98 kb sept 12, 2023 spay sdk flutter plugin samsung pay sdk flutter plugin samsung pay sdk flutter plugin v1 01 00 1 3 mb oct 02, 2024 api reference api_reference_spaysdk_flutterpluginv1 01 00 1 0 mb oct 02, 2024
Develop Samsung Internet
docsamsung pay, to facilitate payment transactions samsung internet browser leverages the w3c payment request api to support samsung pay as a payment method for web purchases chrome also supports a samsung pay web payment method why integrate samsung pay into your website? samsung pay is accepted at more retail locations than any other mobile payment service available because of its unique ability to transact with newer nfc-supported payment terminals and legacy payment terminals it continues to enjoy the best user reviews among mobile payment apps now available for mobile website integration, samsung pay is secure, easy to set up, simple to use, and pre-installed on all new samsung galaxy-class smartphones when integrated with your website, samsung pay presents your users with a common checkout process that leverages samsung pay’s secure purchase authentication technology, eliminating manual entry or re-entry of card details and shipping destinations checkout is streamlined, conversions are maximized, and the exposure of sensitive data is kept to the absolute minimum simplifying the transaction process the benefits of the new process, certainly from an end-user perspective, is that the previous tedium ― request, authorization, payment, and result ― can now be handled in a single step for the web developer, it entails a single javascript api call for samsung pay users, there’s no change at all in the way a payment card is selected and authenticated after selecting the desired merchandise from the merchant’s web site, the user initiates checkout, selects samsung pay as the preferred payment method, authenticates with a fingerprint or pin, and voila ― payment complete that’s the user experience at its most basic when properly implemented, the api also supports editing the billing/shipping address in samsung pay and selecting a different enrolled card before approving the transaction with a fingerprint scan or entering a pin in terms of convenience, it’s a remote shopper’s dream ― no complicated, input-intensive forms to fill out, no fumbling for a plastic card to enter the account number, card expiration, and security code, and no worrying that someone other than the legitimate cardholder is attempting to make the payment meanwhile, samsung pay’s tokenized payload securely protects the transaction from intercept and replay attacks about this guide intended for web developers with a working knowledge of javascript and json, this guide takes you through the complete process of onboarding as a samsung pay merchant partner, creating/registering the w3c service for your domain, adding the w3c payment request object to your website, then testing and releasing your merchant website offering samsung pay as a payment method let's get started determining your gateway integration mode the api methods for integrating samsung pay with your website depend on the type of payment token your payment gateway pg handles — either gateway tokens or network tokens samsung pay supports requests for both types for instance, if stripe is your pg, you will want to request a gateway token from samsung pay on the other hand, if you’re using first data, you’ll want to request an encrypted network token bundle, for which you handle the token decryption yourself or work with the pg first data in this case to handle decrypting the token bundle the process begins when your merchant website makes a payment request and passes all required information to the browser, which then determines compatibility between the accepted payment methods for your website and the methods apps installed on the target device let’s take a brief look at how each integration mode — gateway token and network token — works with samsung pay gateway token mode although samsung pay doesn’t process the payment, your merchant website will still need to invoke the appropriate payment gateway apis to charge and process the token returned by your pg hence, when samsung pay returns a gateway token from stripe, for example, the recommended flow looks like this user selects samsung pay as the payment method at checkout in the merchant's website and the samsung pay app requests partner verification from the samsung pay online payment server encrypted payment information and the partner id are passed to the samsung-pg interface server samsung-pg interface server sends a transaction authorization request to the pg on behalf of the merchant; pg authenticates the partner id before generating a transaction reference id samsung-pg interface server returns the payment token to the pg i e , the gateway token it received from the samsung pay app in step 2 pg continues payment processing with the acquirer and payment network the result approved/declined is returned to the merchant website on the device for display to the user in this mode, samsung pay makes a call to your pg on your behalf and returns a chargeable gateway token network token mode under network token mode, the samsung pay api returns an encrypted network token bundle, which you can then either decrypt yourself or leverage the apis of your pg first data, for example to handle decryption and charge the token user selects samsung pay as the payment method at checkout in the merchant's website and the samsung pay app requests partner verification from the samsung pay online payment server encrypted payment information is passed from the samsung pay app to the pg through the merchant app via the pg sdk applying the merchant's private key, pg decrypts the payment information structure and processes the payment through the acquirer and payment network upon receiving authorization or rejection, pg notifies the merchant website through its pg sdk to simplify integration of network tokens, you can pass the encrypted payload directly to your pg and let it handle decryption in general, decrypting the payload yourself is more complex and involves private key management see your particular pg’s documentation for details once you determine which mode your pg supports, you're ready to register with the portal first, however, there are a number of prerequisites you'll need to satisfy prerequisites registering with the samsung pay developers portal and adapting the appropriate payment request apis for your website in accordance with the guidance contained herein will help to ensure a successful implementation to that end, the following requirements apply release contents minimum samsung pay app version 2 8 xx minimum samsung internet browser version 5 4 minimum chrome browser version 61 supported device models samsung galaxy-class smartphones running minimum version of the wallet app and browser supported payment gateways pgs view the most current list in the portal's payment gateway drop-down menu in service create/edit mode see step 5 under registering your domain for the w3c service registering with the portal through the samsung pay developers portal you can access valuable resources to help you manage the samsung pay features you incorporate into you partner app, including the ability to create multiple samsung pay service groups so you can use different services without the need to create multiple accounts invite co-workers to the portal to help you manage samsung pay features for your website register your website with samsung pay configure your samsung pay w3c service s to create a member account on the samsung pay developers portal open a browser like chrome, go to https //pay samsung com/developers, click sign up and confirm/acknowledge that you accept the samsung pay terms and conditions and understand the privacy policy, then do one of the following a if you already have a valid samsung account, click sign up and enter your samsung account id and password b if you do not have a samsung account, click create a samsung account to create one open the account activation email you receive and click the account activation link if you’re the first samsung pay member of your company to register, select the first option, click next, and complete a company and user profile if, on the other hand, you were given a samsung pay partner id by a co-worker, select the second option — my company is already registered — and enter your company’s partner id in the field provided, then click next after you receive notification by email that your membership is approved, typically within 2 business days, return to https //pay samsung com/developers, click sign in and enter your samsung account id and password for site access as a new member registering your domain for the w3c service your domain is the url associated with your website, whether in test or production the service type specifically associates w3c with your domain once you create the service, you will be prompted to configure the domain you want associated with it to create a new service go to my projects > service management and click create a new service select for test to define the service for initial integration with samsung pay, then click next select w3c mobile web payments as the service type and click next enter a service name and select “united states” as the service country select a payment gateway from the list of supported pgs if your payment gateway uses the network token mode, upload the certificate signing request csr you obtained from your pg supported formats are csr or pem contact your pg for details otherwise, key management is already established for pgs supporting samsung pay’s gateway token mode; hence, click connect with to create a new service connection with the pg and click ok enter the payment domain name s for your website in the service domain field and click add for example, if your domain is mywebstore com but the checkout page is hosted on the subdomain payments mywebstore com, you’ll need to enter payments mywebstore com as the service domain in the portal for each additional domain name, click add notewhen entering the domain name on the portal, do not include an https // prefix confirm your agreement with the terms and conditions, then click next adding w3c payment requests objects to your website in order to accept payments from samsung pay, your website must adhere to the w3c payment request api specification you can get started with the basics by completing the steps that follow and making the appropriate substitutions for your website step 1 feature detect prior making a w3c payment request, it’s wise to run a feature detect to ensure the browser in use supports the w3c payment request api if not, you should fall back to your traditional/normal checkout page example if window paymentrequest { // use payment request api } else { // fallback to traditional checkout window location href = ‘/checkout/traditional’; } step 2 create the paymentrequest constructor the first step is to create a paymentrequest object by calling the paymentrequest constructor, which has the following parameters methoddata – contains a list of payment methods that the website supports e g , visa, amex, samsung pay details – contains information about the shopping cart purchases e g , total, tax, fees, etc options – details pertaining to shipping address, user contact information, etc example var request = new paymentrequest methoddata, // required payment method data details, // required information about transaction options // optional parameter for things like shipping, etc ; step 3 add samsung pay to the methoddata parameter the methoddata parameter contains a list of payment methods supported by the merchant to support samsung pay, you’ll need to add it as a supported payment method notebasic-card is an optional supportedmethod for credit and debit cards saved in the browser, the card details of which are returned directly to the website from the browser before configuring this method, make sure your website and pg can handle generic payment information received from the browser and process with required pci compliance, if applicable see the [w3c basic card payment specification][7] for additional details be aware, however, that if you intend to support a branded samsung pay button, only samsung pay can be enabled as a payment method within the paymentrequest object; basic-card or any other payment method cannot be included if you already offer a generic payment request method, you can continue to do so — and include samsung pay as a payment method within that paymentrequest object from a user experience standpoint, the two distinct pathways look like this standard w3c implementation a standard w3c implementation adds samsung pay to your standard paymentrequest object as one of many supportedmethods available for user selection tapping checkout or its equivalent launches the standard browser payment sheet for user selection of the payment method and/or to add a debit/credit card to the list of options selecting samsung pay as the payment method and tapping pay launches the samsung pay payment sheet branded samsung pay implementation a branded implementation displays a "buy with samsung pay" button in place of your standard checkout button tapping the button will skip directly to the samsung pay payment sheet for authentication unless you specify paymentoptions if paymentoptions is not null, the browser payment sheet is launched see paymentoptions in step 7 for additional guidance first launching your website's checkout page is recommended for branded implementations this is because the samsung pay payment sheet only provides the user's billing address, which means your website will need to capture the user's preferred shipping address, where applicable for physical delivery of purchased goods if no shipping address and/or other options are needed, set the paymentoptions parameter to null as mentioned above, if you populate paymentoptions, the browser payment sheet is automatically launched keeping the foregoing implementations in mind, let's look at how to construct the methoddata argument for the network token mode and gateway token mode, respectively the fields in methoddata comprise supportedmethods – required; specifies https //spay samsung com/ i e , the samsung pay app and other methods suppored by your website data – values specific to the method; for samsung pay, these include version specifies the data structure being used by the merchant; should always be set to 1 until further notice required productid the service id obtained from the samsung pay partner portal required for partner verification; see step #8 under registering your domain for the w3c service merchantgatewayparameter this is the userid value registered with your pg required for gateway token mode in addition, userid should be set in the request parameter for mada token if a merchan request mada token, this field is mandatory as this filed should be included in the payload for mada token, there is a 15-character length limit paymentprotocol defaults to “protocol_3ds,” the only protocol currently supported by samsung pay optional allowedcardnetworks specifies the card brands/networks accepted by the merchant and supported by the pg required merchantname the name of the merchant to be displayed on the payment sheet; must be identical to the merchant name registered on the samsung pay partner portal required ordernumber unique value for merchant use as an external reference id optional isrecurring specifies transaction on subscription basis optional; default = false billingaddressrequired determines if a billing address must be filled-in by the user optional; default = false shown next are examples of the methoddata parameter for each of the supported token modes please note that samsung pay's w3c support for card brands is currently limited to mastercard, visa and american express discover is scheduled for support soon example – network token mode var methoddata = [ { supportedmethods ['https //spay samsung com'], data { 'version' '1', // always 1 until further notice 'productid' '2bc3e6da781e4e458b18bc', // service id from partner portal 'allowedcardnetworks' ['mastercard','visa'], 'merchantname' 'shop samsung demo ', // merchantname must be identical to merchant name on portal 'ordernumber' '1233123', } }] example – gateway token mode var methoddata = [ { supportedmethods ['https //spay samsung com'], data { 'version' '1', // always 1 until further notice 'productid' '7qr7h9ws1872bc3e6da781', // service id from partner portal 'merchantgatewayparameter' {"userid" "acct_ 17irf7f6ypzj7wor"}, 'allowedcardnetworks' ['mastercard','visa'], 'merchantname' 'shop samsung demo ', //merchantname must be identical with merchant name on portal 'ordernumber' '1233123', } }] step 4 fill out the transaction details parameter the details parameter contains information about the transaction there are two major components a total, which reflects the total amount and currency to be charged, and an optional set of displayitems that indicate how the final amount was calculated this parameter is not intended to be a line-item list, but is rather a summary of the order’s major components subtotal, discounts, tax, shipping costs, etc example var details = { displayitems [ { label "total of all items", amount { currency "usd", value "65 00" }, // us$65 00 }, { label "friends & family discount", amount { currency "usd", value "-10 00" }, // -us$10 00 pending true // the price is not yet determined } ], total { label "total", amount { currency "usd", value "55 00" }, // us$55 00 } } step 5 check eligibility to display samsung pay button if you do not support basic-card and you try to call show in step 6 when samsung pay or any other supportedmethod is not present on the device, the returned promise will reject with the following error domexception the payment method is not supported you can, however, check beforehand to see if the user has an available/supported method set up this is done with the canmakepayment method, which tells you whether the user has a payment method that can fulfill the current payment request example – canmakepayment const paymentrequest = new paymentrequest supportedpaymentmethods, transactiondetails, options ; // if canmakepayment isn’t available, default to assume the method is supported const canmakepaymentpromise = promise resolve true ; // feature detect canmakepayment if request canmakepayment { canmakepaymentpromise = paymentrequest canmakepayment ; } canmakepaymentpromise then result => { if !result { // the user does not have a supported payment method // todo redirect to traditional checkout flow return; } // todo the user has a payment - call show } catch err => { // todo either fall back to traditional checkout or call show } ; notebranded samsung pay buttons can be found on the [samsung pay developers][8] portal under the resources tab direct cdn links will be available soon step 6 call the show method to display the payment sheet the payment sheet can be activated by calling its show method this method invokes the browser’s native ui so the user can examine the details of the purchase, add or change the information, and submit it for payment a promise, indicated by its then method and callback function, resolves what will be returned when the user accepts or rejects the payment request example – show request show then function paymentresponse { // process paymentresponse here paymentresponse complete "success" ; } catch function err { console error "uh oh, something bad happened", err message ; } ; step 7 handle the paymentresponse once the user approves the payment request by verifying the payment option and shipping option if provided , the show method’s promise resolves, resulting in a paymentresponse object comprised of the following fields methodname string indicating the chose payment method e g , visa details dictionary containing information for methodname shippingaddress shipping address of the user, if requested shippingoption id of the selected shipping option, if requested payeremail email address of the payer, if requested payerphone telephone number of the payer, if requested payername name of the payer, if requested here, it’s important to remember that the response from the payment request api must be submitted by the merchant in accordance with the pg’s integration model and apis in all cases, the samsung pay response is encapsulated within the paymentresponse details parameter, which comprises the following fields paymentcredential – contains the payment credential information necessary for processing the transaction with the pg in network token mode, this field includes 3ds data in gateway token mode, it includes token information network token mode type use “s” version 1 0 0; standard for payment authentication aka mastercard securecode, verified by visa, and american express safekey data encrypted payload value gateway token mode reference token id reference status authorized or rejected/declined billingaddress – contains the billing address and related attributes for the cardholder, possibly including country [iso3166] alpha-2 code; canonical form is upper case for example, “us” addressline[n] most specific part of the address; can include a street name, a house number, apartment number, a rural delivery route, descriptive instructions, or a post office box number region top level administrative subdivision of the country; can be a state, a province, an oblast, or a prefecture city city/town portion of the address dependentlocality dependent locality or sub-locality within a city; fused for neighborhoods, boroughs, districts, or uk dependent localities postalcode postal code or zip code, also known as pin code in india sortingcode bank sorting code; for example, in the british and irish banking industries, the sort code is a six-digit number, is usually formatted as three pairs of numbers, for example 12-34-56, identifying both the bank and the branch where the account is held languagecode [bcp47] language tag for the address, in canonical form; used to determine the field separators and the order of fields when formatting the address for display organization organization, firm, company, or institution at this address recipient name of the recipient or contact person this member may, under certain circumstances, contain multiline information; for example, it might contain “care of” information phone telephone number of the recipient or contact person paymentinfo – contains the payment information, including card_last4digits last four digits of the card’s dpan cardbrand currently, either mastercard or visa ordernumber merchant’s unique external reference id supplied in the original request’s methoddata parameter if the user pays with a credit card using the basic-card method, then the details response returned directly to your website from the browser will contain cardholdername, cardnumber, expirymonth, expiryyear, cardsecuritycode, billingaddress example request show then paymentresponse => { var paymentdata = { // payment method string, e g “amex” method paymentresponse methodname, // payment details contains payment information details paymentresponse details /* request details depends on pg token mode network - e g , first data; or gateway - e g , stripe ---------------------------------------------------------|------------------------------------------------------| * gateway token mode |* network token mode | * “details” { |* “details { | * “paymentcredential” { |* “method” “3ds”, | * “reference” “tok_1asceoyf6ypzj7f8se6grp0i”, |* “paymentcredential” { | * “status” “authorized” |* “type” “s”, | * }, |* “version” “100”, | * |* “data” “long_encrypted_payload_value”, | * |* }, | *--------------------------------------------------------|------------------------------------------------------| * “paymentinfo” { * “card_last4digits” “1489”, * “cardbrand” “mastercard”, * “ordernumber” “1233123”, * “billingaddress” { * “country” “usa”, * “addressline” [“chhccy”, “hdyxych”], * “region” “ca”, * “city” “mountain view”, * “dependentlocality” “”, * “postalcode” “94043”, * “sortingcode” “”, * “languagecode” “en”, * “organization” “”, * “recipient” “”, * “phone” “” * } * } * } * */ }; return fetch ‘/validatepayment’, { method ‘post’, headers { ‘content-type’ ‘application/json’ }, body json stringify paymentdata } then res => { if res status === 200 { return res json ; } else { throw ‘payment error’; } } then res => { paymentresponse complete “success” ; }, err => { paymentresponse complete “fail” ; } ; } catch err => { console error “error, something went wrong”, err message ; } ; once payment information is received from samsung pay, the website should submit the payment information to the merchant’s pg for transaction processing the ui will show a spinner while the request takes place when a response is received, the website should call complete to close the ui the website is then free to show an order complete or order confirmation page for user feedback as previously mentioned, you can simplify integration of network tokens by passing the encrypted payload directly to your pg and letting it handle decryption in all cases, how you handle a submitted network token depends on the payment gateway refer to your particular pg’s documentation for details paymentoptions is an optional parameter in thepaymentrequest constructor depending on your particular requirements, you may want additional information, such as the user’s shipping address for physical goods purchased and contact details for guest users paymentoptions currently comprises the following requestpayername true if payer name is required; otherwise, false requestpayeremail true if payer email address is required; otherwise, false requestpayerphone true if payer telephone number is required; otherwise, false requestshipping true if shipping address is required; otherwise, false shippingtype available label options “shipping/pickup/delivery” for indicating to user; solely for display purposes example var options = { requestpayeremail false, requestpayername true, requestpayerphone false, requestshipping true, shippingtype "delivery" } noteif any of the elements listed above are set to true, the browser payment sheet is launched; otherwise, the samsung pay payment sheet is displayed putting it all together let’s assemble the various code blocks into a prototype to demonstrate the w3c payment request api in action function onbuyclicked { const samsung_pay = 'https //spay samsung com'; if !window paymentrequest { // paymentrequest api is not available - forwarding to legacy form based experience location href = '/checkout'; } // setup var supportedinstruments = [{ supportedmethods [ samsung_pay ], // 'https //spay samsung com' data { "version" "1", "productid" "2bc3e6da781e4e458b18bc", //service id from partner portal "allowedcardnetworks" ['mastercard','visa'], "ordernumber" "1233123", "merchantname" "shop samsung demo ", //merchant name in partner portal "merchantgatewayparameter" {"userid" "acct_17irf7f6ypzj7wor"}, "isrecurring" false, "billingaddressrequired" false, "paymentprotocol" "protocol_3ds" } }]; var details = { displayitems [{ label 'original donation amount', amount { currency 'usd', value '65 00' } }, { label 'friends and family discount', amount { currency 'usd', value '-10 00' } }], total { label 'total due', amount { currency 'usd', value '55 00' } }; var options = { requestshipping true, requestpayeremail true, requestpayerphone true, requestpayername true }; // initialization var request = new paymentrequest supportedinstruments, details, options ; // when user selects a shipping address request addeventlistener 'shippingaddresschange', e => { e updatewith details, addr => { var shippingoption = { id '', label '', amount { currency ‘usd’, value ‘0 00’ }, selected true}; // shipping to us is supported if addr country === 'us' { shippingoption id = 'us'; shippingoption label = 'standard shipping in us'; shippingoption amount value = '0 00'; details total amount value = '55 00'; // shipping to jp is supported } else if addr country === 'jp' { shippingoption id = 'jp'; shippingoption label = 'international shipping'; shippingoption amount value = '10 00'; details total amount value = '65 00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details shippingoptions = []; return promise resolve details ; { // hardcoded for simplicity if details displayitems length === 2 { details displayitems[2] = shippingoption; } else { details displayitems push shippingoption ; } details shippingoptions = [shippingoption]; return promise resolve details ; } details, request shippingaddress ; } ; // when user selects a shipping option request addeventlistener 'shippingoptionchange', e => { e updatewith details => { // there should be only one option do nothing return promise resolve details ; } details ; } ; // show ui then continue with user payment info request show then result => { // post the result to the server return fetch '/pay', { method 'post', credentials ‘include’, headers { 'content-type' 'application/json' }, body json stringify result tojson } then res => { // only if successful if res status === 200 { return res json ; } else { throw 'failure'; } } then response => { // you should have received a json object if response success == true { return result complete 'success' ; } else { return result complete 'fail' ; } } then => { console log 'thank you!', result shippingaddress tojson , result methodname, result details tojson ; } catch => { return result complete 'fail' ; } ; } catch function err { console error 'uh oh, something bad happened ' + err message ; } ; } document queryselector '#start' addeventlistener 'click', onbuyclicked ; refer to the official w3c integration specs for additional details and definition testing once you have the code saved and loaded, you’re ready to test be sure to test your website or test domain on a device running samsung internet browser and with the samsung pay wallet app already set up and ready to go in accordance with the prerequisites cited above if you use a separate subdomain for your test environment, be sure to add it as an eligible service domain for the service you configured under registering your domain for the w3c service remember that any/all subdomains for production must also be added to the service, up to a maximum of 10 service domains again, please note that samsung pay’s webpay api currently supports mastercard and visa only support for american express and discover is under development and will be available soon be sure to test using the samsung internet and chrome mobile browser apps to test select samsung pay as the payment method by clicking on the branded samsung pay button branded implementations or the samsung pay radio button standard w3c implementations this should launch the samsung pay payment sheet authenticate payment validate your results end to end isolate issues in the log, debug, and test again contact your samsung pay rm to coordinate assistance with troubleshooting recommended test cases check if the samsung pay is available in the payment option on the website verify samsung pay logo on browser sheet verify order summary on the payment sheet verify “edit” and “pay” buttons on payment sheet verify purchased item in the summary verify the billing address on the payment sheet change the billing address try to change the card in payment sheet when only one card is enrolled in samsung pay try to change the card when multiple cards is enrolled in samsung pay verify the payment amount verify the payment options verify the payment completion screen verify merchant name on the payment sheet verify merchant domain name on the payments sheet verify “cancel” and “pay” buttons on browser sheet try to make payment with large amount larger than max allowed amount and verify the behavior make a payment using samsung pay with a card already added for the merchant’s website basic-card verify transaction notification after w3c purchase verify transaction notification after refund set payment options for shipping address and verify that browser payment sheet launches and captures shipping address input/changes by user verify that the shipping cost is updated based on a shipping address change and is reflected in the updated total amount release once your tests are successful and you are satisfied with the results, take the following steps to ready your integrated with samsung pay website for release go to the samsung pay developers portaland create a new release service sharing identical attributes with the service you successfully tested a click on service management, then click create new service b select for release pictured , then click next c select w3c mobile web payments as the service type, then click next d enter a "release" service name and select "united states" as the service country e select united states as the service country f select your payment gateway from the drop-down menu, then click connect with for gateway token mode or provide a valid csr for network token mode g enter your service domain and click add for each additional domain name, click add remember, when entering domain names on the portal, do not include a "https"//" prefix h confirm your agreement with the terms and conditions, then click next retrieve the service id from the service details page and enter copy-paste it into your website's methoddata object in place of the current testing service id when your service is approved by your samsung pay rm — as indicated in the status column of your service management dashboard — you're ready to release your integrated website to the public send queries concerning service package approval to webpayment@samsungpay com
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.