Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
tutorials
bloggift card coupon id card generic card pay as you go (in progress) reservation (in progress) digital key (in progress) notice generic card supports unstructured forms of cards. be a samsung wallet partner partner onboarding to begin offering content through samsung wallet, you must first register as a partner on the samsung wallet partner portal. the integration process is detailed on the samsung developer portal. to join the samsung wallet partner portal, create a samsung account that is used as the service administrator. wallet card management once enrolled, you can create service cards on the wallet cards menu. each card is assigned a card id representing the service, and you can set the card type and linking information. you can manage cards according to their status – test or live. configuring wallet card notice after completing all required forms for the wallet card, click the launch button to request card activation. before providing the service to actual users, remember to turn off the 'test mode.' how to safely secure user data key generation and certificate request the registration process includes certificate exchange to securely transmit service data. refer to the diagram and developer guide, security key & certificate creation guide, to complete the certificate registration and partner enrollment smoothly. certificates exchange process ensuring data security to prevent forgery and leakage of user card data, secure tokenization processing is required. json web token (jwt), which includes encryption and signature, has a validity time basis for verification, thus providing enhanced security. in particular, when generating this token, the key and certificate previously obtained through the certificate exchange process are used. process of generating and verifying security tokens notice depending on how partners provide content services to users, you can choose how to deliver data to the samsung wallet service. two ways to transfer wallet card data add to samsung wallet interface provides two methods for partners to deliver users digital content as wallet cards. data transmit link the general way to transfer wallet card data is to organize tokenized data in the link attached to the button, and the card data is transmitted to the samsung wallet service when the user clicks the button. as long as samsung wallet support is confirmed, you can generate a link containing the user's card data and configure the "add to samsung wallet" button to run the link when pressed, either on an application or web page. data transmit process data fetch link another method to transfer wallet card data is to include only the refid, which represents the user's content, in the "add to samsung wallet" link and transmit it to the samsung wallet service. when a user clicks the "add to samsung wallet" button, samsung servers refer to the get card data api information set on the wallet card and retrieve user content using the received refid to complete registration. data fetch process this method is suitable for providing user's data through email or mms messages where static links cannot be avoided. there is an option to secure these static links. data fetch process for static links setting up data synchronization on the partner portal, you can set up the wallet card information and configure the server interaction api that the content provider needs to prepare. this api is an interface for managing card registrations, deletions, information, and state changes to sync with those registered on samsung wallet. register wallet cards when a user card is added to samsung wallet, samsung wallet servers use the send card state api to communicate card registration and deletion status to the content provider, allowing them to manage content that needs to be synchronized with samsung wallet. when a wallet card is registered, added event is sent to the partner's server update wallet cards changes to the synchronization target content can be notified to the samsung wallet service through the update notification api. here, the value that distinguishes each piece of content is the refid that the partner must provide when registering the users’ wallet card. through the get card data api, samsung wallet servers can check the latest content information any time. if updates occur on the partner's side, updated event notifications should be sent to the samsung server in case users withdraw content from the partner's side in case users delete cards from samsung wallet notice both servers should verify requests using the authorization header of the api request. this authorization token is in jwt format, familiar from card data security. effortless wallet card registration with just one click this feature is primarily composed of a link-connected button and can be provided through the content provider's application, web page, email, or mms message. various service channels javascript library for web developers we provide a javascript library and a user guide, implement the button, to help integrate your web pages. creating buttons and links in your app for configuring buttons in applications, utilize the button image resources. providing services via mms, email, or qr codes to provide services through fixed links, check out the details of the data fetch link. these static links can also be used by scanning qr codes. experience the service and practice you can experience service integration development using the codelab and use the testing tool to preregister the wallet cards created on the partner portal, which could be helpful. conclusion we've looked at how to provide digital content through the "add to samsung wallet" feature. we continuously update the guides on the developer portal, so please refer to them when preparing for integration. summary the "add to samsung wallet" service welcomes participation from content service partners and developers. for inquiries or technical support, please contact us through the form provided on the developer portal. i hope this post has been helpful, and now i'll conclude my writing here. thank you. this post was written based on the sdc23 korea session.
Choi, Jonghwa
Develop Samsung Wallet
docgift cards and more to the wallet app on their samsung galaxy device follow these guidelines when using the button in your apps, web pages, and email, or when using the qr code on pc browser or kiosk app/mobile web add the "add to samsung wallet" button according to the instructions at [implement the button] /implement-the-button html place the button on the page where the user sees the qr code or barcode for the first time, such as a booking completion or purchase completion page place the button just below or close to the qr code or barcode that can be saved in samsung wallet mms to implement “add to samsung wallet” in an mms message, place the coupon or other content that can be saved to samsung wallet in the message and include the “add to samsung wallet” link at the bottom of the message in an mms message on a samsung mobile device where samsung wallet one ui version 5 0 is installed, the “add to samsung wallet” button is automatically displayed when the "add to samsung wallet" link is included in the message e-mail to add boarding passes, event tickets, coupons, memberships, and gift cards to samsung wallet, users can click “add to samsung wallet” in emails opened on samsung galaxy or galaxy tab devices with samsung wallet installed show the “add to samsung wallet” button with the mobile invitation, booking details, purchase details, or sign-up details included in the email place the button just below or close to the qr code or barcode that can be saved in samsung wallet pc/kiosk place the “add to samsung wallet” qr code on the right side of completion pages for purchases, bookings, and membership card sign-ups, and for coupons, gift cards, and tickets notice for details on how to apply a custom button in the integration, please refer to implementing atw button about atw button images, please refer to image resources for more details
Develop Samsung Wallet
webgift cards gift cards can be added to wallet. registered gift cards are securely stored and easy to access when needed. membership memberships can be added to wallet. registered membership cards display the membership point status and addtional membership program information. tickets movie and event tickets can be added to wallet. registered tickets can provide expiration reminders and additional ticket information. coupons coupons from various channels, such as sms, mms, email, and in-service can be added to wallet. registered coupons can provide expiration reminders and usage status information. generic cards generic cards can be added to wallet. registered generic cards can display various types of card art templates and undefined label fields. this type lets you add a variety of scalable cards to the wallet. ev charge cards ev charge cards can be added to wallet. registered ev charge cards allow the user to start charging their vehicles and receive benefits from their charging networks easily and conveniently. digital ids digital ids, such as driver's licenses, company ids, student ids, and others, can be added to wallet. registered digital ids can be used to access your place or prove your identity online and offline. how to design samsung wallet we encourage you to learn and follow the rules and guidelinessuggested to ensure message consistency and drive brand awareness. learn more news and blogs learn more tutorials apr 23, 2024 get started with "add to samsung wallet" digital content provided by samsung wallet: a guide for developers and service providers choi, jonghwa apr 23, 2024 tutorials mobile jun 12, 2024 introduce loyalty cards to your application with samsung wallet learn how to create a loyalty card in the samsung wallet partners portal and read the guidelines for integrating it into your app. m. a. hasan molla jun 12, 2024 tutorials mobile may 15, 2024 implementing "add to wallet" in an android application tutorial on how your app can add movie tickets (or other wallet cards) to samsung wallet mobassir ahsan may 15, 2024 how can we help you? faq search frequently asked questions by keywords. join the forum visit the forum to ask questions and exchange ideas with other developers. get support submit a 1:1 support request and receive a response within 2 business days.
Develop Samsung Pay
apigift card static final string card_type_loyalty indicates that the card type is loyalty card static final string card_type_transit indicates that the card type is transit card static final string card_type_vaccine_pass indicates that the card type is vaccine pass static final string disposed card is deleted from samsung pay static final string expired card is registered on samsung pay, but its current status is "expired" this might occur if the card or token expiration time has reached and samsung pay has not renewed it static final string pending_activation card is registered on samsung pay but not activated yet a notification of card activation is expected to be pushed to samsung pay in a moment static final string pending_provision card is not fully registered on samsung pay and current state is "pending provision" usually, this state returns when the user has not completed the secondary authentication idv static final string suspended card is registered on samsung pay and current state is "suspended" suspend can be triggered by issuer, card network, or the user fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value method summary all methodsinstance methodsconcrete methods modifier and type method description spaysdk brand getcardbrand api to get card brand string getcardid api to get unique identification of a card in samsung pay android os bundle getcardinfo api to get extra card information if any related to the card string getcardstatus api to get current status of the card methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, wait, wait, wait field details active public static final string active card is fully registered on samsung pay and current state is "active" since api level 1 1 see also constant field values disposed public static final string disposed card is deleted from samsung pay since api level 1 1 see also constant field values expired public static final string expired card is registered on samsung pay, but its current status is "expired" this might occur if the card or token expiration time has reached and samsung pay has not renewed it since api level 1 1 see also constant field values pending_provision public static final string pending_provision card is not fully registered on samsung pay and current state is "pending provision" usually, this state returns when the user has not completed the secondary authentication idv since api level 1 1 see also constant field values suspended public static final string suspended card is registered on samsung pay and current state is "suspended" suspend can be triggered by issuer, card network, or the user since api level 1 1 see also constant field values pending_activation public static final string pending_activation card is registered on samsung pay but not activated yet a notification of card activation is expected to be pushed to samsung pay in a moment since api level 2 3 see also constant field values card_type public static final string card_type indicates that the key for card type since api level 1 8 see also constant field values card_type_credit_debit public static final string card_type_credit_debit indicates that the card type is either credit or debit this is a valid type for addcardinfo setcardtype string since api level 1 1 see also constant field values card_type_gift public static final string card_type_gift indicates that the card type is gift card since api level 1 1 see also constant field values card_type_loyalty public static final string card_type_loyalty indicates that the card type is loyalty card since api level 1 1 see also constant field values card_type_credit public static final string card_type_credit indicates that the card type is credit card this is a valid type for addcardinfo setcardtype string since api level 1 2 see also constant field values card_type_debit public static final string card_type_debit indicates that the card type is debit card this is a valid type for addcardinfo setcardtype string since api level 1 2 see also constant field values card_type_transit public static final string card_type_transit indicates that the card type is transit card since api level 1 8 see also constant field values card_type_vaccine_pass public static final string card_type_vaccine_pass indicates that the card type is vaccine pass since api level 2 16 see also constant field values method details getcardid public string getcardid api to get unique identification of a card in samsung pay returns unique id to refer a card in samsung pay since api level 1 1 getcardbrand public spaysdk brand getcardbrand api to get card brand returns brand name of the card since api level 1 9 see also spaysdk brand getcardinfo public android os bundle getcardinfo api to get extra card information if any related to the card returns extra cardinfo the following are list of extra card information provided on the bundle keys values apptoappconstants extra_app2app_intent string app2app intent name apptoappconstants extra_app2app_payload string app2app payload spaysdk extra_last4_dpan string last 4 digit of dpan spaysdk extra_last4_fpan string last 4 digit of fpan spaysdk extra_card_type card_type_credit_debit card_type_credit card_type_debit card_type_gift card_type_loyalty card_type_transit spaysdk extra_device_type samsungpay#device_type_phone samsungpay#device_type_gear spaysdk extra_issuer_name string issuername issuercode for korean issuers since api level 1 1 getcardstatus public string getcardstatus api to get current status of the card returns current card status the status can be one of the following pending_provision pending_activation active suspended disposed expired since api level 1 1 samsung electronics samsung pay sdk 2 19 00 - jun 12 2024
Develop Samsung Wallet
docgift card 'gift card' cards support enrolling prepaid cards also known as gift certificate, gift voucher or gift token links urls to get balance and transactions history in real time is provided in the partners portal if a partner needs to integrate communication between samsung wallet server and the partner’s server to support the feature, the partner has to set the links in partners portal wallet card type wallet card subtype giftcard others type value description attributes {fields} 1 title string 32 required main title e g , samsung gift card 2 eventid string 36 optional if full cancelation of the event occurs, find and process all gift cards with this id 3 orderid string 36 optional a unique identifier for an order 4 subtitle1 string 32 optional the auxiliary field which displays supporting information 5 logoimage string 256 optional logo image url to be displayed in the card item the file size should not exceed 256 kb 6 logoimage darkurl string 256 optional logo image url in dark mode the file size should not exceed 256 kb 7 logoimage lighturl string 256 optional logo image url in light mode the file size should not exceed 256 kb 8 providername string 32 required gift card provider name 9 user string 64 optional name of person who holds the gift card 10 preventcaptureyn string 1 optional flag whether this wallet card view prevents screen capture either 'y' or 'n', the default value is 'n' 11 startdate long 13 optional start date display start date epoch timestamp in milliseconds 12 enddate long 13 optional end date display end date epoch timestamp in milliseconds 13 locations string 1024 optional list of locations where the gift card can be used * see location format 14 noticedesc string 5000 optional text of the notice * long content is allowed * see additional information format 15 csinfo string 512 optional providers’ customer service informationusing data in json format converted to escape string * allowed items call, email, or website* see the example below 16 applinklogo string 256 required app link image url the file size should not exceed 256 kb 17 applinkname string 32 required app link name 18 applinkdata string 256 required information about the partner app link 19 bgimage string 256 optional url for card art background image the recommended size for image resources is 888 x 555 px 20 mainimg string 256 optional url for gift card image the file size should not exceed 512 kb 21 bgcolor string 8 optional color of the card art e g ,#00ffff 22 fontcolor string 8 optional color of the font on the card art acceptable values dark, light 23 blinkcolor string 8 optional color of the blinking effect which indicates that a card cannot be captured in the indicator area e g , #00ffff 24 barcode value string 4096 optional actual data that is delivered when the barcode/qr code is scanned 25 barcode serialtype string 32 optional presentation type e g , serialnumber, barcode *see barcode format 26 barcode ptformat string 32 optional presentation format e g , barcode, qrcode, serial *see barcode format 27 barcode ptsubformat string 32 optional presentation sub-format e g , code_128, qr_code * see barcode format 28 barcode pin string 16 optional pin to show with a barcode 29 barcode errorcorrectionlevel string 4 optional amount of redundancy or error correction data included in the code there are four error correction levels available in qr codes * code options l/m/q/h 30 merchantid string 36 optional merchant identifier 31 merchantname string 32 optional merchant name to display 32 amount string 32 optional initial balance this is going to be shown as received e g , $1,000 33 balance string 32 optional remaining balance this is going to be shown as received e g , $1,000 34 summaryurl string 256 optional web url that show details, such as balance or transactions history example { "card" { "type" "giftcard", "subtype" "others", "data" [ { "refid" "b3fdc982-28c9-47a3-b02f-d484779698a7", "createdat" 1672574400000, "updatedat" 1672574400000, "language" "en", "attributes" { "title" "samsung gift card", "eventid" "event-001", "logoimage" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "logoimage darkurl" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "providername" "samsung gift card provider", "user" "ms jane doe", "noticedesc" "<ul><li>gift card test</li></ul>", "csinfo" "{\"call\" \"0000-0000\",\"email\" \"samsungwallet@samsungwallet com\",\"website\" \"https //www samsungwallet com/cs/\" }", "applinklogo" "https //play-lh googleusercontent com/znfa1roz7hpv9j-jiacbjmjudl2x-fnuwte0oyvbbcwvf5vpzoqqikbxgk7d-aptvag=w240-h480-rw", "applinkname" "gift card link", "applinkdata" "https //www samsung com/", "bgcolor" "#0a1a4f", "fontcolor" "light", "blinkcolor" "#00ffff", "barcode value" "cs16138353212584806754fg1802", "barcode serialtype" "qrcode", "barcode ptformat" "qrcodeserial", "barcode ptsubformat" "qr_code" } } ] } } loyalty 'loyalty' cards support enrolling loyalty cards also known as membership links urls to get points in real time can be provided in the partners portal if a partner needs to integrate communication between samsung wallet server and the partner’s server to support the feature, the partner has to set the links in the partners portal wallet card type wallet card subtype loyalty others type value description attributes {fields} 1 title string 32 required main title e g ,samsung loyalty card 2 eventid string 36 optional if full cancelation of the event occurs, find and process all loyalty cards with this id 3 groupingid string 36 optional identifier used to group related cards 4 orderid string 36 optional a unique identifier for an order 5 subtitle1 string 32 optional the auxiliary field which displays supporting information 6 logoimage string 256 optional logo image url to be displayed in the card item the file size should not exceed 256 kb 7 logoimage darkurl string 256 optional logo image url in dark mode the file size should not exceed 256 kb 8 logoimage lighturl string 256 optional logo image url in light mode the file size should not exceed 256 kb 9 providername string 32 required loyalty card provider name 10 startdate long 13 optional start date display start date epoch timestamp in milliseconds 11 enddate long 13 optional end date display end date epoch timestamp in milliseconds 12 locations string 1024 optional list of locations where the card can be used * see location format 13 noticedesc string 5000 optional text of notice *html supported 14 csinfo string 512 optional providers’ customer service information using data in json format converted to escape string * allowed items call, email, website, facebook, pinterest, x, or instagram * see the example below 15 applinklogo string 256 required app link image url the file size should not exceed 256 kb 16 applinkname string 32 required app link name 17 applinkdata string 256 required information about the partner app link 18 bgimage string 256 optional background image for a card art the recommended size for image resources is 888 x 555 px 19 bgcolor string 8 optional color of the card art e g , #00ffff 20 fontcolor string 8 optional color of the font on the card art acceptable values dark, light 21 blinkcolor string 8 optional color of the blinking effect which indicates that a card cannot be captured in the indicator area e g , #00ffff 22 barcode value string 4096 optional actual data that is delivered when the barcode/qr code is scanned 23 barcode serialtype string 32 optional presentation type e g , serialnumber, barcode * see barcode format 24 barcode ptformat string 32 optional presentation format e g , barcode, qrcode, serial * see barcode format 25 barcode ptsubformat string 32 optional presentation sub-format e g , code_128, qr_code *see barcode format 26 barcode errorcorrectionlevel string 4 optional amount of redundancy or error correction data included in the code there are four error correction levels available in qr codes * code options l/m/q/h 27 merchantid string 36 optional merchant identifier 28 merchantname string 32 optional merchant name to display 29 amount string 32 optional total amount of points or initial balance this is going to be shown as received it is recommended to use a one letter currency symbol e g , $ 1,000, 1,000p 30 balance string 32 optional available points or remaining balance this is going to be shown as received it is recommended to use a one letter currency symbol e g , $ 1,000, 1,000p 31 summaryurl string 256 optional webpage url that shows details, such as balance or transactions history example { "card" { "type" "loyalty", "subtype" "others", "data" [ { "refid" "b3fdc982-28c9-47a3-b02f-d484779698a8", "createdat" 1672574400000, "updatedat" 1672574400000, "language" "en", "attributes" { "title" "samsung loyalty card", "eventid" "event-001", "logoimage" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "logoimage darkurl" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "providername" "samsung loyalty card provider", "noticedesc" "<ul><li>loyalty card test</li></ul>", "csinfo" " {\"call\" \"0000-0000\",\"email\" \"samsungwallet@samsungwallet com\",\"website\" \"https //www samsungwallet com/cs/\",\"instagram\" \"https //www instagram com/samsungwallet\",\"pinterest\" \"https //www pinterest com/samsungwallet\",\"x\" \"https //www twitter com/samsungwallet\",\"facebook\" \"https //www facebook com/samsungwallet\" }", "applinklogo" "https //play-lh googleusercontent com/znfa1roz7hpv9j-jiacbjmjudl2x-fnuwte0oyvbbcwvf5vpzoqqikbxgk7d-aptvag=w240-h480-rw", "applinkname" "loyalty card link", "applinkdata" "https //www samsung com/", "bgcolor" "#0a1a4f", "barcode value" "cs16138353212584806754fg1802", "barcode serialtype" "qrcode", "barcode ptformat" "qrcodeserial", "barcode ptsubformat" "qr_code", "amount" "1,000p", "balance" "500p" } } ] } } digital ids 'digital id' cards are used to present identification for employees, students, drivers, guests, etc wallet card type wallet card subtype idcard employees, nationals, students, drivers, guests, others -employees -nationals -students -drivers type value description attributes {fields} 1 title string 32 required main title of cardse g , commercial access, employee badge 2 holdername string 64 required name of card holders 3 secondholdername string 64 optional second name of card holders 4 organization string 64 optional organization of card holders belongingi e , name of department, division, affiliation, association or team 5 position string 64 optional position of card holders 6 identifier string 64 required unique id value 7 idnumber string 64 optional representative value for an idi e , id number, document number 8 address string 256 optional address of card holders 9 placeoflocation string 64 optional place of location associated with the cardholder 10 idphoto string 128k optional holder’s photo image data encoded base64the file size should not be greater than 128 kb 11 idphoto format string 32 optional image file formate g , jpeg, png* unsupported image formats may exist 12 idphoto status string 16 optional status of the dataallowed value unchanged 13 document string 1024k optional first document of identity 14 document format string 32 optional document format- allowed value pdf, jpeg, png 15 document status string 16 optional status of the dataallowed value unchanged 16 issuedate long 13 required issue date epoch timestamp in milliseconds 17 birthdate string 16 optional date of birth 18 gender string 16 optional gender of card holders 19 classification string 16 optional classified identity type 20 expiry long 13 optional expiry date in timestamp format issued data is cleaned up after it expires epoch timestamp in milliseconds 21 contacts string 32 optional personal contact information such as phone number 22 logoimage string 256 optional logo image url to be displayed in card item the file size should not exceed 256 kb 23 logoimage darkurl string 256 optional logo image url in dark mode the file size should not exceed 256 kb* if this value does not exist, logoimage will be substituted 24 logoimage lighturl string 256 optional logo image url in light mode the file size should not exceed 256 kb* if this value does not exist, logoimage will be substituted 25 logotext string 16 optional text as an alternative to logoimage 26 providername string 32 required content provider name 27 issuername string 32 optional place of issue or issuing authority name 28 extrainfo string 512 optional additional information* see additional information format 29 noticedesc string 1024 optional text of the notice * long content is allowed * see additional information format 30 csinfo string 512 required providers’ customer service information using data in json format converted to escape string * allowed items call, email, or website* see the example below 31 privacymodeyn string 1 optional whether or not to require user authentication when using the card either ‘y’ or ‘n’* default ‘n’ 32 applinklogo string 256 optional app link image url the file size should not exceed 256 kb 33 applinkname string 32 optional app link name 34 applinkdata string 256 optional information about the partner app link 35 locations string 1024 optional list of locations where the card can be used* see location format 36 coverimage string 256 optional card cover image urlthe file size should not exceed 512 kb the recommended size for image resources is 888 x 555 px 37 bgimage string 256 optional card background image urlthe file size should not exceed 512 kb the recommended size for image resources is 888 x 555 px 38 bgcolor string 8 optional color of the card art support hex color code e g , #015aaa 39 fontcolor string 8 optional color of the font on the card art allowed value black, white 40 blinkcolor string 8 optional color of the blinking effect in the indicator area support hex color code e g , #015aaa 41 preventcaptureyn string 1 optional flag whether this wallet card view prevents screen capture either 'y' or 'n' * default 'n' 42 barcode value string 4096 optional actual data that is delivered when the barcode/qr code is scanned 43 barcode serialtype string 32 optional presentation type e g , serialnumber, barcode, * see barcode format 44 barcode ptformat string 32 optional presentation format e g , barcode, qrcode, serial, * see barcode format 45 barcode ptsubformat string 32 optional presentation sub-format e g , code_128, qr_code, * see barcode format 46 barcode errorcorrectionlevel string 4 optional amount of redundancy or error correction data included in the code there are four error correction levels available in qr codes - code options l/m/q/h * default l 47 barcode interval string 4 optional update interval if support for dynamic updates epoch timestamp in milliseconds 48 authentication string 64 optional authentication data which meets choose options * see authentication for details 49 provision data string 512 optional elements to complete provisioning* see provisioning for details example { "card" { "type" "idcard", "subtype" "employees", "data" [ { "refid" "identitycard-bpo1r3e5-3313-0991-z404-sq12994414u8", "createdat" 1658385817000, "updatedat" 1658385817000, "language" "en", "attributes" { "title" "employee id card", "holdername" "kim samsung", "secondholdername" " samsung ", "organization" "digital wallet, mx", "position" "professional", "identifier" "2306070003", "idphoto" "{base64 encoded image data}", "idphoto format" "jpeg", "document" "{base64 encoded pdf data}", "document format" "pdf", "issuedate" "1658385817000", "expiry" "1765855665000", "logoimage" "https // /logo png", "providername" "samsung electronics", "extrainfo" "{\"count\" 1,\"info\" [{\"title\" \"shortcode\",\"content\" [\"404457\"]}]}", "noticedesc" "{\"count\" 2,\"info\" [{\"title\" \"notice1\",\"content\" [\"description1\",\"description2\"]},{\"title\" \"notice2\",\"content\" [\"description1\",\"description2\"]}]}", "csinfo" "{\"call\" \"555 123-4567\", \"email\" \"cs@email com\", \"website\" \"https //homepage com/cs\"}", "applinkname" "samsung electronics", "applinklogo" "https // /applinklogo png", "applinkdata" "https //www applinkorweblink com", "coverimage" "https // /card/cover png", "bgimage" "https // /card/background png", "fontcolor" "dark", "barcode value" "5728306720836720763017601", "barcode serialtype" "qrcode", "barcode ptformat" "qrcode", "barcode ptsubformat" "qr_code", "barcode interval" "300000", "authentication" "samsung@samsung com", "provision data" "{\"appkey\" \"abcdefaei;fadaf=\",\"telno\" \"01012345678\",\"provider\" \"sec\",\"id\" \"0000000000000000\",\"authkey\" \"a3b7fgj0ea\"}" }, "localization" [ { "language" "ko", "attributes" { "title" "사원증", "holdername" "김삼성", "secondholdername" "kim samsung", "providername" "삼성전자" } } ] } ] } } pay as you go 'pay as you go' card supports a system that pays just before using the cost for the service wallet card type wallet card subtype payasyougo evcharges, others type value description attributes {fields} 1 title string 32 required main title of cardse g , samsung charge card 2 subtitle1 string 32 optional the auxiliary field which displays supporting information 3 logoimage string 256 optional logo image url to be displayed in the card item the file size must not be greater than 256 kb 4 logoimage darkurl string 256 optional logo image url in dark mode the file size should not exceed 256 kb* if this value does not exist, logoimage will be substituted 5 logoimage lighturl string 256 optional logo image url in light mode the file size must not be greater than 256 kb * if this value does not exist, logoimage will be substituted 6 providername string 32 optional content provider name 7 holdername string 64 optional name of card holders 8 preventcaptureyn string 1 optional flag whether this wallet card view prevents screen capture either ‘y’ or ‘n’, the default value is ‘n’ 9 startdate long 13 optional start date display start date epoch timestamp in milliseconds 10 enddate long 13 optional end date display end date epoch timestamp in milliseconds 11 locations string 1024 optional list of locations where the card can be used * see location format 12 noticedesc string 5000 required text of the benefits using data in json format converted to escape string* see additional information information format 13 csinfo string 512 optional providers’ customer service information using data in json format converted to escape string * allowed items call, email, website, youtube, instagram, privacynotice, or termsandcondition* see the example below 14 applinklogo string 256 required app link image url the file size must not be greater than 256 kb 15 applinkname string 32 required app link name 16 applinkdata string 256 required information about the partner app link 17 bgimage string 256 optional url for card art background image 18 bgcolor string 8 optional color of the card art e g , #00ffff 19 fontcolor string 8 optional color of the font on the card art supported colors are white or black #000000 or #ffffff 20 blinkcolor string 8 optional color of the blinking effect which indicates that a card cannot be captured in the indicator area e g , #00ffff 21 barcode value string 4096 conditional barcode data, serial number * required if serialtype isn’t 'none' 22 barcode serialtype string 32 required presentation type barcode/qr/serial/none * see barcode format 23 barcode ptformat string 32 conditional presentation format * see barcode format* required if serialtype isn’t 'none' 24 barcode ptsubformat string 32 conditional 25 barcode pin string 16 optional pin to show with a barcode 26 identifier string 64 optional unique id value such as a membership number 27 grade string 32 optional grade value 28 authentication string 64 optional authentication data which meets choose options * see authentication for details 29 provision data string 512 optional elements to complete provisioning* see provisioning for details 30 transactions string 4096 optional transaction history * long content is allowed * see transactions format 31 summaryurl string 256 optional webpage url that show details, such as transactions example { "card" { "type" "payasyougo", "subtype" "evcharges", "data" [ { "refid" "b3fdc982-28c9-47a3-b02f-d484779698a7", "createdat" 1672574400000, "updatedat" 1672574400000, "language" "en", "attributes" { "title" "ev charge card", "logoimage" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "logoimage darkurl" "https //gpp walletsvc samsung com/mcs/images/contents/wallet_intro_logo png", "providername" "ev-samsung", "holdername" "ms jane doe", "preventcaptureyn" "y", "enddate" 1772574400000, "noticedesc" "{\"count\" 2,\"info\" [{\"title\" \"포인트 적립\",\"content\" [\"결제금액 1000원당 포인트가 적립됩니다 \"]},{\"title\" \"포인트 사용방법\",\"content\" [\"적립하신 포인트의 유효기간은 발생일로부터 5년입니다 \",\"유효기간이 지난 포인트는 소멸됩니다 \"]}]}", "csinfo" " {\"call\" \"0000-0000\",\"website\" \"https //www samsungwallet com/cs/\",\"instagram\" \"https //www instagram com/samsungwallet\",\"youtube\" \"https //www youtube com/@samsungwallet\",\"privacynotice\" \"https //privacy samsungwallet com/\",\"termsandcondition\" \"https //www samsungwallet com/tnc\" }", "applinklogo" "https //play-lh googleusercontent com/znfa1roz7hpv9j-jiacbjmjudl2x-fnuwte0oyvbbcwvf5vpzoqqikbxgk7d-aptvag=w240-h480-rw", "applinkname" "ev charge link", "applinkdata" "https //www samsungev com/", "bgcolor" "#0a1a4f", "fontcolor" "#ffffff", "blinkcolor" "#00ffff", "barcode value" "1234000067890000", "barcode serialtype" "qrcode", "barcode ptformat" "qrcodeserial", "barcode ptsubformat" "qr_code", "barcode pin" "1234", "identifier" "ev-001", "grade" "prime", "authentication" "sdaiwegjhewoghewoihgewo", "provision data" "asd2hfih9gwejdahgi4uaewhgeo6whgo12ewhgoewahg1iawpriuq7hg5wel", "transactions" "{\"transactions\" [{\"date\" \"2023-09-10 12 00 00\",\"description\" \"ev-samsung suwon\"},{\"date\" \"2023-09-20 18 00 00\",\"description\" \"ev-samsung gangnam\"}]}" } } ] } } generic card 'generic card' is defined for registering various forms of cards that aren't defined as other types partners can customize the items on the generic card to display by connecting them with card data wallet card type wallet card subtype generic others type value description attributes {fields} 1 title string 32 required main title 2 subtitle string 32 optional the auxiliary field which displays supporting information 3 providername string 32 required provider name 4 eventid string 32 optional event identifier 5 groupingid string 32 optional identifier used to group related cards 6 startdate long 13 required start date display start date epoch timestamp in milliseconds 7 startdate relativenotitime string 4 optional the relative time from startdate in minutes to provide a notification to the usere g , 5, 10, 15, 30, 60, and up to 2880 8 enddate long 13 optional end date display end date epoch timestamp in milliseconds 9 enddate relativenotitime string 4 optional the relative time from enddate in minutes to provide a notification to the usere g , 5, 10, 15, 30, 60, and up to 2880 10 mainimg string 256 required url for main image the file size should not exceed 512 kb 11 logoimage string 256 optional logo image url to be displayed in card item the file size should not exceed 256 kb 12 logoimage darkurl string 256 optional logo image url in dark mode the file size should not exceed 256 kb* if this value does not exist, logoimage will be substituted 13 logoimage lighturl string 256 optional logo image url in light modethe file size should not exceed 256 kb* if this value does not exist, logoimage will be substituted 14 coverimage string 256 optional card cover image urlthe file size should not exceed 512 kb the recommended size for image resources is 888 x 555 px 15 bgimage string 256 optional card background image urlthe file size should not exceed 512 kbthe recommended size for image resources is 888 x 555 px 16 text{i} string 64 optional text item i 1~15 17 image{i} string 128k optional image item i 1~5 18 image{i} lighturl string 256 optional image item in light mode 19 image{i} darkurl string 256 optional image item in dark mode 20 image{i} status string 16 optional image item status 21 serial{i} value string 4096 optional actual data that is delivered when the barcode/qr code is scanned i 1~2 22 serial{i} serialtype string 32 optional presentation typee g , serialnumber, barcode, * see barcode format 23 serial{i} ptformat string 32 optional presentation formate g , barcode, qrcode, serial, * see barcode format 24 serial{i} ptsubformat string 32 optional presentation sub-formate g , code_128, qr_code, * see barcode format 25 serial{i} errorcorrectionlevel string 4 optional amount of redundancy or error correction data included in the code there are four error correction levels available in qr codes - code options l/m/q/h 26 noticedesc string 1024 required notice description * long content is allowed * see additional information format 27 csinfo string 512 optional providers’ customer service information using data in json format converted to escape string* allowed items calls, emails, or websites 28 providerviewlink string 512 optional link to additional information from the provider* see links format 29 privacymodeyn string 1 optional whether or not to require user authentication when using the cardeither ‘y’ or ‘n’* default ‘n’ 30 bgcolor string 8 optional color of the card art e g , #00ffff 31 fontcolor string 8 optional color of the font on the card art acceptable values dark, light 32 blinkcolor string 8 optional color of the blinking effect in the indicator areae g , #00ffff 33 preventcaptureyn string 1 optional flag whether this wallet card view prevents screen capture either 'y' or 'n'* default 'n' 34 nonetworksupportyn string 1 optional sets whether to support to open the wallet card under 'no network' status either 'y' or 'n'* default 'n' 35 applinklogo string 256 required app link image url the file size should not exceed 256 kb 36 applinkname string 32 required app link name 37 applinkdata string 256 required information about the partner app link 38 locations string 1024 optional list of locations where the card can be used * see location format example { "card" { "type" "generic", "subtype" "others", "data" [ { "createdat" 1661745824345, "updatedat" 1661745824345, "language" "en", "refid" "refid-012345", "attributes" { "title" "samsung generic card", "subtitle" "personal members", "providername" "samsung", "startdate" 1661751274000, "startdate utcoffset" "utc+9", "enddate" 1761778000000, "enddate utcoffset" "utc+9", "enddate relativenotitime" "1440", "text1" "13047623", "text2" "silver", "text3" "suwon station branch", "text4" "031 000-1235", "timestamp1" 1761751274000, "timestamp1 utcoffset" "utc+9", "mainimg" "https //www samsung com/images/main png", "image1" "https //www samsung com/images/image1 png", "image1 darkurl" "https //www samsung com/images/dark png", "image1 lighturl" "https //www samsung com/images/light png", "serial1 value" ">1180mm2241b7c 0000000000000298060000000000 0 090870907 ", "serial1 serialtype" "qrcode", "serial1 ptformat" "qrcode", "serial1 ptsubformat" "qr_code", "bgcolor" "#ff5000", "fontcolor" "dark", "noticedesc" "{\"count\" 2,\"info\" [{\"title\" \"notice1\",\"content\" [\"description1\",\"description2\"]},{\"title\" \"notice2\",\"content\" [\"description1\",\"description2\"]}]}", "csinfo" "{\"calls\" [{\"key\" \"emergency\",\"value\" \"82 123-4567\"},{\"key\" \"customer service\",\"value\" \"82 123-9876\"}],\"emails\" [{\"key\" \"cs team\",\"value\" \"cs@atwsample com\"}],\"websites\" [{\"key\" \"faq\",\"value\" \"https //atwhomepage com/faq\"},{\"key\" \"support\",\"value\" \"https //atwhomepage com/support\"}]}", "providerviewlink" "{\"count\" 1,\"info\" [{\"link\" \"https //samsung external info link/refid-012345\",\"type\" \"web\",\"text\" \"see more information\"}]}", "applinkdata" "https //www samsung com/", "applinklogo" "https //www samsung com/logo png", "applinkname" "samsung" }, "localization" [ { "language" "ko", "attributes" { "title" "삼성 제네릭 카드", "subtitle" "개인 멤버스", "providername" "삼성", "text2" "실버 등급", "text3" "수원역점" } } ] } ] } }
Learn Code Lab
codelabgift card gift card, also referred to as a prepaid card, provides real-time balance and transaction history loyalty loyalty cards function as membership credentials, managing membership information through these cards, loyalty points can be administered and redeemed id id cards can fulfill identification verification purposes, such as identity cards, employee cards, and licenses physical documents can be represented through wallet cards, and near field communication nfc -based authentication can be provided reservation reservation cards can contain diverse online booking details, including rental cars, restaurants, and accommodations ongoing reservation information can be managed as a journey pay as you go pay as you go cards allow users to register services that can be charged and utilized according to their preference for convenient use generic card generic cards enable users to create customized cards by selecting preferred card template layouts and designing elements 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 more information, refer to manage wallet cards set up your environment you will need the following latest version of samsung wallet app from galaxy store samsung galaxy device that supports samsung wallet access to samsung wallet partners site internet browser, such as chrome openssl intellij idea or any java ide optional start the onboarding process partners can manage wallet cards and monitor performance with the samsung wallet partners site to join as partner generate a private key and certificate signing request csr using the openssl command you can follow the instructions in security factors notea private key enables encryption and is the most important component of certificates while csr, which is a necessary factor to obtain a signed certificate, includes the public key and additional information like organization and country proceed to register in the samsung wallet partners site using your samsung account follow the samsung wallet partner onboarding process upload the generated csr for data encryption in encryption setting management section after registration, you will receive a welcome email noteupon receiving the certificates via email, be sure to keep the information safe from exposure and only use them for the following purposes signed certificate used along with the private key to sign data samsung certificate used to encrypt card data and validate authentication tokens in server api headers create a wallet card follow the steps below to create a wallet card in samsung wallet partners site click the wallet cards menu and choose create wallet card fill out the general information form with the details of the wallet card in wallet card template, choose a card type and sub type select the design type and click done you can choose from various types of wallet card templates optimized for partners after inputting all necessary details, click save to set the wallet card status to draft launch the wallet card you can launch and request activation of the card by clicking the launch button upon agreeing to proceed, the launch button text changes to launched and the card status becomes verifying add the card to samsung wallet using the test tool open a web browser on your computer or galaxy mobile device, and go to the following link partner walletsvc samsung com/addtowallettest go to add to wallet tab and click choose key file to upload your private key in the select card dropdown menu, select the created card to display the card details and populate sample data navigate to the form tab and modify the card data as desired notethe structure for configuring wallet cards follows the defined specification you can refer to the full list of card-specific attributes specification scroll down to the bottom of the page and click the add to samsung wallet button click done when a preview of the card shows on your mobile screen with a message indicating that the card has been added to your wallet once the card is added to your samsung wallet app, you can check its details by clicking on it noteyou can also go to the playground tab and add cards to the samsung wallet app even without creating a card on the wallet partners site update the status of the added card if a server api info partner get card data and partner send card state is registered in the wallet card, real-time updates of the user's registered cards can be provided notefor more information, see server interaction modify and update the card's status by utilizing the push notification feature of the test tool navigate to the push notification tab ensure that the correct private key is uploaded and the same card as in the add to wallet tab is selected copy the ref id value from the add to wallet tab and paste it into ref id field in the push notification tab in the status field, enter one of the following card states expired, redeemed, held, suspended, or deleted the current state is set to active then, click the request push notification button check the card in the samsung wallet app to confirm the change tokenize card data and implement the add to samsung wallet button to your service optional notethis step is optional, but if you want to learn how to integrate the add to samsung wallet button into your services like an android app, web app, or email, you can follow these steps the samsung wallet partners site provides generated add to samsung wallet scripts for each wallet card you create you can simply copy and paste these scripts into your partner apps web and android or include them in emails/mms messages to implement the add to wallet button, follow these steps go to the [add to wallet script guide] section of the card you created click show to view the available scripts and then copy the appropriate script for your service develop a program that can generate tokenized card data cdata the cdata represents the actual content of the wallet card and comes in different formats depending on the card type you can check the cdata generation sample code for reference the cdata is derived from the card data, which is in json format for testing purposes, you can utilize the generated json from the test tool follow the implementing atw button guide to determine where to incorporate the generated cdata and gain further insights into this process you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can utilize the add to samsung wallet service by yourself! to learn more about samsung wallet, visit developer samsung com/wallet
web
gift cards, loyalty cards, and id cards to samsung wallet. code lab code lab customize styles of a watch face with watch face studio learn how to easily customize the style of a watch face using the customization editor in watch face studio. know how to make your watch face respond to your step count using conditional lines. code lab code lab matter: build a matter iot app with smartthings home api learn how to create an iot app to onboard, control, remove, and share matter devices using smartthings home apis. tutorial tutorial start your learning journey with code lab code lab is a learning platform where you can get started with the latest technologies and services in samsung. tutorial tutorial integrate samsung iap in your unreal engine 5 game monetize your unreal engine game in galaxy store using samsung iap unreal plugin video tutorials go to youtube video apr 3, 2024 developing apps for galaxy watch? start setting up! learn how to enable developer mode on your galaxy watch, operating on wear os powered by samsung. apr 3, 2024 video mar 21, 2023 quick and easy: using a galaxy emulator skin watch this youtube shorts to quickly learn how to make your android virtual device look like a galaxy device using the galaxy emulator skin. mar 21, 2023 video oct 12, 2022 watch face studio with dark mode create a beautiful watch face that is refined and provides a more comfortable viewing experience in low-light situations. oct 12, 2022 video feb 9, 2022 how to test your mobile apps through a web browser remote test lab is a service that enables developers to control devices remotely. with this, you can test your applications on a real device by interacting with it over the network in real-time. feb 9, 2022 newsletter monthly newsletter for samsung developers if you don't currently receive the newsletter, you can subscribe here. 뉴스레터 전송을 위한 개인정보 수집∙이용에 동의합니다(필수). detail 광고성 정보 수신에 동의합니다(필수). detail i agree to data processing for sending newsletters. (required) detail i consent to receiving newsletters via email. (required) i consent to receiving newsletters via email. detail subscribe code lab learn about how to use samsung sdks and tools to implement various use cases with sample apps. learn more foldables and large screens boost your app's value with foldables and large screen optimization learn more
Develop Samsung Wallet
docgift cards wallet card type loyalty view wallet card you can view all registered information for a wallet card, as well as edit and delete it launch wallet cards you can launch and activate cards, at which point they move to verification you can activate a card by clicking the "launch" button once a card is launched, the button text changes to 'launched' the activation cannot be canceled when a card is launched, its status changes to 'verifying', and then to ‘active’ after administrator approval rejected wallet cards if the wallet card is rejected after launching, you can modify the card and re-launch the administrator registers the reason for rejection when rejecting the launched wallet card it is sent to the partner by email from the system, including the reason for rejection partners can apply for launch again by checking the reason for rejection and modifying the wallet card information testing mode you can test a card internally to make sure everything works before you officially expose it to users the "testing mode" option is enabled by default all data generated in testing mode is periodically deleted card exposure is not affected even when the testing mode is enabled when testing mode is activated, samsung wallet may show error code and message on the card addition screen be sure to turn off testing mode after the test is over admin approval active status all launched cards are activated after the administrator's approval when a card is launched, its status changes to 'verifying' and then to 'active' after administrator approval when the card is activated, it is made visible to the user "add to wallet" integration for wallet integration, you need to insert an "add to wallet" script to your system the "add to wallet" script is available for web, android, and email/mms each system has different script composition to implement an "add to wallet" button, follow the procedure below create the tokenized card data cdata card data is the actual content data of wallet card and it has several formats based on the card type refer to cdata generation sample code for details copy the sample "add to wallet" script from the partners portal’s wallet card page and replace "cdata" with the data token created above apply the script to your system see web integration sample code and android integration sample code for details below is the "add to wallet" script guide in the partners portal for "add to wallet" integration, you may need some base data you can find that and other necessary information on partners portal and wallet api spec you can also add image beacon in the script for tracking effect analysis performance monitoring the samsung wallet service is monitored to get an effective measure of the wallet performance overview wallet card total number of wallet cards registered in the portal wallet card type total number of wallet card types registered in the portal wallet card template total number of templates registered in the portal recent trends provides key indicators and trend charts for the selected period you can change the period and wallet card type being reviewed item description registered registration by wallet card category impressions count when the coupon or banner is displayed on each screen page click count of click on a specific link to the number of total users who view a coupon or banner click through rate percentage of clicks against impressions in the coupon or banner[ctr % = clicks/impressions] stats of all wallet cards provides detailed statistical information for the selected wallet card you can change the period, template, and wallet card type you can check detailed information and charts for each indicator item description registered registration by wallet card category number of registrations by wallet card category and registrations by template number of registrations by template , registered number of registrations for the specified wallet card category/template , registration by partner number of registrations by partner active device number of device registering cards in the wallet max number of unique device ids dmid the max number means the maximum value during the statistical period - the hourly graph shows the maximum time's value - the daily graph shows the maximum date's value top 10 of all templates statistics on top 10 templates based on number of registrations or clicks & ctr add to wallet - impressions number of impressions counts for 'add to wallet' button add to wallet - clicks number of clicks for 'add to wallet' button add to wallet – click through rate ratio of clicks against impressions for 'add to wallet' button[ctr % = clicks/impressions] wallet cards - impressions number of exposures of registered content wallet cards – clicks number of clicks on registered content wallet cards – click through rate click through rate of registered content age & gender age & gender statistics for impression/click/ctr data by wallet card / wallet category registered by end user
tutorials mobile
bloggift card loyalty card id card create your wallet card at the samsung wallet portal. you can create as many cards as you need. the samsung wallet portal also allows you to manage your cards and monitor their performance. testing wallet cards use the “add to wallet” test tool to test the card at any time, before or after launching it: in the samsung wallet portal, enable testing mode for the card you want to test. skip this step if you have already launched the card. on your samsung device, go to the “add to wallet” test tool and sign in with your samsung account. select the card from the list and provide test data in the appropriate fields. in the “partner’s private key” field, paste your decrypted private key. this must be the same private key that was used during onboarding. noteif your private key is encrypted, you must first decode it with the ssl command. an encrypted key starts with the following text: -----begin encrypted private key----- once decoded, the key starts with the following text: -----begin private key----- 5. tap the “add to samsung wallet” button to add the card to samsung wallet on your device. for more information about testing wallet cards, see “add to wallet” test tool. launching wallet cards when you are ready to make the wallet card accessible to users, click “launch” to start the verification process. launching a card cannot be canceled. figure 1: wallet card launched the samsung wallet administrator reviews the card and approves or rejects it. if your card is rejected, check the rejection email for the reason. modify the card to address the issue and launch it again. for more information about wallet card verification, see launch wallet cards (verifying status) and launch wallet cards (rejected status). implementing “add to wallet” links after launching your wallet card, create a link that users can click to add the content to their samsung wallet. to include the card data in tokenized form, use the following url format: https://a.swallet.link/atw/v1/{card id}#clip?cdata={cdata token} where: {card id} path parameter is the unique identifier for the wallet card in the samsung wallet portal. #clip hash parameter is case-sensitive. cdata query parameter contains the encrypted card data in jwt format. for more information, see the "cdata token generation" section below. if the encrypted card data is longer than 2048 bytes, or you do not want to include the tokenized data in the url, store and reference the card data on your server. create the url in the following format: https://a.swallet.link/atw/v1/{card id}#clip?pdata={reference id} where: {card id} path parameter is the unique identifier for the wallet card in the samsung wallet portal. #clip hash parameter is case-sensitive. pdata query parameter is the unique identifier for the card data stored on your server. for more information on “add to wallet” links, see add to wallet interface. cdata token generation the card data in basic json format must be provided as a jwt (json web token). for token generation details, see security. you can also study the cdata generation sample code. to ensure your cdata token is valid, keep the following requirements in mind: pay attention to the mandatory fields in the card object. all timestamps are utc epoch time in milliseconds. card data attributes vary based on the card type. for detailed card data specifications, see wallet cards. your private key must match the key used for the security certificate signed by samsung. if you are using the correct private key, the following commands generate the same hash: $ openssl rsa -noout -modulus -in partner.key | openssl md5 $ openssl x509 -noout -modulus -in partner.crt | openssl md5 generated jwt tokens expire in 30 seconds. the “add to wallet” link must be used within this time. otherwise, you must generate a new token and new link. next steps to integrate the “add to wallet” feature as a button in your application or website, see implement the button. you can update the information on a card that has been stored in a user’s samsung wallet by communicating between your server and the samsung server. for information, see server interaction. if you have any questions or face difficulties implementing the content in this article, you can contact samsung developer support. related resources samsung wallet documentation integrate “add to samsung wallet” button into partner services code lab
M. A. Hasan Molla
tutorials mobile
bloggift cards and loyalty cards, for your service and issue them to users who can add them to the samsung wallet application on their device. samsung wallet cards are signed with the rs256 asymmetric algorithm. the rs256 signing algorithm requires a private key, which is a personal credential that must never be shared in the application. consequently, a separate server application is needed to store the key and sign the wallet card data (cdata). when the user taps the "add to samsung wallet" button in the application, the server application creates and signs the wallet card data, then returns a jwt token that is used to add the wallet card to the user's samsung wallet application. figure 1: "add to wallet" flow this tutorial uses kotlin to demonstrate how to implement the "add to wallet" feature in an android mobile application that adds movie tickets to samsung wallet. it also shows how to generate the wallet cards using a spring boot server. you can follow along with the tutorial by downloading the sample code files. develop the mobile application to implement the "add to wallet" button in the mobile application, you must configure the application, implement the application ui, and define the application logic for the button. configuring the mobile application project create an application project and configure it to connect to and communicate with the server through rest api requests: in android studio, create a new project. to implement rest api support in the application, add the following retrofit library dependencies to the application's "build.gradle" file: 'com.squareup.retrofit2:retrofit:2.11.0' 'com.squareup.retrofit2:converter-gson: 2.11.0' to enable communication with the server, add the following permissions to the "androidmanifest.xml" file: <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.access_wifi_state"/> to enable testing with a local non-https server, add the following attribute to the "application" element in the "androidmanifest.xml" file: android:usescleartexttraffic="true" implementing the application ui the application ui consists of two screens: the movie tickets list and a ticket detail page. in the application code, define a movie data class that contains details for the movie tickets that can be added to samsung wallet. data class movie( val name:string, val studio:string, val ticketnumber:string, ) create a recyclerview that displays the list of movie tickets as buttons on the main screen. each button has a listener that opens the detail page for the ticket. you can study the implementation details in the sample code. to check whether the device supports samsung wallet, send an http get request to the following endpoint, where build.model is the model of the device: https://api-us3.mpay.samsung.com/wallet/cmn/v2.0/device/available?servicetype=wallet&modelname=${build.model} create the ticket detail page layout in the "activity_movie_detail.xml" file. the "add to wallet" button is implemented on this page. figure 2: detail page layout implement the ticket detail page functionality in the moviedetailactivity activity class in the application code. for this demonstration, the movie ticket data is predefined in the application code. in a real application, the data is usually retrieved in real time from an external database. val movielists = listof<movie>( movie("the wallet", "samsung studios", "a-01"), movie("crying sea", "laplace studio","h-07"), movie("canoe", "terra productions", "r-03") ) val position:int = intent.getintextra("movieposition", 0) val movie:movie = movielists[position] binding.mvnametext.text = movie.name binding.mvstudiotext.text = movie.studio binding.mvticketnumber.text = "ticket: ${movie.ticketnumber}" binding.addtowalletbutton.setonclicklistener { // request server to generate card data // retrieve signed card data from server // add card to samsung wallet application } when the user taps the "add to wallet" button, onclicklistener() is triggered. its functionality is defined later in this tutorial. connecting to the server to communicate with the server: in the tokenresponse class, define the structure of the json response to be received from the server. the status field indicates whether the token generation request was successful, and the jwt field contains the generated cdata in the form of a jwt token. data class tokenresponse( val status: string, val jwt:string ) in the "apiclient.kt" file, define a retrofitclient object that is used to establish the connection with the server. define the apiinterface interface, which defines the api request and response: the api endpoint url is base_url/movie/{id}, where {id} is the movie ticket id to be added the expected response from the endpoint is a tokenresponse object. define an apiclient object that extends apiinterface and creates a retrofitclient instance to establish the server connection. object retrofitclient { private const val base_url = "http://192.xxx.xxx.xxx:8080" // define your server url val retrofit: retrofit by lazy { retrofit.builder() .baseurl(base_url) .addconverterfactory(gsonconverterfactory.create()) .build() } } interface apiinterface { @get("/movie/{id}") suspend fun getmovie(@path("id") movieid:int): response<tokenresponse> } object apiclient { val apiservice: apiinterface by lazy { retrofitclient.retrofit.create(apiinterface::class.java) } } adding card data to samsung wallet to request cdata generation from the server and add the wallet card to samsung wallet: in the addtowalletbutton.setonclicklistener() method within the moviedetailactivity class, send a request to the server to generate cdata for the selected movie ticket. if cdata generation is successful, to add the movie ticket to samsung wallet, send an http request containing the cdata token to the following endpoint url: https://a.swallet.link/atw/v1/{card id}#clip?cdata={cdata token} for more information about this endpoint, see data transmit link. binding.addtowalletbutton.setonclicklistener { coroutinescope(dispatchers.main).launch { val response = apiclient.apiservice.getmovie(position) if(response.issuccessful && response.body()!=null){ startactivity(intent( intent.action_view, uri.parse("http://a.swallet.link/atw/v1/3aabbccddee00#clip?cdata=${response.body()!!.jwt}"))) // replace '3aabbccddee00' part with your card id } } } notethe generated cdata is valid for 30 seconds, so it is recommended to generate the cdata only when the "add to samsung wallet" button is clicked. if the cdata has expired by the time the token is sent to samsung wallet, the user can receive a "request timed out" error. generate signed wallet card data the server application must be configured to receive the card data request from the mobile application and return a signed jwt token. this part of the tutorial uses the spring boot framework. configuring the server project to create and configure a server application to generate and sign wallet card data: in the spring initializr tool or any supported java ide, create a spring boot project and open the sample code. to configure the server to receive rest api requests from the mobile application, add the "spring web" dependency to the project. define a token data class. make sure it has the same attributes as the tokenresponse data class defined in the mobile application. data class token(val status:string, val jwt:string initialize a tokencontroller class that receives the incoming requests and returns a token object in response. @restcontroller @requestmapping("movie") class tokencontroller { @getmapping(path = ["/{movieid}"]) fun getmovie(@pathvariable movieid:int): token { return token("success", "{dummy_cdata}") // cdata generation logic } } the cdata generation and signing logic is described in the next section. implementing card data signing logic for easier understanding, this section describes a simplified implementation of the cdata generation sample code. in the server application project, copy the following credential files to the "sample/securities/" directory. samsung public key from the samsung certificate ("samsung.crt") partner public key from your partner certificate ("partner.crt") partner private key from the private key file ("partner.key") to handle the certificate files and signing algorithms, add the following dependencies to the server application's "build.gradle" file: implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3' implementation 'org.bouncycastle:bcprov-jdk18on:1.77' in a new "jwtgen.kt" file, define a readcertificate() method that reads the public keys from the certificates and a readprivatekey() method that reads the private key from the key file. private val partner_id = "4048012345678912345" // replace with your partner id private val samsungpublickey = readcertificate(getstringfromfile("sample/securities/samsung.crt")) private val partnerpublickey = readcertificate(getstringfromfile("sample/securities/partner.crt")) private val partnerprivatekey = readprivatekey(getstringfromfile("sample/securities/partner.key")) fun readprivatekey(key: string): privatekey { val keybyte = readkeybyte(key) lateinit var privatekey: privatekey val pkcs8spec = pkcs8encodedkeyspec(keybyte) try { val kf = keyfactory.getinstance("rsa") privatekey = kf.generateprivate(pkcs8spec) } catch (e: invalidkeyspecexception) { e.printstacktrace() } catch (e: nosuchalgorithmexception) { e.printstacktrace() } return privatekey } fun readcertificate(cert: string): publickey { lateinit var certificate: certificate val keybyte = readkeybyte(cert) val `is`: inputstream = bytearrayinputstream(keybyte) try { val cf = certificatefactory.getinstance("x.509") certificate = cf.generatecertificate(`is`) } catch (e: certificateexception) { e.printstacktrace() } return certificate.publickey } private fun readkeybyte(key: string): bytearray { val keybyte: bytearray val bais = bytearrayinputstream(key.tobytearray(standardcharsets.utf_8)) val reader: reader = inputstreamreader(bais, standardcharsets.utf_8) val pemreader = pemreader(reader) var pemobject: pemobject? = null try { pemobject = pemreader.readpemobject() } catch (e: ioexception) { e.printstacktrace() } keybyte = if (pemobject == null) { base64.getdecoder().decode(key) } else { pemobject.content } return keybyte } fun getstringfromfile(path: string?): string { try { val file = file(objects.requirenonnull(classloader.getsystemclassloader().getresource(path)).file) return string(files.readallbytes(file.topath())) } catch (e: ioexception) { throw runtimeexception(e) } } generating card data cdata token generation is implemented in the "jwtgen.kt" file: read the file containing raw json data that defines the ticket data structure. for this demonstration, use the "ticket.json" file in the "sample/payload/" directory of the cdata generation sample code. generate or fill in the required ticket details. for example, the "{title}" and "{seatnumber}" fields are replaced with the movie title and seat number. for information about the complete json structure, see wallet cards. convert the json data to a jwe object. encrypt the jwe object with the samsung public key. build the custom jws header for samsung wallet cards. sign and validate the complete jws object with your partner private and public key using the rs256 asymmetric algorithm. this is the cdata token. private val currenttimemillis = system.currenttimemillis() private val plaindata:string = getstringfromfile("sample/payload/ticket.json") .replace("{refid}", uuid.randomuuid().tostring()) .replace("{language}", "en") .replace("{createdat}", currenttimemillis.tostring()) .replace("{updatedat}", currenttimemillis.tostring()) .replace("{issuedate}", currenttimemillis.tostring()) .replace("{startdate}", (currenttimemillis + timeunit.days.tomillis(1)).tostring()) .replace("{enddate}", (currenttimemillis + timeunit.days.tomillis(1) + +timeunit.hours.tomillis(2)).tostring()) fun generatecdata(moviename: string, movieticktno:string): string{ // modify data as needed val data = plaindata.replace("{title}", "\"$moviename\"") .replace("{seatnumber}","\"$movieticktno\"") //print(data) return generate(partner_id, samsungpublickey, partnerpublickey, partnerprivatekey, data) } private fun generate(partnerid: string, samsungpublickey: publickey, partnerpublickey: publickey, partnerprivatekey: privatekey, data: string): string { val jweenc = encryptionmethod.a128gcm val jwealg = jwealgorithm.rsa1_5 val jweheader = jweheader.builder(jwealg, jweenc).build() val encryptor = rsaencrypter(samsungpublickey as rsapublickey) val jwe = jweobject(jweheader, payload(data)) try { jwe.encrypt(encryptor) } catch (e: joseexception) { e.printstacktrace() } val payload = jwe.serialize() val jwsalg = jwsalgorithm.rs256 val utc = system.currenttimemillis() val jwsheader = jwsheader.builder(jwsalg) .contenttype("card") .customparam("partnerid", partnerid) .customparam("ver", "2") .customparam("utc", utc) .build() val jwsobj = jwsobject(jwsheader, payload(payload)) val rsajwk = rsakey.builder(partnerpublickey as rsapublickey) .privatekey(partnerprivatekey) .build() val signer: jwssigner try { signer = rsassasigner(rsajwk) jwsobj.sign(signer) } catch (e: joseexception) { e.printstacktrace() } return jwsobj.serialize() } returning the signed token in the server application code, when the server receives a request at the movie/{movieid} endpoint, the tokencontroller class calls the jwtgen.generatecdata() method with the movie id, which generates and returns the cdata jwt token in the api response. in this tutorial, since the movie ticket list was predefined in the mobile application project, make sure the same movie data class and list are defined here too. @restcontroller @requestmapping("movie") class tokencontroller { @getmapping(path = ["/{movieid}"]) fun getmovie(@pathvariable movieid:int): token { val movielists = listof<movie>( movie("the wallet", "samsung studios", "a-01"), movie("crying sea", "laplace studio","h-07"), movie("canoe", "terra productions", "r-03") ) if( movieid>2){ // implement your verification logic return token("failure", "") } else{ val cdata = jwtgen.generatecdata(movielists[movieid].name, movielists[movieid].ticketnumber) return token("success", cdata) } } } testing the application to test your "add to wallet" integration: connect the server and the mobile device to the same network. launch the server and mobile applications. in the mobile application, tap a movie ticket in the list. its detail page opens. tap add to samsung wallet. the server generates and returns the cdata token. the samsung wallet application launches on the device and the movie ticket information is added to it. figure 3: ticket added to samsung wallet summary implementing the "add to wallet" feature enables your users to add your digital content, such as tickets, passes, and loyalty cards, to the samsung wallet application on their mobile device as wallet cards. in addition to implementing the "add to samsung wallet" button in your mobile application, you must also create a server application that securely generates and signs the wallet card data and returns it to the mobile application for transmitting to samsung wallet. for more information about adding "add to wallet" to your application, see implementing atw button. you can also study the extended sample application (clicking this link downloads the sample code) and the api reference. if you have questions about or need help with the information presented in this article, you can share your queries on the samsung developers forum. you can also contact us directly for more specialized support through the samsung developer support portal. resources click the links below to download the sample code. android app sample code extended android app sample code cdata generation server sample code
Mobassir Ahsan
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.