coupons, gift cards, loyalty cards, and id cards to samsung wallet partnership request to create, manage, and monitor performance of wallet cards with the samsung wallet partners portal, you must become an official samsung partner once done, you can fully utilize this code lab you can learn more by visiting samsung wallet partner onboarding process, here in samsung developers notein accordance with the applicable samsung partner agreements, this code lab covers setup and use of the samsung wallet partners portal for purposes of integrating the add to samsung wallet functionality into partner sites the use cases and corresponding code samples included are representative examples only and should not be construed as either recommended or required overview samsung wallet is the secure, go-everywhere app for your essentials — credit cards, boarding passes, tickets, coupons, and more all in one spot, all accessible with one swipe users can conveniently access the samsung wallet by swiping it up from the bottom of the screen various wallet cards of partners can be added to the samsung wallet, allowing users to quickly and easily access partners' contents, such as boarding passes registered boarding passes can remind the user of boarding time and help during check-in depending on the integration level, it can provide status information updates related to flights, such as boarding gate changes or cancellations tickets registered tickets can provide additional information about the event and an alarm before expiration ticket cards support event commodities for performances, sports, movies, and entrance coupons registered coupons for various channels can provide alarms before expiration and update usage status gift cards gift cards are prepaid cards, also known as gift certificates, gift vouchers, or gift tokens gift cards in wallet support provide balance and transaction history in real time loyalties loyalty or membership cards serve as members’ certificates the cards in wallet show loyalty points id cards the id cards are for identification purposes, as well as for access authentication it supports real-time status change as the user's permission is changed notedepending on your country or region, some card types are not supported if you need assistance, please contact us at developer samsung com/dashboard/support the image below shows the process of managing wallet cards for detailed description, see manage wallet cards set up your environment you will need the following latest samsung wallet from galaxy store samsung galaxy device that supports samsung wallet samsung wallet partners portal account internet browser, such as chrome idea such as intellij key pairs, certificate from samsung see encryption setting partner private key partner certificate samsung certificate start your project open your internet browser and go to the following sample partner sites boarding pass - https //codesandbox io/s/wtr5s2 ticket - https //codesandbox io/s/c66tdq coupon - https //codesandbox io/s/p2kym4 gift card - https //codesandbox io/s/hhnr5m loyalty - https //codesandbox io/s/7m78dt id card - https //codesandbox io/s/rsc226 click fork on the selected project to copy and modify the code once done, the forked project has been automatically copied to your codesandbox account modify the index html later for the add to samsung wallet integration notethe next steps require a samsung wallet partners portal account if you wish to check and test the complete code of these sample partner sites, you can jump to you're done! section of this code lab otherwise, you can proceed to learn the process of integrating add to samsung wallet functionality create wallet cards now, go to samsung wallet partners portal and sign in using your samsung partner account on the left sidebar menu, click wallet cards > create wallet card and enter the wallet card details of your chosen card type as below in wallet card template, choose a card type and a sub type select the card template then, click done you can choose from various types of wallet card templates optimized for partners once all the details are entered and the correct template is selected, click save to set the wallet card status to draft launch wallet cards you can launch and request activation of the cards by clicking the launch button upon agreeing to proceed, the launch button text changes to launched and the card status becomes verifying apply the add to samsung wallet script the samsung wallet partners portal includes generated add to samsung wallet scripts for every wallet card created these scripts can be copied and inserted into partner apps web and android or via email/mms go to [add to wallet script guide] of the card s you created click show to see the scripts for web integration and copy the script under web button js code sample notea statistical image beacon is added to the script for tracking effect analysis below are the generated add to samsung wallet scripts of wallet cards created for this code lab copy the script of your chosen card type boarding pass <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3fre4kmmboq00", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641030840334;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093501522138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641030840334;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093501522138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> ticket <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3fre4mp5mui00", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641034510350;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093588496138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641034510350;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093588496138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> coupon <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3fre4p0otdv00", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> gift card <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3gna29cgdi7g0", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> loyalty <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3gna0sm71ts00", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> id card <script src="https //us-cdn-gpp stg mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> <div id="target_id"></div> <script> samsungwallet addbutton { partnercode "4030093436155138240", cardid "3gna1lkrjvng0", cdata "${card data as jwt}", rdclickurl "https //us-rd mcsvc samsung com/statistics/click/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", rdimpressionurl "https //us-rd mcsvc samsung com/statistics/impression/addtowlt?ep=c50c3754feb24833b30c10b275bb6ab8;cc=gc;ii=1287098641019830286;co=4030093436155138240;cp=1288017491089625089;si=24;pg=101212967375212546;pi=aqz68ebxsx6mv9jsazxzaa;tp=4030093644822138240;li=0", targetid "target_id", buttonid "button_id", } ; </script> paste the copied add to samsung wallet script into the index html file of the sample partner site then, add the attributes below, to the samsungwallet addbutton function target "wallet", showforced true target sets the button's name to samsung wallet "wallet" or samsung pay "pay" by default, the value is "wallet" showforced is a flag to show or hide the button by default, the button is hidden otherwise, set the flag value to true to know the samsung wallet or pay service availability for device and country, see check service available device noteincluding the javascript library in the head tag and adding the rest of the script to the body tag is recommended yet, it works if you paste it as is generate and input the cdata the add to samsung wallet script does not automatically include the cdata encrypted card data as it requires encryption for security purposes cdata is the actual content data of wallet card and it has several formats based on card type download the cdata generator and input your parner id you can use the sample cdata generator created to serve the purpose of this code lab only download the cdata generation sample code locate and open the downloaded file in intellij idea in the project folder, go to src > main > java > jwtgenerator java input your partner id as partner_code string value public class jwtgenerator { private static final string partner_id = "insert_your_partner_id"; //same with partnercode of add to samsung wallet script build your card data in jwtgenerator java, uncomment the plaindata that corresponds with your selected card type // boarding pass // string plaindata = new payloadutil "sample/payload/boardingpass json" getsampleboardingpass ; // coupon // string plaindata = new payloadutil "sample/payload/coupon json" getsamplecoupon ; // ticket // string plaindata = new payloadutil "sample/payload/ticket json" getsampleticket ; tipyou can modify the cdata generator to function according to your requirements for example, you can define the plaindata to load and process card data types other than boarding pass, ticket, and coupon go to resources > sample > payload and create a json file for your card data you can also use the card data builder created for this code lab to edit your chosen sample card copy the json format string to your json file after making your card data secure your wallet card next, go to resources > sample > securities add your private key partner key , partner certificate partner crt , and samsung certificate samsung crt in this directory to secure your wallet card partner private key a key required to use with partner certificate to sign card data this safe-keeping key can be created with certificate signing request csr when you joined the partner portal see encryption setting partner certificate a certificate required to sign or verify tokenized data it will be attached to the partner sign-up completion mail samsung certificate a certificate required to encrypt card data it will be attached to the partner sign-up completion mail for details about these security factors, see security input the cdata to add to samsung wallet script build the project right-click on jwtgenerator class and click run 'jwtgenerator main ' to create the cdata different cdata must be created for each of the sample partner sites of this code lab notethe generated cdata won't expire and can only be used for code lab testing cdata is valid only within 30 seconds after creation for security purposes in actual application lastly, go back to the index html of the chosen partner site and paste the generated cdata to the cdata attribute value of the addbutton sub-item test the add to samsung wallet button with the samsung wallet app, you can test the add to samsung wallet button functionality integrated into the sample partner sites directly on a mobile device access the url provided by codesandbox on samsung internet or any browser if your device does not support samsung wallet such as desktop, laptop, or tablet, you can scan the qr code to load the page on your galaxy device click the samsung wallet button in the sample partner site to add the card to the samsung wallet noteyou can see and monitor wallet card statistics by going to the portal's dashboard > wallet card statistics you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can integrate the add to samsung wallet with your website by yourself! if you're having trouble, you may check the complete code below boarding pass airlines boarding pass buses boarding pass trains ticket movies ticket sports ticket entrances coupon gift card loyalty card id card to learn more about samsung wallet, visit developer samsung com/wallet