Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 payment class cardinfo java lang object com samsung android sdk samsungpay v2 payment cardinfo all implemented interfaces android os parcelable public class cardinfo extends object implements android os parcelable this class provides card information related to payment operations since api level 1 1 see also paymentmanager requestcardinfo bundle, paymentmanager cardinfolistener nested class summary nested classes modifier and type class description static class cardinfo builder this is builder class for constructing cardinfo object which is passed to samsung pay from merchant nested classes/interfaces inherited from interface android os parcelable android os parcelable classloadercreator<t extends object>, android os parcelable creator<t extends object> field summary fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value method summary all methodsinstance methodsconcrete methods modifier and type method description spaysdk brand getbrand api to get the card brand string getcardid api to get unique identification of a card in samsung pay android os bundle getcardmetadata api to get 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 method details getbrand public spaysdk brand getbrand api to get the card brand returns card brand types such as spaysdk brand americanexpress spaysdk brand mastercard spaysdk brand visa spaysdk brand discover spaysdk brand chinaunionpay spaysdk brand eci since api level 1 1 getcardid public string getcardid api to get unique identification of a card in samsung pay returns unique id to refer a card in samsung pay since api level 1 1 getcardmetadata public android os bundle getcardmetadata api to get extra card information if any related to the card returns extra cardinfo bundle since api level 1 5, spaysdk extra_last4_fpan and spaysdk extra_last4_dpan of the card which were used for the current transaction is included in customsheetpaymentinfo in case of onsuccess callback refer to paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
tutorials mobile
blogas businesses strive to enhance their mobile payment capabilities and provide seamless transaction experiences to users, integrating third-party payment solutions like samsung pay has become increasingly common. however, amid the excitement of implementing these solutions, developers often encounter challenges and pitfalls that can hinder the integration process and impact the overall user experience. in this blog, we show some of the most common mistakes developers make when integrating the samsung pay sdk, and offer practical insights and best practices to overcome these hurdles and ensure successful implementation and testing. pitfall 1: using an unofficial email id to implement the samsung pay sdk, the first step is to establish a partnership between your company and samsung. when submitting a partnership request, do so using your company's official email domain. this precaution is crucial, as partnership requests originating from non-official email addresses are prone to rejection by the samsung relationship manager. pitfall 2: providing the wrong issuer name while creating your service while creating a service for the push provisioning feature, you have to add the issuer names, meaning the names of your financial institution or bank. you must make sure to provide the correct names that have been registered with the card networks such as visa, mastercard and so on. if incorrect names are provided, the getallcard() api returns an empty list even though the card has already been added to the samsung wallet. to confirm your issuer name, first add your card to the samsung wallet application. tap on the card in the wallet application, open the more menu, and select customer services. the correct issuer name is listed on the “customer services” pane. to correct your issuer name for services that you have created: select my projects > service management. select the service name to open the service details page. select edit info. you can delete the incorrect issuer name and enter a new one. pitfall 3: using service id with an invalid effective date a common error that occurs during sdk integration is the error_expired_or_invalid_debug_key (-310) error. this error occurs in two cases: using a newly created service id without generating an expiration date of the service: after creating a service, if you check the edit info of the service details page, you will find that the debug effective data is blank. hence, you have to generate a date right after creating the service. using a service id with an expired debugging date: the service id provided by samsung pay portal remains valid for 90 days. after that time, the service expires. therefore, you must generate a date for debugging every 90 days. to generate or extend the validity date of the service: select my projects > service management. select the service name to open the service details page. select edit info. click generate new date. provide a samsung account for testing the application. this account is placed on the allow list for testing. click generate. the new expiration date of your service appears on the page. remember to extend the date after 90 days if you continue testing your application past that point. pitfall 4: configuring the release service with insufficient information it is essential to include the apk file when setting up the release service. failure to include the apk file will result in samsung pay’s relationship manager rejecting the service, leading to delays in the release process. additionally, ensure that you have correctly integrated the appropriate service id into your release application. pitfall 5: testing your application with a mismatched configuration samsung wallet uses the service id, package name, and apk signature for partner verification. if you test your application with an apk signature different from the one already registered in the samsung pay portal, samsung pay recognizes that the apk signature is inconsistent with the service id and produces the error code -6 (not_allowed). in conclusion, navigating the integration of the samsung pay sdk can present you with many challenges. but, armed with the knowledge shared here, you can steer clear of some potential pitfalls and ensure a smoother implementation process. by prioritizing thorough testing, adhering to best practices, and maintaining clear communication with samsung's support channels, you can mitigate risks and deliver a seamless payment experience to users.
Ummey Habiba Bristy
Develop Samsung Pay
docinitiate in-app payment the main classes and interfaces involved here are samsungpay– class for a merchant app to get samsung pay sdk information and the status of samsung pay on the device paymentmanager – class to provide payment/transaction functionality cardinfolistener – interface for requestcardinfo result callbacks from samsung wallet customsheettransactioninfolistener – interface for transaction success/failure callbacks from samsung wallet; payment information is provided with a success callback and must be used by the merchant app for processing the payment the flow pictured next captures the essential online payment api process between merchant apps integrated with the samsung pay sdk and samsung wallet and the merchant’s payment gateway pg reflected in the diagram above are the following operations check the ready status of samsung pay start the payment manager to establish the service binding and verify the merchant app get payment card information and the payment amount, including updates get/update the user’s billing and shipping addresses, including an updated payment amount if shipping charges will be incurred authenticate the user submit payment information to pg verify transaction success or failure token modes network vs gateway to complete the payment, the merchant’s designated payment gateway pg handles one of two types of tokens gateway tokens indirect or network tokens direct the samsung pay sdk supports both types the essential difference between the two types is who decrypts the token information network tokens require that the merchant app handles decryption of the token bundle or work with the pg to handle decryption, whereas gateway token decryption is handled by the pg via the samsung-pg interface server check with your pg to determine its specific requirements for payment processing regardless of the pg model employed, direct or indirect, the goal is to offer samsung pay as a secure payment method within your merchant app the most common use case involves the following general steps to make a purchase, the user selects to “buy” or got to checkout after adding items to a shopping cart now in checkout, the user selects a payment option; for example, either the merchant’s “standard” method or samsung pay upon selecting samsung pay, the user is presented with a payment sheet that allows for card selection and shipping address confirmation with the option to add/modify information for this order, whereupon the user * makes payment card selection from the list of enrolled cards * chooses to change or add the delivery address * enters required address information in the form presented and saves it * authenticates the payment method, amount, and delivery with a biometric verification fingerprint, iris… or pin checking registered/enrolled card information before displaying the samsung pay button, a partner app can query card brand information for the user’s currently enrolled payment cards in samsung wallet to determine if payment is supported with the enrolled card for example, if a merchant app accepts one card brand exclusively but the user has not registered any cards matching this brand in samsung wallet, the merchant app needs to determine whether or not to display the samsung pay button for this purchase checkout to query the card brand, use the requestcardinfo api method of the paymentmanager class the requestfilter is optional bundle data reserved for future use the merchant app does not need to set a value for it now however, before calling this method, cardinfolistener must be registered so its listener can provide the following events onresult - called when the samsung pay sdk returns card information from samsung wallet; returns information about enrolled cards or is empty if no card is registered onfailure - called when the query fails; for example, if sdk service in the samsung wallet app ends abnormally the following snippet shows how to retrieve the list of supported card brands from 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 paymentmanager = paymentmanager context, partnerinfo paymentmanager requestcardinfo bundle , cardinfolistener // get card brand list //cardinfolistener is for listening requestcardinfo callback events val cardinfolistener cardinfolistener = object cardinfolistener { // this callback is received when the card information is received successfully override fun onresult cardresponse list<cardinfo> { var visacount = 0 var mccount = 0 var amexcount = 0 var dscount = 0 var brandstrings = "card info " var brand spaysdk brand? for i in cardresponse indices { brand = cardresponse[i] brand when brand { spaysdk brand americanexpress -> amexcount++ spaysdk brand mastercard -> mccount++ spaysdk brand visa -> visacount++ spaysdk brand discover -> dscount++ else -> { /* other card brands */ } } } brandstrings += " vi = $visacount, mc = $mccount, ax = $amexcount, ds = $dscount" log d tag, "cardinfolistener onresult $brandstrings" toast maketext context, "cardinfolistener onresult" + brandstrings, toast length_long show } /* * this callback is received when the card information cannot be retrieved * for example, when sdk service in the samsung wallet app dies abnormally */ override fun onfailure errorcode int, errordata bundle { //called when an error occurs during in-app cryptogram generation toast maketext context, "cardinfolistener onfailure " + errorcode, toast length_long show } } creating a transaction request upon successful initialization of the samsungpay class, the merchant app needs to create a transaction request with payment information noteas of sdk v2 0 00, the normal payment sheet is deprecated all merchant apps must now use the custom payment sheet, which offers more dynamic controls for tailoring the ui look and feel with additional customer order and payment data merchant app developers choosing to temporarily continue offering the normal sheet will need to configure their android manifest to reflect the pre-2 0 00 version of the sdk used to implement their app’s existing normal sheet, although this is not recommended in all cases, merchant app developers should update their apps with the latest version of the sdk as soon as possible to avoid timing out using an earlier version of the sdk when responding to samsung pay callbacks using the custom payment sheet to initiate a payment transaction with samsung pay’s custom payment sheet, your merchant app must populate the following mandatory fields in customsheetpaymentinfo merchant name - as it will appear in samsung pay’s payment sheet, as well as the user's card account statement amount - the constituent transaction properties currency, item price, shipping price, tax, total price which together determine the total amount the user is agreeing to pay the merchant cautionnot populating the mandatory fields throws an illegalargumentexception optionally, the following fields can be added to the payment information merchant id- can be used for the merchant’s own designated purpose at its discretion unless the merchant uses an indirect pg like stripe or braintree if an indirect pg is used, this field must be set to the merchant’s payment gateway id fetched from the samsung pay developers portal merchant id is mandatory if a merchant request mada token, this filed should be included in the payload order number - usually created by the merchant app via interaction with a pg this number is required for refunds and chargebacks in the case of visa cards, the value is mandatory the allowed characters are [a-z][a-z][0-9,-] and the length of the value can be up to 36 characters address - the user’s billing and/or shipping address see applying an addresscontrol for details allowed card brands - specifies card brands accepted by the merchant if no brand is specified, all brands are accepted by default if at least one brand is specified, all other card brands not specified are set to "card not supported’ on the payment sheet here’s the 'customsheetpaymentinfo' structure class customsheetpaymentinfo parcelable { private val version string? = null private val merchantid string? = null private val merchantname string? = null private val ordernumber string? = null private val addressinpaymentsheet addressinpaymentsheet = addressinpaymentsheet do_not_show private val allowedcardbrand list<spaysdk brand>? = null private val cardinfo cardinfo? = null private val iscardholdernamerequired = false private val isrecurring = false private val merchantcountrycode string? = null private val customsheet customsheet? = null private val extrapaymentinfo bundle? = null } your merchant app sends this customsheetpaymentinfo to samsung wallet via the applicable samsung pay sdk api methods upon successful user authentication in direct mode, samsung wallet returns the above "payment info" structure and a result string the result string is forwarded to the pg by your merchant app to complete the transaction it will vary based on the pg you’re using noteif you want to add any other information for any card brand, you can add them in the extrapaymentinfo bundle the following example demonstrates how to populate customsheet in the customsheetpaymentinfo class see sample merchant app using custom payment sheet below for example usage of each customsheet control /* * make user's transaction details * the merchant app should send customsheetpaymentinfo to samsung wallet via * the applicable samsung pay sdk api method for the operation being invoked */ private fun makecustomsheetpaymentinfo customsheetpaymentinfo { val brandlist = arraylist<spaysdk brand> // if the supported brand is not specified, all card brands in samsung wallet are // listed in the payment sheet brandlist add paymentmanager brand visa brandlist add paymentmanager brand mastercard brandlist add paymentmanager brand americanexpress /* * make the sheetcontrols you want and add them to custom sheet * place each control in sequence with amountboxcontrol listed last */ val customsheet = customsheet customsheet addcontrol makebillingaddresscontrol customsheet addcontrol makeshippingaddresscontrol customsheet addcontrol makeplaintextcontrol customsheet addcontrol makeshippingmethodspinnercontrol customsheet addcontrol makeamountcontrol val extrapaymentinfo = bundle /* * you can add transaction type for mada card brand * the supported values are purchase and preauthorization * if you don't set any value, the default value is purchase */ extrapaymentinfo putstring spaysdk extra_online_transaction_type, spaysdk transactiontype preauthorization tostring val customsheetpaymentinfo = customsheetpaymentinfo builder setmerchantid "123456" setmerchantname "sample merchant" // merchant requires billing address from samsung wallet and // sends the shipping address to samsung wallet // show both billing and shipping address on the payment sheet setaddressinpaymentsheet customsheetpaymentinfo addressinpaymentsheet need_billing_send_shipping setallowedcardbrands brandlist setcardholdernameenabled true setrecurringenabled false setcustomsheet customsheet setextrapaymentinfo extrapaymentinfo build return customsheetpaymentinfo } requesting payment with a custom payment sheet the startinapppaywithcustomsheet method of the paymentmanager class is applied to request payment using a custom payment sheet in samsung wallet the two methods are defined as follows startinapppaywithcustomsheet - initiates the payment request with a custom payment sheet the payment sheet persist for 5 minutes after the api is called if the time limit expires, the transaction fails updatesheet - must be called to update current payment sheet as of api level 1 5, a merchant app can update the custom sheet with a custom error message refer to updating sheet with custom error message when you call the startinapppaywithcustomsheet method, a custom payment sheet is displayed on the merchant app screen from it, the user can select a registered card for payment and change the billing and shipping addresses, as necessary the result is delivered to customsheettransactioninfolistener, which provides the following events onsuccess - called when samsung pay confirms payment it provides the customsheetpaymentinfo object and the paymentcredential json string customsheetpaymentinfo is used for the current transaction it contains amount, shippingaddress, merchantid, merchantname, ordernumber api methods exclusively available in the onsuccess callback comprise getpaymentcardlast4dpan – returns the last 4 digits of the user's digitized personal/primary identification number dpan getpaymentcardlast4fpan – returns the last 4 digits of the user's funding personal/primary identification number fpan getpaymentcardbrand – returns the brand of the card used for the transaction getpaymentcurrencycode – returns the iso currency code in which the transaction is valued getpaymentshippingaddress – returns the shipping/delivery address for the transaction getpaymentshippingmethod – returns the shipping method for the transaction for pgs using the direct model network tokens , the paymentcredential is a json object containing encrypted cryptogram which can be passed to the pg pgs using the indirect model gateway tokens like stripe, it is a json object containing reference card reference – a token id generated by the pg and status i e , authorized, pending, charged, or refunded refer to payment credential sample for details oncardinfoupdated - called when the user changes the payment card in this callback, updatesheet method must be called to update current payment sheet onfailure - called when the transaction fails; returns the error code and errordata bundle for the failure here’s how to call the startinapppaywithcustomsheet method of the paymentmanager class /* * customsheettransactioninfolistener is for listening callback events of 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 */ private val transactionlistener = object customsheettransactioninfolistener { // this callback is received when the user changes card on the custom payment sheet in samsung pay override fun oncardinfoupdated selectedcardinfo cardinfo, customsheet customsheet { /* * called when the user changes card in samsung wallet * newly selected cardinfo is passed so merchant app can update transaction amount * based on different card if needed , */ val amountboxcontrol = customsheet getsheetcontrol amount_control_id as amountboxcontrol amountboxcontrol updatevalue product_item_id, 1000 0 //item price amountboxcontrol updatevalue product_tax_id, 50 0 // sales tax amountboxcontrol updatevalue product_shipping_id, 10 0 // shipping fee amountboxcontrol updatevalue product_fuel_id, 0 0, "pending" // additional item status amountboxcontrol setamounttotal 1060 0, amountconstants format_total_price_only // grand total customsheet updatecontrol amountboxcontrol // call updatesheet with amountboxcontrol; mandatory try { paymentmanager updatesheet customsheet } catch e java lang illegalstateexception { e printstacktrace } catch e java lang nullpointerexception { e printstacktrace } } /* * this callback is received when the payment is approved by the user and the transaction payload * is generated payload can be an encrypted cryptogram network token mode or the pg's token * reference id gateway token mode */ override fun onsuccess response customsheetpaymentinfo, paymentcredential string, extrapaymentdata bundle { /* * called when samsung pay creates the transaction cryptogram, which merchant app then sends * to merchant server or pg to complete in-app payment */ try { val dpan = response cardinfo cardmetadata getstring spaysdk extra_last4_dpan, "" val fpan = response cardinfo cardmetadata getstring spaysdk extra_last4_fpan, "" toast maketext context, "dpan " + dpan + "fpan " + fpan, toast length_long show } catch e java lang nullpointerexception { e printstacktrace } toast maketext context, "transaction onsuccess", toast length_long show } override fun onfailure errorcode int, errordata bundle { // called when an error occurs during cryptogram generation toast maketext context, "transaction onfailure $errorcode", toast length_long show } } private fun startinapppaywithcustomsheet { // show custom payment sheet try { val bundle = bundle bundle putstring samsungpay partner_service_type, spaysdk servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle paymentmanager = paymentmanager context, partnerinfo // request payment using samsung wallet paymentmanager startinapppaywithcustomsheet makecustomsheetpaymentinfo , transactionlistener } catch e illegalstateexception { e printstacktrace } catch e numberformatexception { e printstacktrace } catch e nullpointerexception { e printstacktrace } catch e illegalargumentexception { e printstacktrace } } when an address is provided by samsung wallet, onaddressupdated is called whenever address information is updated in the custom payment sheet you can use the updatesheet method to update the shipping fee or any other relevant information in the payment sheet set the errorcode to determine if the address provided by samsung wallet app is invalid, out of delivery, or does not exist for example, when the merchant does not support the product delivery to the designated location billing address from samsung wallet is not valid for tax recalculation for all such cases, the merchant app should call updatesheet with one of the following error codes error_shipping_address_invalid error_shipping_address_unable_to_ship error_shipping_address_not_exist error_billing_address_invalid error_billing_address_not_exist the sample code included below under applying the address control demonstrates how to use the updatesheet method for 'addresscontrol' in the payment sheet payment credential sample the paymentcredential is the resulting output of the startinapppaywithcustomsheet method the structure varies depending on the pg you’re using and the integration model—direct or indirect the following paymentcredential is for a visa card for pg using direct network token mode – e g first data, adyen, cybs sample paymentcredential json output using jwe-only { "billing_address" {"city" "billingcity","country" "usa","state_province" "ca","street" "billingaddr1","zip_postal_code" "123456"}, "card_last4digits" "1122", "3ds" {"data" "eyjhbgcioijsu0exxzuilcjrawqioijcak91a1h2afv4wu5wofiwvgs2y25oactzwwfqzxhiehrvz0vfdhlhyy9npsisinr5cci6ikppu0uilcjjagfubmvsu2vjdxjpdhldb250zxh0ijoiulnbx1blssisimvuyyi6ikexmjhhq00ifq fg2oouvhdgkkivyba2s5kturpwueujkzeyxz7n6kalhqahszv3p5jabaoj-rokcznfjdg3qierzjktu7zxst9gwv4oclahpfdw64w0x6ttaxeyjiivkjug-edxxtwajeyeikgc68wehf1cltsqg4zlwi6upvcaywdppbn0hl0c5wcf5az4wabytv_fda5ahguypne70keqrtwdlacw9mzejx2xth7msd9ohoulr8luq-7gha17jhoobwgmoq9q0haocnm0ljwiuhkoryyu-njulnbkk8fzus_aiumgdv2yn9ygfqilmculb0vwuf0yekx6isgaxi0zqhliusjkcz_w auzzxog46lnrtk3q qe2llws30vzh-zduue8b045cnfrm2p-rjzgbnzchels3v26n64cfg1av5mtp5f-fswbj3ntp5x4v1nk8fmdy0uspxzemfvl5badgac7w9frxt6x5xv1fqu6-q-zkbxcb9bygownt983bckoe1bd5djxfbodlrc4j68ikdjc5m3lebdx6hv0aqzkmilch-jevl3awqykbny4vj7m3fizw7u1prli2zfwukxdfs4vwv3bpm4qudemvnhxj qtymdmn4ne93juljnmwkjg","type" "s","version" "100"}, "merchant_ref" "merchantid", "method" "3ds", "recurring_payment" false } decrypt using the merchant’s private key below is sample private key -----begin rsa private key----- miieowibaakcaqea4lzyjqr+dqd/xleoxct9jwtjxhd2ptjke9djtmijki0h2oc2ghow4ujhhy/1jvft2+zcnjtoxuvlp+76/dwa3bcwfrj+fpp6x5kkylpb+djdyo1ttumltnqcwymjb3u7jbc+xr4vkfrzqjxke7xhn/sbb82ue8c3smzvkynuji<…> -----end rsa private key----- the decrypted output will be similar to this { "amount" "1000", "currency_code" "usd", "utc" "1490266732173", "eci_indicator" "5", "tokenpan" "1234567890123456", "tokenpanexpiration" "0420", "cryptogram" "ak+zkbpmcorcabcd3agraoacfa==" } processing the payload depending on the structure of the payment processing api provided by your pg, your merchant app can send either of these directly to the pg entire paymentcredential output extracted “3ds” part only consult your pg documentation for specific guidance when using indirect model e g stripe in indirect gateway token mode, paymentcredential is the pg’s token reference id and its status here’s a sample of the json output { "reference" "tok_18rje5e6szui23f2mefakep7", "status" "authorized" } for stripe, your merchant app should be able to pass this token object directly to charge or another appropriate payment processing api provided by the pg
Develop Samsung Pay
docflutter plugin overview samsung pay sdk flutter plugin enables to use the samsung pay sdk the primary aim of the samsung pay sdk is to integrate selected samsung wallet features with flutter based android apps on samsung devices the following major operations are supported in the plugin 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 partner applications with the samsung pay sdk flutter plugin, the following components are included in the download samsung pay sdk flutter plugin contains classes, interfaces, and required libraries of samsung pay which is required to communicate with samsung pay services api reference provides descriptions of the apis included in the samsung pay sdk flutter plugin sample merchant app and sample issuer app showing how samsung pay apis can be coded in a finished flutter plugin project all major operations of the samsung pay sdk flutter plugin are implemented for demonstration purposes samsung pay sdk flutter plugin architecture the following diagram shows a high-level architecture revealing the general interactions between the samsung pay sdk flutter plugin and a partner app viewed at this level, the partner apps leverage the samsung pay sdk flutter plugin 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 pay samsung pay sdk flutter plugin - sdk integrated into the partner app for direct communication with samsung pay samsung pay app - pay 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 setting up flutter plugin environment the importance of maintaining a good development environment cannot be overstated for integrating the samsung pay sdk flutter plugin with your partner app, the following prerequisites and recommendations help ensure a successful plugin integration and implementation please check the requirements below for the samsung pay sdk flutter plugin for android and system requirements please check the samsung pay android sdk overview to develop a samsung pay sdk flutter plugin service, merchants and issuers need to create service please check this guide for service creation process service registration download the samsung pay sdk flutter plugin to use the plugin the plugin has the following directory structure folder contents docs api reference documentation libs samsungpaysdkflutter_v1 01 00 flutter plugin – contains the samsung pay apis to be used by your partner app samples sample apps integrate samsung pay sdk flutter plugin with your project be sure to do the following before attempting to use the plugin if not already part of your environment, download and install an ide android studio is recommended download the samsung pay sdk flutter plugin configure your ide to integrate the samsung pay sdk flutter plugin with your partner app go to pubspec yaml and enter the following dependency dependencies samsung_pay_sdk_flutter path plugin_directory_path\ [note] if your plugin path is c \users\username\downloads, the dependency will be like below dependencies samsung_pay_sdk_flutter path c \users\username\downloads\ for android proguard rules and dexguard, please check the android sdk overview
Develop Samsung Internet
docweb payments integration guide overview to help standardize and streamline how payments are done on the web, the worldwide web consortium w3c has introduced a payment request api to provide an interface between a merchant web page and a mobile payment app, like samsung 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
Develop Samsung Pay
apiid card information this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_max_card_num_reached this error indicates that the maximum number of card limit has reached and user cannot add more card to samsung pay this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_max_pan_provision_num_reached this error indicates that the limit number of enrollments of this pan has reached and user cannot add this pan this time static final int error_server_reject this error indicates that the server declined the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_tsm_fail this error indicates that tsm error is reported during card downloading static final int error_verify_card this error indicates that server was unable to verify the card operation this may be due to invalid verification code static final int error_wallet_id_mismatch this error indicates that wallet id is mismatch this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final string extra_app2app_intent key to represent app2app intent name defined by issuer server static final string extra_app2app_payload key to represent app2app payload sent by issuer server static final string extra_card_balance key to represent card balance static final string extra_card_status_reason key to represent extra card status for issuer app static final string extra_issuer_app_card_linked key to represent extra card information for card link field details error_verify_card static final int error_verify_card this error indicates that server was unable to verify the card operation this may be due to invalid verification code since api level 1 2 see also constant field values error_card_already_registered static final int error_card_already_registered this error indicates that the requested operation is already done and this operation cannot be performed again this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_framework_internal static final int error_framework_internal this error indicates that an error occurred in payment framework while processing the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error for example, unable to load certificate from ta, unable to access payment framework db, and so on since api level 1 2 see also constant field values error_invalid_card static final int error_invalid_card this error indicates that the card is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_invalid_cardinput static final int error_invalid_cardinput this error indicates that the user entered invalid card information this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_server_reject static final int error_server_reject this error indicates that the server declined the request this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_max_card_num_reached static final int error_max_card_num_reached this error indicates that the maximum number of card limit has reached and user cannot add more card to samsung pay this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values error_tsm_fail static final int error_tsm_fail this error indicates that tsm error is reported during card downloading this is for tsm solution only since api level 1 4 see also constant field values error_authentication_not_ready static final int error_authentication_not_ready this error indicates that authentication is not ready state during update card service since api level 1 8 see also constant field values error_authentication_failed static final int error_authentication_failed this error indicates that authentication is failed during update card service since api level 1 8 see also constant field values error_authentication_closed static final int error_authentication_closed this error indicates that authentication is force closed during update card service since api level 1 8 see also constant field values error_authentication_timed_out static final int error_authentication_timed_out this error indicates that authentication is closed due to timeout during update card service since api level 1 8 see also constant field values error_card_not_supported static final int error_card_not_supported this error indicates that card is not supported this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 2 5 see also constant field values error_max_pan_provision_num_reached static final int error_max_pan_provision_num_reached this error indicates that the limit number of enrollments of this pan has reached and user cannot add this pan this time user needs to contact issuer to resolve this issue this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 2 5 see also constant field values error_wallet_id_mismatch static final int error_wallet_id_mismatch this error indicates that wallet id is mismatch this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 2 5 see also constant field values error_auth_code_invalid static final int error_auth_code_invalid this error indicates that auth code is invalid this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_expired static final int error_auth_code_expired this error indicates that auth code is expired this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_max_try_reached static final int error_auth_code_max_try_reached this error indicates that maximum idnv try reached this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_auth_code_type_invalid static final int error_auth_code_type_invalid this error indicates that auth code type is invalid this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values error_card_idv_not_supported static final int error_card_idv_not_supported this error indicates that the card does not support any idnv this is returned as spaysdk extra_error_reason for error_verify_card error since api level 2 7 see also constant field values extra_app2app_intent static final string extra_app2app_intent key to represent app2app intent name defined by issuer server since api level 1 1 see also constant field values extra_app2app_payload static final string extra_app2app_payload key to represent app2app payload sent by issuer server since api level 1 1 see also constant field values extra_card_balance static final string extra_card_balance key to represent card balance since api level 1 8 see also constant field values extra_card_status_reason static final string extra_card_status_reason key to represent extra card status for issuer app since api level 1 4 see also constant field values extra_issuer_app_card_linked static final string extra_issuer_app_card_linked key to represent extra card information for card link since api level 2 2 see also constant field values samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
docbecome a member to become a samsung pay partner, firstly you need to sign up to the samsung pay portal and then register your membership sign up/sign in to sign up as a samsung pay partner and request access to the samsung pay developers site, do the following in your browser, go to samsung pay developers if you already have a samsung account, click log in otherwise, click sign up and create an account a company business email address that won't change over time is recommended as the primary samsung account user id for managing your portal projects agree to the site's terms and conditions and acknowledge that you understand the samsung pay partners privacy policy, then click create a samsung account fill out the onscreen account creation form, making sure to correctly type the security code, then click continue click sign up, enter your samsung account id email address and password, then click sign in look in your email inbox for a welcome message with an account activation link and click the link this opens the developers site registration page complete the company and user profile described in the next step to become a registered samsung pay developer partner register your membership while becoming a member of the samsung pay developer community, you need to provide some information about your company - contact information, type of business, size, etc this information is entered into a company and user profile, which you can subsequently update as changes occur if you are the first one in your company to join samsung pay developers, you will be the principal contact as such, you will be given permissions to manage projects and invite others in your company to collaborate if you are an invited co-worker, you'll need your company's partner id to register follow these steps to register if you are the first samsung pay member of your company to register, select the first option "i am the first samsung pay member of my company" if 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 click next complete the company information form and agree to the terms and conditions of use, then click save and next if you cannot complete the profile at this time, click skip and verify later complete the user information form, then click done; or, if you cannot provide the information at this time, click skip and verify later upon review of the information provided, your samsung pay relationship manager rm may request additional details once your membership registration is approved, you'll be granted access to currently restricted areas of the samsung pay portal and you can invite members of your team to collaborate on your samsung pay projects until then, take advantage of valuable resources like the samsung pay sdk and sdk programming guide from the following link android sdk [in-app payment and push provisioning] https //developer samsung com/pay/native/sdk-overview html web checkout sdk https //developer samsung com/pay/web/overview html w3c mobile payment https //developer samsung com/internet/android/web-payments-integration-guide html when you receive the email notifying you of membership approval, you're ready to get started in your browser, return to the samsung pay portal and sign in set up your partner project when you integrate your project with samsung pay, it is important to have a clear understanding of what is involved for starters, consider the difference between apps and services app an app can be your issuer app or merchant app service a service is a combination of your app, its service type, a csr and a service id your app will pass these information to samsung wallet for partnership verification you can create different service for the same package for multiple purpose testing note that,only one application can be added under one service id for example app deployment scenario unique service-app combinations global issuer app using a different csr encryption key for services in different regions to interact with local servers service 1 = com issuer walletapp, csr1_us service 2 = com issuer walletapp, csr2_plcc_abcmart same issuer app for all customers but different csrs for managing different card services b2b vs plcc service 1 = com issuer walletapp, csr1_regular service 2 = com issuer walletapp, csr2_plcc_abcmart multiple merchant apps using the same pg service 1 = com merchant electronicsapp, csr_pg1 service 2 = com merchant groceryapp, csr_pg1 global merchant app using a different pg for each country service 1 = com merchant electronicsapp, csr_pg1 service 2 = com merchant electronicsapp, csr_pg2 multiple web sites using the same pg service 1 = electronicssite merchant com, csr_pg1 service 2 = grocerysite merchant com, crs_pg1 global merchant web site using a different pg for each country service 1 = electronicsapp merchant com, csr_pg1 service 2 = electronicsapp merchant com, csr_pg2 create new service to create a new service follow the below steps go to my projects > service management or click services management in the navigation panel on the left, then click create new service select for test or for release to define the service for integration with samsung pay, then click next note that, samsung pay will verify all services requested only for release purpose this is to ensure all samsung pay features are functioning correctly and follows samsung pay guideline select your desired service type web online payment service w3c mobile web payments in-app online payment service app to app card enrollment click save and next web online payment service enter the new service name select your service country select your payment gateway from the list of supported payment gateways 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 confirm your agreement with the portal's terms and conditions click the link to read and print , then click done thus, you have completed service configuration for web online payment w3c mobile web payments service enter the new service name select your service country select your payment gateway from the list of supported payment gateways 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 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 will need to enter payments mywebstore com as the service domain in the portal for each additional domain name, click add confirm your agreement with the portal's terms and conditions click the link to read and print , then click done thus, you have completed service configuration for w3c mobile web payments in-app online payment service enter the new service name select your service country select your payment gateway from the list of supported payment gateways drag and drop the csr you share with your payment gateway in the box provided or click the paperclip to browse confirm your agreement with the portal's terms and conditions click the link to read and print , then click save and next app to app card enrollment service enter the new service name select your service country add issuer names these correspond to your financial institution/bank's name s registered with the card networks be sure to click the add button after each entry note that, the issuer name on the samsung pay portal and the actual issuer name of the card must match if you cannot confirm the actual issuer name of the card, just add your card to samsung wallet app and see its details information open wallet app > tap on the card > three-dot menu > customer services option under the title you will find the issuer name confirm your agreement with the portal's terms and conditions click the link to read and print , then click save and next for android sdk in-app online payment service and push provisioning service , you have to go through two additional steps- providing app information and setting test environment providing app information if you have already registered an app following register a partner app for android sdk section, select i already registered app information then select the desired app name from the app list you can add a new app on the fly by selecting i will upload new app information click next setting test environment now enter up to 30 test accounts comma-separated these are samsung accounts associated with a registered samsung pay app on a supported device you can always edit the service later to add or delete test accounts click done to save the service configuration and see it listed in your service management dashboard register a partner app for android sdk go to my projects > app management in the navigation panel on the left, then click add new app enter the app name enter its package name to specifically identify this app enter an app description optional; helpful for version control upload the apk file by dragging and dropping it in the corresponding box click the paperclip icon to browse upload representative screenshots showing ui branding elements/buttons in a supported format png, jpeg, gif indicating samsung pay as a supported payment option in your app steps 5 and 6 are required for release versions of your app; not required for initial integration testing click create, then click next at the bottom of the plug-in configuration page your newly added app is now listed in your app management dashboard you can view its details by clicking its app name then, on the app details page, you can edit the app name and description by clicking the corresponding pencil icon
tutorials mobile
blogsamsung wallet is introducing a new feature called "generic card" for partners who cannot use other card types to fulfill their business requirements. this provides flexibility to modify various field labels for the card, according to the partners’ business needs. other cards, such as boarding passes and coupons serve a specific purpose, and their field labels cannot be modified. however, with a generic card, the label can be modified so it can be used for multiple purposes. in this article, you learn how to modify a generic card to use it as an insurance card. we will explain the details specification with example of the generic card. at the end of the article a guide will be provided to implement this card for your reference, to help you modify your generic card according to your needs. card setup before you begin creating a new card template, log in to the samsung wallet partner site and create a generic card. log in to the samsung wallet partner site. go to the wallet cards and then create wallet card. for more details about creating a card, check the manage wallet cards documentation. select generic card from the available card templates. modify the card information. when you have finished editing card information, launch the card to complete card setup. for more information on how to launch the card, see launch wallet cards. template editor use the template editor to modify the card template. from the "cardart" view, you can modify the card color, set a background image or change the logo image properties. from the "enlarge" view, you can modify the {{text1}} and {{text2}} labels. however, only the label itself can be changed in the template editor. to set the label value, you need to update the json file. from the "detail" view, you can modify the "textgroup" and "applink" properties. modify the text label according to your needs. it is also possible to add new text fields, with a maximum of 12 text fields allowed. after every modification, click save. finally, apply all changes by clicking apply. if you want to preview your changes, just click preview. add to samsung wallet now that the card has been created in the site, it is ready to be distributed to fulfill your business needs. implement the "add to samsung wallet" functionality to the platform where you are planning to distribute the cards. when users click "add to samsung wallet," the card is added to the wallet application on the user’s galaxy device. this functionality can be added through the application/mobile web, mms, or email. additionally, you can use a qr code on a computer web browser and kiosk. samsung provides a codelab guide for developers so that they can easily understand the implementation. for additional information on the codelab guide, read utilize the add to samsung wallet service for digital cards. further details can also be found in the implementing atw button documentation. card specifications to complete the "add to samsung wallet" button implementation, you must generate the card data token and create a final url. for more information, see add to samsung wallet. let’s start by reviewing the generic card specifications to generate the card data token. the generic card follows the specifications below. for more information on them, see the generic card section. name description title the main title of the generic card. in the sample card, the title is "card title." in the image below, the title is "insurance identification card." subtitle the subtitle of the generic card. in the sample card, it is "card subtitle". providername use this field to set the card provider name. for more information, check the card json example below. however, the provider name depends on your card type and should be modified accordingly. eventid enter an id as an event identifier. in case your card is prepaid, for example a gift card, or if you have vouchers to events, such as concerts, it is possible to define an event id. for instance: "event-001". groupingid enter an identifier to group related cards. startdate enter the starting date and the epoch timestamp in milliseconds. startdate.relativenotitime enter the amount of time within which you want to provide a notification to the user. the notification time is the relative time from the startdate. the value can be up to 2880 milliseconds. enddate enter the end date and the epoch timestamp in milliseconds. enddate.relativenotitime enter the amount of time within which you want to provide a notification to the user. the notification time is the relative time from the enddate. the value can be up to 2880 milliseconds. logoimage set the logo image url. the file size must not exceed 256 kb. also this image can be set from the template editor. logoimage.darkurl set the logo image url for the dark mode. the file size must not exceed 256 kb. logoimage.lighturl set the logo image url for the light mode. the file size must not exceed 256 kb. bgimage set the background image url. the file size must not exceed 512 kb. text{i} set the label-text value that should be displayed for each field containing the details of your card. the label is defined in the template editor, shown in the image below. to set the value of the label, update the json file. image{i} enter the image url, such as: "https://www.samsung.com/images/image1.png". this url is just an example, you must update it according to your needs. this field only works in generic card type3. we have used a type1 card in the example. so this field in the example json has no effect on the card. you can find all three card type sample uis here. image{i}.lighturl enter the image url in light mode, such as: "https://www.samsung.com/images/light.png". this url is just an example, you must update it according to your needs. image{i}.darkurl enter the image url in dark mode, such as: "https://www.samsung.com/images/dark.png". this url is just an example, you must update it according to your needs. serial{i} set the serial for barcode or qr code. serial{i}.serialtype serial presentation type. for more information on the presentation types (serialtype), see references. serial{i}.ptformat set the presentation format. for more details on the presentation formats (ptformat), see references. serial{i}.ptsubformat set the presentation subformat here. for more details on the barcode formats (ptsubformat), see references. serial{i}.errorcorrectionlevel set the error correction levels in this field. the amount of redundancy or error correction data included in the code varies. qr codes offer four levels of error correction: l, m, q, and h. the qr field looks like the following in your card: privacymodeyn set the user authentication if required. set the value to "y" or "n" bgcolor set the card art color. fontcolor set the card art font color. nonetworksupportyn set the value to "y" to open the wallet card when under the "no network" status. otherwise, set the value to "n" noticedesc set the the notice description here. see the image below of how it is added to card. applinklogo add the application link logo url in this field. applinkname add the application link name in this field. applinkdata add the application link url in this field. locations list of locations where the card will be used. this information can be used to provide location-based services. samsung wallet can use this information to show maps, names of places, and addresses. for more information on the locations field and json format, check references. card json example in previous sections, you have learned about the card specifications. next, let’s implement the generic card fields according to your needs. in this section, as the aim is to create an insurance card, you must use the fields accordingly. samsung provides a specifically formatted json structure. you need to configure the card data objects within the structure’s data array. for more details, see the generic card section. { "card": { "type": "generic", "subtype": "others", "data": [ { "createdat": 1709712961000, "updatedat": 1709712961000, "language": "en ", "refid": "933533e1-9284-461c-905f-bc177526a8d1", "attributes": { "title": "insurance identification card", "subtitle": "insurance card", "providername": "samsung insurance co.", "eventid": "1", "groupingid":"1", "startdate": 1731299205000, "startdate.relativenotitime": 500, "enddate": 1731320805000, "enddate.relativenotitime": 400, "logoimage": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "logoimage.darkurl": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "logoimage.lighturl": "https://us-cdn-gpp.stg.mcsvc.samsung.com/mcp25/resource/2023/12/20/55ea769f-d14d-4c47-94cc-50cade36cdd9.png", "bgimage": "", "text1": "1234567", "text2": "samsung insurance co.", "text3": "jaqueline m", "text4": "samsung motors 2014 galaxy5", "text5": "11sam23sung3t", "text6": "(031)000-1235", "image1": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "image1.darkurl": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "image1.lighturl": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2024/3/5/b9445e3f-2ef5-4d81-9fca-b7a8a7cd599f.png", "serial1.value": ">1180mm2241b7c 0000000000000298060000000000 0 090870907 ", "serial1.serialtype": "qrcode", "serial1.ptformat": "qrcode", "serial1.ptsubformat": "qr_code", "serial1.errorcorrectionlevel": "m", "privacymodeyn": "y", "bgcolor": "#3396ff", "fontcolor": "#ffffff", "nonetworksupportyn": "n", "noticedesc": "{\"count\":2,\"info\":[{\"title\":\"notice1\",\"content\":[\"description1\",\"description2\"]},{\"title\":\"notice2\",\"content\":[\"description1\",\"description2\"]}]}", "applinklogo": "https://www.samsung.com/logo.png", "applinkdata": "https://www.samsung.com/", "applinkname": "samsung insurance co.", "locations": "[{\"lat\": 37.2573276, \"lng\": 127.0528215, \"address\": \"suwon\", \"name\": \"digital city\"}]" } } ] } } generic card testing with the "add to wallet" test tool now, you can test the generic card with the "add to wallet" test tool provided by samsung. just follow these steps: sign in to the add to wallet test tool. for more information, see the samsung wallet test tool. enter the private key in the "enter partner private key" field. in this tool, you find all cards that you have created from the samsung wallet partner site in the "select card" section. for more information, see the samsung wallet partner site. select the generic card that you have just created. now select json from the data field and modify the existing json data fields according to the card specification details. after modifying the json data fields, check if the json is valid. finally, if the private key is valid, the "add to samsung wallet" button becomes active at the bottom of the page. then, just click add to samsung wallet to finish adding the generic card. if you use the provided example json and add the card to the wallet, the card looks like the following: server integration in this step, server configuration is needed because the generated jwt token expires after 30 seconds. developers are advised to only generate this token after a user has clicked the "add to wallet" button. as you have already performed testing with the "add to wallet" test tool, you need to configure your server. for more information on the implementation of both the "add to samsung wallet" button and server-side logic, see implementing "add to wallet" in an android application. this article explains how you can distribute your card with your android application and how to generate the jwt token at runtime, after pressing the "add to samsung wallet" button. conclusion you have now learned the basics for how to set up a generic card and test it for your business needs. in case you have further questions, contact samsung developer support. related resources utilize the add to samsung wallet service for digital cards introduce loyalty cards to your application with samsung wallet implementing "add to wallet" in an android application seamlessly integrate "add to wallet" for samsung wallet
M. A. Hasan Molla
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 class spaysdk java lang object com samsung android sdk samsungpay v2 spaysdk direct known subclasses cardmanager, paymentmanager public abstract class spaysdk extends object this class allows to define samsung pay sdk information, common error codes, and constants since api level 1 1 nested class summary nested classes modifier and type class description static enum spaysdk brand this enumeration provides sdk supported card brands such as american express, mastercard, visa, discover, china unionpay, octopus, eci, pagobancomat, mada and elo static enum spaysdk servicetype this enumeration provides service types partners must set their service type in the partnerinfo when they call any apis static enum spaysdk transactiontype this value is specifically supported for mada tokens and will not apply to other token types field summary fields modifier and type field description static final string common_status_table this table shows the status codes used commonly status bundle keys bundle values spay_not_supported 0 extra_error_reason error_device_not_samsung -350 error_spay_pkg_not_found -351 error_spay_sdk_service_not_available -352 error_device_integrity_check_fail -353 error_spay_app_integrity_check_fail -360 error_android_platform_check_fail -361 spay_not_ready 1 extra_error_reason error_spay_setup_not_completed -356 error_spay_app_need_to_update -357 error_spay_internal -1 extra_error_reason error_server_internal -311 n/a n/a error_not_allowed -6 extra_error_reason error_invalid_parameter -12 error_sdk_not_supported_for_this_region -300 error_service_id_invalid -301 error_service_unavailable_for_this_region -302 error_partner_app_signature_mismatch -303 error_partner_app_version_not_supported -304 error_partner_app_blocked -305 error_user_not_registered_for_debug -306 error_service_not_approved_for_release -307 error_partner_not_approved -308 error_unauthorized_request_type -309 error_expired_or_invalid_debug_key -310 error_missing_information -354 error_unable_to_verify_caller -359 error_invalid_parameter -12 n/a n/a error_no_network -21 n/a n/a error_server_no_response -22 n/a n/a error_partner_info_invalid -99 extra_error_reason error_partner_sdk_api_level -10 error_partner_service_type -11 error_partner_sdk_version_not_allowed -358 error_initiation_fail -103 n/a n/a spay_not_allowed_temporally 3 extra_error_reason error_spay_connected_with_external_display -605 error_spay_fmm_lock -604 n/a n/a paymentmanager error_making_sheet_failed -115 n/a n/a static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard static final string device_id key to represent unique device id static final string device_type_gear device type is gear static final string device_type_phone device type is phone static final int error_android_platform_check_fail this error indicates that android platform version check has failed for in-app payment, the samsung pay sdk requires android 6 0 m android api level 23 or later versions of the android os this is returned as extra_error_reason for spay_not_supported error static final int error_device_integrity_check_fail this error indicates that device integrity check has failed this is returned as extra_error_reason for spay_not_supported error static final int error_device_not_samsung this error indicates that the device is not a samsung device this is returned as extra_error_reason for spay_not_supported error static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired this is returned as extra_error_reason for error_not_allowed error for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed static final int error_initiation_fail this error indicates that session initiation or service binding has failed for example, if the service connection with samsung pay was not successful static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value static final int error_missing_information this error indicates that some information of partner is missing this error code is returned as an extra_error_reason of error_not_allowed error for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network for example, partner app tries to verify with server while network is not connected static final int error_none this error indicates that requested operation is success with no error static final int error_not_allowed this error indicates that requested operation is not allowed for example, partner app verification has failed in samsung pay server static final int error_not_found this error indicates that given card id is not found in samsung pay static final int error_not_supported this error indicates that requested operation is not supported in samsung pay static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is blocked, then the partner app verification will be failed static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if different signature is used for signing apk, the partner app verification will be failed checking signature logic will be activated in case debug mode is "n" static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay this is returned as extra_error_reason for error_not_allowed error for example, if the version registered from developer portal is higher than current version or no any version registered , then the partner app verification will be failed static final int error_partner_info_invalid this error indicates that partner information is invalid for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is submitted but not approved, then the partner app verification will be failed static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid partner must set valid api level in the androidmanifest file static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed this is returned as extra_error_reason for error_partner_info_invalid error static final int error_partner_service_type this error indicates that the service type is invalid partner must set valid service type in partnerinfo when calling apis this is returned as extra_error_reason for spay_not_ready error static final int error_registration_fail this error indicates that the card provisioning has failed static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region this is returned as extra_error_reason for error_not_allowed error for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error this is returned as extra_error_reason for error_spay_internal error for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed static final int error_server_no_response this error indicates that server did not respond to the samsung pay request static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if invalid service id was used in partner app, then the partner app verification will be failed static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is not registered for release mode, then the partner app verification will be failed static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed this is returned as extra_error_reason for spay_not_supported error static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated partner app need to ask user to update samsung pay app static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display due to security reason, samsung pay cannot be launched at this moment in this case, partner can guide user to disconnect any external display if connected static final int error_spay_fmm_lock this error indicates that device is locked due to fmm find my mobile partner app needs to ask user to unlock the samsung pay app static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device this is returned as extra_error_reason for spay_not_supported error this could mean that the device does not support samsung pay static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device this is returned as extra_error_reason for spay_not_supported error static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed partner app need to ask user to set up samsung pay app static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment this is returned as extra_error_reason for error_not_allowed error for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment this is returned as extra_error_reason for error_not_allowed error for example, if the merchant app calls enrollment api, then the partner app verification will be failed static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation for example, user taps the cancel or back key on the payment sheet static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed static final string extra_accept_combo_card key to represent that a merchant accepts combo card partner can use this key to let customers to choose debit/credit in case of combo card static final string extra_card_type key to represent card type the possible values are card card_type_credit_debit card card_type_credit card card_type_debit card card_type_gift card card_type_loyalty card card_type_transit static final string extra_country_code key to represent country code device country code iso 3166-1 alpha-2 static final string extra_cpf_holder_name key to get cpf holder name in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback static final string extra_cpf_number key to get cpf number in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback static final string extra_cryptogram_type key to represent the dsrp digital secure remote payments cryptogram type of mastercard static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not static final string extra_device_type key to represent type of the device mobile or gear static final string extra_error_reason key to represent extra error reasons static final string extra_error_reason_message key to represent extra error reason messages static final string extra_issuer_name key to represent name of the issuer this key can be used in the bundle for partnerinfo string, bundle static final string extra_issuer_pkgname key to represent package name of the issuer app on android static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number dpan static final string extra_last4_fpan key to represent the last four digits of funding personal identification number fpan static final string extra_member_id key to represent member id of the issuer this is for korean issuers only static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service i e static final string extra_online_transaction_type static final string extra_partner_name key to represent name of the partner app this key can be used in the bundle for partnerinfo string, bundle static final string extra_request_id key to represent request id when a request is failed, tr will send this key to partner app static final string extra_require_cpf key to represent that a partner requires cpf partner can use this key to ask samsung pay to show cpf information in the payment sheet static final string extra_resolved_1 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_resolved_2 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_resolved_3 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_resolved_4 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_resolved_5 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_resolved_6 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_resolved_7 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 partner_service_type key to represent unique service type this key must be set in the bundle for partnerinfo string, bundle static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card this is for korean issuers only static final int spay_not_allowed_temporally samsung pay is not allowed temporally refer extra reason delivered with extra_error_reason static final int spay_not_ready samsung pay is not completely activated usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet in this case, partner app can call samsungpay activatesamsungpay api to launch samsung pay or can call samsungpay gotoupdatepage api to update samsung pay app static final int spay_not_supported samsung pay is not supported on this device usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed static final int spay_ready samsung pay is activated and ready to use usually, this status code is returned after user completes all the mandatory updates and is signed in static final string wallet_dm_id key to represent unique device management id static final string wallet_user_id key to represent user's wallet id method summary all methodsstatic methodsconcrete methods modifier and type method description static int getversioncode returns the version code of the samsung pay sdk static string getversionname returns the version name of the samsung pay sdk methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details error_none public static final int error_none this error indicates that requested operation is success with no error see also constant field values error_spay_internal public static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on see also constant field values error_not_supported public static final int error_not_supported this error indicates that requested operation is not supported in samsung pay see also constant field values error_not_found public static final int error_not_found this error indicates that given card id is not found in samsung pay see also constant field values error_not_allowed public static final int error_not_allowed this error indicates that requested operation is not allowed for example, partner app verification has failed in samsung pay server see also constant field values error_user_canceled public static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation for example, user taps the cancel or back key on the payment sheet see also constant field values error_partner_sdk_api_level public static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid partner must set valid api level in the androidmanifest file minimum possible version is 1 4 also if the partner set the values defined in higher api level, samsung pay will send this error to partner app this is returned as extra_error_reason for error_partner_info_invalid error since api level 1 4 see also constant field values error_partner_service_type public static final int error_partner_service_type this error indicates that the service type is invalid partner must set valid service type in partnerinfo when calling apis this is returned as extra_error_reason for spay_not_ready error since api level 1 4 see also constant field values error_invalid_parameter public static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value since api level 2 3 see also constant field values error_no_network public static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network for example, partner app tries to verify with server while network is not connected see also constant field values error_server_no_response public static final int error_server_no_response this error indicates that server did not respond to the samsung pay request see also constant field values error_partner_info_invalid public static final int error_partner_info_invalid this error indicates that partner information is invalid for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on since api level 2 5 see also constant field values error_initiation_fail public static final int error_initiation_fail this error indicates that session initiation or service binding has failed for example, if the service connection with samsung pay was not successful see also constant field values error_registration_fail public static final int error_registration_fail this error indicates that the card provisioning has failed since api level 1 2 see also constant field values error_duplicated_sdk_api_called public static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner since api level 2 1 see also constant field values error_sdk_not_supported_for_this_region public static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region this is returned as extra_error_reason for error_not_allowed error for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed see also constant field values error_service_id_invalid public static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if invalid service id was used in partner app, then the partner app verification will be failed since api level 2 5 see also constant field values error_service_unavailable_for_this_region public static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region since api level 2 5 see also constant field values error_partner_app_signature_mismatch public static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if different signature is used for signing apk, the partner app verification will be failed checking signature logic will be activated in case debug mode is "n" since api level 2 9 see also constant field values error_partner_app_version_not_supported public static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay this is returned as extra_error_reason for error_not_allowed error for example, if the version registered from developer portal is higher than current version or no any version registered , then the partner app verification will be failed since api level 2 9 see also constant field values error_partner_app_blocked public static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is blocked, then the partner app verification will be failed since api level 2 9 see also constant field values error_user_not_registered_for_debug public static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed see also constant field values error_service_not_approved_for_release public static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is not registered for release mode, then the partner app verification will be failed since api level 2 5 see also constant field values error_partner_not_approved public static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is submitted but not approved, then the partner app verification will be failed see also constant field values error_unauthorized_request_type public static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment this is returned as extra_error_reason for error_not_allowed error for example, if the merchant app calls enrollment api, then the partner app verification will be failed see also constant field values error_expired_or_invalid_debug_key public static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired this is returned as extra_error_reason for error_not_allowed error for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed see also constant field values error_server_internal public static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error this is returned as extra_error_reason for error_spay_internal error for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed since api level 2 5 see also constant field values error_device_not_samsung public static final int error_device_not_samsung this error indicates that the device is not a samsung device this is returned as extra_error_reason for spay_not_supported error see also constant field values error_spay_pkg_not_found public static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device this is returned as extra_error_reason for spay_not_supported error this could mean that the device does not support samsung pay see also constant field values error_spay_sdk_service_not_available public static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device this is returned as extra_error_reason for spay_not_supported error see also constant field values error_device_integrity_check_fail public static final int error_device_integrity_check_fail this error indicates that device integrity check has failed this is returned as extra_error_reason for spay_not_supported error see also constant field values error_spay_app_integrity_check_fail public static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed this is returned as extra_error_reason for spay_not_supported error see also constant field values error_android_platform_check_fail public static final int error_android_platform_check_fail this error indicates that android platform version check has failed for in-app payment, the samsung pay sdk requires android 6 0 m android api level 23 or later versions of the android os this is returned as extra_error_reason for spay_not_supported error since api level 1 5 see also constant field values error_missing_information public static final int error_missing_information this error indicates that some information of partner is missing this error code is returned as an extra_error_reason of error_not_allowed error for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app see also constant field values error_spay_setup_not_completed public static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed partner app need to ask user to set up samsung pay app if user agrees, call samsungpay activatesamsungpay api this is returned as extra_error_reason for spay_not_ready error see also constant field values error_spay_app_need_to_update public static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated partner app need to ask user to update samsung pay app if user agrees, call samsungpay gotoupdatepage api this is returned as extra_error_reason for spay_not_ready error since api level 1 1 see also constant field values error_partner_sdk_version_not_allowed public static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed this is returned as extra_error_reason for error_partner_info_invalid error since api level 2 5 see also constant field values error_unable_to_verify_caller public static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment this is returned as extra_error_reason for error_not_allowed error for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity see also constant field values error_spay_fmm_lock public static final int error_spay_fmm_lock this error indicates that device is locked due to fmm find my mobile partner app needs to ask user to unlock the samsung pay app if user agrees, call samsungpay activatesamsungpay to unlock the samsung pay app since api level 2 1 see also samsungpay activatesamsungpay constant field values error_spay_connected_with_external_display public static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display due to security reason, samsung pay cannot be launched at this moment in this case, partner can guide user to disconnect any external display if connected since api level 2 7 see also constant field values spay_not_supported public static final int spay_not_supported samsung pay is not supported on this device usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed since api level 1 1 see also constant field values spay_not_ready public static final int spay_not_ready samsung pay is not completely activated usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet in this case, partner app can call samsungpay activatesamsungpay api to launch samsung pay or can call samsungpay gotoupdatepage api to update samsung pay app since api level 1 1 see also constant field values spay_ready public static final int spay_ready samsung pay is activated and ready to use usually, this status code is returned after user completes all the mandatory updates and is signed in since api level 1 1 see also constant field values spay_not_allowed_temporally public static final int spay_not_allowed_temporally samsung pay is not allowed temporally refer extra reason delivered with extra_error_reason since api level 2 7 see also constant field values spay_has_transit_card public static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card this is for korean issuers only since api level 2 8 see also constant field values spay_has_no_transit_card public static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only since api level 2 8 see also constant field values device_type_phone public static final string device_type_phone device type is phone since api level 1 1 see also constant field values device_type_gear public static final string device_type_gear device type is gear since api level 1 1 see also constant field values extra_last4_dpan public static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number dpan since api level 1 1 see also constant field values extra_last4_fpan public static final string extra_last4_fpan key to represent the last four digits of funding personal identification number fpan since api level 1 1 see also constant field values extra_issuer_name public static final string extra_issuer_name key to represent name of the issuer this key can be used in the bundle for partnerinfo string, bundle since api level 1 1 see also constant field values extra_issuer_pkgname public static final string extra_issuer_pkgname key to represent package name of the issuer app on android since api level 1 1 see also constant field values extra_partner_name public static final string extra_partner_name key to represent name of the partner app this key can be used in the bundle for partnerinfo string, bundle since api level 2 6 see also constant field values extra_error_reason public static final string extra_error_reason key to represent extra error reasons since api level 1 1 see also constant field values extra_error_reason_message public static final string extra_error_reason_message key to represent extra error reason messages since api level 2 9 see also constant field values extra_card_type public static final string extra_card_type key to represent card type the possible values are card card_type_credit_debit card card_type_credit card card_type_debit card card_type_gift card card_type_loyalty card card_type_transit since api level 1 1 see also constant field values extra_device_type public static final string extra_device_type key to represent type of the device mobile or gear the possible values are device_type_phone device_type_gear since api level 1 1 see also constant field values extra_member_id public static final string extra_member_id key to represent member id of the issuer this is for korean issuers only since api level 1 1 see also constant field values extra_country_code public static final string extra_country_code key to represent country code device country code iso 3166-1 alpha-2 since api level 1 1 see also constant field values extra_device_card_limit_reached public static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not since api level 1 1 see also constant field values extra_cryptogram_type public static final string extra_cryptogram_type key to represent the dsrp digital secure remote payments cryptogram type of mastercard cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo since api level 2 4 see also constant field values extra_resolved_1 public static final string extra_resolved_1 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_resolved_2 public static final string extra_resolved_2 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_resolved_3 public static final string extra_resolved_3 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_resolved_4 public static final string extra_resolved_4 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_resolved_5 public static final string extra_resolved_5 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_resolved_6 public static final string extra_resolved_6 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_resolved_7 public static final string extra_resolved_7 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_request_id public static final string extra_request_id key to represent request id when a request is failed, tr will send this key to partner app request id would be helpful for debugging a failed request between partner and tr since api level 2 5 see also constant field values cryptogram_type_ucaf public static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard ucaf cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo ucaf is a default cryptogram type if not specified in the extrapaymentinfo bundle since api level 2 4 see also constant field values cryptogram_type_icc public static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard icc cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo since api level 2 4 see also constant field values extra_accept_combo_card public static final string extra_accept_combo_card key to represent that a merchant accepts combo card partner can use this key to let customers to choose debit/credit in case of combo card it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo the possible value is the boolean since api level 2 9 see also constant field values extra_require_cpf public static final string extra_require_cpf key to represent that a partner requires cpf partner can use this key to ask samsung pay to show cpf information in the payment sheet it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo the possible value is the boolean this is for brazil partners only since api level 2 11 see also constant field values extra_cpf_holder_name public static final string extra_cpf_holder_name key to get cpf holder name in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback since api level 2 11 see also constant field values extra_cpf_number public static final string extra_cpf_number key to get cpf number in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback since api level 2 11 see also constant field values extra_merchant_ref_id public static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service i e bixby when marketplace apps request in-app payment, they can set merchant reference id so that samsung pay app can get detail information about the merchant using the id since api level 2 11 see also constant field values extra_online_transaction_type public static final string extra_online_transaction_type see also constant field values wallet_user_id public static final string wallet_user_id key to represent user's wallet id since api level 1 2 see also constant field values device_id public static final string device_id key to represent unique device id since api level 1 2 see also constant field values wallet_dm_id public static final string wallet_dm_id key to represent unique device management id since api level 1 2 see also constant field values partner_service_type public static final string partner_service_type key to represent unique service type this key must be set in the bundle for partnerinfo string, bundle since api level 1 4 see also constant field values common_status_table public static final string common_status_table this table shows the status codes used commonly status bundle keys bundle values spay_not_supported 0 extra_error_reason error_device_not_samsung -350 error_spay_pkg_not_found -351 error_spay_sdk_service_not_available -352 error_device_integrity_check_fail -353 error_spay_app_integrity_check_fail -360 error_android_platform_check_fail -361 spay_not_ready 1 extra_error_reason error_spay_setup_not_completed -356 error_spay_app_need_to_update -357 error_spay_internal -1 extra_error_reason error_server_internal -311 n/a n/a error_not_allowed -6 extra_error_reason error_invalid_parameter -12 error_sdk_not_supported_for_this_region -300 error_service_id_invalid -301 error_service_unavailable_for_this_region -302 error_partner_app_signature_mismatch -303 error_partner_app_version_not_supported -304 error_partner_app_blocked -305 error_user_not_registered_for_debug -306 error_service_not_approved_for_release -307 error_partner_not_approved -308 error_unauthorized_request_type -309 error_expired_or_invalid_debug_key -310 error_missing_information -354 error_unable_to_verify_caller -359 error_invalid_parameter -12 n/a n/a error_no_network -21 n/a n/a error_server_no_response -22 n/a n/a error_partner_info_invalid -99 extra_error_reason error_partner_sdk_api_level -10 error_partner_service_type -11 error_partner_sdk_version_not_allowed -358 error_initiation_fail -103 n/a n/a spay_not_allowed_temporally 3 extra_error_reason error_spay_connected_with_external_display -605 error_spay_fmm_lock -604 n/a n/a paymentmanager error_making_sheet_failed -115 n/a n/a see also constant field values method details getversioncode public static int getversioncode returns the version code of the samsung pay sdk returns sdk version code since api level 1 1 getversionname @nonnull public static string getversionname returns the version name of the samsung pay sdk returns sdk version name since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 card class cardmanager java lang object com samsung android sdk samsungpay v2 spaysdk com samsung android sdk samsungpay v2 card cardmanager all implemented interfaces apptoappconstants public final class cardmanager extends spaysdk implements apptoappconstants this class provides apis for card management the apis include getting card status, adding new card to samsung pay, and so on note whenever a new instance of cardmanager is created, all pending requests which were sent by another instances will be discarded it would be helpful when partner application attempt to send a request again however, in a single session of partner application, you should maintain only one instance of this class and use it to send requests to samsung pay application since api level 1 1 nested class summary nested classes/interfaces inherited from class com samsung android sdk samsungpay v2 spaysdk spaysdk brand, spaysdk servicetype, spaysdk transactiontype field summary fields modifier and type field description static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final string push_provision_error this table shows the status codes used commonly status bundle keys bundle values spaysdk error_registration_fail -104 spaysdk extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 spaysdk extra_request_id string value returned from server apptoappconstants error_tsm_fail -507 spaysdk extra_error_reason string error message for tsm solution fields inherited from class com samsung android sdk samsungpay v2 spaysdk common_status_table, cryptogram_type_icc, cryptogram_type_ucaf, device_id, device_type_gear, device_type_phone, error_android_platform_check_fail, error_device_integrity_check_fail, error_device_not_samsung, error_duplicated_sdk_api_called, error_expired_or_invalid_debug_key, error_initiation_fail, error_missing_information, error_no_network, error_none, error_not_allowed, error_not_found, error_not_supported, error_partner_app_blocked, error_partner_app_signature_mismatch, error_partner_app_version_not_supported, error_partner_info_invalid, error_partner_not_approved, error_partner_sdk_api_level, error_partner_sdk_version_not_allowed, error_partner_service_type, error_registration_fail, error_sdk_not_supported_for_this_region, error_server_internal, error_server_no_response, error_service_id_invalid, error_service_not_approved_for_release, error_service_unavailable_for_this_region, error_spay_app_integrity_check_fail, error_spay_app_need_to_update, error_spay_connected_with_external_display, error_spay_fmm_lock, error_spay_internal, error_spay_pkg_not_found, error_spay_sdk_service_not_available, error_spay_setup_not_completed, error_unable_to_verify_caller, error_unauthorized_request_type, error_user_canceled, error_user_not_registered_for_debug, extra_accept_combo_card, extra_card_type, extra_country_code, extra_cpf_holder_name, extra_cpf_number, extra_cryptogram_type, extra_device_card_limit_reached, extra_device_type, extra_error_reason, extra_error_reason_message, extra_issuer_name, extra_issuer_pkgname, extra_last4_dpan, extra_last4_fpan, extra_member_id, extra_merchant_ref_id, extra_online_transaction_type, extra_partner_name, extra_request_id, extra_require_cpf, extra_resolved_1, extra_resolved_2, extra_resolved_3, extra_resolved_4, extra_resolved_5, extra_resolved_6, extra_resolved_7, partner_service_type, spay_has_no_transit_card, spay_has_transit_card, spay_not_allowed_temporally, spay_not_ready, spay_not_supported, spay_ready, wallet_dm_id, wallet_user_id fields inherited from interface com samsung android sdk samsungpay v2 apptoappconstants error_auth_code_expired, error_auth_code_invalid, error_auth_code_max_try_reached, error_auth_code_type_invalid, error_authentication_closed, error_authentication_failed, error_authentication_not_ready, error_authentication_timed_out, error_card_already_registered, error_card_idv_not_supported, error_card_not_supported, error_framework_internal, error_invalid_card, error_invalid_cardinput, error_max_card_num_reached, error_max_pan_provision_num_reached, error_server_reject, error_tsm_fail, error_verify_card, error_wallet_id_mismatch, extra_app2app_intent, extra_app2app_payload, extra_card_balance, extra_card_status_reason, extra_issuer_app_card_linked constructor summary constructors constructor description cardmanager android content context context, partnerinfo partnerinfo api to get the cardmanager instance the caller should set valid serviceid method summary all methodsinstance methodsconcrete methods modifier and type method description void addcard addcardinfo addcardinfo, addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay partner app uses this api to add card to samsung pay by providing the required card details void addcobadgecard addcardinfo primaryaddcardinfo, addcardinfo secondaryaddcardinfo, addcardlistener listener api to add a co-badge card from partner app example issuer/bank app to samsung pay partner app uses this api to add co-badge card to samsung pay by providing the required card details void getallcards android os bundle cardfilter, getcardlistener listener api to get all the cards from samsung pay for the given filter void verifycardidv idvverifyinfo idvverifyinfo, statuslistener listener api to verify and activate a card in samsung pay issuer app uses this api to send verification code back to token network to activate a card on samsung pay when adding a card to samsung pay, the issuer/card network may request secondary authentication idv the user can verify idv via issuer app and after user verification by logging to issuer app , issuer app sends some information back to issuer/card network via samsung pay to activate the card methods inherited from class com samsung android sdk samsungpay v2 spaysdk getversioncode, getversionname methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details error_invalid_parameter public static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 1 2 see also constant field values push_provision_error public static final string push_provision_error this table shows the status codes used commonly status bundle keys bundle values spaysdk error_registration_fail -104 spaysdk extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 spaysdk extra_request_id string value returned from server apptoappconstants error_tsm_fail -507 spaysdk extra_error_reason string error message for tsm solution see also constant field values constructor details cardmanager public cardmanager android content context context, partnerinfo partnerinfo api to get the cardmanager instance the caller should set valid serviceid partnerinfo is passed to samsung pay for caller verification context ct = activity; // or context ct = service; string issuername = "mybank"; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay extra_issuer_name, issuername ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; cardmanager cardmanager = new cardmanager ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 1 1 method details addcard public void addcard @nonnull addcardinfo addcardinfo, @nonnull addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay partner app uses this api to add card to samsung pay by providing the required card details this helps user to add their cards to samsung pay directly from partner app cardmanager cardmanager = new cardmanager ct, pinfo ; string cardtype = card card_type_credit; string tokenizationprovider = addcardinfo provider_abcd; // get it from issuer app // samsung pay does not provide detailed payload information // generate provisioning payload in accordance with your card network specifications string testpayload = "thisistestpayloadcardinfo1234567890"; bundle carddetail = new bundle ; carddetail putstring addcardinfo extra_provision_payload, testpayload ; addcardinfo addcardinfo = new addcardinfo cardtype, tokenizationprovider, carddetail ; cardmanager addcard addcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle // such as samsungpay extra_error_reason or samsungpay extra_request_id if provided } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ; parameters addcardinfo - detail card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with spaysdk error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the codes from the push_provision_error with bundle data note please refer spaysdk common_status_table for other error status in case of tsm, please refer addcardlistener onprogress int, int, bundle throws nullpointerexception - thrown if parameters are null since api level 1 2 addcobadgecard public void addcobadgecard @nonnull addcardinfo primaryaddcardinfo, @nonnull addcardinfo secondaryaddcardinfo, @nonnull addcardlistener listener api to add a co-badge card from partner app example issuer/bank app to samsung pay partner app uses this api to add co-badge card to samsung pay by providing the required card details this helps user to add their cards to samsung pay directly from partner app parameters primaryaddcardinfo - detail primary card information to add secondaryaddcardinfo - detail secondary card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with spaysdk error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the codes from the push_provision_error with bundle data note please refer spaysdk common_status_table for other error status in case of tsm, please refer addcardlistener onprogress int, int, bundle throws nullpointerexception - thrown if parameters are null since api level 2 22 getallcards public void getallcards @nullable android os bundle cardfilter, @nonnull getcardlistener listener api to get all the cards from samsung pay for the given filter since api level 2 13, getallcards bundle, getcardlistener would return a card list in which a card of spaysdk brand visa brand would hold a token reference id as its card getcardid instead of a provisioned token id in earlier api level since api level 1 4, partner must define issuer names as a card filter on samsung pay developers while on-boarding bundle cardfilter = new bundle ; // since api level 1 4, card filter is retrieved from samsung pay developers // no need to set from partner app cardfilter putstring cardmanager extra_issuer_name, issuername ; cardmanager getallcards cardfilter, new getcardlistener { @override public void onsuccess list<card> cards { // getting card status is success if cards == null || cards isempty { log e tag,"no card is found" ; return; } else { // perform operation with card data for card s cards { log d tag, "cardid " + s getcardid + "cardstatus" + s getcardstatus ; // get extra card data if s getcardinfo != null { string last4fpan = s getcardinfo getstring cardmanager extra_last4_fpan ; string last4dpan = s getcardinfo getstring cardmanager extra_last4_dpan ; string app2apppayload = s getcardinfo getstring cardmanager extra_app2app_payload ; string cardtype = s getcardinfo getstring cardmanager extra_card_type ; string cardissuername = s getcardinfo getstring cardmanager extra_issuer_name ; log d tag, "last4fpan " + last4fpan + "last4dpan" + last4dpan + "app2apppayload " + app2apppayload ; } } } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters cardfilter - filter to limit the card list since api level 1 4, issuer name filter is retrieved from samsung pay developers cardfilter bundle key-value pairs are defined as follows keys values spaysdk extra_issuer_name string issuername issuercode for korean issuers listener - callback through which the result is provided on success, getcardlistener onsuccess list is invoked with list of cards on any failure, the error code is provided via getcardlistener onfail int, bundle note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if listener is null since api level 2 15 verifycardidv public void verifycardidv @nonnull idvverifyinfo idvverifyinfo, @nonnull statuslistener listener api to verify and activate a card in samsung pay issuer app uses this api to send verification code back to token network to activate a card on samsung pay when adding a card to samsung pay, the issuer/card network may request secondary authentication idv the user can verify idv via issuer app and after user verification by logging to issuer app , issuer app sends some information back to issuer/card network via samsung pay to activate the card cardmanager cardmanager = new cardmanager ct, pinfo ; // issuer can get cardid from getallcards api result string cardid = "card_id_example_dummy" ; // issuer app gets card status from samsung pay and talks to issuer server // and gets authentication code string authcode = "auth_code_example_dummy"; // if any extra information issuer wants to pass to card network/issuer server bundle cardinfodata = new bundle ; idvverifyinfo idvverifyinfo = new idvverifyinfo cardid, authcode, cardinfodata ; // in case auth code is generated for sms or email, // set authcodetype as idvverifyinfo idv_type_sms or idvverifyinfo idv_type_email // if you don't specify any value for authcodetype, idv_type_app2app will be used by default idvverifyinfo setidnvtype idvverifyinfo idv_type_app2app ; cardmanager verifycardidv idvverifyinfo, new statuslistener { @override public void onsuccess int status, bundle data { // log d tag, "verification code successfully send to server" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters idvverifyinfo - card verification information from issuer listener - verification status callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked when request operation is success on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata the failure code can be one of the following codes with bundle data status bundle keys bundle values apptoappconstants error_verify_card -8 spaysdk extra_error_reason apptoappconstants error_auth_code_invalid -517 apptoappconstants error_auth_code_expired -518 apptoappconstants error_auth_code_max_try_reached -519 apptoappconstants error_auth_code_type_invalid -520 apptoappconstants error_card_idv_not_supported -521 note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
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.