Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Connect Samsung Developer Conference
websamsung wallet: mobile driver’s license / state id users will soon be able to add their driver’s license or state id to samsung wallet. initially, mobile driver’s licenses / state ids will work in a limited number of states at select tsa checkpoints to verify an id with just a tap.however, this is just the beginning. we look forward to expanding the feature to more states and adding more use cases beyond tsa checkpoints, some of which are currently not even possible with a physical id card. stay tuned. back to list
Develop Samsung Pay
docenable app to app service the following diagram illustrates the flows of the app-to-app apis for payment card push provisioning bank appsamsung wallet apptoken service providerref[checking samsungpay status]section in common flowalt[if neccessary optional ]1cardmanager getallcards 2onsuccess card cardid, card cardstatus 3request card information with card cardid4success5samsungpay getwalletinfo 6onsuccess device_id, wallet_user_id 7create provisioningpayloadwith card information & wallet informationrefer to card networks spec8cardmanager addcard payload 9request token provision10success11onsuccess flows of push provisioning apis the main classes involved are samsung pay – for fetching samsung wallet app status and wallet information on the device paymentmanager – for card provisioning and invoking favorite cards payment functionalities cardmanager – for payment card management watchmanager – for all functions related to samsung pay watch let’s now take a look at how each one works in the context of your bank app requesting registered card list in the samsung pay thegetallcards method of the cardmanager class is used to request a list of all cards currently registered/enrolled in samsung wallet on the same device running the issuer’s app to succeed, the issuer app must pass valid partnerinfo to 'cardmanager' for caller verification 'cardfilter' narrows the card list returned by samsung wallet to the issuername specified please be noted that getsamsungpaystatus must be called before getallcards getallcards could not return a cards list when getsamsungpaystatus responds with a code other than spay_ready noteto get the cards list of samsung pay watch, you have to use the watchmanager class instead of the cardmanager class as of api level sdk version 1 4, cardfilter retrieves this information from the samsung pay developers portal certain issuers may need to register multiple issuer name s with the portal, depending on their app and/or the requirements of their token service provider tsp the getallcards parameter cardfilter matches the issuer name s specified with those registered in the portal only complete matches are returned this method is typically called when your partner app wants to check the card status it does not need to be called every time the partner app resumes therefore, you should create the card list with the 'oncreate ' method, rather than the 'onresume ' method the result of a getallcards call is delivered to getcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides the list of all filtered cards and their status card information includes cardid, cardstatus, and extra cardinfo data onfail - called when the operation fails here’s an example of how to use the 'getallcards ' api method in your issuer app val cardfilter = bundle // since api level 1 4, cardfilter param is ignored partner does not need to use it here // it is retrieved from the samsung pay developers portal cardfilter putstring cardmanager extra_issuer_name, issuername cardmanager getallcards null, object getcardlistener{ override fun onsuccess cards mutablelist<card>? { // 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 s in cards { log d tag, "cardid " + s cardid + "cardstatus " + s cardstatus // get extra card data if s cardinfo != null { val cardid = s cardid // since api level 2 13, id from card network val last4fpan = s cardinfo getstring cardmanager extra_last4_fpan val last4dpan = s cardinfo getstring cardmanager extra_last4_dpan val cardtype = s cardinfo getstring cardmanager extra_card_type val cardissuername = s cardinfo getstring cardmanager extra_issuer_name log d tag, "last4fpan $last4fpan last4dpan $last4dpan cardid $cardid" } } } } override fun onfail errorcode int, errordata bundle? { // getting card status is failed } } getting wallet information the samsungpay class provides the getwalletinfo api method, which is called to request wallet information from the samsung wallet app prior to calling the addcard api, when you want to avoid duplicate provisioning your issuer app uses this information to uniquely identify the user and the samsung wallet app on a particular device wallet device management id, device id, and wallet user id noteto get wallet information of samsung pay watch, you have to use the watchmanager class instead of the cardmanager class fun getwalletinfo list<string> keys, statuslistener callback the following example demonstrates how to use it // set the serviceid assigned by the samsung pay developers portal during service creation val serviceid = "sampleserviceid" val bundle = bundle bundle putstring samsungpay extra_issuer_name, "issuer name" bundle putstring samsungpay partner_service_type, servicetype app2app tostring val pinfo = partnerinfo serviceid, bundle val samsungpay = samsungpay context, pinfo // add bundle keys to get wallet information from samsung pay // this information can be delivered to the partner server for an eligibility check val keys = arraylist<string> keys add samsungpay wallet_user_id keys add samsungpay device_id samsungpay getwalletinfo keys, object statuslistener{ override fun onsuccess status int, walletdata bundle { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa val deviceid = walletdata getstring samsungpay device_id // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa val walletuserid = walletdata getstring samsungpay wallet_user_id } override fun onfail errorcode int, errordata bundle? { log e tag, "onfail callback is called, errorcode " + errorcode ; // check the extra error codes in the errordata bundle for all the reasons in // samsungpay extra_error_reason, when provided } } adding a card to samsung pay your issuer app calls the 'addcard ' api method of cardmanager to add a card to samsung wallet by providing the required card details, your app can make it convenient and easy for users to add their bank-issued debit/credit cards to samsung wallet directly from your app without additional steps, like switching between apps noteif you want to add a card to samsung pay watch, you have to use the 'watchmanager' class instead of the cardmanager class for most issuers, getwalletinfo suffices for requesting current wallet information the response from samsung wallet tells the issuer app whether or not the user’s card has already been added to samsung wallet or is ineligible for provisioning it is therefore recommended that you call getwalletinfo before displaying the add to samsung pay button if the card is eligible, display the “add” button and, if the user taps it, call addcard importantremember to obtain the governing issuer implementation guide s and specifications from the respective card network and implement each network’s required handling in your partner app and server the 'addcard ' result is delivered to addcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides information and status regarding the added card onfail - called when the operation fails; returns the error code and extra bundle data such as extra_error_reason or extra_request_id if provided onprogress - called to indicate the current progress of the 'addcard ' operation; can be used to show a progress bar to the user in the issuer app this callback is supported for tsm solution issuers in china and spain here’s an example of how to use the addcard api method in your issuer app val cardtype = card card_type_credit val tokenizationprovider string = addcardinfo provider_abcd // samsung pay does not provide detailed payload information; generate the provisioning payload in // accordance with your card network specifications val testpayload = "thisistestpayloadcardinfo1234567890" val carddetail = bundle carddetail putstring extra_provision_payload, testpayload //issuer id is mandatory for mc and elo but optional for all the others carddetail putstring extra_issuer_id, "bin" val addcardinfo = addcardinfo cardtype, tokenizationprovider, carddetail cardmanager addcard addcardinfo, object addcardlistener { override fun onsuccess status int, card card? { log d tag, "onsuccess callback is called" ; } override fun onfail errorcode int, errordata bundle? { log d tag, "onfail callback is called" ; // check some extra error codes in the errordata bundle // such as samsungpay extra_error_reason or samsungpay extra_request_id if provided } override fun onprogress currentcount int, totalcount int, bundledata bundle? { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } adding a co-badge card to samsung pay co-badge payment cards combine two payment brands/networks to add a co-badge card through push provisioning, you must provide two different card network details one for the primary card network and another for the secondary card network issuer app calls the addcobadgecard api method of cardmanager to add a co-badge card to samsung pay in most cases, calling getwalletinfo will suffice to request current wallet information the response from samsung pay indicates whether the user's co-badge card has already been added to samsung pay or is ineligible for provisioning therefore, it is advisable to call getwalletinfo before displaying the add to samsung pay button if the co-badge card is eligible, display the "add" button and, upon user tapping, call addcobadgecard important please remember to refer to the relevant issuer implementation guide s and specifications provided by each card network and ensure that your partner app and server adhere to their specific requirements the addcobadgecard result is delivered to addcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides information and status regarding the added card onfail - called when the operation fails; returns the error code and extra bundle data such as extra_error_reason or extra_request_id if provided onprogress - called to indicate the current progress of the 'addcard ' operation; can be used to show a progress bar to the user in the issuer app this callback is supported for tsm solution issuers in china and spain here’s an example of how to use the addcobadgecard api method in your issuer app note samsung pay does not provide detailed payload information; generate the provisioning payload in accordance with your card networks specifications string cardtype = card card_type_credit; string primarytokenizationprovider = addcardinfo provider_abcd; //provide your primary card network payload string testprimarypayload = "thisistestprimarypayloadcardinfo1234567890"; string secondarytokenizationprovider = addcardinfo provider_efgh; //provide your secondary card network payload string testsecondarypayload = "thisistestsecondarypayloadcardinfo1234567890"; bundle primarycarddetail = new bundle ; primarycarddetail putstring addcardinfo extra_provision_payload, testprimarypayload ; addcardinfo primaryaddcardinfo = new addcardinfo cardtype, primarytokenizationprovider, primarycarddetail ; bundle secondarycarddetail = new bundle ; secondarycarddetail putstring addcardinfo extra_provision_payload, testsecondarypayload ; addcardinfo secondaryaddcardinfo = new addcardinfo cardtype, secondarytokenizationprovider, secondarycarddetail ; cardmanager addcobadgecard primaryaddcardinfo, secondaryaddcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int error, bundle errordata { log d tag, "onfail callback is called" ; 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 ; } } ;
Learn Code Lab
codelabintegrate samsung 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
doccommon flow once setup is complete, you’re ready to add the samsung pay sdk flutter plugin code within your partner app for calling the samsung pay sdk’s apis and receiving callbacks the following functionalities are ready to call through apis checking samsung wallet status activating the samsung wallet app updating the samsung wallet app checking samsung wallet status the first step in implementing the samsung pay sdk flutter plugin within your partner app is to create the samsungpaysdkflutter instance, this will check the samsung wallet status on the device it's determine the support for samsung wallet or lack thereof , and whether or not to display the samsung pay button to the user for selection as a payment option the samsung pay button also lets issuer apps add a card to samsung wallet in both instances, the partner app must have valid partnerinfo to pass to samsungpay for caller verification to set its partnerinfo, the partner app passes its serviceid sid and servicetype, both of which are assigned by the samsung pay developers portal when you create the service this will be used for checking blocked list and version control between the samsung pay sdk flutter plugin and the samsung wallet app on the device you must set the servicetype in partnerinfo to call other samsung wallet apis string serviceid; map<string,dynamic> data; static final samsungpaysdkflutterplugin = samsungpaysdkflutter partnerinfo serviceid 'partner_app_service_id', data {spaysdk partner_service_type servicetype app2app name tostring } ; after setting partnerinfo, your partner app can now call getsamsungpaystatus this method of the samsungpay class must be called before using any other feature in the samsung pay sdk flutter plugin future<void> getsamsungpaystatus statuslistener? statuslistener the result is delivered to statuslistener and provides onsucccess and onfail events check the android sdk common flow for more details the following sample code shows how to use the getsamsungpaystatus api method myhomepage samsungpaysdkflutterplugin getsamsungpaystatus statuslistener onsuccess status, bundle async { showstatus status, bundle ; }, onfail errorcode, bundle { showerror errorcode, bundle ; } ; activating the samsung walllet app the samsungpaysdkflutter class provides the following api method to activate the samsung wallet app on a device future<void> activatesamsungpay activatesamsungpay is called to activate the samsung wallet app on the same device on which the partner app is running first, the partner app must check the samsung wallet status with a getsamsungpaystatus call if the status is spay_not_ready and extra_error_reason is error_spay_setup_not_complete, the partner app needs to display an appropriate message to user, then call activatesamsungpay to launch the samsung wallet app so the user can sign in here’s an example of how to code this samsungpaysdkflutterplugin activatesamsungpay ; updating the samsung wallet app the samsungpaysdkflutter class provides the following api method to update the samsung wallet app on the device future<void> gotoupdatepage gotoupdatepage is called to update samsung wallet app on the same device on which the partner app is running as with all api calls, the partner app must first check the samsung wallet status with getsamsungpaystatus if this returns spay_not_ready and extra_error_reason is error_spay_app_need_to_update, then the partner app needs to display an appropriate message to the user and call gotoupdatepage , which launches the samsung wallet update page the following code sample reflects how to update samsung wallet samsungpaysdkflutterplugin gotoupdatepage ;
Develop Samsung Pay
docunderstanding and using the sdk the samsung pay sdk is an application framework for integrating selected samsung wallet features with android-based partner apps on samsung devices the following major operations are supported in-app payment gives customers the option of paying for products and services with samsung wallet push provisioning allows customers add a bank card to samsung wallet from the issuer app by providing the required card details to integrate your partner application with the samsung pay sdk, the following components are included your sdk download samsungpay jar contains classes and interfaces of the samsung pay sdk which need to be integrated to partner apps javadoc provides descriptions of the apis included in the samsung pay sdk, along with sample code showing how to use them sample merchant app and sample issuer app showing how samsung pay apis can be coded in a finished android project all major operations of samsung pay sdk are implemented for demonstration purposes samsung pay sdk architecture the following diagram shows a high-level architecture revealing the general interactions between the samsung pay sdk and a partner app viewed at this level, the partner apps leverage the samsung pay sdk to perform the operations shown ― push provisioning and opening favorite cards for issuers; online payments for merchants ― with samsung pay the key components involved are partner app - merchant- or issuer-developed app for making online/offline payments and provisioning payment cards through samsung wallet samsung pay sdk - sdk integrated into the partner app for direct communication with samsung wallet samsung wallet app - wallet app that the samsung pay sdk communicates with financial network - comprises the payment gateways, acquirers, card associations, and issuers that participate in transaction processing under agreement with the merchant the main classes comprising the samsung pay sdk include samsungpay – used by the partner app to get the samsung pay sdk information and the status of samsung wallet app on the device paymentmanager – provides payment/transaction functionality cardmanager – manages card list get, add, update functionality watchmanager – manages all functions related to samsung pay watch cardinfolistener – interface for requestcardinfo result from samsung wallet customsheettransactioninfolistener – interface for transaction success/failure callbacks from samsung wallet use case in-app payment the most common in-app online payment use cases take the following form merchant app presents user with the option of making payment with samsung wallet upon the user selecting the samsung pay option, the merchant app calls the apis included in the samsung pay sdk to initiate a transaction with samsung wallet app samsung wallet app responds with the tokenized payment information necessary to complete the transaction merchant app forwards this payment information to the designated payment gateway pg , either directly through the merchant's web server, or indirectly via the samsung-pg interface server for normal transaction processing use case app-to-app push provisioning the push provisioning use case ― adding payment cards to samsung wallet from the card issuer’s app ― typically takes this form the user logs into the issuer app the issuer app checks if samsung wallet is activated on the device and ready to use if it is in the ready status, the issuer app displays an add button for cards not currently registered/enrolled with the samsung wallet app if the add card option is selected, the issuer app calls an api to push the proper payload data to samsung wallet while the card is being provisioned, samsung wallet stays in background setting up sdk development environment the importance of maintaining a good development environment cannot be overstated for integrating the samsung pay sdk with your partner app, the following prerequisites and recommendations help ensure a successful sdk implementation system requirements the samsung pay sdk is designed exclusively for samsung mobile devices supporting samsung pay and running android lollipop 5 1 android api level 22 or later versions of the android os the sdk’s in-app payments functionality requires android 6 0 m android api level 23 or later versions of the android os note as of sdk version 1 5, if the device runs android lollipop 5 1 android api level 22 or an earlier version, the getsamsungpaystatus api method returns a spay_not supported status code merchant apps still using samsung pay sdk 1 4 or earlier not recommended must check the android version running their app use the following snippet to determine the os version running on a device and whether or not to display the samsung pay button in your partner app import android os build; // in-app payment supported on android m or above // check android version of the device if build version sdk_int < build version_codes m { //hide samsung pay button } service registration to develop a samsung pay sdk service, merchants and issuers need to register for an account with samsung pay developers in order to create the appropriate service type for their applications here are some helpful links inside the portal become a member https //pay samsung com/developers/tour/memberguide create services https //pay samsung com/developers/tour/svcguide register apps https //pay samsung com/developers/tour/appsguide manage services and apps https //pay samsung com/developers/tour/svcnappsguide add samsung pay sdk to your project be sure to do the following before attempting to use the sdk if not already part of your environment, download and install an ide android studio is recommended download the samsung pay sdk the sdk package has the following directory structure folder contents docs javadoc – api reference documentation libs samsungpay jar sdk java archive file – contains the samsung pay apis to be used by your partner app samples sample apps configure your ide to integrate the samsung pay sdk with your partner app a add samsungpay jar to the libs folder of your android project b go to gradle scripts > build gradle and enter the following dependency dependencies { compile files 'libs/samsungpay jar' } c import the sdk package into your code import com samsung android sdk samsungpay v2; proguard rules if your app s have any issue with proguard, the following rules are recommended dontwarn com samsung android sdk samsungpay ** -keep class com samsung android sdk ** { *; } -keep interface com samsung android sdk ** { *; } when dexguard is employed, the following additional rules apply -keepresourcexmlelements manifest/application/meta-data@name=spay_sdk_api_level android r os targetsdkversion 30 informationfrom android r os if the target sdk version is 30 , you must include the following <queries> element in the androidmanifest <?xml version="1 0" encoding="utf-8"?> <manifest xmlns android="http //schemas android com/apk/res/android" xmlns tools="http //schemas android com/tools" package="xxx xxx xxx xxx"> <queries> <package android name="com samsung android spay" /> <package android name="com samsung android samsungpay gear" /> </queries> configuring api level api level attributes as of sdk version 1 4, enhanced version control management has been introduced to improve backward compatibility and handle api dependency from country and service type for example, if a partner integrates the latest sdk―for instance, api level 2 22―but continues to use apis based in level 1 4, the partner app remains compatible with samsung wallet apps supporting api level 1 4 without the necessity of upgrading the samsung pay app the chief characteristics and properties of the api level include every api starting from version 1 4 has an api level assigned based on the sdk version number in which it is introduced the sdk’s javadoc reference can be filtered by api level so you can determine the minimum api level you need to configure in the metadata section of your app’s androidmanifest file the earliest possible version is 1 4 this lets you use the api level defined in your androidmanifest without having to trigger an upgrade of the samsung wallet app on the user’s device implement the following usage in your androidmanifest <application <meta-data android name="spay_sdk_api_level" android value="2 22" /> // most recent sdk version is recommended to leverage the latest apis but it need to be set to 2 17 for russia </application> partner app verification in partner verification process samsung pay sdk verify your registered app, version in samsung pay portal and service it also determines device and app compatibility your app needs to verify the presence of the samsung wallet app on the device, its status, and whether or not its version is sufficient to support your implementation of the sdk appendix a common terminology terminology description aavs automatic add value service aidl android interface definition language for communication merchant a business entity engaged in retail e-commerce that provides an online checkout service for purchasing its products and/or services to registered end users issuer financial institution empowered to issue credit and/or debit payment cards to qualified consumers and businesses payment gateway pg e-commerce app service provider equipped to authorize credit card payments for e-businesses, online retailers, bricks and clicks, or traditional brick and mortar payment token secure method for payment ensuring that a cardholder’s information is not exploited by unauthorized parties samsung pay samsung’s proprietary mobile wallet app and payment system samsung pay service the server and service components of samsung pay samsung pay watch samsung pay app on samsung galaxy watches to support payment system eligibility check a query by third-party apps to check whether or not samsung pay is supported/activated/ready-to-use on a samsung device mst magnetic secure transmission tui trusted user interface
tutorials blockchain
bloghere at samsung, we want to stay on top of blockchain technology, which has the potential to revolutionize many aspects of our lives. cryptocurrency is a trillion dollar market and one of its biggest players is ethereum, a blockchain technology that allows its users to create decentralized applications (dapps) powered by its own currency, eth. the samsung blockchain platform (sbp) sdk provides android developers with a convenient platform and full set of features for developing dapps that interact with the ethereum network. transactions are the heart of any blockchain-based system. in ethereum, transactions can be initiated by either an account or a smart contract. the sbp sdk supports eth transactions, erc-20 token transactions, and erc-721 token transactions. this article describes a sample application that demonstrates how to use the sbp sdk to store and transfer erc-20 tokens, a primary transaction method on the ethereum network. you can follow along with the demonstration by downloading the sample application. the sample application connects to the hardware wallet on the device and retrieves your account details. you can then add a token to the account and create a transaction. each of these actions has been implemented with a corresponding button to help you understand the sequence of steps and visualize the result. figure 1: sample application prerequisites to implement sbp sdk features in an android application, you must integrate the sdk by downloading the aar file and adding its required dependencies. retrieving account details to retrieve your account details: configure and create an instance of the sblockchain class, which implements the sbp sdk. in the sample application, to call the onclickobjectcreate() method and create an instance of the sblockchain class, select create object. when the instance is successfully created, the message "object has been created" is displayed. figure 2: "sblockchain" class instance created connect to the hardware wallet. hardware wallets are special devices that provide secure storage for keys. the sbp sdk supports ledger nano s, ledger nano x, and samsung blockchain keystore wallets. the sample application implements support for the samsung blockchain keystore, which is a hardware wallet preloaded on selected galaxy devices. the sblockchain class allows you to access the hardwarewalletmanager class instance, which enables connecting to the hardware wallet. notefor information about integrating other hardware wallets, see getting started. in the sample application, when the hardware wallet is connected, its wallet id is shown. figure 3: hardware wallet connected restore the account information. sbp sdk manages each blockchain address as an account. the account contains the information required to sign a transaction, including the public and private key pair. you can both generate accounts for and restore your accounts from the ethereum network. once you have restored your accounts, they are saved and their details can be retrieved requiring a network operation. you only need to restore the accounts again when you change wallets. notefor more information about generating and restoring accounts, see account management. in the sample application, select create account to restore your account from the network. this is an asynchronous operation. the next time you select "create account," the account details are simply retrieved from memory. the sample application retrieves the first account in your hd path and displays its address below the "create account" button, as shown in figure 4. figure 4: account address successfully retrieved sending tokens to send an erc-20 token: add a token to the account. in the sample application, to add a token to the account, enter the contract address in the "contract address" field and select add token. noteto add the token, you must own it. for demonstration purposes, a token from the goerli faucet is added to the account and used in the following figure. figure 5: token added the following code snippet illustrates how the sample application implements adding a token. public void onclickaddtokenaccount(view view){ if (textutils.isempty(tokenaddressedittext.gettext().tostring())) { toast.maketext(mainactivity.this, "please add a token address", toast.length_short).show(); return; } addedtokenaddress = tokenaddressedittext.gettext().tostring(); boolean check = checkexistingtokenaccount(); if(check){ toast.maketext(mainactivity.this, "token already added", toast.length_short).show(); gettokenbalancebutton.setenabled(true); return; } ethereumservice.addtokenaddress((ethereumaccount) mfirstaccount, addedtokenaddress).setcallback(new listenablefuturetask.callback<ethereumaccount>() { @override public void onsuccess(final ethereumaccount account) { log.d(log_tag, "onsuccess: addtokenaccount " + account); runonuithread(()->{ gettokenbalancebutton.setenabled(true); }); getaccount(); } @override public void onfailure( @nonnull final executionexception exception) { log.e(log_tag, "onfailure: addtokenaccount " + exception); } @override public void oncancelled(@notnull interruptedexception exception) { log.e(log_tag, "onfailure: addtokenaccount " + exception); } }); } // check whether the token is already added to the account private boolean checkexistingtokenaccount(){ for (account currentaccount : accountlist) { if (currentaccount.getaddress().equals(mfirstaccount.getaddress())) { if (addedtokenaddress.equals(((ethereumaccount) currentaccount).gettokenaddress())) { return true; } } } return false; } retrieve the token balance. to ensure you have sufficient balance to make a transaction, you can check the token balance. in the sample application, select get token balance. this is a network operation and can take some time. the retrieved balance is displayed below the "get token balance" button. figure 6: token balance retrieved the following code snippet illustrates how to perform this task in two steps: first, retrieve the account associated with the token address with the gettokenaccount() method. next, pass the account into the gettokenbalance() method of the sdk to retrieve the token balance. private ethereumaccount gettokenaccount(){ ethereumaccount ethereumaccount = null; for (account currentaccount : accountlist) { if (currentaccount.getaddress().equals(mfirstaccount.getaddress())) { if (addedtokenaddress.equals(((ethereumaccount) currentaccount).gettokenaddress())) { ethereumaccount = (ethereumaccount) currentaccount; } } } return ethereumaccount; } public void onclickgettokenbalance(view view){ mtokenaccount = gettokenaccount(); if(mtokenaccount == null){ log.e(log_tag, "token account is null"); } ethereumservice.gettokenbalance(mtokenaccount).setcallback(new listenablefuturetask.callback<biginteger>() { @override public void onsuccess(biginteger tokenbalance) { runonuithread(()->{ tokenbalancetext.setenabled(true); gaspricebutton.setenabled(true); tokenbalancetext.settext(tokenbalance.tostring()); }); } @override public void onfailure(@nonnull executionexception e) { log.e(log_tag, "fetching balance is failed."); log.e(log_tag, "" + e.getmessage()); } @override public void oncancelled(@nonnull interruptedexception e) { log.e(log_tag, "fetching balance is canceled."); } }); } retrieve the gas fee. network operations on the ethereum network require gas, which is a unit that measures the effort required by the network to complete the operation. to perform a transaction, you must retrieve the gas fee and the gas limit of the transaction. the gas fee is determined by how quickly you want the transaction to be performed. in the sample application, enter the destination address and amount for the transaction, select the desired transaction speed, then select gas price. figure 7: gas fee retrieved the following code snippet illustrates how to retrieve the gas fee. public void onclickgasprice(view view) { ethereumservice.getfeeinfo(ethereumtransactiontype.eip1559).setcallback(new listenablefuturetask.callback<feeinfo>() { @override public void onsuccess(feeinfo feeinfo) { methereumfeeinfo = (eip1559feeinfo) feeinfo;; log.i(log_tag, "fee info is fetched successfully."); runonuithread(() -> { gaslimitbutton.setenabled(true); toast.maketext(getapplicationcontext(), "fee info is fetched successfully.", toast.length_short).show(); } ); } @override public void onfailure(@notnull executionexception e) { log.e(log_tag, "fetching fee info is failed."); log.e(log_tag, "" + e.getmessage()); } @override public void oncancelled(@notnull interruptedexception e) { log.e(log_tag, "fetching fee info is canceled."); } }); } retrieve the gas limit. the gas limit represents the maximum amount of work that may be required for the transaction. in the sample application, to retrieve the gas limit, select gas limit. the limit is calculated and displayed next to the "gas limit" button. noteto retrieve the gas limit, the "send account address" and "send amount" fields must not be empty. figure 8: gas limit retrieved the following code snippet illustrates how to retrieve the gas limit. public void onclickgaslimit(view view) { string toaddress = toaddressedittext.gettext().tostring(); string amount = sendamountedittext.gettext().tostring(); if (toaddress.isempty() || amount.isempty()) { toast.maketext(getapplicationcontext(), "fill send address and amount field", toast.length_short).show(); } else if(!ethereumservice.isvalidaddress(toaddress)){ toast.maketext(getapplicationcontext(), "invalid address.", toast.length_short).show(); } else { bigdecimal sendamount = new bigdecimal(amount); biginteger convertedsendamount = ethereumutils.convertethtowei(sendamount); list<type> inparams = arrays.aslist(new address(toaddress), new uint(convertedsendamount)); list outparams = arrays.aslist(new typereference<bool>() {}); string encodedfunction = functionencoder.encode(new function("transfer", inparams, outparams)); ethereumservice.estimategaslimit((ethereumaccount) mfirstaccount, toaddress, null, encodedfunction).setcallback(new listenablefuturetask.callback<biginteger>() { @override public void onsuccess(biginteger biginteger) { mgaslimit = biginteger; log.i(log_tag, "gas limit is fetched successfully."); log.i(log_tag, "gas limit is:" + biginteger.tostring()); runonuithread(() -> { sendbutton.setenabled(true); gaslimittext.settext(biginteger.tostring()); }); } @override public void onfailure(@notnull executionexception e) { log.e(log_tag, "fetching gas limit has failed."); log.e(log_tag, "" + e.getmessage()); } @override public void oncancelled(@notnull interruptedexception e) { log.e(log_tag, "fetching gas limit has been canceled."); } }); } } send the tokens. in the sample application, to send tokens using your available balance, select send. noteto confirm the transaction, samsung implements a trusted user interface (tui) with the samsung blockchain keystore to ensure that the transaction is safe and not tampered with. the tui runs completely separate from the device os, ensuring maximum security. for more information about the tui and other samsung blockchain keystore features, see what makes samsung blockchain keystore unique. when the transaction is complete, you can use the transaction hash to find the transaction details on the ethereum blockchain explorer. figure 9: transaction created the following code snippet illustrates how to create a transaction. public void onclicksendtoken(view view) { if (textutils.isempty(toaddressedittext.gettext().tostring())) { toast.maketext(mainactivity.this, "to address field must be filled!", toast.length_short).show(); return; } if (textutils.isempty(sendamountedittext.gettext().tostring())) { toast.maketext(mainactivity.this, "send amount field must be filled!", toast.length_short).show(); return; } string toaddress = toaddressedittext.gettext().tostring(); biginteger sendamount = new biginteger(sendamountedittext.gettext().tostring()); // retrieve the gas price int transactionspeedid = transactionspeedgroup.getcheckedradiobuttonid(); if (transactionspeedid == -1) { toast.maketext(getapplicationcontext(), "select a transaction speed.", toast.length_short).show(); } else { switch (transactionspeedid) { case r.id.transaction_speed_slow: mgasprice = methereumfeeinfo.getslowpriorityfee(); log.d(log_tag, "gasprice: " + mgasprice); break; case r.id.transaction_speed_normal: mgasprice = methereumfeeinfo.getnormalpriorityfee(); log.d(log_tag, "gasprice: " + mgasprice); break; case r.id.transaction_speed_fast: mgasprice = methereumfeeinfo.getfastpriorityfee(); log.d(log_tag, "gasprice: " + mgasprice); break; } } if(transactionspeedid != -1) { try { ethereumservice.sendtokentransaction( mhardwarewallet, (ethereumaccount) mtokenaccount, toaddress, addedtokenaddress, mgasprice, methereumfeeinfo.getestimatedbasefee().add(mgasprice), mgaslimit, sendamount, null ).setcallback(new listenablefuturetask.callback<transactionresult>() { @override public void onsuccess(transactionresult transactionresult) { log.d(log_tag, "transaction hash: " + transactionresult.gethash()); runonuithread(() -> toast.maketext(getapplicationcontext(), "transaction hash: " + transactionresult.gethash(), toast.length_short).show() ); } @override public void onfailure(@notnull executionexception e) { log.e(log_tag, "transaction failed."); log.e(log_tag, "" + e.getmessage()); } @override public void oncancelled(@notnull interruptedexception e) { log.e(log_tag, "transaction canceled."); } }); } catch (availabilityexception e) { log.e(log_tag, "error in sending: " + e); } } } conclusion token transactions are a vital part of the ethereum ecosystem, and the sbp sdk enables you to create wallet applications that manage erc-20 tokens and transactions. share your thoughts with us and the global blockchain developer community on the samsung blockchain developer forum. learn more about sbp sdk and its features in our recent blogs: integrate payment ui with your ethereum dapp step into the decentralized blockchain future with samsung blockchain ecosystem send trx with the samsung blockchain platform sdk additional resources on the samsung developers site the samsung developers site has many resources for developers looking to build for and integrate with samsung devices and services. stay in touch with the latest news by creating a free account and subscribing to our monthly newsletter. visit the galaxy store games page for information on bringing your game to galaxy store and visit the marketing resources page for information on promoting and distributing your android apps. finally, our developer forum is an excellent way to stay up-to-date on all things related to the galaxy ecosystem.
Samiul Hossain
tutorials mobile
blogas businesses strive to enhance their mobile payment capabilities and provide seamless transaction experiences to users, integrating third-party payment solutions like samsung pay has become increasingly common. however, amid the excitement of implementing these solutions, developers often encounter challenges and pitfalls that can hinder the integration process and impact the overall user experience. in this blog, we show some of the most common mistakes developers make when integrating the samsung pay sdk, and offer practical insights and best practices to overcome these hurdles and ensure successful implementation and testing. pitfall 1: using an unofficial email id to implement the samsung pay sdk, the first step is to establish a partnership between your company and samsung. when submitting a partnership request, do so using your company's official email domain. this precaution is crucial, as partnership requests originating from non-official email addresses are prone to rejection by the samsung relationship manager. pitfall 2: providing the wrong issuer name while creating your service while creating a service for the push provisioning feature, you have to add the issuer names, meaning the names of your financial institution or bank. you must make sure to provide the correct names that have been registered with the card networks such as visa, mastercard and so on. if incorrect names are provided, the getallcard() api returns an empty list even though the card has already been added to the samsung wallet. to confirm your issuer name, first add your card to the samsung wallet application. tap on the card in the wallet application, open the more menu, and select customer services. the correct issuer name is listed on the “customer services” pane. to correct your issuer name for services that you have created: select my projects > service management. select the service name to open the service details page. select edit info. you can delete the incorrect issuer name and enter a new one. pitfall 3: using service id with an invalid effective date a common error that occurs during sdk integration is the error_expired_or_invalid_debug_key (-310) error. this error occurs in two cases: using a newly created service id without generating an expiration date of the service: after creating a service, if you check the edit info of the service details page, you will find that the debug effective data is blank. hence, you have to generate a date right after creating the service. using a service id with an expired debugging date: the service id provided by samsung pay portal remains valid for 90 days. after that time, the service expires. therefore, you must generate a date for debugging every 90 days. to generate or extend the validity date of the service: select my projects > service management. select the service name to open the service details page. select edit info. click generate new date. provide a samsung account for testing the application. this account is placed on the allow list for testing. click generate. the new expiration date of your service appears on the page. remember to extend the date after 90 days if you continue testing your application past that point. pitfall 4: configuring the release service with insufficient information it is essential to include the apk file when setting up the release service. failure to include the apk file will result in samsung pay’s relationship manager rejecting the service, leading to delays in the release process. additionally, ensure that you have correctly integrated the appropriate service id into your release application. pitfall 5: testing your application with a mismatched configuration samsung wallet uses the service id, package name, and apk signature for partner verification. if you test your application with an apk signature different from the one already registered in the samsung pay portal, samsung pay recognizes that the apk signature is inconsistent with the service id and produces the error code -6 (not_allowed). in conclusion, navigating the integration of the samsung pay sdk can present you with many challenges. but, armed with the knowledge shared here, you can steer clear of some potential pitfalls and ensure a smoother implementation process. by prioritizing thorough testing, adhering to best practices, and maintaining clear communication with samsung's support channels, you can mitigate risks and deliver a seamless payment experience to users.
Ummey Habiba Bristy
Learn Code Lab
codelabintegrate samsung 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
Develop Samsung Pay
docin mobile payment card provisioning, id&v identity verification is the process of verifying the user’s identity before they can add their payment card to their mobile device samsung wallet supports various ways to ensure that only authorized individuals have access to their own payment cards and to prevent fraud these id&v methods are shown in the following screenshot they include receiving an sms, email, phone call, or access code, or verifying their identity through their bank’s website, banking application, or phone support this guide focuses on app-to-app id&v, which allows the user to verify their identity through another application, typically the application for their own bank you can implement app-to-app id&v through the samsung wallet application in 2 ways using the samsung wallet sdk, which must be integrated into the banking application itself using android intents, which enables you to implement the feature without the samsung wallet sdk specifically, this documentation describes using android intents to implement app-to-app id&v in your banking application card network specification details related to app-to-app id&v are not within the scope of this document note american express amex does not support app-to-app id&v if you want to support adding amex cards to samsung wallet, you must use other id&v methods
FAQ marketplace, mobile, web
docfaq & troubleshooting if the samsung pay app throws error_not_allowed -6 / error_unable_to_verify_caller -359 , what needs to be checked on the partner app side? for debug verify that the serviceid is correct; make sure it was generated for the test mode and not for release verify that the servicetype is correct; make sure it is same as the value assigned by the samsung pay developers portal when you create the service verify that the device’s samsung account is registered allowed under test accounts in the service details for release verify that the serviceid is correct; make sure it was generated for release and not for the test mode verify that the servicetype is correct; make sure it is same as the value assigned by the samsung pay developers portal when you create the service ask your samsung pay relationship manager rm to confirm that the status of your service is approved i received an onsuccess callback for a `getallcards ` response but the card list is empty even though there already one or more installed cards in samsungpay one of the most common exceptions during development is that “getallcard ” returns an empty list even though the card has already been added to the samsung wallet the main reason for this exception is the mismatch of an issuer name with the samsung pay portal the issuer name on the samsung pay portal and the actual issuer name of the card must be the same to overcome this problem if you cannot confirm the actual issuer name of the card, just add the card to samsung wallet app and see its details information open wallet app > tap on the card > three-dot menu > customer service option > under the title you will find the issuer name the following screenshot would be helpful for better understanding, i have received an onfail callback for `getsamsungpaystatus ` with a `spay_not_supported` status code if your app’s target api level is set to 30 or higher, refer to setting up your sdk development environmen part and follow guide for android r os targetsdkversion 30 i am getting 500 error when registering a csr while creating the 'web payment' service what should i do? if your csr was signed using your own private key rather than signed by a payment gateway, please select payment gateway with 'none default ' note the default pg name is 'none default ' i am getting error_partner_app_signature_mismatch error this error occurs due to the following reasons the package name configured in the samsung pay portal is not the same as the application the signature of the apk that has been uploaded to the samsung pay portal and the testing apk is not same check the app’s package name from samsung pay portal > my projects > app management > click on a specific app name i am getting error_not_registered_user_for_debugging error this error occurs if the samsung account has not been added to samsung pay portal while the service status is debugging log into the samsung pay portal first then go to my projects> service management > click on your service name > add test accounts in the service details page i am getting error_inadequate_data_from_db error this error occurs due to the following reasons payment gateway pg csr is required for merchant who is integrating with pg if this csr is missing, merchant app will face this error you should ask your pg to provide pg csr and upload it into the samsung pay portal log into the samsung pay portal first then go to my projects> service management > click on your service name to upload your csr this error occurs when the apk uploaded to samsung pay portal has invalid information please double check with below limitations app package name 50 byte app version 20 length app signature 100 length i am getting error_not_supported_country_code error this error happens if selected countries in samsung pay portal doesn't match with partner's device country or device iso please add the device country on service detail by following the steps below go to samsung pay portal> login using the manager account > my projects > service management > click on a specific service > click on edit info > add country under service location i am getting error_service_not_exist error no service is found under the provided id, service has been deleted or an invalid service id please check the service id or create a new service to use it for your further testing to check the service id, log into the samsung pay portal first then go to my projects> service management > click on your service name to create new service, go through the partner on boarding guide i am getting error_not_approved_service error the error arises when the service is not in the "debugging" state for test environments or "approved" or "verifying" for release environments please contact your rm to change the status of your service i am getting spay_not_supported error the error code spay_not_supported typically indicates that the device either lacks compatibility to run samsung pay or the samsung pay app is not installed make sure the wallet app you're using is a valid one or you could reach our support for help i am getting error_spay_app_need_to_update error this error signifies that the samsung wallet app requires an update in such cases, the partner app should prompt the user to update samsung wallet app if the user agrees, the app should invoke the samsungpay gotoupdatepage api to guide the user to the update page for samsung wallet app i am getting error_partner_sdk_version_not_allowed error this error indicates that the partner app is utilizing a samsung pay sdk that is not permitted using a valid samsung pay sdk version should solve this issue we recommend using the latest version of the sdk please check the latest version from here i am getting error_sdk_not_supported_for_this_region error this error indicates that the samsung pay sdk is not supported in particular region for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed please contact with your rm to know supported region for specific version of the samsung pay sdk i am getting error_not_allowed error this error indicates that requested operation is not allowed for example, partner app verification has failed in samsung pay server please create support ticket in developer support channel by attaching the dumpstate log i am getting error_invalid_payload error this error indicates that payload is not correct samsung pay does not provide detailed payload information please generate the provisioning payload in accordance with your card network specifications i am getting error_card_not_supported error this error occurs if the samsung wallet service is not enabled by the card issuer please contact your card issuer to enable the digital wallet service for your card i am getting error_invalid_parameter error the error caused by wrongly created payload issuer need to create payload correctly based on card network's specification i am getting error_card_already_registered error this error indicates that the requested operation is already done and this operation cannot be performed again at first, delete the card from samsung wallet app and then try push provisioning again i am getting unknown_error_code error what should i do? you can create a ticket via samsung developer portal >support > dev support with the following information for technical support regarding this samsung pay sdk implementation error • description or comment to explain what kinds of issue you are having as possible as detail for example what is the issue? which apis used for your test scenario? what is expected response from the api and what is actual response? • dumpstate log to take dumpstate log please follow the steps from here how to get samsung wallet test app? please follow the steps below to get the samsung wallet test app login into pay samsung com/developer using your samsung account go to support> request test app copy the galaxy app url then click on my projects > service management select specific service register your test samsung account in test account field
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.