Implementing VWW button
add to samsung wallet' • "vww" verify with samsung wallet' cardid string required wallet card identifier* value granted from the partners portal cdata string required encrypted card object json * this field needs to be encrypted * refer to security for more details partnercode |string required partner code * value granted from the partners portal buttonid string required dom element id for the "verify with samsung wallet" web button for samsung wallet buttontype string optional "verify with samsung wallet" button type [“btnsw” / “btnatsw” / “qrcode”, default btnsw] authtoken string optional token generated when “qrcode” is used * required only if the “buttontype” is set to “qrcode” model string optional device model to display button* by default, value from user-agent is used if no value from user-agent, the button is displayed * to display buttons only on devices supporting samsung wallet, explicitly include the model name * for example, you can retrieve the device model name e g , sm-s928f from the browser's user-agent inline string optional flag to display the "verify with samsung wallet" image button in one-line format default true one-line locale string optional locale of the "verify with samsung wallet" image button rdclickurl string required url for logging a button click event * value granted from the partners portal rdimpressionurl string required url for logging a button impression event * value granted from the partners portal showforced string optional flag to force the "verify with samsung wallet" button to be displayed default false mediatheme string optional load the button’s resources from the media theme policy there are 4 themes default, inversion, lightonly, and darkonly default default *default load the button’s theme according to the prefers-color-scheme policy *inversion load the inverse of the default button’s theme *lightonly load the light theme of the default button *darkonly load the dark theme of the default button style string cssstyledeclaration optional load the button with custom style onshowbutton function optional callback handler function for the button’s on-show event onclickbutton function optional callback handler function for the button’s on-click event if you register the handler function, you must return a callback or promise value samsungwallet addbutton function this function allows partners to explicitly render the samsung wallet api for the "verify with samsung wallet" web button samsungwallet addbutton { type "vww", cardid "card_id", cdata "cdata", partnercode "partner_code", targetid "target_id", buttonid "button_id", buttontype "btnvwsw", rdclickurl "rd_click_url", rdimpressionurl "rd_impression_url", } button attributes unlike the samsung wallet html tag, you must use camelcase in the button attributes in function case attribute description type string required service type default is "atw"• "atw" 'add to samsung wallet' • "vww" verify with samsung wallet' cardid string required wallet card identifier* value granted from the partners portal cdata string required encrypted card object json * this field needs to be encrypted * refer to security for more details partnercode string required partner code * value granted from the partners portal targetid string required dom document object model element id to place the "verify with samsung wallet" web button for samsung wallet buttonid string required dom element id for the "verify with samsung wallet" web button for samsung wallet buttontype string optional "verify with samsung wallet" button type [“btnsw” / “btnatsw” / “qrcode”, default btnsw] authtoken string optional token generated when “qrcode” is used * required only if the “buttontype” is set to “qrcode” model string optional device model to display button* by default, value from user-agent is used if no value from user-agent, the button is displayed * to display buttons only on devices supporting samsung wallet, explicitly include the model name * for example, you can retrieve the device model name e g , sm-s928f from the browser's user-agent inline string optional flag to display the "verify with samsung wallet" image button in one-line format default true one-line locale string optional locale of the "verify with samsung wallet" image button rdclickurl string required url for logging a button click event * value granted from the partners portal rdimpressionurl string required url for logging a button impression event * value granted from the partners portal showforced string optional flag to force the "verify with samsung wallet" button to be displayed default false mediatheme string optional load the button’s resources from the media theme policy there are 4 themes default, inversion, lightonly, and darkonly default default *default load the button’s theme according to the prefers-color-scheme policy *inversion load the inverse of the default button’s theme *lightonly load the light theme of the default button *darkonly load the dark theme of the default button style object cssstyledeclaration optional load the button with custom style onshowbutton function optional callback handler function for the button’s on-show event onclickbutton function optional callback handler function for the button’s on-click event if you register the handler function, you must return a callback or promise value usage of onclickbutton handler partners can choose whether to proceed with the next "verify with samsung wallet" step using a promise or a callback function, if they register a callback handler in onclickbutton we recommend that partner add the process of generating jwt cdata add cdata to options cdata to this handler, because of the cdata expiration time the function parameters are defined as follows attribute description options button attributes optional attributes of the current button callback function optional callback function to pass the flag to proceed default false promise resolve function optional promise-resolved value to pass the flag to proceeddefault false callback to web button process from callback attributes for es5 by executing a callback function with a flag, you can proceed to the next 'verify with samsung wallet' process onclickbutton function options, callback { // todo partner's process callback flag } callback to web button process from returning promise for es6 by returning a promise with a resolving flag, you can proceed to the next ‘verify with samsung wallet’ process onclickbutton async options => { return new promise async resolve, reject => { // todo partner's process await resolve flag } } implementing vww button on the app this section explains how to implement an "verifying with samsung wallet" button in the partner’s app please download below sample code and refer it refer to android sample code data transmit link the most common and straightforward method is the data transmit link approach, which securely includes tokenized data in the atw link the atw link format for this method is as follows the name data transmit link has been changed from typical flow type value description url https //a swallet link/vww/v1/{cardid}#clip?cdata={cdata} path parameters cardid string required wallet card identifier issued from partner portal when the partner manager signs up for partner services and registers the wallet card they want to service hash path parameters #clip string required parameters for the hash link* the first letter is capitalized query parameters cdata string required actual payload data in basic json format to communicate between partners and samsung wallet this must be secured in jwt json web token format * refer to security for more details [example] https //a swallet link/vww/v1/1656147182764415319#clip?cdata=eyjjdhkioijkv1qilcjhbgcioijsinrpbwvzdgftcci6imnyzwf0zwqgdgltzsisinbhcnruzxjjrci6inbhcnruzxigsuqifq … … … … dn0_oz3xcr0juq3mlszliutxfotewnz0mqj7kinjysnm5xfwqt5vcn20peebelgux8vjxly4_9g4bhq-hd4o9poyutuawew yzdlmtfho -nycel3t0yznzad2kck_hrtwigeerhlgn6ydaq_fpfdslxsa3zjtnpg3wcuqew5cidpbpfswbqlropqepnawg5nlm3dkaa4a1dzazmbsr1bgzhrh_viknx3cy5mo0jnbexl_yiz5_wb379uyswumqipitzvg2ijyvfht17i4