Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Pay
docsamsung pay overview this guide explains test cards that can be registered on samsung pay's testing android application package stg apk these test cards can only be registered on the stg apk and also require a valid card registration on the wallet application’s production environment features after installing the stg apk, you can register the card information below to test online payments test card test card numbers including fpan, cvv, cvc, expiration date from the payment networks listed below can be on supported devices to test within the samsung pay staging environment visa card number card type expiry date cvv 4622 9431 2304 8218 credit 12/25 736 4622 9431 2304 8226 credit 12/25 454 mastercard card number card type expiry date cvv/cvc2 5186 1516 5001 2004 credit 12/25 123
Learn Code Lab
codelabsamsung pay web checkout with merchant sites objective learn how to integrate the samsung pay payment system into your merchant sites using the samsung pay web checkout sdk partnership request to use the samsung pay web checkout sdk, you must become an official samsung pay partner once done, you can fully utilize this code lab you can learn more about the partnership process by visiting the samsung pay page here in samsung developers notein accordance with the applicable samsung pay partners agreements, this code lab covers the setup and use of the samsung pay web checkout sdk for purposes of integrating samsung pay with merchant sites the use cases and corresponding code samples included are representative examples only and should not be considered as either recommended or required overview the samsung pay web checkout service enables users to pay for purchases on your website with payment cards saved in the samsung wallet app on their mobile device it supports browser-based payments on both computers and mobile devices a mobile device with samsung wallet installed is required to make purchases through samsung pay web checkout when the user chooses to pay with samsung pay, they must provide their samsung account id email id or scan the qr code on the screen with their mobile device the user then authorizes the purchase within the samsung wallet application, which generates the payment credential on the device and transmits it to your website through the web checkout for more information, see samsung pay web checkout set up your environment you will need the following access to samsung pay developers site samsung wallet test app from samsung pay developers site samsung galaxy device that supports samsung wallet app internet browser, such as google chrome codesandbox account notein this code lab, you can use the samsung wallet test app to try the functionality of the samsung pay web checkout service in a staging environment you can use the official samsung wallet app from the galaxy store once your service is in the production environment start your project and register your service in your browser, open the link below to access the project file of the sample merchant site codesandbox io/s/virtual-store-sample-fnydk5 click the fork button to create an editable copy of the project next, follow the steps below to register your sample merchant site in the samsung pay developers site go to my projects > service management click create new service select web online payment as your service type enter your service name and select your service country select your payment gateway from the list of supported payment gateways pg if your pg uses the network token mode, upload the certificate signing request csr or privacy enhanced mail pem file you obtained from your pg 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 for each additional domain url, click add in this code lab, the generated preview url of the forked project is your service domain click the name of the newly created service to see its details, such as the generated service id that you can use for all the registered service domains include the samsung pay web checkout javascript sdk the samsung pay web checkout sdk uses javascript to integrate the samsung pay payment system to your website this sdk allows users to purchase items via web browser in the <head> section of the index html file of the project, include the samsung pay web checkout javascript sdk file <script src="https //img mpay samsung com/gsmpi/sdk/samsungpay_web_sdk js"></script> initialize the samsung pay client to initiate payments using the samsung pay api, create a new instance of the paymentclient class and pass an argument specifying that the environment as stage write the code below in the <script> tag of the <body> section const samsungpayclient = new samsungpay paymentclient { environment "stage" } ; when the service is still in debug or test mode, you can only use the staging environment to test payment functionality without processing live transactions noteby default, the service is initially set to debug or test mode during creation to switch the service status to release mode, a request must be made through the samsung pay developers site after successfully transitioning to release mode, change the environment to production next, define the service id, security protocol, and card brands that the merchant can support as payment methods the service id is the unique id assigned to your service upon creation in the samsung pay developers site let paymentmethods = { version "2", serviceid "", //input your service id here protocol "protocol_3ds", allowedbrands ["visa", "mastercard"] }; check whether the samsung pay client is ready to pay using the given payment method call the createandaddbutton function if the response indicates that the client is ready samsungpayclient isreadytopay paymentmethods then function response { if response result { createandaddbutton ; } } catch function err { console error err ; } ; create and implement the samsung pay button go to the <body> section and, inside the page-container div, create a container for the samsung pay button <div align="center" id="samsungpay-container"></div> next, go back to the <script> tag and write the createandaddbutton function inside this function, generate the samsung pay button by calling the createbutton method ensure that the button appears on the page by appending it to the container you created function createandaddbutton { const samsungpaybutton = samsungpayclient createbutton { onclick onsamsungpaybuttonclicked, buttonstyle "black"} ; document getelementbyid "samsungpay-container" appendchild samsungpaybutton ; } function onsamsungpaybuttonclicked { // create the transaction information //launch the payment sheet } from the createandaddbutton function, call the onsamsungpaybuttonclicked function when the user clicks the generated button create the transaction information in the onsamsungpaybuttonclicked function, create the transactiondetail object for the user’s purchase input your service domain in the url key let transactiondetail = { ordernumber "sample0n1y123", merchant { name "virtual shop", url "", //input your service domain countrycode "us" }, amount { option "format_total_estimated_amount", currency "usd", total 2019 99 } }; below are the descriptions of the keys included in the transactiondetail object key type description ordernumber string order number of the transaction allowed characters [a-z][a-z][0-9,-] merchant object data structure containing the merchant information merchant name string merchant name merchant url string merchant domain url e g , samsung com the maximum length is 100 characters merchant countrycode string merchant country code e g , us for united states iso-3166-1 alpha-2 amount object data structure containing the payment amount amount option string display format for the total amount on the payment sheet format_total_estimated_amount = displays "total estimated amount " with the total amountformat_total_price_only = displays the total amount only amount currency string currency code e g , usd for us dollar the maximum length is 3 character amount total string total payment amount in the currency specified by amount currencythe amount must be an integer e g , 300 or in a format valid for the currency, such as 2 decimal places after a separator e g , 300 50 notefor the complete list of specifications for the transactiondetail object, see samsung pay web checkout api reference launch the payment sheet after creating the transaction information, call the loadpaymentsheet method to display the web checkout ui the user can either input their email address or scan the generated qr code a timer screen in the web checkout ui is displayed after the user input, while a payment sheet is launched in the user's samsung wallet app the payment sheet contains the payment card option s and the transaction details when the user confirms their payment on their mobile device, you will receive the paymentcredential object generated by the device then, inform the samsung server of the payment result using the notify method the paymentresult object contains the payment result information during transaction processing and after the payment is processed with the pg network notefor real transactions, you need to extract the payment credential information from the 3ds data key within the paymentcredential object and process it through your payment provider however, in this code lab, you only need to print the paymentcredential to the console samsungpayclient loadpaymentsheet paymentmethods, transactiondetail then function paymentcredential { console log "paymentcredential ", paymentcredential ; const paymentresult = { status "charged", provider "test pg" }; samsungpayclient notify paymentresult ; } catch function error { console log "error ", error ; } ; other possible values of the status key are charged - payment was charged successfully canceled - payment was canceled by either the user, merchant, or the acquiring bank rejected - payment was rejected by the acquiring bank erred - an error occurred during the payment process test the samsung pay button after integrating the samsung pay web checkout service into your sample merchant site, follow the steps below to test the functionality of the integrated service open your sample merchant site in a new tab then, click the pay with samsung pay button in the web checkout ui, enter the email address of your samsung account to send a payment request to samsung pay tap the push notification sent to the samsung wallet app installed on your mobile device then, click accept when the payment sheet is loaded, tap on pin and enter your pin to proceed a verified message will display in both the samsung wallet app and web checkout ui to indicate that the payment was processed successfully you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can integrate the samsung pay web checkout service into your website by yourself if you're having trouble, you may check the complete code below codesandbox io/s/virtual-store-complete-dkhzfx to learn more about developing apps for samsung pay devices, visit developer samsung com/pay
Learn Code Lab
codelabsamsung pay sdk objective learn how to integrate in-app payment with your merchant apps using samsung pay sdk partnership request to use the samsung pay sdk, you must become an official samsung partner once done, you can fully utilize this code lab you can learn more about the partnership process by visiting samsung pay page, here in samsung developers notein accordance with the applicable samsung partner agreements, this code lab covers setup and use of the samsung pay sdk for purposes of integrating the samsung pay app with partner apps the use cases and corresponding code samples included are representative examples only and should not be construed as either recommended or required overview the samsung pay sdk is an application framework for integrating selected samsung pay features with android-based partner apps on samsung devices in-app payment, which allows customers to pay for products and services with samsung pay, is one of the operations supported alongside push provisioning and open favorite cards partner apps can leverage the samsung pay sdk to perform different operations ― push provisioning and open favorite cards for issuers; in-app payment for merchants key components include partner app app developed by merchant or issuer for making online or offline payments and provisioning payment cards through samsung pay samsung pay sdk sdk integrated into the partner app for direct communication with samsung pay samsung pay app pay app with which the samsung pay sdk communicates financial network comprises the payment gateways, acquirers, card associations, and issuers that participate in transaction processing under agreement with the merchant most common use case for in-app payment the merchant app allows the user to make payments with samsung pay upon user selection of the samsung pay option, the merchant app calls the apis included in the samsung pay sdk to initiate a transaction with the samsung pay app the samsung pay app responds with the tokenized payment information necessary to complete the transaction the merchant app forwards this payment information to the designated payment gateway pg , either directly through the merchant's web server or indirectly via the samsung-pg interface server for standard transaction processing for more detailed information, see the official samsung pay sdk programming guide set up your environment you will need the following samsung wallet or samsung pay app depending on the country a compatible mobile device with android marshmallow 6 0 or android api level 23 or later android os versions samsung pay sdk android studio latest version recommended java se development kit jdk 11 or later sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! in-app payment sample code 1 90 mb integrate the samsung pay sdk with your app the following steps comprise the general process for integrating the samsung pay sdk with your app sign up for the samsung pay developers site by clicking sign up and register your samsung account or create it if you don't already have one , then sign in follow the on-screen instructions for adding your app and creating a new service to generate the service id you'll need to use in your project download the samsung pay sdk by going to resources > sdk download add the samsung pay sdk jar file samsungpay jar to your android project using android studio or file explorer develop your partner app with the required api calls and callbacks for samsung pay integration upload a release version of your app to the samsung pay developers site for approval upon samsung approval, publish your partner app to the google play store and samsung galaxy apps notethe service id is already provided in the sample code for this code lab however, this service id is for test purposes only and cannot be used for an actual application or service using the provided test service id enforces your app to use the fixed properties below service id 0915499788d6493aa3a038 package name com test beta pay app version 1 0/ 1 or higher start your project after downloading the sample code containing the project files, in android studio click open to open existing project locate the downloaded android project sampleonlinepay from the directory and click ok add the samsungpaysdk_2 18 00_release jar file from the sdk's libs folder to your android project's libs folder go to gradle scripts > build gradle module sampleonlinepay app and enter the following to the dependencies block implementation files 'libs/samsungpaysdk_2 18 00_release jar' if the target sdk version is 30 android 11 or the r-os , you must include the following <queries> element in androidmanifest xml <queries> <package android name="com samsung android spay" /> </queries> configure the api level as of sdk version 1 4, enhanced version control management has been introduced to improve backward compatibility and handle api dependency from country and service type for example, if a partner integrates the latest sdk—for instance, api level 2 18—but continues to use apis based on level 1 4, the partner app remains compatible with samsung pay apps supporting api level 1 4 without upgrading the samsung pay app implement the following in application tag of androidmanifest xml <meta-data android name="spay_sdk_api_level" android value="2 17" /> // most recent sdk version is recommended to leverage the latest apis add an xml layout and modify the activity next, replace the xml layout in res > layout > activity_main xml this layout shows the sample item information such as image, name, and price <?xml version="1 0" encoding="utf-8"?> <layout xmlns tools="http //schemas android com/tools" xmlns app="http //schemas android com/apk/res-auto" xmlns android="http //schemas android com/apk/res/android"> <androidx constraintlayout widget constraintlayout android layout_width="match_parent" android layout_height="match_parent" tools context=" mainactivity"> <imageview android id="@+id/imageview" android layout_width="350dp" android layout_height="184dp" android layout_margintop="100dp" app layout_constraintend_toendof="parent" app layout_constraintstart_tostartof="parent" app layout_constrainttop_totopof="parent" android src="@drawable/galaxy_s23_ultra_image"/> <imageview android id="@+id/samsung_pay_button" android layout_width="wrap_content" android layout_height="75dp" app layout_constraintbottom_tobottomof="parent" app layout_constraintend_toendof="parent" app layout_constraintstart_tostartof="parent" android src="@drawable/pay_rectangular_full_screen_black" android visibility="invisible"/> <textview android id="@+id/textview" android layout_width="wrap_content" android layout_height="wrap_content" android layout_margintop="10dp" android text="galaxy s23 ultra" android textsize="16sp" android textstyle="bold" app layout_constraintend_toendof="parent" app layout_constraintstart_tostartof="parent" app layout_constrainttop_tobottomof="@+id/imageview" /> <textview android id="@+id/textview2" android layout_width="wrap_content" android layout_height="wrap_content" android layout_margintop="5dp" android text="$1,199 00" android textsize="14sp" app layout_constraintend_toendof="parent" app layout_constrainthorizontal_bias="0 517" app layout_constraintstart_tostartof="parent" app layout_constrainttop_tobottomof="@+id/textview" /> </androidx constraintlayout widget constraintlayout> </layout> since you added a data binding layout, you need to inflate the xml file differently go to java > com > test > beta > pay > mainactivity kt, and declare the databinding variable in the mainactivity class private lateinit var databinding activitymainbinding replace the standard setcontentview declaration with the data binding version inside the oncreate method databinding = databindingutil setcontentview this, r layout activity_main check samsung pay status in the mainactivity, create the samsungpay instance to determine if the device supports samsung pay and if the samsung pay button can be displayed as the user's payment option, check the samsung pay status samsungpay requires a valid partnerinfo from the merchant app, which consists of service id and service type during onboarding, the samsung pay developers site assigns the service id and service type in the mainactivity, declare the partnerinfo variable private lateinit var partnerinfo partnerinfo then, set the partnerinfo in the oncreate method val bundle = bundle bundle putstring spaysdk partner_service_type, spaysdk servicetype inapp_payment tostring partnerinfo = partnerinfo service_id, bundle after setting partnerinfo, call the getsamsungpaystatus method via updatesamsungpaybutton function inside the oncreate method updatesamsungpaybutton the getsamsungpaystatus method of the samsungpay class must be called before using any other feature in the samsung pay sdk write the updatesamsungpaybutton function as follows private fun updatesamsungpaybutton { val samsungpay = samsungpay this, partnerinfo samsungpay getsamsungpaystatus object statuslistener { override fun onsuccess status int, bundle bundle { when status { spaysdk spay_ready -> { databinding samsungpaybutton visibility = view visible // perform your operation } spaysdk spay_not_ready -> { // samsung pay is supported but not fully ready // if extra_error_reason is error_spay_app_need_to_update, // call gotoupdatepage // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay databinding samsungpaybutton visibility = view invisible } spaysdk spay_not_allowed_temporally -> { // if extra_error_reason is error_spay_connected_with_external_display, // guide user to disconnect it databinding samsungpaybutton visibility = view invisible } spaysdk spay_not_supported -> { databinding samsungpaybutton visibility = view invisible } else -> databinding samsungpaybutton visibility = view invisible } } override fun onfail errorcode int, bundle bundle { databinding samsungpaybutton visibility = view invisible toast maketext applicationcontext, "getsamsungpaystatus fail", toast length_short show } } } tipfor the list and detailed definition of status codes such as spay_ready, refer to checking samsung pay status noteas of sdk version 1 5, if the device has android lollipop 5 1 android api level 22 or earlier versions, the getsamsungpaystatus api method returns a spay_not supported status code merchant apps using sdk 1 4 or earlier must check their app's android version activate the samsung pay app the samsungpay class provides an api method called activatesamsungpay to activate the samsung pay app on the same device where the partner app is running if the getsamsungpaystatus returns spay_not_ready and the extra_error_reason is error_spay_setup_not_complete, the partner app needs to display an appropriate message to the user then, call activatesamsungpay to launch samsung pay app and request the user to sign in in updatesamsungpaybutton function, add the code to call activatesamsungpay method via doactivatesamsungpay function when the status is spay_not_ready // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay val extraerror = bundle getint samsungpay extra_error_reason if extraerror == samsungpay error_spay_setup_not_completed { doactivatesamsungpay spaysdk servicetype inapp_payment tostring } create the doactivatesamsungpay function as below private fun doactivatesamsungpay servicetype string { val bundle = bundle bundle putstring samsungpay partner_service_type, servicetype val partnerinfo = partnerinfo service_id, bundle val samsungpay = samsungpay this, partnerinfo samsungpay activatesamsungpay } create a transaction request upon successfully initializing the samsungpay class, the merchant app should create a transaction request with payment information samsung pay offers two types of online payment sheet―normal and custom the normal payment sheet has fixed display items ― items, tax, and shipping the custom payment sheet offers more dynamic controls for customizing the ui, together with additional customer order and payment data for this code lab, use the custom payment sheet and populate the fields in customsheetpaymentinfo to initiate a payment transaction /* * make user's transaction details * the merchant app should send paymentinfo to samsung pay via the applicable samsung pay sdk api method for the operation * being invoked * upon successful user authentication, samsung pay returns the "payment info" structure and the result string * the result string is forwarded to the pg for transaction completion and will vary based on the requirements of the pg used * the code example below illustrates how to populate payment information in each field of the paymentinfo class */ private fun maketransactiondetailswithsheet customsheetpaymentinfo? { val brandlist = brandlist val extrapaymentinfo = bundle val customsheet = customsheet customsheet addcontrol makeamountcontrol return customsheetpaymentinfo builder setmerchantid "123456" setmerchantname "sample merchant" setordernumber "amz007mar" // if you want to enter address, please refer to the javadoc // reference/com/samsung/android/sdk/samsungpay/v2/payment/sheet/addresscontrol html setaddressinpaymentsheet customsheetpaymentinfo addressinpaymentsheet do_not_show setallowedcardbrands brandlist setcardholdernameenabled true setrecurringenabled false setcustomsheet customsheet setextrapaymentinfo extrapaymentinfo build } private fun makeamountcontrol amountboxcontrol { val amountboxcontrol = amountboxcontrol amount_control_id, "usd" amountboxcontrol additem product_item_id, "item", 1199 00, "" amountboxcontrol additem product_tax_id, "tax", 5 0, "" amountboxcontrol additem product_shipping_id, "shipping", 1 0, "" amountboxcontrol setamounttotal 1205 00, amountconstants format_total_price_only return amountboxcontrol } private val brandlist arraylist<spaysdk brand> get { val brandlist = arraylist<spaysdk brand> brandlist add spaysdk brand visa brandlist add spaysdk brand mastercard brandlist add spaysdk brand americanexpress brandlist add spaysdk brand discover return brandlist } request 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 pay when you call the startinapppaywithcustomsheet method, a custom payment sheet is displayed on the merchant app screen from there, the user can select a registered card for payment and change the billing and shipping addresses as necessary the payment sheet lasts for 5 minutes after calling the api if the time limit expires, the transaction fails in the mainactivity class, declare the paymentmanager variable private lateinit var paymentmanager paymentmanager then, in oncreate , set an onclicklistener method before calling the updatesamsungpaybutton function to trigger the startinapppaywithcustomsheet function when the samsungpaybutton is clicked databinding samsungpaybutton setonclicklistener { startinapppaywithcustomsheet } lastly, create a function to call startinapppaywithcustomsheet method of the paymentmanager class /* * paymentmanager startinapppaywithcustomsheet is a method to request online in-app payment with samsung pay * partner app can use this method to make in-app purchase using samsung pay from their * application with custom payment sheet */ private fun startinapppaywithcustomsheet { paymentmanager = paymentmanager applicationcontext, partnerinfo paymentmanager startinapppaywithcustomsheet maketransactiondetailswithsheet , transactioninfolistener } /* * customsheettransactioninfolistener is for listening callback events of online in-app custom sheet payment * this is invoked when card is changed by the user on the custom payment sheet, * and also with the success or failure of online in-app payment */ private val transactioninfolistener paymentmanager customsheettransactioninfolistener = object paymentmanager 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 pay * newly selected cardinfo is passed and partner app can update transaction amount based on new card if needed * call updatesheet method this is mandatory */ paymentmanager updatesheet customsheet } override fun onsuccess response customsheetpaymentinfo, paymentcredential string, extrapaymentdata bundle { /* * you will receive the payloads shown below in paymentcredential parameter * the output paymentcredential structure varies depending on the pg you're using and the integration model direct, indirect with samsung */ toast maketext applicationcontext, "onsuccess ", toast length_short show } // this callback is received when the online payment transaction has failed override fun onfailure errorcode int, errordata bundle? { toast maketext applicationcontext, "onfailure ", toast length_short show } } run the app after building the apk, you can run the sample merchant app and see how it connects to samsung pay upon clicking the button at the bottom of the screen to thoroughly test the sample app, you must add at least one card to the samsung pay app you're done! congratulations! you have successfully achieved the goal of this code lab now, you can integrate in-app payment with your app by yourself! if you face any trouble, you may download this file in-app payment complete code 2 26 mb to learn more about developing apps for samsung pay devices, visit developer samsung com/pay
Learn Code Lab
codelabsamsung pay sdk flutter plugin into merchant apps for in-app payment objective learn how to integrate in-app payment with your flutter-based merchant apps using samsung pay sdk flutter plugin partnership request to use the samsung pay sdk flutter plugin, you must become an official samsung partner once done, you can fully utilize this code lab you can learn more about the partnership process by visiting samsung pay in samsung developers overview the samsung pay sdk flutter plugin allows developers to use samsung wallet features in flutter applications it is the wrapper of samsung pay sdk, which is an application framework for integrating samsung wallet features on galaxy devices the samsung pay sdk flutter plugin offers in-app payment feature that gives customers the opportunity to pay for products and services with samsung wallet set up your environment you will need the following samsung wallet app version 5 6 53, 5 8 0 samsung pay sdk flutter plugin android studio latest version recommended java se development kit jdk 11 or later flutter sdk a compatible galaxy device with android q 10 0 or android api level 29 or later android os versions noteflutter sdk must be installed and set up properly when developing flutter applications after downloading, follow the installation guide appropriate to your operating system after proper installation and setup, configure your android studio to include the flutter plugin for intellij check this editor guide for the detailed steps sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! in-app payment flutter plugin sample code 20 4 mb start your project in android studio, click open to open an existing project locate the flutterinapppayment project from the directory, and click ok go to file > settings > languages & frameworks > flutter to change the flutter sdk path input the directory path where your flutter sdk is installed and click apply install the plugin and configure the api level add samsungpaysdkflutter_v1 01 00 folder in the project go to samsungpaysdkflutter_v1 01 00 > pubspec yaml file and click on pub get in right side of the action ribbon or run flutter pub get in the command line next, go to flutterinapppayment > pubspec yaml and add the samsungpaysdkflutter_v1 01 00 plugin under dependencies samsung_pay_sdk_flutter path /samsungpaysdkflutter_v1 01 00 warningbe careful of line alignment of pubspec yaml file, as the indentations indicate the structure and hierarchy of the data from the terminal, run flutter pub get command or click on pub get in the right side of the action ribbon configure the api level samsung pay sdk flutter plugin supports samsung pay sdk version 2 18 or later hence, we must set a valid api version latest version 2 19 of samsung pay sdk go to android > app > src > main > androidmanifest xml and add the api level in the meta-data of application tag <meta-data android name="spay_sdk_api_level" android value="2 19" /> // most recent sdk version is recommended to leverage the latest apis add the samsung pay button go to the main project, flutterinapppayment project > lib > main dart here, the ui is created using the build widget this widget shows the sample item information such as image, name, and price add a bottomnavigationbar before the end of the body of scaffold to display the samsung pay button bottomnavigationbar visibility visible isspaystatusready, child inkwell ontap { requestpaymentwithsamsungwallet ; }, child image asset 'assets/pay_rectangular_full_screen_black png' , , , check samsung pay status in main dart > myhomepage class, create an instance of samsungpaysdkflutter with valid partnerinfo service id and service type during onboarding, the samsung pay developers site assigns the service id and service type these data are used for partner verification static final samsungpaysdkflutterplugin = samsungpaysdkflutter partnerinfo serviceid service_id, data {spaysdk partner_service_type servicetype inapp_payment name} ; notethe service id is already provided in the sample code for this code lab however, this service id is for test purposes only and cannot be used for an actual application or service to change the service id in your actual application, the value of the variable service_id should be modified to check whether samsung pay is supported on your galaxy device, call the getsamsungpaystatus api and change the samsung pay button visibility accordingly in checksamsungpaystatus method, apply the following code void checksamsungpaystatus { //update ui according to samsung pay status myhomepage samsungpaysdkflutterplugin getsamsungpaystatus statuslistener onsuccess status, bundle async { if status == "2" { setstate { isspaystatusready = true; } ; } else { setstate { isspaystatusready = false; } ; _showtoast context,"spay status not ready" ; } }, onfail errorcode, bundle { setstate { isspaystatusready = false; } ; _showtoast context,"spay status api call failed" ; } ; } inside initstate method, call checksamsungpaystatus to ensure that getsamsungpaystatus api is called before any other api is called checksamsungpaystatus ; notethe getsamsungpaystatus api must be called before using any other feature in the samsung pay sdk flutter plugin create a custom payment sheet samsung pay sdk flutter plugin offers a custom type payment sheet called customsheet to customize the ui with additional payment related data here, create customsheet using the following controls amountboxcontrol it is a mandatory control to build a customsheet it provides the monetary details of the transaction addresscontrol it is used to display the billing and shipping address in makeamountcontrol method, add items and total price to build amountboxcontrol amountboxcontrol additem strings product_item_id, "item", 1199 00, "" ; amountboxcontrol additem strings product_tax_id, "tax", 5 0, "" ; amountboxcontrol additem strings product_shipping_id, "shipping", 1 0, "" ; amountboxcontrol setamounttotal 1205 00, spaysdk format_total_price_only ; in makebillingaddress method, add the following code to create billingaddresscontrol set sheetitemtype as zip_only_address while creating billingaddresscontrol to get the zip code as we are expecting to get the user's billing address from samsung wallet, set sheetupdatedlistener addresscontrol billingaddresscontrol = addresscontrol strings billing_address_id, sheetitemtype zip_only_address name ; billingaddresscontrol setaddresstitle strings billing_address ; billingaddresscontrol sheetupdatedlistener = billinglistener; return billingaddresscontrol; notefrom samsung pay sdk version 2 19 onwards, users can only add zip code as their billing address only the zip code is fetched from the user's samsung wallet instead of the full billing address implement this listener in makeupcustomsheet method to update the custom sheet when the user updates their billing address sheetupdatedlistener sheetupdatedlistener = sheetupdatedlistener onresult string controlid, customsheet sheet { if controlid == strings billing_address_id { var addresscontrol = sheet getsheetcontrol controlid as addresscontrol; setstate { postalcode = addresscontrol address! postalcode; } ; } myhomepage samsungpaysdkflutterplugin updatesheet sheet ; } ; create the shipping address in buildshippingaddressinfo method to add it in shipping addresscontrol this is the shipping address from the merchant app maddress = address addressee "jane smith", addressline1 "123 main st", addressline2 "suite 456", city "anytown", state "st", countrycode "usa", postalcode "12345", phonenumber "+1 555-123-4567", email "example@email com" ; add this address in makeshippingaddress method shippingaddresscontrol address = buildshippingaddressinfo ; finally, complete the makeupcustomsheet method by adding amountboxcontrol, billingaddresscontrol, and shippingaddresscontrol customsheet addcontrol makeamountcontrol ; customsheet addcontrol makebillingaddress sheetupdatedlistener ; customsheet addcontrol makeshippingaddress ; create a transaction request to start the payment process, the merchant app should create a transaction request with payment information in maketransactiondetailswithsheet method, add the merchant name and custom sheet in customsheetpaymentinfo customsheetpaymentinfo customsheetpaymentinfo = customsheetpaymentinfo merchantname "in app payment flutter app", customsheet makeupcustomsheet ; your merchant app must fill the following mandatory fields in customsheetpaymentinfo customsheetpaymentinfo merchantid = "123456"; customsheetpaymentinfo setordernumber "amz007mar" ; customsheetpaymentinfo setmerchantcountrycode "us" ; customsheetpaymentinfo addressinpaymentsheet = addressinpaymentsheet need_billing_send_shipping; request payment with a custom payment sheet the startinapppaywithcustomsheet api is called to request payment using a custom payment sheet in samsung pay this api requires customsheetpaymentinfo and customsheettransactioninfolistener first, implement this listener before starting the payment customsheettransactioninfolistener transactionlistener { customsheettransactioninfolistener customsheettransactioninfolistener = customsheettransactioninfolistener oncardinfoupdated paymentcardinfo paymentcardinfo, customsheet customsheet { myhomepage samsungpaysdkflutterplugin updatesheet customsheet ; }, onsuccess customsheetpaymentinfo customsheetpaymentinfo, string paymentcredential, map<string, dynamic>? extrapaymentdata { print "payment success" ; }, onfail string errorcode, map<string, dynamic> bundle { print "payment failed" ; } ; return customsheettransactioninfolistener; } lastly, call startinapppaywithcustomsheet api to start the payment in the requestpaymentwithsamsungwallet method void requestpaymentwithsamsungwallet { myhomepage samsungpaysdkflutterplugin startinapppaywithcustomsheet maketransactiondetailswithsheet , transactionlistener ; } run the app build the app by running flutter build apk --debug in the command line or going to build > flutter > build apk deploy the app on the device test it by clicking on samsung pay button to proceed with the payment transaction to thoroughly test the sample app, you must add at least one payment card to the samsung wallet app you're done! congratulations! you have successfully achieved the goal of this code lab now, you can integrate in-app payment with your flutter app by yourself! if you are having trouble, you may download this file in-app payment flutter plugin complete code 62 0 mb to learn more about developing apps for samsung pay devices, visit developer samsung com/pay
Develop Samsung Pay
apisamsung pay status on the device also, this class provides apis to activate samsung pay on the device partner apps must check the samsung pay status on the device before performing any card management or payment operation since api level 1 1 constructor summary constructors constructor description samsungpay android content context context, partnerinfo partnerinfo constructor to get the samsungpay instance the caller should set the valid serviceid in partnerinfo method summary all methodsinstance methodsconcrete methods modifier and type method description void activatesamsungpay api to bring the samsung pay app to a state in which cards can be added samsung pay might be either in stub only state or samsung account is not signed in state partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay and user can sign in to the app void getsamsungpaystatus statuslistener listener api to get the samsung pay status on the device partner issuers, merchants, and so on applications must call this api to check the current state of samsung pay before doing any operation void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay partner app can use this information to uniquely identify the user and samsung pay app on a particular device void gotoupdatepage api to go to samsung pay update page partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay app if samsung pay app version is same or bigger than 2 1 00, it goes to "about samsungpay" menu if samsung pay app version is lower than 2 1 00 or kr device, it launches samsung pay app main screen methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait constructor details samsungpay public samsungpay android content context context, partnerinfo partnerinfo constructor to get the samsungpay instance the caller should set the valid serviceid in partnerinfo partnerinfo is passed to samsung pay for partner verification context ct = activity; // or context ct = service; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 1 1 method details getsamsungpaystatus public void getsamsungpaystatus statuslistener listener api to get the samsung pay status on the device partner issuers, merchants, and so on applications must call this api to check the current state of samsung pay before doing any operation // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay getsamsungpaystatus new statuslistener { @override public void onsuccess int status, bundle data { // success case if status == spay_ready { log d tag, "samsung pay is ready on the device" ; // perform your operation } else if status == spay_not_ready { // samsung pay is supported but not fully ready // if extra_error_reason is error_spay_app_need_to_update, // call gotoupdatepage // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay } else if status == spay_not_allowed_temporally { log d tag, "samsung pay is not allowed temporally" ; // if extra_error_reason is error_spay_connected_with_external_display, // guide user to disconnect it } else { // samsung pay is not supported on this device log d tag, "device does not support samsung pay" ; } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, samsung pay status code is provided via statuslistener onsuccess int status, bundle data if samsung pay is ready to be used, samsungpay#spay_ready will be returned otherwise, samsungpay#spay_not_ready or samsungpay#spay_not_supported or samsungpay#spay_not_allowed_temporally can be returned with samsungpay#extra_error_reason from bundle also, partner can get extra information from bundle data bundle keys if provided bundle values #extra_country_code device country code iso 3166-1 alpha-2 #extra_member_id string memberid for korean issuers only on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if the callback passed is null since api level 1 1 gotoupdatepage public void gotoupdatepage api to go to samsung pay update page partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay app if samsung pay app version is same or bigger than 2 1 00, it goes to "about samsungpay" menu if samsung pay app version is lower than 2 1 00 or kr device, it launches samsung pay app main screen // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay gotoupdatepage ; since api level 1 2 activatesamsungpay public void activatesamsungpay api to bring the samsung pay app to a state in which cards can be added samsung pay might be either in stub only state or samsung account is not signed in state partner app checks the samsung pay status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay and user can sign in to the app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay partner_service_type, samsungpay servicetype inapp_payment tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; samsungpay activatesamsungpay ; since api level 1 1 getwalletinfo public void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay partner app can use this information to uniquely identify the user and samsung pay app on a particular device // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring samsungpay extra_issuer_name, "issuer name" ; bundle putstring samsungpay partner_service_type, samsungpay servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; samsungpay samsungpay = new samsungpay context, pinfo ; // bundle keys added to get wallet information from samsung pay // this information can be delivered to the partner server for eligibility check arraylist<string> keys = new arraylist<> ; keys add samsungpay wallet_user_id ; keys add samsungpay device_id ; samsungpay getwalletinfo keys, new statuslistener { @override public void onsuccess int status, bundle walletdata { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa string deviceid = walletdata get samsungpay device_id ; // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa string walletuserid = walletdata get samsungpay wallet_user_id ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as samsungpay extra_error_reason if provided } } parameters keys - key list to get wallet information if the list is empty, all possible key values are returned the possible keys are #wallet_dm_id #device_id #wallet_user_id listener - callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked with wallet information the success code can be one of the following codes with bundle data status bundle keys bundle values usage vts mdes #error_none samsungpay#wallet_dm_id string device management id n/a paymentappinstanceid = device_id + padding "00" + wallet_dm_id *if you need 'paymentappinstanceid', you can generate it as above samsungpay#device_id string device id clientdeviceid samsungpay#wallet_user_id string wallet user id clientwalletaccountid on any failure, the error code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 1 2 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apisamsung pay watch status on the device before performing any card management also, this class provides apis getting cards information, adding new card to samsung pay on watch, and so on since api level 2 5 field summary fields modifier and type field description static final string device_serial_num key to represent device serial number to generate the paymentappinstanceid static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error static final int error_spay_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay gear static final int error_spay_watch_connection this error indicates that samsung pay watch plug-in can not connect with samsung pay watch partner app should ask user to check bluetooth connection or pairing static final int error_spay_watch_pay_progress this error indicates that samsung pay watch is in a process of payment static final int error_spay_watch_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay watch static final int spay_watch_taking_log_for_report this error indicates that samsung pay watch is taking log for error report static final int spay_watch_update_is_ongoing this error indicates that samsung pay watch being updated fields inherited from interface com samsung android sdk samsungpay v2 apptoappconstants error_auth_code_expired, error_auth_code_invalid, error_auth_code_max_try_reached, error_auth_code_type_invalid, error_authentication_closed, error_authentication_failed, error_authentication_not_ready, error_authentication_timed_out, error_card_already_registered, error_card_idv_not_supported, error_card_not_supported, error_framework_internal, error_invalid_card, error_invalid_cardinput, error_max_card_num_reached, error_max_pan_provision_num_reached, error_server_reject, error_tsm_fail, error_verify_card, error_wallet_id_mismatch, extra_app2app_intent, extra_app2app_payload, extra_card_balance, extra_card_status_reason, extra_issuer_app_card_linked constructor summary constructors constructor description watchmanager android content context context, partnerinfo partnerinfo api to get the watchmanager instance the caller should set valid serviceid method summary all methodsinstance methodsconcrete methods modifier and type method description void activatesamsungpay api to bring the samsung pay on watch app to a state in which cards can be added samsung pay on watch might be samsung account is not signed in state partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay on watch and user can sign in to the app void addcard addcardinfo addcardinfo, addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay on watch partner app uses this api to add card to samsung pay on watch by providing the required card details void getallcards android os bundle cardfilter, getcardlistener listener api to get all the cards from samsung pay on watch for the given filter void getsamsungpaystatus statuslistener listener api to get the samsung pay on watch status on the device partner issuers applications must call this api to check the current state of samsung pay on watch before doing any operation void getwalletinfo list<string> keys, statuslistener listener api to get the requested wallet information from samsung pay on watch partner app can use this information to uniquely identify the user and samsung pay on watch app on a particular device void gotoupdatepage api to go to samsung pay on watch update page partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay on watch app methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details device_serial_num public static final string device_serial_num key to represent device serial number to generate the paymentappinstanceid since api level 2 5 see also constant field values error_spay_pin_lock_setup_canceled public static final int error_spay_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay gear since api level 2 5 see also constant field values error_invalid_parameter public static final int error_invalid_parameter this error indicates that the given parameter is invalid this is returned as spaysdk extra_error_reason for spaysdk error_registration_fail error since api level 2 5 see also constant field values error_spay_watch_pin_lock_setup_canceled public static final int error_spay_watch_pin_lock_setup_canceled this error indicates that user canceled the pin lock setup partner app should ask user to setup pin for samsung pay watch since api level 2 5 see also constant field values spay_watch_update_is_ongoing public static final int spay_watch_update_is_ongoing this error indicates that samsung pay watch being updated since api level 2 5 see also constant field values spay_watch_taking_log_for_report public static final int spay_watch_taking_log_for_report this error indicates that samsung pay watch is taking log for error report since api level 2 5 see also constant field values error_spay_watch_pay_progress public static final int error_spay_watch_pay_progress this error indicates that samsung pay watch is in a process of payment since api level 2 5 see also constant field values error_spay_watch_connection public static final int error_spay_watch_connection this error indicates that samsung pay watch plug-in can not connect with samsung pay watch partner app should ask user to check bluetooth connection or pairing since api level 2 5 see also constant field values constructor details watchmanager public watchmanager android content context context, partnerinfo partnerinfo api to get the watchmanager instance the caller should set valid serviceid partnerinfo is passed to samsung pay on watch for caller verification context ct = activity; // or context ct = service; string issuername = "mybank"; // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager extra_issuer_name, issuername ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager ct, pinfo ; parameters context - activity context or service context partnerinfo - partner information throws nullpointerexception - thrown if parameters are null since api level 2 5 method details getsamsungpaystatus public void getsamsungpaystatus @nonnull statuslistener listener api to get the samsung pay on watch status on the device partner issuers applications must call this api to check the current state of samsung pay on watch before doing any operation // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager getsamsungpaystatus new statuslistener { @override public void onsuccess int status, bundle data { // success case if status == spay_ready { log d tag, "samsung pay on watch is ready on the device" ; // perform your operation } else if status == spay_not_ready { // samsung pay on watch is supported but not fully ready // if extra_error_reason is error_spay_app_need_to_update, // call gotoupdatepage // if extra_error_reason is error_spay_setup_not_completed, // call activatesamsungpay } else { // samsung pay on watch is not supported on this device log d tag, "device does not support samsung pay on watch" ; } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, samsung pay on watch status code is provided via statuslistener onsuccess int status, bundle data if samsung pay on watch is ready to be used, #spay_ready will be returned otherwise, #spay_not_ready or #spay_not_supported can be returned with #extra_error_reason from bundle also, partner can get extra information from bundle data bundle keys if provided bundle values spaysdk extra_country_code device country code iso 3166-1 alpha-2 on any failure, the failure code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if the callback passed is null since api level 2 5 gotoupdatepage public void gotoupdatepage api to go to samsung pay on watch update page partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_app_need_to_update, partner app can call this api to go to update samsung pay on watch app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager gotoupdatepage ; since api level 2 5 activatesamsungpay public void activatesamsungpay api to bring the samsung pay on watch app to a state in which cards can be added samsung pay on watch might be samsung account is not signed in state partner app checks the samsung pay on watch status with getsamsungpaystatus statuslistener api if the status is #spay_not_ready and #extra_error_reason is #error_spay_setup_not_completed, partner app can call this api to launch samsung pay on watch and user can sign in to the app // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; watchmanager activatesamsungpay ; since api level 2 5 getwalletinfo public void getwalletinfo list<string> keys, @nonnull statuslistener listener api to get the requested wallet information from samsung pay on watch partner app can use this information to uniquely identify the user and samsung pay on watch app on a particular device // set the serviceid which is assigned by the samsung pay developer during on boarding string serviceid = "sampleserviceid"; bundle bundle = new bundle ; bundle putstring watchmanager extra_issuer_name, "issuer name" ; bundle putstring watchmanager partner_service_type, watchmanager servicetype app2app tostring ; partnerinfo pinfo = new partnerinfo serviceid, bundle ; watchmanager watchmanager = new watchmanager context, pinfo ; // bundle keys added to get wallet information from samsung pay on watch // this information can be delivered to the partner server for eligibility check arraylist<string> keys = new arraylist<> ; keys add watchmanager wallet_user_id ; keys add watchmanager device_id ; watchmanager getwalletinfo keys, new statuslistener { @override public void onsuccess int status, bundle walletdata { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa string deviceid = walletdata get watchmanager device_id ; // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa string walletuserid = walletdata get watchmanager wallet_user_id ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } parameters keys - key list to get wallet information if the list is empty, all possible key values are returned the possible keys are #wallet_dm_id #device_id #wallet_user_id device_serial_num listener - callback through which the result is provided on success, statuslistener onsuccess int status, bundle data is invoked with wallet information the success code can be one of the following codes with bundle data status bundle keys bundle values usage vts mdes #error_none #wallet_dm_id string device management id n/a paymentappinstanceid = device_serial_num + wallet_dm_id *if you need 'paymentappinstanceid', you can generate it as above #device_id string device id clientdeviceid #wallet_user_id string wallet user id clientwalletaccountid device_serial_num string device serial number n/a on any failure, the error code is provided via statuslistener onfail int errorcode, bundle errordata note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if parameters are null since api level 2 5 addcard public void addcard @nonnull addcardinfo addcardinfo, @nonnull addcardlistener listener api to add a card from partner app example issuer/bank app to samsung pay on watch partner app uses this api to add card to samsung pay on watch by providing the required card details this helps user to add their cards to samsung pay on watch directly from partner app watchmanager watchmanager = new watchmanager ct, pinfo ; string cardtype = card card_type_credit; string tokenizationprovider = addcardinfo provider_abcd; // get it from issuer app // samsung pay on watch does not provide detailed payload information // generate provisioning payload in accordance with your card network specifications string testpayload = "thisistestpayloadcardinfo1234567890"; bundle carddetail = new bundle ; carddetail putstring addcardinfo extra_provision_payload, testpayload ; addcardinfo addcardinfo = new addcardinfo cardtype, tokenizationprovider, carddetail ; watchmanager addcard addcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle // such as watchmanager extra_error_reason or watchmanager extra_request_id if provided } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ; parameters addcardinfo - detail card information to add listener - callback through which the result is provided on success, addcardlistener onsuccess int, card is invoked with #error_none status code with added card information on any failure, the error code is provided via addcardlistener onfail int errorcode, bundle errordata the failure code can be one of the following codes with bundle data status bundle keys bundle values #error_registration_fail -104 #extra_error_reason apptoappconstants error_card_already_registered -500 apptoappconstants error_framework_internal -501 apptoappconstants error_invalid_card -502 apptoappconstants error_invalid_cardinput -503 error_invalid_parameter -504 apptoappconstants error_server_reject -505 apptoappconstants error_max_card_num_reached -506 apptoappconstants error_card_not_supported -514 apptoappconstants error_max_pan_provision_num_reached -515 apptoappconstants error_wallet_id_mismatch -516 error_spay_watch_pin_lock_setup_canceled -701 spay_watch_update_is_ongoing -702 spay_watch_taking_log_for_report -703 error_spay_watch_pay_progress -704 error_spay_watch_connection -705 #extra_request_id string value returned from server note please refer spaysdk common_status_table for other error status throws nullpointerexception - thrown if parameters are null since api level 2 17 getallcards public void getallcards @nullable android os bundle cardfilter, @nonnull getcardlistener listener api to get all the cards from samsung pay on watch for the given filter since api level 2 5, partner must define issuer names as a card filter on samsung pay developers while on-boarding bundle cardfilter = new bundle ; watchmanager getallcards cardfilter, new getcardlistener { @override public void onsuccess list<card> cards { // getting card status is success if cards == null || cards isempty { log e tag,"no card is found" ; return; } else { // perform operation with card data for card s cards { log d tag, "cardid " + s getcardid + "cardstatus" + s getcardstatus ; // get extra card data if s getcardinfo != null { string last4fpan = s getcardinfo getstring watchmanager extra_last4_fpan ; string last4dpan = s getcardinfo getstring watchmanager extra_last4_dpan ; string cardtype = s getcardinfo getstring watchmanager extra_card_type ; string cardissuername = s getcardinfo getstring watchmanager extra_issuer_name ; log d tag, "last4fpan " + last4fpan + "last4dpan" + last4dpan + "app2apppayload " + app2apppayload ; } } } } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; // to get more reason of the failure, // check some extra error codes in the errordata bundle such as watchmanager extra_error_reason if provided } } ; parameters listener - callback through which the result is provided on success, getcardlistener onsuccess list is invoked with list of cards on any failure, the error code is provided via getcardlistener onfail int, bundle note please refer spaysdk common_status_table in detail throws nullpointerexception - thrown if listener is null since api level 2 13 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apisamsung 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
docsamsung 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 Pay
apisamsung pay and current state is "active" static final string card_type indicates that the key for card type static final string card_type_credit indicates that the card type is credit card static final string card_type_credit_debit indicates that the card type is either credit or debit static final string card_type_debit indicates that the card type is debit card static final string card_type_gift indicates that the card type is gift card static final string card_type_loyalty indicates that the card type is loyalty card static final string card_type_transit indicates that the card type is transit card static final string card_type_vaccine_pass indicates that the card type is vaccine pass static final string disposed card is deleted from samsung pay static final string expired card is registered on samsung pay, but its current status is "expired" this might occur if the card or token expiration time has reached and samsung pay has not renewed it static final string pending_activation card is registered on samsung pay but not activated yet a notification of card activation is expected to be pushed to samsung pay in a moment static final string pending_provision card is not fully registered on samsung pay and current state is "pending provision" usually, this state returns when the user has not completed the secondary authentication idv static final string suspended card is registered on samsung pay and current state is "suspended" suspend can be triggered by issuer, card network, or the user 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 getcardbrand api to get card brand string getcardid api to get unique identification of a card in samsung pay android os bundle getcardinfo api to get extra card information if any related to the card string getcardstatus api to get current status of the card methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, wait, wait, wait field details active public static final string active card is fully registered on samsung pay and current state is "active" since api level 1 1 see also constant field values disposed public static final string disposed card is deleted from samsung pay since api level 1 1 see also constant field values expired public static final string expired card is registered on samsung pay, but its current status is "expired" this might occur if the card or token expiration time has reached and samsung pay has not renewed it since api level 1 1 see also constant field values pending_provision public static final string pending_provision card is not fully registered on samsung pay and current state is "pending provision" usually, this state returns when the user has not completed the secondary authentication idv since api level 1 1 see also constant field values suspended public static final string suspended card is registered on samsung pay and current state is "suspended" suspend can be triggered by issuer, card network, or the user since api level 1 1 see also constant field values pending_activation public static final string pending_activation card is registered on samsung pay but not activated yet a notification of card activation is expected to be pushed to samsung pay in a moment since api level 2 3 see also constant field values card_type public static final string card_type indicates that the key for card type since api level 1 8 see also constant field values card_type_credit_debit public static final string card_type_credit_debit indicates that the card type is either credit or debit this is a valid type for addcardinfo setcardtype string since api level 1 1 see also constant field values card_type_gift public static final string card_type_gift indicates that the card type is gift card since api level 1 1 see also constant field values card_type_loyalty public static final string card_type_loyalty indicates that the card type is loyalty card since api level 1 1 see also constant field values card_type_credit public static final string card_type_credit indicates that the card type is credit card this is a valid type for addcardinfo setcardtype string since api level 1 2 see also constant field values card_type_debit public static final string card_type_debit indicates that the card type is debit card this is a valid type for addcardinfo setcardtype string since api level 1 2 see also constant field values card_type_transit public static final string card_type_transit indicates that the card type is transit card since api level 1 8 see also constant field values card_type_vaccine_pass public static final string card_type_vaccine_pass indicates that the card type is vaccine pass since api level 2 16 see also constant field values method details 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 getcardbrand public spaysdk brand getcardbrand api to get card brand returns brand name of the card since api level 1 9 see also spaysdk brand getcardinfo public android os bundle getcardinfo api to get extra card information if any related to the card returns extra cardinfo the following are list of extra card information provided on the bundle keys values apptoappconstants extra_app2app_intent string app2app intent name apptoappconstants extra_app2app_payload string app2app payload spaysdk extra_last4_dpan string last 4 digit of dpan spaysdk extra_last4_fpan string last 4 digit of fpan spaysdk extra_card_type card_type_credit_debit card_type_credit card_type_debit card_type_gift card_type_loyalty card_type_transit spaysdk extra_device_type samsungpay#device_type_phone samsungpay#device_type_gear spaysdk extra_issuer_name string issuername issuercode for korean issuers since api level 1 1 getcardstatus public string getcardstatus api to get current status of the card returns current card status the status can be one of the following pending_provision pending_activation active suspended disposed expired since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
apisamsung 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.