Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 card class addcardinfo java lang object com samsung android sdk samsungpay v2 card addcardinfo all implemented interfaces android os parcelable public class addcardinfo extends object implements android os parcelable this class provides card information for enrollment since api level 1 2 nested class summary nested classes/interfaces inherited from interface android os parcelable android os parcelable classloadercreator<t extends object>, android os parcelable creator<t extends object> field summary fields modifier and type field description static final string extra_issuer_id key to represent issuer bin range static final string extra_key_moscow_transit key to send extra transit card data to samsung pay for russia virtual troika project the format of the data should be json string object static final string extra_provision_payload key to represent encrypted blob from issuer on carddetail bundle static final string extra_samsung_pay_card key to represent a samsung pay card for push provisioning if the key value is true, the current push provisioning card will have a samsung pay card type in samsung pay application this is only for specific issuer in uk static final string provider_amex indicates that the card tokenization provider is amex static final string provider_discover indicates that the card tokenization provider is discover static final string provider_elo indicates that the card tokenization provider is elo static final string provider_gemalto indicates that the card tokenization provider is gemalto static final string provider_gift indicates that the card tokenization provider is gift static final string provider_loyalty indicates that the card tokenization provider is loyalty static final string provider_mada indicates that the card tokenization provider is mada static final string provider_mastercard indicates that the card tokenization provider is mastercard static final string provider_mir indicates that the card tokenization provider is mir static final string provider_napas indicates that the card tokenization provider is napas static final string provider_pagobancomat indicates that the card tokenization provider is pagobancomat static final string provider_paypal indicates that the card tokenization provider is paypal static final string provider_plcc indicates that the card tokenization provider is plcc static final string provider_vaccine_pass indicates that the card tokenization provider is vaccinepass refer cardmanager addcard addcardinfo, addcardlistener in detail static final string provider_visa indicates that the card tokenization provider is visa fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value constructor summary constructors constructor description addcardinfo string cardtype, string tokenizationprovider, android os bundle carddetail constructor to create addcardinfo instance method summary all methodsinstance methodsconcrete methods modifier and type method description android os bundle getcarddetail api to get card details string getcardtype api to get card type string gettokenizationprovider api to get tokenization provider example vi, mc, ax, ds, and so on void setcarddetail android os bundle carddetail api to set extra card details void setcardtype string cardtype api to set card type void settokenizationprovider string tokenizationprovider api to set tokenization provider methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details extra_provision_payload public static final string extra_provision_payload key to represent encrypted blob from issuer on carddetail bundle since api level 1 2 see also constant field values extra_issuer_id public static final string extra_issuer_id key to represent issuer bin range this field is mandatory for elo since api level 1 2 see also constant field values provider_visa public static final string provider_visa indicates that the card tokenization provider is visa since api level 1 2 see also constant field values provider_mastercard public static final string provider_mastercard indicates that the card tokenization provider is mastercard since api level 1 2 see also constant field values provider_amex public static final string provider_amex indicates that the card tokenization provider is amex since api level 1 2 see also constant field values provider_discover public static final string provider_discover indicates that the card tokenization provider is discover since api level 1 2 see also constant field values provider_plcc public static final string provider_plcc indicates that the card tokenization provider is plcc since api level 1 2 see also constant field values provider_gift public static final string provider_gift indicates that the card tokenization provider is gift since api level 1 2 see also constant field values provider_loyalty public static final string provider_loyalty indicates that the card tokenization provider is loyalty since api level 1 2 see also constant field values provider_paypal public static final string provider_paypal indicates that the card tokenization provider is paypal since api level 2 0 see also constant field values provider_gemalto public static final string provider_gemalto indicates that the card tokenization provider is gemalto since api level 2 3 see also constant field values provider_napas public static final string provider_napas indicates that the card tokenization provider is napas since api level 2 3 see also constant field values provider_mir public static final string provider_mir indicates that the card tokenization provider is mir since api level 2 3 see also constant field values provider_pagobancomat public static final string provider_pagobancomat indicates that the card tokenization provider is pagobancomat since api level 2 7 see also constant field values extra_samsung_pay_card public static final string extra_samsung_pay_card key to represent a samsung pay card for push provisioning if the key value is true, the current push provisioning card will have a samsung pay card type in samsung pay application this is only for specific issuer in uk since api level 2 14 see also constant field values provider_vaccine_pass public static final string provider_vaccine_pass indicates that the card tokenization provider is vaccinepass refer cardmanager addcard addcardinfo, addcardlistener in detail cardmanager cardmanager = new cardmanager ct, pinfo ; string cardtype = card card_type_vaccine_pass; string tokenizationprovider = addcardinfo provider_vaccine_pass; string payload = "please follow json object specification"; bundle carddetail = new bundle ; carddetail putstring addcardinfo extra_provision_payload, payload ; addcardinfo addcardinfo = new addcardinfo cardtype, tokenizationprovider, carddetail ; cardmanager addcard addcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int errorcode, bundle errordata { log e tag, "onfail callback is called, errorcode " + errorcode ; if errordata != null && errordata containskey spaysdk extra_error_reason_message { log e tag, "onfail extra reason message " + errordata getstring spaysdk extra_error_reason_message ; } } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ; json object specification mandatory fields version, cardid, type, cardart, qrdata, decoding, chunks, chunk, provider name, patient name, vaccine product, vaccine date, performer { "version" "1 0", "cardid" "xxxx-xxxxx-xxxxxxxxx", "type" "vaccinationrecordcard", "cardart" "https //issuer logo url location/logo png", "qrdata" { "decoding" "none", "chunks" [ "shc /012345678901234567890123456789" ] }, "expirationdate" "20231011", "provider" { "name" "vaccine pass provider name" }, "issuer" { "name" "vaccine pass issuer name" }, "patient" { "dateofbirth" "19510120", "name" { "family" "anyperson", "given" "john b " } }, "vaccinations" [ { "vaccine" { "product" "moderna", "lot" "0000001", "date" "20210101" }, "performer" { "name" "abc general hospital", "identityassurancelevel" "ial1 2" } }, { "vaccine" { "product" "moderna", "lot" "0000007", "date" "20210129" }, "performer" { "name" "abc general hospital", "identityassurancelevel" "ial1 2" } } ] } since api level 2 18 see also constant field values extra_key_moscow_transit public static final string extra_key_moscow_transit key to send extra transit card data to samsung pay for russia virtual troika project the format of the data should be json string object since api level 2 17 see also constant field values provider_mada public static final string provider_mada indicates that the card tokenization provider is mada since api level 2 22 see also constant field values provider_elo public static final string provider_elo indicates that the card tokenization provider is elo since api level 2 21 see also constant field values constructor details addcardinfo public addcardinfo @nonnull string cardtype, @nonnull string tokenizationprovider, @nonnull android os bundle carddetail constructor to create addcardinfo instance parameters cardtype - card type to add tokenizationprovider - tokenization provider of the card carddetail - card detail which partner wants to pass to samsung pay throws illegalargumentexception - if not allowed card type is used or carddetail does not contain extra_provision_payload nullpointerexception - if tokenizationprovider or carddetail is null since api level 1 2 method details setcarddetail public void setcarddetail @nonnull android os bundle carddetail api to set extra card details parameters carddetail - card detail which partner wants to pass to samsung pay bundle key-value pairs are defined as follows keys values extra_provision_payload string provisionpayload throws nullpointerexception - if carddetail is null illegalargumentexception - if carddetail does not contain extra_provision_payload since api level 1 2 settokenizationprovider public void settokenizationprovider @nonnull string tokenizationprovider api to set tokenization provider parameters tokenizationprovider - tokenization provider of the card tokenization provider can be one of the following provider_visa provider_mastercard provider_amex provider_discover provider_gemalto provider_plcc provider_gift provider_loyalty provider_paypal provider_napas provider_mir provider_pagobancomat provider_mada provider_elo throws nullpointerexception - if tokenization provider is null since api level 1 2 setcardtype public void setcardtype string cardtype api to set card type parameters cardtype - card type to add card type can be one of the following card card_type_credit_debit card card_type_credit card card_type_debit throws illegalargumentexception - if not allowed card type is used since api level 1 2 getcarddetail public android os bundle getcarddetail api to get card details since api level 1 2 gettokenizationprovider public string gettokenizationprovider api to get tokenization provider example vi, mc, ax, ds, and so on since api level 1 2 getcardtype public string getcardtype api to get card type since api level 1 2 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Wallet
docapi guidelines app2app sdk integration specs description & use rp sdk is an app2app sdk for samsung wallet driver's license service online scenarios this sdk provides an implementation for direct communication between the samsung wallet and partner applications build the settings rpsdk requires additional dependencies with dependencies { implementation "rp-sdk-1 0-release aar" implementation "androidx core core-ktx 1 3 2" implementation "androidx lifecycle lifecycle-runtime-ktx 2 7 0" implementation "androidx lifecycle lifecycle-livedata-core-ktx 2 7 0" implementation "io reactivex rxjava2 rxjava 2 2 21" implementation "io reactivex rxjava2 rxkotlin 2 4 0" implementation "io reactivex rxjava2 rxandroid 2 1 1" implementation "com squareup okhttp3 okhttp 4 11 0" implementation "com google code gson gson 2 10 1" implementation "org bouncycastle bcprov-jdk15to18 1 66" implementation "com nimbusds nimbus-jose-jwt 9 37 3" } androidmanifest xml <manifest xmlns android="http //schemas android com/apk/res/android"> <uses-permission android name="android permission internet" /> <queries> <package android name="com samsung android spay" /> </queries> </manifest> r8 / proguard the specific rules are already bundled into the aar which can be interpreted by r8 automatically sdk method app2app sdk supports one method request signature & parameters of the request method fun request targetpackagename string, requestid string, applink string, onresponselistener onresponselistener? = null parameter name description targetpackagename the pakcage name to connect to requestid a random string to identify each request applink the applink built by samsung mcs server guide onresponselistener a listener to receive each events or requests [sample code] binding button setonclicklistener { rpclientapis request "com samsung android spay", uuid randomuuid tostring , applink, object rpclientapis onresponselistener { override fun ongetmdocrequestdata deviceengagementbytes bytearray bytearray? { log i tag, "ongetmdocrequestdata $deviceengagementbytes " /** * 1 prepare mdoc request data iso-18013-5 * 2 build sessionestablishmentbytes iso-18013-5 * 3 encrypt it with hkdf iso-18013-5, 9 1 1 5 cryptographic operations **/ return "encryptedsessionestablishmentbytes" } override fun onmdocresponse encryptedresponse bytearray { log i tag, "onmdocresponse $encryptedresponse " /** * 1 decrypt it with hkdf iso-18013-5, 9 1 1 5 cryptographic operations * 2 cbor decode it **/ } override fun onmdocresponsefailed exception exception { log i tag, "onmdocresponsefailed $exception " } } } error code explanation the below exceptions might occur through the onmdocresponsefailed callback exceptions name description rpcommunicationexception this error occurs when the data requested by the listener is incorrect rpconnectionfailedexception this occurs when the app 2 app communication between apps is not working this usually occurs when the target package name is written incorrectly web2app api integration specs the api specifications that need to be implemented by the rp partner are described below called by samsung to the rp partner send key send the wallet application key info and return the data field types requested to the client for authentication of the mdl [request] type value description method post url {partner server url}/rp/v1 0/{cardid}/{refid}/key headers authorization string 1024 required credential token the token can have the prefix "bearer" as an authorization type, e g , bearer <credentials> * refer to authorization token for more details path parameters cardidstring 32 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 refid string 32 required unique content identifier defined by the content provider query parameter n/a payload data string 3000 required jwt data encrypted with the public key information and card type if decrypted this data is decoded, and it has the following format information { “data” “xxxxxxxxxxx”, “card” {"type" "relyingparty", "subtype" "others", "designtype" "us-01" }} [example] post {partner server url}/rp/v1 0/{cardid}/{refid}/key content-type application/json { “data” “eyjjdhkioijbvvriiiwidmvyijoimiisinbhcnruzxjjzci6inrlc3qilcj1dgmioje3mtyymdyznjaxmtasimfszyi6iljtmju2in0 zxlkbgjttwlpaupctvrjnfiwtk5jaxdpwvd4bklqb2lvbe5ctfu5qljwqxrnaluysw4wllz5afaxs0fnmvjhbzbdn2nix2pydgtfoddqbnhrrmpfwkppcnnsuus4mnn0owvxtjeyvzvmoejax1d5ngvzmze3vdnad0pncmpwzwdzoek3avlcwwrlogj5lxfimjblu3ruc3jsszlpslfnn1fam2xzauxscxltb0vlbervd0fpatrmry1jukzwdvlrbxrintg3utd1zwnuq1lwwgzwalvecg01yxbfbdv3szm1ugz3d0dkrem2tmowz1awbtz3nk1kdl9mddbvzwc2mwzjagdbyny0emxmzju2cvyzm0t6zjdjbwvpbkjrnnpmsgutymfwyxhvzk5ld2htzwvjuzftv3larm1nvlj6mefsmnbxa0dqlvjkt1iza3vzavo0vjfidy1aq2iyvwvwyvdzru9nuedrvw1mbtfuowjwt1zmz1nuv1f0se5pvtfjyvrhtg1dwlpvqs5pmzzrd1g4wmjnq21wd3o2ll9kzehfvxnnbm13b1drddrmcu4xmuncauntsnutbwpyv2zrckxos0zvenbss085ckdxbudpz0pqukf1ntfsotryc2vivwdfwu9ns2rgr1vomwjhmhb3y0tfngtjmet2dkfowhprodn0azbjqzrot2f6vzlmovntt0rhmu9imefoavfzqzddevfqnndnlwflvk8waejwsejkmeduruh1z3exc21vvmxrbjblsnjqwhm4x3fwcnplekwtadfpcfk1aes1zug5q3nisms0aehcngnmwulkrujfz09bcgzxcgfumgfsvgfmodhhdxlqsgzhdgrma0tlwdv0q0rtajixse5tt0fhwtjvwlzrr0hxu0wzngjabtu5aezmnvdha0ljce9bmhlwue9tqznwtflkv2jsmm85lkfoedbvytvgetzudkxkvxvketazshc e07yyl7ior3885vykss5_q1icpx750uu2ge5sujsedx3dr_u0x4tse9_0nxm46dywnfuxruagfjdnjhibc707li9vi3xtyihwnweifydgv1qb9oddkyyzuahxqmjhvuqncdt6df2caqzf5qgmvqfmgse_t7ipu8vqfxe34do-skzj8ftduss2ecdanbqokchih3m39noubpfhcx68plpcw50dixlupxwegniu2t3co24yliaklgac669accxdqr34utvuqhtjt_ftxkahalzoa34_hj_s82fivixh1itd74uojzse7ibwya_kvysozavnmztz2th9cbwycvx8wa” } [response] type value description http status code 200 ok payload data string 3000 required jwt data encrypted with the data field types requested to the client for authentication of the mdl [result] http status code description 200 ok success 400 bad request requests cannot or will not be processed due to something that is perceived to be a client error 401 unauthorized authorization token is invalid or expired 500 internal server error the server encountered an unexpected condition that prevented it from fulfilling the request 503 service unavailable the server is not ready to handle the request send authentication data the data is encrypted according to the requested data and then transmitted along with the data card information [request] type value description method post url {partner server url}/rp/v1 0/{cardid}/{refid}/auth headers authorization string 1024 required credential token the token can have the prefix "bearer" as an authorization type, e g , bearer <credentials> * refer to authorization token for more details pathparameters cardid string 32 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 refid string 32 required unique content identifier defined by the content provider queryparameter n/a payload data string 3000 required jwt data encrypted with the public key information and card type if decrypted this data is decoded, it has the following format information { “data” “xxxxxxxxxxx”, “card” {"type" "idcard","subtype" "drivers","designtype" "us-01" }} [example] post {partner server url}/rp/v1 0/{cardid}/{refid}/auth content-type application/json { “data” “eyjjdhkioijbvvriiiwidmvyijoimiisinbhcnruzxjjzci6inrlc3qilcj1dgmioje3mtyymdyznjaxmtasimfszyi6iljtmju2in0 zxlkbgjttwlpaupctvrjnfiwtk5jaxdpwvd4bklqb2lvbe5ctfu5qljwqxrnaluysw4wllz5afaxs0fnmvjhbzbdn2nix2pydgtfoddqbnhrrmpfwkppcnnsuus4mnn0owvxtjeyvzvmoejax1d5ngvzmze3vdnad0pncmpwzwdzoek3avlcwwrlogj5lxfimjblu3ruc3jsszlpslfnn1fam2xzauxscxltb0vlbervd0fpatrmry1jukzwdvlrbxrintg3utd1zwnuq1lwwgzwalvecg01yxbfbdv3szm1ugz3d0dkrem2tmowz1awbtz3nk1kdl9mddbvzwc2mwzjagdbyny0emxmzju2cvyzm0t6zjdjbwvpbkjrnnpmsgutymfwyxhvzk5ld2htzwvjuzftv3larm1nvlj6mefsmnbxa0dqlvjkt1iza3vzavo0vjfidy1aq2iyvwvwyvdzru9nuedrvw1mbtfuowjwt1zmz1nuv1f0se5pvtfjyvrhtg1dwlpvqs5pmzzrd1g4wmjnq21wd3o2ll9kzehfvxnnbm13b1drddrmcu4xmuncauntsnutbwpyv2zrckxos0zvenbss085ckdxbudpz0pqukf1ntfsotryc2vivwdfwu9ns2rgr1vomwjhmhb3y0tfngtjmet2dkfowhprodn0azbjqzrot2f6vzlmovntt0rhmu9imefoavfzqzddevfqnndnlwflvk8waejwsejkmeduruh1z3exc21vvmxrbjblsnjqwhm4x3fwcnplekwtadfpcfk1aes1zug5q3nisms0aehcngnmwulkrujfz09bcgzxcgfumgfsvgfmodhhdxlqsgzhdgrma0tlwdv0q0rtajixse5tt0fhwtjvwlzrr0hxu0wzngjabtu5aezmnvdha0ljce9bmhlwue9tqznwtflkv2jsmm85lkfoedbvytvgetzudkxkvxvketazshc e07yyl7ior3885vykss5_q1icpx750uu2ge5sujsedx3dr_u0x4tse9_0nxm46dywnfuxruagfjdnjhibc707li9vi3xtyihwnweifydgv1qb9oddkyyzuahxqmjhvuqncdt6df2caqzf5qgmvqfmgse_t7ipu8vqfxe34do-skzj8ftduss2ecdanbqokchih3m39noubpfhcx68plpcw50dixlupxwegniu2t3co24yliaklgac669accxdqr34utvuqhtjt_ftxkahalzoa34_hj_s82fivixh1itd74uojzse7ibwya_kvysozavnmztz2th9cbwycvx8wa” } [response] type value description http status code 200 ok400 bad request [result] http status code description 200 ok success 400 bad request requests cannot or will not be processed due to somethingthat is perceived to be a client error 401 unauthorized authorization token is invalid or expired 500 internal server error the server encountered an unexpected condition that prevented it from fulfilling the request 503 service unavailable the server is not ready to handle the request code explanation based on the sample code jwt jws + jwe decryption between the wallet backed server and partner server 1 verify by generateing a jws using the body data // generate jws by the body data private static signedjwt parsejwt final string data { try { return signedjwt parse data ; } catch parseexception e { log error "parserjwt error class {}, error message {}", e getclass , e getmessage ; throw new customexception httpstatus internal_server_error, "parserjwt error" ; } } // verify jws using samsung public key public requestbody getrequestbody final keyring keyring { final signedjwt signedjwt = jwtutils verify keyring gettargetpublickey , encrypteddata, 60 * 10000 ; // verify and generate jws try { final string strbody = jwtutils getdecryptedpayloadfrom keyring getsourceprivatekey , jweobject parse signedjwt getpayload tostring ; // decryption jwe by the jws return objectmapper readvalue strbody, requestbody class ; // convert to data format requested by client } catch parseexception | jsonprocessingexception e { log error "getrequestbody {}", e getmessage ; throw new customexception httpstatus internal_server_error, "data body parse error" ; } } 2 decrypt the jwe using the jws jweobject parse signedjwt getpayload tostring public static string getdecryptedpayloadfrom final key privatekey, final jweobject data { try { data decrypt new rsadecrypter privatekey privatekey ; // decryption jwe using partner private key return data getpayload tostring ; } catch joseexception e { log error "joseexception message {}", e getmessage ; throw new customexception httpstatus internal_server_error, "getdecryptedpayloadfrom error" ; } } 3 convert to the format send by the client public requestbody getrequestbody final keyring keyring { final signedjwt signedjwt = jwtutils verify keyring gettargetpublickey , encrypteddata, 60 * 10000 ; // verify and generate jws try { final string strbody = jwtutils getdecryptedpayloadfrom keyring getsourceprivatekey , jweobject parse signedjwt getpayload tostring ; // decryption jwe by the jws return objectmapper readvalue strbody, requestbody class ; // convert to data format requested by client } catch parseexception | jsonprocessingexception e { log error "getrequestbody {}", e getmessage ; throw new customexception httpstatus internal_server_error, "data body parse error" ; } } generate mdocestablishment 1 generate rsa key per refid public class transactioncontext { private final keypair keypair; // rsa key private final byte[] clientengagement; // body data received through key api, base64url decoded value @equalsandhashcode exclude private int encryptmessagecounter = 0; // count value when encrypted @equalsandhashcode exclude private int decryptmessagecounter = 0; // count value when decrypted } private cache<string, transactioncontext> contextcache; // rsa key management per refid with memory cache // generate and store rsa key per refid only once upon first request public transactioncontext settransactioncontext final string key, final string base64encodedclientengagement { log info "base64encodedclientpublickey {}", base64encodedclientengagement ; this contextcache put key, new transactioncontext keyutils generatekeypair , base64utils decode base64encodedclientengagement getbytes ; return this gettransactioncontextby key ; } // part of retrieving ras key based on refid public transactioncontext gettransactioncontextby final string key { return optional ofnullable this contextcache getifpresent key orelsethrow -> { log info "{} is empty", key ; return new customexception httpstatus bad_request, "no key matching the refid" ; } ; } 2 create request field values @override public mono<list<string>> createrequest final partnerinputdto inputdto { final string mockdata = "{ \"doctype\" \"org iso 18013 5 1 mdl\", \"namespaces\" { \"org iso 18013 5 1\" { \"sex\" false, \"portrait\" false, \"given_name\" false, \"issue_date\" false, \"expiry_date\" false, \"family_name\" false, \"document_number\" false, \"issuing_authority\" false }, \"org iso 18013 5 1 aamva\" { \"dhs_compliance\" false, \"edl_credential\" false } } }"; return mono just collections singletonlist mockdata ; } 3 generate establishment @allargsconstructor public class establishment { private final transactioncontext context; // info of client public key , partner private key, public key private final list<string> strreqs; // data field information required for authentication to the client private final keyring keyring; // rsa key information for jwt jws + jwe encryption and decryption between wallet backed server and partner server } protected cborobject generate { final cborobject sessionestablishment = cborobject newmap ; sessionestablishment set e_reader_key, cborobject fromobjectandtag keyutils getereaderkey context , tag_size ; // generate onekey by public key in transactioncontext sessionestablishment set data, cborobject fromobject cipherutils encrypt context, generaterequestformat getrequestcborobjectsfrom strreqs ; // add request data field information for authentication return sessionestablishment; } generate the response value jwt jws + jwe 1 generate establishment with jwe public static string encryptedstringjwe final key publickey, final string data { // please enter samsung public key and establishment data final jweobject jwe = new jweobject new jweheader builder jwealgorithm rsa_oaep_256, encryptionmethod a128gcm build , new payload data ; try { jwe encrypt new rsaencrypter rsapublickey publickey ; return jwe serialize ; } catch joseexception e { log error "encryptedstringjwe exception message {}", e getmessage ; throw new customexception httpstatus internal_server_error, "encryptedstringjwe error" ; } } 2 generate jws by jwe public static string generatesignedstringjws final key privatekey, final key publickey, final string payload { // enter your partner’s public key, private key, and jwe data try { final jwsobject jwsobj = new jwsobject getdefaultjwsheader , new payload payload ; jwssigner signer = new rsassasigner new rsakey builder rsapublickey publickey privatekey rsaprivatekey privatekey build ; jwsobj sign signer ; return jwsobj serialize ; } catch joseexception e { log error "encryptedstringjws exception message {}", e getmessage ; throw new customexception httpstatus internal_server_error, "generatesignedstringjws error" ; } } 3 generate jwt jws + jwe public partneroutputdto topartneroutputdto { final cborobject generate = this generate ; final string establishment = base64 geturlencoder encodetostring generate encodetobytes ; final string strjwe = jwtutils encryptedstringjwe keyring gettargetpublickey , establishment ; final jwsheader jwsheader = jwtutils getdefaultjwsheader keyring getversion , keyring getcertificateid , "partnerid" ; return new partneroutputdto jwtutils generatesignedstringjws jwsheader, keyring getsourceprivatekey , keyring getsourcepublickey ,strjwe ; } authentication processing for values in data fields requested for authentication 1 retrieve transactioncontext value stored in cache using refid value @override public mono<transactioncontext> getcontext final partnerinputdto inputdto { return mono just this transactioncontextmanager gettransactioncontextby inputdto getrefid ; } 2 processes the decryption process of the request body data like jwt jws + jwe decryption between wallet backed server and partner server 3 generate mdocresponse public class mdocresponse { private final transactioncontext context; // managed tranactioncontext by refid private final byte[] data; // base64url decoded data after decrypting jwt jws + jwe data public mdocresponse final transactioncontext context, final string inputdto { this context = context; this data = base64utils decode inputdto getbytes standardcharsets utf_8 ; } } 4 get the field values requested for authentication from the data in mdocresponse public string getdata { // sessiondata = { // ? "data" bstr ; encrypted mdoc response or mdoc request // ? "status" uint ; status code // } final cborobject response = cborobject decodefrombytes data ; checktype response, cbortype map ; final cborobject data = response get data ; checktype data, cbortype bytestring ; return cborobject decodefrombytes isencryptedmode ? cipherutils decrypt this context, data getbytestring data getbytestring tojsonstring ; } 5 create a session value using the transactioncontext value managed by refid and then decrypt it private static byte[] processcipher final ciphermode ciphermode, final transactioncontext context, final byte[] bytes { // ciphermode encrypt or decrypt, bytes data passed by the client try { cipher cipher = cipher getinstance "aes/gcm/nopadding" ; final int counter = ciphermode encrypt == ciphermode ? context getencryptmessagecounter context getdecryptmessagecounter ; gcmparameterspec parameterspec = new gcmparameterspec 128, getsessionkeyiv ciphermode identifier, counter ; cipher init ciphermode ciphermode , getsecretkeyspec context, ciphermode info , parameterspec ; return cipher dofinal bytes ; } catch invalidalgorithmparameterexception | nosuchpaddingexception | illegalblocksizeexception | nosuchalgorithmexception | badpaddingexception | invalidkeyexception e { log error "error type {}, message {}", e getclass , e getmessage ; throw new customexception httpstatus internal_server_error, "processcipher error" ; } } 6 examining data received from the client @override public mono<void> authentication final string response { log info "response info {}", response ; return mono empty ; }
Develop Samsung Pay
docenable app to app service the following diagram illustrates the flows of the app-to-app apis for payment card push provisioning bank appsamsung wallet apptoken service providerref[checking samsungpay status]section in common flowalt[if neccessary optional ]1cardmanager getallcards 2onsuccess card cardid, card cardstatus 3request card information with card cardid4success5samsungpay getwalletinfo 6onsuccess device_id, wallet_user_id 7create provisioningpayloadwith card information & wallet informationrefer to card networks spec8cardmanager addcard payload 9request token provision10success11onsuccess flows of push provisioning apis the main classes involved are samsung pay – for fetching samsung wallet app status and wallet information on the device paymentmanager – for card provisioning and invoking favorite cards payment functionalities cardmanager – for payment card management watchmanager – for all functions related to samsung pay watch let’s now take a look at how each one works in the context of your bank app requesting registered card list in the samsung pay thegetallcards method of the cardmanager class is used to request a list of all cards currently registered/enrolled in samsung wallet on the same device running the issuer’s app to succeed, the issuer app must pass valid partnerinfo to 'cardmanager' for caller verification 'cardfilter' narrows the card list returned by samsung wallet to the issuername specified please be noted that getsamsungpaystatus must be called before getallcards getallcards could not return a cards list when getsamsungpaystatus responds with a code other than spay_ready noteto get the cards list of samsung pay watch, you have to use the watchmanager class instead of the cardmanager class as of api level sdk version 1 4, cardfilter retrieves this information from the samsung pay developers portal certain issuers may need to register multiple issuer name s with the portal, depending on their app and/or the requirements of their token service provider tsp the getallcards parameter cardfilter matches the issuer name s specified with those registered in the portal only complete matches are returned this method is typically called when your partner app wants to check the card status it does not need to be called every time the partner app resumes therefore, you should create the card list with the 'oncreate ' method, rather than the 'onresume ' method the result of a getallcards call is delivered to getcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides the list of all filtered cards and their status card information includes cardid, cardstatus, and extra cardinfo data onfail - called when the operation fails here’s an example of how to use the 'getallcards ' api method in your issuer app val cardfilter = bundle // since api level 1 4, cardfilter param is ignored partner does not need to use it here // it is retrieved from the samsung pay developers portal cardfilter putstring cardmanager extra_issuer_name, issuername cardmanager getallcards null, object getcardlistener{ override fun onsuccess cards mutablelist<card>? { // getting card status is success if cards == null || cards isempty { log e tag, "no card is found" return } else { // perform operation with card data for s in cards { log d tag, "cardid " + s cardid + "cardstatus " + s cardstatus // get extra card data if s cardinfo != null { val cardid = s cardid // since api level 2 13, id from card network val last4fpan = s cardinfo getstring cardmanager extra_last4_fpan val last4dpan = s cardinfo getstring cardmanager extra_last4_dpan val cardtype = s cardinfo getstring cardmanager extra_card_type val cardissuername = s cardinfo getstring cardmanager extra_issuer_name log d tag, "last4fpan $last4fpan last4dpan $last4dpan cardid $cardid" } } } } override fun onfail errorcode int, errordata bundle? { // getting card status is failed } } getting wallet information the samsungpay class provides the getwalletinfo api method, which is called to request wallet information from the samsung wallet app prior to calling the addcard api, when you want to avoid duplicate provisioning your issuer app uses this information to uniquely identify the user and the samsung wallet app on a particular device wallet device management id, device id, and wallet user id noteto get wallet information of samsung pay watch, you have to use the watchmanager class instead of the cardmanager class fun getwalletinfo list<string> keys, statuslistener callback the following example demonstrates how to use it // set the serviceid assigned by the samsung pay developers portal during service creation val serviceid = "sampleserviceid" val bundle = bundle bundle putstring samsungpay extra_issuer_name, "issuer name" bundle putstring samsungpay partner_service_type, servicetype app2app tostring val pinfo = partnerinfo serviceid, bundle val samsungpay = samsungpay context, pinfo // add bundle keys to get wallet information from samsung pay // this information can be delivered to the partner server for an eligibility check val keys = arraylist<string> keys add samsungpay wallet_user_id keys add samsungpay device_id samsungpay getwalletinfo keys, object statuslistener{ override fun onsuccess status int, walletdata bundle { // log d tag, "dowalletinfo onsuccess callback is called" ; // for visa, deviceid can be set to "clientdeviceid" as defined by visa val deviceid = walletdata getstring samsungpay device_id // for visa, walletuserid can be set to "clientwalletaccountid" as defined by visa val walletuserid = walletdata getstring samsungpay wallet_user_id } override fun onfail errorcode int, errordata bundle? { log e tag, "onfail callback is called, errorcode " + errorcode ; // check the extra error codes in the errordata bundle for all the reasons in // samsungpay extra_error_reason, when provided } } adding a card to samsung pay your issuer app calls the 'addcard ' api method of cardmanager to add a card to samsung wallet by providing the required card details, your app can make it convenient and easy for users to add their bank-issued debit/credit cards to samsung wallet directly from your app without additional steps, like switching between apps noteif you want to add a card to samsung pay watch, you have to use the 'watchmanager' class instead of the cardmanager class for most issuers, getwalletinfo suffices for requesting current wallet information the response from samsung wallet tells the issuer app whether or not the user’s card has already been added to samsung wallet or is ineligible for provisioning it is therefore recommended that you call getwalletinfo before displaying the add to samsung pay button if the card is eligible, display the “add” button and, if the user taps it, call addcard importantremember to obtain the governing issuer implementation guide s and specifications from the respective card network and implement each network’s required handling in your partner app and server the 'addcard ' result is delivered to addcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides information and status regarding the added card onfail - called when the operation fails; returns the error code and extra bundle data such as extra_error_reason or extra_request_id if provided onprogress - called to indicate the current progress of the 'addcard ' operation; can be used to show a progress bar to the user in the issuer app this callback is supported for tsm solution issuers in china and spain here’s an example of how to use the addcard api method in your issuer app val cardtype = card card_type_credit val tokenizationprovider string = addcardinfo provider_abcd // samsung pay does not provide detailed payload information; generate the provisioning payload in // accordance with your card network specifications val testpayload = "thisistestpayloadcardinfo1234567890" val carddetail = bundle carddetail putstring extra_provision_payload, testpayload val addcardinfo = addcardinfo cardtype, tokenizationprovider, carddetail cardmanager addcard addcardinfo, object addcardlistener { override fun onsuccess status int, card card? { log d tag, "onsuccess callback is called" ; } override fun onfail errorcode int, errordata bundle? { log d tag, "onfail callback is called" ; // check some extra error codes in the errordata bundle // such as samsungpay extra_error_reason or samsungpay extra_request_id if provided } override fun onprogress currentcount int, totalcount int, bundledata bundle? { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } adding a co-badge card to samsung pay co-badge payment cards combine two payment brands/networks to add a co-badge card through push provisioning, you must provide two different card network details one for the primary card network and another for the secondary card network issuer app calls the addcobadgecard api method of cardmanager to add a co-badge card to samsung pay in most cases, calling getwalletinfo will suffice to request current wallet information the response from samsung pay indicates whether the user's co-badge card has already been added to samsung pay or is ineligible for provisioning therefore, it is advisable to call getwalletinfo before displaying the add to samsung pay button if the co-badge card is eligible, display the "add" button and, upon user tapping, call addcobadgecard important please remember to refer to the relevant issuer implementation guide s and specifications provided by each card network and ensure that your partner app and server adhere to their specific requirements the addcobadgecard result is delivered to addcardlistener, which provides the following events onsuccess - called when the operation succeeds; provides information and status regarding the added card onfail - called when the operation fails; returns the error code and extra bundle data such as extra_error_reason or extra_request_id if provided onprogress - called to indicate the current progress of the 'addcard ' operation; can be used to show a progress bar to the user in the issuer app this callback is supported for tsm solution issuers in china and spain here’s an example of how to use the addcobadgecard api method in your issuer app note samsung pay does not provide detailed payload information; generate the provisioning payload in accordance with your card networks specifications string cardtype = card card_type_credit; string primarytokenizationprovider = addcardinfo provider_abcd; //provide your primary card network payload string testprimarypayload = "thisistestprimarypayloadcardinfo1234567890"; string secondarytokenizationprovider = addcardinfo provider_efgh; //provide your secondary card network payload string testsecondarypayload = "thisistestsecondarypayloadcardinfo1234567890"; bundle primarycarddetail = new bundle ; primarycarddetail putstring addcardinfo extra_provision_payload, testprimarypayload ; addcardinfo primaryaddcardinfo = new addcardinfo cardtype, primarytokenizationprovider, primarycarddetail ; bundle secondarycarddetail = new bundle ; secondarycarddetail putstring addcardinfo extra_provision_payload, testsecondarypayload ; addcardinfo secondaryaddcardinfo = new addcardinfo cardtype, secondarytokenizationprovider, secondarycarddetail ; cardmanager addcobadgecard primaryaddcardinfo, secondaryaddcardinfo, new addcardlistener { @override public void onsuccess int status, card card { log d tag, "onsuccess callback is called" ; } @override public void onfail int error, bundle errordata { log d tag, "onfail callback is called" ; check some extra error codes in the errordata bundle such as samsungpay extra_error_reason or samsungpay extra_request_id if provided } @override public void onprogress int currentcount, int totalcount, bundle bundledata { log d tag,"onprogress callback is called " + currentcount + " / " + totalcount ; } } ;
Distribute Galaxy Store
docgalaxy store statistics galaxy store statistics gss is a powerful tool that not only provides information such as sales data and number of downloads for your entire seller portal portfolio, each individual app, and in-app purchases, but also information that can be used to make better business decisions, such as what are the most popular channels used by your customers to link to your apps and if those clicks lead to downloads conversion rate information about the gss system can be found in the online user guide must be logged in to seller portal to view this article contains supplemental information to this guide and helps you navigate the gss system to find the data that is available about the data the data displayed in gss is based on a selected time grouping and date range both values are shown and can be set by clicking one of the dropdown icons in the top right corner of the main gss page time grouping determines how the data is aggregated in the report daily, weekly, or monthly , beginning at 00 00 00 gmt and ending at 23 59 59 gmt the date range determines the period of time for which the data is reported all purchases and downloads are recorded using gmt data is collected for free and paid apps that have a status of for sale, suspended, beta deployed, or beta suspended were normally released, suspended, then deleted were beta released, suspended, then terminated in-app purchase items are referred to as items in the gss and this article and data is collected for in-app purchases in the free and paid apps described above each item purchase download is considered a single data point the data collected for gss is updated daily what and where data is displayed in galaxy store statistics when you launch galaxy store statistics gss , the main screen displays your entire portfolio of apps for which data is collected data is displayed in different ways to help you visualize, track, sort, filter, and compare numbers the following sections list the data available by broad categories and where you can find it in gss some data may overlap categories and are listed more than once categories include sales downloads and purchases page views, user acquisition, and impressions ratings my customers subscriptions conversion rate updates notein the tables if a statistic is aggregated by all apps, all items, or each app, you can find the statistic on the landing page main menu or applications page of gss if a statistic is aggregated by a selected app, you must select an app in the table of the landing page before you can find the navigation links listed in the table once you navigate to a specific statistic, you can view the same statistic for a different app by clicking the magnifying glass next to the selected app’s icon in the upper right corner of gss and choosing another app sales sales are gross not net income based on the full registered prices of apps and items sales do not reflect reductions in prices due to coupons and discounts that is, apps purchased with a coupon or a discount including 100% discounts contribute their full registered price to your sales if you are interested in your earnings your sales minus applicable fees, including european union vat, samsung commission and payment gateway commissions, and other taxes and fees , return to seller portal, click accounting, and select sales summary, financial report, or settlement report unless noted otherwise, item sales include income from purchased items and subscriptions statistic description aggregated by how to find total sales total income the app has generated, including item sales all apps and items main menu card each app main menu table selected app dashboard card, graph 1statistics graph 1,2 app sales sales an app has generated does not include item sales or subscriptions selected app sales report > overview table 4 item sales sales an item has generated all items main menu card selected app main menu table dashboard card, graph 1statistics graph 1,2sales report > revenue graph, table, pie chart 3 total revenue total income an app has generated this includes app sales, item sales, and subscriptions selected app sales report > overview table 4 % of total the percentage of this app’s sales out of total sales this statistic is available for total sales, item purchases, and item sales each app main menu table % vs previous percentage change in sales this time period compared to the previous time period this statistic is available for total sales, item purchases, and item sales all apps and items main menu card each app main menu table estimated sales report total sales, app sales, and item sales shown by month for the last 12 months selected app sales report > revenue table 3 orders, refunds, and revenue by product type orders are the number of times an app or item has been purchased refunds are the number of times you refunded the purchase price of an app or item revenue is the amount of sales minus refunds for the app or item selected app sales report > revenue table 3 item purchases number of items purchased and number of cancelled payments all items main menu card, graph each app main menu table selected app dashboard card, graph 1statistics graph 1,2 revenue by items and subscriptions item and subscription income selected app sales report > overview table 4 revenue by subscriptions revenue generated by all subscriptions selected app sales report > subscriptions graph 5 arppu average revenue per paying user the average amount of money a paying customer spends selected app dashboard card, graph 1statistics graph 1 % vs previous arppu increase or decrease of money spent compared to the previous time period selected app dashboard card 1 total revenue by item buyers total revenue for unique users who purchase an item in your app selected app sales report > overview table 4 revenue by new item buyers all revenue for unique users who purchase an item in your app for the first time selected app sales report > overview table 4 revenue by returning item buyers all revenue for unique users who purchase an item in your app and who have also previously purchased an item in your app selected app sales report > overview table 4 cumulative item purchases total number of unique users who have purchased an item in your app selected app dashboard graph 1 footnotes 1can be filtered by country, operator, and/or model 2additional graph s and chart s available, when filtered 3can be filtered by item, country, operator, and/or model 4shown by day, last 7 days, and last 30 days 5can be filtered by country and/or model downloads and purchases app download statistics are the number of downloads for your paid and free apps, including discounted apps or apps purchased with a coupon downloads do not count purchased items downloads also do not count the number of times an app is re-downloaded to the same device however, downloads by total devices include all downloads, including downloads of the same app to the same device statistic description aggregated by how to find total downloads the number of devices on which all apps are downloaded for the first time all apps main menu card % vs previous percentage change in downloads this time period compared to the previous time period all apps main menu card each app main menu table selected app dashboard card 1 new downloads/new downloads by device the number of devices on which users download the app for the first time each app main menu table selected app dashboard card, graph 1statistics graph 1,2 downloads by total devices the number of devices on which users download the app, including devices that uninstalled your app and are downloading it again all apps main menu card selected app statistics graph 1 % of total the percentage of this app’s downloads out of total downloads this statistic is available for new downloads and downloads by total devices each app main menu table by channel current and previous number of devices on which users download the app, including devices that uninstalled your app and are downloading it again, as a result of a clicked link from a channel selected app user acquisition > acquisition report > channel graph, table 5 by source current and previous number of devices on which users download the app, including devices that uninstalled your app and are downloading it again, as a result of a clicked link from a specific area, app, or site selected app user acquisition > acquisition report > source graph, table 5 by keywords current and previous number of devices on which users download the app, including devices that uninstalled your app and are downloading it again, as a result of searching by a keyword to find the app selected app user acquisition > acquisition report > keywords graph, table 5 by featuring current and previous number of devices on which users download the app, including devices that uninstalled your app and are downloading it again, as a result of a clicked link from a banner or icon that appears in galaxy store galaxy store curates the banners and icons that are featured selected app user acquisition > acquisition report > featuring graph, table 5 item purchases number of items purchased and number of cancelled payments all items main menu card, graph each app main menu table selected app dashboard card, graph 1statistics graph 1,2 updates by device number of devices that download an update for the app selected app dashboard card 1 footnotes 1can be filtered by country, operator, and/or model 2additional graph s and chart s available, when filtered 3can be filtered by item, country, operator, and/or model 4shown by day, last 7 days, and last 30 days 5can be filtered by country and/or model page views by links, user acquisition, and impressions the number of views of an app’s detail page that are referred by a specific source how a user finds your app and the number of times an item has been viewed that results in no interaction statistic description aggregated by how to find by channel the number of page views of an app’s detail page in the current and previous time periods as a result of a user following a link from a specific channel channels are specific sources grouped into broad categories and subcategories such as samsung-related channels, default apps on a samsung device, galaxy store, referrals, direct, hun heads-up notifications, similar to push notifications campaigns , and more selected app user acquisition > acquisition report > channel graph, table 5 by source the number of page views of an app’s detail page in the current and previous time periods as a result of a user following a link from a specific source sources are specific areas, apps, or sites selected app user acquisition > acquisition report > source graph, table 5 by keywords the number of page views of an app’s detail page in the current and previous time periods as a result of a user following a link from a keyword search in galaxy store selected app user acquisition > acquisition report > keywords graph, table 5 by featuring the number of page views of an app’s detail page in the current and previous time periods as a result of a user following a link from a banner or icon that appears in galaxy store galaxy store curates the banners and icons that are featured selected app user acquisition > acquisition report > featuring graph, table 5 impressions the number of times an item is viewed on a page but results in no interaction for example, a user may see the content in a list such as a result from a site search but not click the link selected app user acquisition > acquisition report > featuring graph, table 5 footnotes 5can be filtered by country and/or model ratings the average rating of an app out of 5 stars and number of ratings submitted by your customers statistic description aggregated by how to find average rating daily average star rating this app has received across all ratings submitted selected app dashboard card, graph 1statistics graph 1 ratings volume the number of ratings submitted all apps main menu card each app main menu table selected app dashboard card 1statistics graph 1 % vs previous percentage change in ratings volume this time period compared to the previous time period all apps main menu card each app main menu table % of total the percentage of this app’s amount of ratings out of the total number of ratings each app main menu table footnotes 1can be filtered by country, operator, and/or model my customers buyers are your customers who spend money to purchase an app, item, or subscription statistic description aggregated by how to find arppu average revenue per paying user the average amount of money a paying customer spends sales reports are grouped by day and 30-day rolling average selected app dashboard card, graph 1statistics graph 1sales report > buyers > arppu graphs 1 buyers by region number of buyers displayed by groups of countries regions include europe, cis commonwealth of independent states , asia, america, and mea middle east & africa selected app sales report > buyers chart 1 buyers by country number of buyers displayed by country selected app sales report > buyers chart 1 buyers by top countries the five countries with the most number of buyers selected app sales report > buyers chart 1 buyers by device number of buyers displayed by devices selected app sales report > buyers graph 1 item buyers unique users who purchase one or more a items in your app all items main menu card each app main menu table selected app dashboard card 1statistics graph 1sales report > overview table 4 new item buyers unique users who purchase an item in your app for the first time all items main menu card each app main menu table selected app dashboard card 1statistics graph 1sales report > overview table 4 returning item buyers unique users who purchase an item in your app and who have also previously purchased an item in your app selected app sales report > overview table 4 % vs previous percentage change in buyers this time period compared to the previous time period this statistic is available for item buyers and new item buyers all items main menu card each app main menu table selected app dashboard card 1dashboard table item buyers only 1 % of total the percentage of this app’s buyers out of the total number of buyers this statistic is available for item buyers and new item buyers each app main menu table total revenue by item buyers total revenue for unique users who purchase an item in your app selected app sales report > overview table 4 revenue by new item buyers all revenue for unique users who purchase an item in your app for the first time selected app sales report > overview table 4 revenue by returning item buyers all revenue for unique users who purchase an item in your app and who have also previously purchased an item in your app selected app sales report > overview table 4 cumulative item purchases total number of unique users who have purchased an item in your app selected app sdashboard graph 1 footnotes 1can be filtered by country, operator, and/or model 2additional graph s and chart s available, when filtered 3can be filtered by item, country, operator, and/or model 4shown by day, last 7 days, and last 30 days 5can be filtered by country and/or model subscriptions a subscription is an automatic recurring customer payment for a set billing cycle statistic description aggregated by how to find active total number of active subscriptions the graph also includes subscriptions grouped by discount price and regular price selected app sales report > subscriptions card, graph 6 new active total number of subscriptions that started during the given period the graph also includes subscriptions grouped by discount price and regular price selected app sales report > subscriptions card, graph 6 cancelled total number of subscriptions that were cancelled during the given period the graph also includes subscriptions grouped by voluntary and involuntary cancellations selected app sales report > subscriptions card, graph 6 % vs previous percentage change in subscriptions this time period compared to the previous time period this statistic is available for active, new active, and cancelled subscriptions card and graph and subscription revenue graph only, free trials do not count towards revenue selected app sales report > subscriptions card, graph 6 trend comparison of active, new active, and cancelled subscriptions selected app sales report > subscriptions graph 6 revenue revenue generated by all subscriptions selected app sales report > subscriptions graph 5 footnotes 5can be filtered by country and/or model 6can be filtered by country, model, and/or free trial conversion rate the conversion rate is the percentage of downloads of your app that occur as the result the user following a link you can use this statistic to determine how your users are finding your apps you may then choose to advertise more heavily on the most used sources or try to increase your presence on the least used sources statistic description aggregated by how to find by channel ratio of downloads to page views as a result of a clicked link from a channel selected app user acquisition > acquisition report > channel graph, table 5 by source ratio of downloads to page views as a result of a clicked link from a specific area, app, or site selected app user acquisition > acquisition report > source graph, table 5 by keywords ratio of downloads to page views as a result of searching by a keyword to find the app selected app user acquisition > acquisition report > keywords graph, table 5 by featuring ratio of downloads to page views as a result of a clicked link from a banner or icon that appears in galaxy store galaxy store curates the banners and icons that are featured selected app user acquisition > acquisition report > featuring graph, table 5 previous conversion rates in the previous time period selected app user acquisition > acquisition report > channel/source/keywords graph, table 5 footnotes 5can be filtered by country and/or model updates view how many devices download an update to your app statistic description aggregated by how to find updates by device number of devices that download an update for the app selected app dashboard card 1 % vs previous percentage change in the number of devices that downloaded updates this time period compared to the previous time period selected app dashboard card 1 update by events number of times the app has been updated selected app statistics graph 1 footnotes 1can be filtered by country, operator, and/or model
tutorials mobile
blogas businesses strive to enhance their mobile payment capabilities and provide seamless transaction experiences to users, integrating third-party payment solutions like samsung pay has become increasingly common. however, amid the excitement of implementing these solutions, developers often encounter challenges and pitfalls that can hinder the integration process and impact the overall user experience. in this blog, we show some of the most common mistakes developers make when integrating the samsung pay sdk, and offer practical insights and best practices to overcome these hurdles and ensure successful implementation and testing. pitfall 1: using an unofficial email id to implement the samsung pay sdk, the first step is to establish a partnership between your company and samsung. when submitting a partnership request, do so using your company's official email domain. this precaution is crucial, as partnership requests originating from non-official email addresses are prone to rejection by the samsung relationship manager. pitfall 2: providing the wrong issuer name while creating your service while creating a service for the push provisioning feature, you have to add the issuer names, meaning the names of your financial institution or bank. you must make sure to provide the correct names that have been registered with the card networks such as visa, mastercard and so on. if incorrect names are provided, the getallcard() api returns an empty list even though the card has already been added to the samsung wallet. to confirm your issuer name, first add your card to the samsung wallet application. tap on the card in the wallet application, open the more menu, and select customer services. the correct issuer name is listed on the “customer services” pane. to correct your issuer name for services that you have created: select my projects > service management. select the service name to open the service details page. select edit info. you can delete the incorrect issuer name and enter a new one. pitfall 3: using service id with an invalid effective date a common error that occurs during sdk integration is the error_expired_or_invalid_debug_key (-310) error. this error occurs in two cases: using a newly created service id without generating an expiration date of the service: after creating a service, if you check the edit info of the service details page, you will find that the debug effective data is blank. hence, you have to generate a date right after creating the service. using a service id with an expired debugging date: the service id provided by samsung pay portal remains valid for 90 days. after that time, the service expires. therefore, you must generate a date for debugging every 90 days. to generate or extend the validity date of the service: select my projects > service management. select the service name to open the service details page. select edit info. click generate new date. provide a samsung account for testing the application. this account is placed on the allow list for testing. click generate. the new expiration date of your service appears on the page. remember to extend the date after 90 days if you continue testing your application past that point. pitfall 4: configuring the release service with insufficient information it is essential to include the apk file when setting up the release service. failure to include the apk file will result in samsung pay’s relationship manager rejecting the service, leading to delays in the release process. additionally, ensure that you have correctly integrated the appropriate service id into your release application. pitfall 5: testing your application with a mismatched configuration samsung wallet uses the service id, package name, and apk signature for partner verification. if you test your application with an apk signature different from the one already registered in the samsung pay portal, samsung pay recognizes that the apk signature is inconsistent with the service id and produces the error code -6 (not_allowed). in conclusion, navigating the integration of the samsung pay sdk can present you with many challenges. but, armed with the knowledge shared here, you can steer clear of some potential pitfalls and ensure a smoother implementation process. by prioritizing thorough testing, adhering to best practices, and maintaining clear communication with samsung's support channels, you can mitigate risks and deliver a seamless payment experience to users.
Ummey Habiba Bristy
Develop Samsung Wallet
doccode lab exercise for add to wallet integration exercise this code lab exercise provides partners an opportunity to test and consolidate their understanding of samsung wallet it is designed to walk partners through the whole wallet integration process just in 30 minutes it consists of the following 10 sections objective overview set up your environment start your project create wallet cards launch wallet cards apply the add to wallet script generate and input the cdata test the "add to wallet" button you're done! if you have read through all the materials in this section, please don't hesitate to try the code lab exercise it will be worth it!
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 payment interface paymentmanager customsheettransactioninfolistener enclosing class paymentmanager public static interface paymentmanager customsheettransactioninfolistener this interface is for listening callback events of online in-app custom sheet payment this is invoked when card is changed by the user on the custom payment sheet, and also with the success or failure of online in-app payment this listener is registered when paymentmanager startinapppaywithcustomsheet customsheetpaymentinfo, customsheettransactioninfolistener api is called caution amountboxcontrol must be returned in oncardinfoupdated on sheetupdatedlistener to remove progress bar on custom payment sheet private final paymentmanager customsheettransactioninfolistener mtransactionlistener2 = new paymentmanager customsheettransactioninfolistener { @override public void oncardinfoupdated cardinfo selectedcardinfo, customsheet sheet { // update amount if needs double upateditem = 3000; // update amountboxcontrol amountboxcontrol amountboxcontrol = amountboxcontrol sheet getsheetcontrol "id_amount" ; double item = upateditem; double tax = amountboxcontrol getvalue "id_tax" ; double shipping = amountboxcontrol getvalue "id_shipping" ; double total = item + tax + shipping; amountboxcontrol updatevalue "id_item", item ; amountboxcontrol updatevalue "id_tax", tax ; amountboxcontrol setamounttotal total, amountconstants format_total_price_only ; sheet updatecontrol amountboxcontrol ; // call updatesheet api method with amountboxcontrol this is mandatory paymentmanager updatesheet sheet ; } @override public void onsuccess customsheetpaymentinfo response, string paymentcredential, bundle extrapaymentdata { log d tag, "transaction succeeded" ; } @override public void onfailure int errorcode, bundle errordata { log d tag, "transaction failed" + errorcode + "/" + errordata ; } } since api level 1 3 see also paymentmanager startinapppaywithcustomsheet customsheetpaymentinfo, customsheettransactioninfolistener method summary all methodsinstance methodsabstract methods modifier and type method description void oncardinfoupdated cardinfo selectedcardinfo, customsheet sheet this callback is received when the user changes card on the custom payment sheet in samsung pay in this callback, updatesheet method must be called to update current payment sheet void onfailure int errcode, android os bundle errordata this callback is received when the online payment transaction has failed void onsuccess customsheetpaymentinfo customsheetpaymentinfo, string paymentcredential, android os bundle extrapaymentdata this callback is received when the online in-app payment transaction is approved by user and able to successfully generate in-app payload method details oncardinfoupdated void oncardinfoupdated cardinfo selectedcardinfo, customsheet sheet this callback is received when the user changes card on the custom payment sheet in samsung pay in this callback, updatesheet method must be called to update current payment sheet parameters selectedcardinfo - currently selected card's information since api level 1 3 see also paymentmanager updatesheet customsheet paymentmanager updatesheet customsheet, int, string onsuccess void onsuccess customsheetpaymentinfo customsheetpaymentinfo, string paymentcredential, android os bundle extrapaymentdata this callback is received when the online in-app payment transaction is approved by user and able to successfully generate in-app payload the payload could be an encrypted cryptogram direct in-app payment or payment gateway's token reference id indirect in-app payment parameters customsheetpaymentinfo - online payment information from samsung pay since api level 1 5, spaysdk extra_last4_fpan and spaysdk extra_last4_dpan of the card which was used for the current transaction is included in cardinfo paymentcredential - payment credentials example cryptogram, aid direct in-app payment , or tokenrefid indirect in-app payment extrapaymentdata - additional payment credentials if any since api level 1 3 onfailure void onfailure int errcode, android os bundle errordata this callback is received when the online payment transaction has failed parameters errcode - the result code of error cause errordata - extra error message data, if any, provided by samsung pay note please refer spaysdk common_status_table in detail since api level 1 3 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Pay
docinitiate in-app payment the main classes and interfaces involved here are samsungpay– class for a merchant app to get samsung pay sdk information and the status of samsung pay on the device paymentmanager – class to provide payment/transaction functionality cardinfolistener – interface for requestcardinfo result callbacks from samsung wallet customsheettransactioninfolistener – interface for transaction success/failure callbacks from samsung wallet; payment information is provided with a success callback and must be used by the merchant app for processing the payment the flow pictured next captures the essential online payment api process between merchant apps integrated with the samsung pay sdk and samsung wallet and the merchant’s payment gateway pg reflected in the diagram above are the following operations check the ready status of samsung pay start the payment manager to establish the service binding and verify the merchant app get payment card information and the payment amount, including updates get/update the user’s billing and shipping addresses, including an updated payment amount if shipping charges will be incurred authenticate the user submit payment information to pg verify transaction success or failure token modes network vs gateway to complete the payment, the merchant’s designated payment gateway pg handles one of two types of tokens gateway tokens indirect or network tokens direct the samsung pay sdk supports both types the essential difference between the two types is who decrypts the token information network tokens require that the merchant app handles decryption of the token bundle or work with the pg to handle decryption, whereas gateway token decryption is handled by the pg via the samsung-pg interface server check with your pg to determine its specific requirements for payment processing regardless of the pg model employed, direct or indirect, the goal is to offer samsung pay as a secure payment method within your merchant app the most common use case involves the following general steps to make a purchase, the user selects to “buy” or got to checkout after adding items to a shopping cart now in checkout, the user selects a payment option; for example, either the merchant’s “standard” method or samsung pay upon selecting samsung pay, the user is presented with a payment sheet that allows for card selection and shipping address confirmation with the option to add/modify information for this order, whereupon the user * makes payment card selection from the list of enrolled cards * chooses to change or add the delivery address * enters required address information in the form presented and saves it * authenticates the payment method, amount, and delivery with a biometric verification fingerprint, iris… or pin checking registered/enrolled card information before displaying the samsung pay button, a partner app can query card brand information for the user’s currently enrolled payment cards in samsung wallet to determine if payment is supported with the enrolled card for example, if a merchant app accepts one card brand exclusively but the user has not registered any cards matching this brand in samsung wallet, the merchant app needs to determine whether or not to display the samsung pay button for this purchase checkout to query the card brand, use the requestcardinfo api method of the paymentmanager class the requestfilter is optional bundle data reserved for future use the merchant app does not need to set a value for it now however, before calling this method, cardinfolistener must be registered so its listener can provide the following events onresult - called when the samsung pay sdk returns card information from samsung wallet; returns information about enrolled cards or is empty if no card is registered onfailure - called when the query fails; for example, if sdk service in the samsung wallet app ends abnormally the following snippet shows how to retrieve the list of supported card brands from samsung pay val serviceid = "partner_app_service_id" val bundle = bundle bundle putstring samsungpay partner_service_type, spaysdk servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle val paymentmanager = paymentmanager context, partnerinfo paymentmanager requestcardinfo bundle , cardinfolistener // get card brand list //cardinfolistener is for listening requestcardinfo callback events val cardinfolistener cardinfolistener = object cardinfolistener { // this callback is received when the card information is received successfully override fun onresult cardresponse list<cardinfo> { var visacount = 0 var mccount = 0 var amexcount = 0 var dscount = 0 var brandstrings = "card info " var brand spaysdk brand? for i in cardresponse indices { brand = cardresponse[i] brand when brand { spaysdk brand americanexpress -> amexcount++ spaysdk brand mastercard -> mccount++ spaysdk brand visa -> visacount++ spaysdk brand discover -> dscount++ else -> { /* other card brands */ } } } brandstrings += " vi = $visacount, mc = $mccount, ax = $amexcount, ds = $dscount" log d tag, "cardinfolistener onresult $brandstrings" toast maketext context, "cardinfolistener onresult" + brandstrings, toast length_long show } /* * this callback is received when the card information cannot be retrieved * for example, when sdk service in the samsung wallet app dies abnormally */ override fun onfailure errorcode int, errordata bundle { //called when an error occurs during in-app cryptogram generation toast maketext context, "cardinfolistener onfailure " + errorcode, toast length_long show } } creating a transaction request upon successful initialization of the samsungpay class, the merchant app needs to create a transaction request with payment information noteas of sdk v2 0 00, the normal payment sheet is deprecated all merchant apps must now use the custom payment sheet, which offers more dynamic controls for tailoring the ui look and feel with additional customer order and payment data merchant app developers choosing to temporarily continue offering the normal sheet will need to configure their android manifest to reflect the pre-2 0 00 version of the sdk used to implement their app’s existing normal sheet, although this is not recommended in all cases, merchant app developers should update their apps with the latest version of the sdk as soon as possible to avoid timing out using an earlier version of the sdk when responding to samsung pay callbacks using the custom payment sheet to initiate a payment transaction with samsung pay’s custom payment sheet, your merchant app must populate the following mandatory fields in customsheetpaymentinfo merchant name - as it will appear in samsung pay’s payment sheet, as well as the user's card account statement amount - the constituent transaction properties currency, item price, shipping price, tax, total price which together determine the total amount the user is agreeing to pay the merchant cautionnot populating the mandatory fields throws an illegalargumentexception optionally, the following fields can be added to the payment information merchant id- can be used for the merchant’s own designated purpose at its discretion unless the merchant uses an indirect pg like stripe or braintree if an indirect pg is used, this field must be set to the merchant’s payment gateway id fetched from the samsung pay developers portal merchant id is mandatory if a merchant request mada token, this filed should be included in the payload order number - usually created by the merchant app via interaction with a pg this number is required for refunds and chargebacks in the case of visa cards, the value is mandatory the allowed characters are [a-z][a-z][0-9,-] and the length of the value can be up to 36 characters address - the user’s billing and/or shipping address see applying an addresscontrol for details allowed card brands - specifies card brands accepted by the merchant if no brand is specified, all brands are accepted by default if at least one brand is specified, all other card brands not specified are set to "card not supported’ on the payment sheet here’s the 'customsheetpaymentinfo' structure class customsheetpaymentinfo parcelable { private val version string? = null private val merchantid string? = null private val merchantname string? = null private val ordernumber string? = null private val addressinpaymentsheet addressinpaymentsheet = addressinpaymentsheet do_not_show private val allowedcardbrand list<spaysdk brand>? = null private val cardinfo cardinfo? = null private val iscardholdernamerequired = false private val isrecurring = false private val merchantcountrycode string? = null private val customsheet customsheet? = null private val extrapaymentinfo bundle? = null } your merchant app sends this customsheetpaymentinfo to samsung wallet via the applicable samsung pay sdk api methods upon successful user authentication in direct mode, samsung wallet returns the above "payment info" structure and a result string the result string is forwarded to the pg by your merchant app to complete the transaction it will vary based on the pg you’re using noteif you want to add any other information for any card brand, you can add them in the extrapaymentinfo bundle the following example demonstrates how to populate customsheet in the customsheetpaymentinfo class see sample merchant app using custom payment sheet below for example usage of each customsheet control /* * make user's transaction details * the merchant app should send customsheetpaymentinfo to samsung wallet via * the applicable samsung pay sdk api method for the operation being invoked */ private fun makecustomsheetpaymentinfo customsheetpaymentinfo { val brandlist = arraylist<spaysdk brand> // if the supported brand is not specified, all card brands in samsung wallet are // listed in the payment sheet brandlist add paymentmanager brand visa brandlist add paymentmanager brand mastercard brandlist add paymentmanager brand americanexpress /* * make the sheetcontrols you want and add them to custom sheet * place each control in sequence with amountboxcontrol listed last */ val customsheet = customsheet customsheet addcontrol makebillingaddresscontrol customsheet addcontrol makeshippingaddresscontrol customsheet addcontrol makeplaintextcontrol customsheet addcontrol makeshippingmethodspinnercontrol customsheet addcontrol makeamountcontrol val extrapaymentinfo = bundle /* * you can add transaction type for mada card brand * the supported values are purchase and preauthorization * if you don't set any value, the default value is purchase */ extrapaymentinfo putstring spaysdk extra_online_transaction_type, spaysdk transactiontype preauthorization tostring val customsheetpaymentinfo = customsheetpaymentinfo builder setmerchantid "123456" setmerchantname "sample merchant" // merchant requires billing address from samsung wallet and // sends the shipping address to samsung wallet // show both billing and shipping address on the payment sheet setaddressinpaymentsheet customsheetpaymentinfo addressinpaymentsheet need_billing_send_shipping setallowedcardbrands brandlist setcardholdernameenabled true setrecurringenabled false setcustomsheet customsheet setextrapaymentinfo extrapaymentinfo build return customsheetpaymentinfo } requesting payment with a custom payment sheet the startinapppaywithcustomsheet method of the paymentmanager class is applied to request payment using a custom payment sheet in samsung wallet the two methods are defined as follows startinapppaywithcustomsheet - initiates the payment request with a custom payment sheet the payment sheet persist for 5 minutes after the api is called if the time limit expires, the transaction fails updatesheet - must be called to update current payment sheet as of api level 1 5, a merchant app can update the custom sheet with a custom error message refer to updating sheet with custom error message when you call the startinapppaywithcustomsheet method, a custom payment sheet is displayed on the merchant app screen from it, the user can select a registered card for payment and change the billing and shipping addresses, as necessary the result is delivered to customsheettransactioninfolistener, which provides the following events onsuccess - called when samsung pay confirms payment it provides the customsheetpaymentinfo object and the paymentcredential json string customsheetpaymentinfo is used for the current transaction it contains amount, shippingaddress, merchantid, merchantname, ordernumber api methods exclusively available in the onsuccess callback comprise getpaymentcardlast4dpan – returns the last 4 digits of the user's digitized personal/primary identification number dpan getpaymentcardlast4fpan – returns the last 4 digits of the user's funding personal/primary identification number fpan getpaymentcardbrand – returns the brand of the card used for the transaction getpaymentcurrencycode – returns the iso currency code in which the transaction is valued getpaymentshippingaddress – returns the shipping/delivery address for the transaction getpaymentshippingmethod – returns the shipping method for the transaction for pgs using the direct model network tokens , the paymentcredential is a json object containing encrypted cryptogram which can be passed to the pg pgs using the indirect model gateway tokens like stripe, it is a json object containing reference card reference – a token id generated by the pg and status i e , authorized, pending, charged, or refunded refer to payment credential sample for details oncardinfoupdated - called when the user changes the payment card in this callback, updatesheet method must be called to update current payment sheet onfailure - called when the transaction fails; returns the error code and errordata bundle for the failure here’s how to call the startinapppaywithcustomsheet method of the paymentmanager class /* * customsheettransactioninfolistener is for listening callback events of in-app custom sheet payment * this is invoked when card is changed by the user on the custom payment sheet, * and also with the success or failure of online in-app payment */ private val transactionlistener = object customsheettransactioninfolistener { // this callback is received when the user changes card on the custom payment sheet in samsung pay override fun oncardinfoupdated selectedcardinfo cardinfo, customsheet customsheet { /* * called when the user changes card in samsung wallet * newly selected cardinfo is passed so merchant app can update transaction amount * based on different card if needed , */ val amountboxcontrol = customsheet getsheetcontrol amount_control_id as amountboxcontrol amountboxcontrol updatevalue product_item_id, 1000 0 //item price amountboxcontrol updatevalue product_tax_id, 50 0 // sales tax amountboxcontrol updatevalue product_shipping_id, 10 0 // shipping fee amountboxcontrol updatevalue product_fuel_id, 0 0, "pending" // additional item status amountboxcontrol setamounttotal 1060 0, amountconstants format_total_price_only // grand total customsheet updatecontrol amountboxcontrol // call updatesheet with amountboxcontrol; mandatory try { paymentmanager updatesheet customsheet } catch e java lang illegalstateexception { e printstacktrace } catch e java lang nullpointerexception { e printstacktrace } } /* * this callback is received when the payment is approved by the user and the transaction payload * is generated payload can be an encrypted cryptogram network token mode or the pg's token * reference id gateway token mode */ override fun onsuccess response customsheetpaymentinfo, paymentcredential string, extrapaymentdata bundle { /* * called when samsung pay creates the transaction cryptogram, which merchant app then sends * to merchant server or pg to complete in-app payment */ try { val dpan = response cardinfo cardmetadata getstring spaysdk extra_last4_dpan, "" val fpan = response cardinfo cardmetadata getstring spaysdk extra_last4_fpan, "" toast maketext context, "dpan " + dpan + "fpan " + fpan, toast length_long show } catch e java lang nullpointerexception { e printstacktrace } toast maketext context, "transaction onsuccess", toast length_long show } override fun onfailure errorcode int, errordata bundle { // called when an error occurs during cryptogram generation toast maketext context, "transaction onfailure $errorcode", toast length_long show } } private fun startinapppaywithcustomsheet { // show custom payment sheet try { val bundle = bundle bundle putstring samsungpay partner_service_type, spaysdk servicetype inapp_payment tostring val partnerinfo = partnerinfo serviceid, bundle paymentmanager = paymentmanager context, partnerinfo // request payment using samsung wallet paymentmanager startinapppaywithcustomsheet makecustomsheetpaymentinfo , transactionlistener } catch e illegalstateexception { e printstacktrace } catch e numberformatexception { e printstacktrace } catch e nullpointerexception { e printstacktrace } catch e illegalargumentexception { e printstacktrace } } when an address is provided by samsung wallet, onaddressupdated is called whenever address information is updated in the custom payment sheet you can use the updatesheet method to update the shipping fee or any other relevant information in the payment sheet set the errorcode to determine if the address provided by samsung wallet app is invalid, out of delivery, or does not exist for example, when the merchant does not support the product delivery to the designated location billing address from samsung wallet is not valid for tax recalculation for all such cases, the merchant app should call updatesheet with one of the following error codes error_shipping_address_invalid error_shipping_address_unable_to_ship error_shipping_address_not_exist error_billing_address_invalid error_billing_address_not_exist the sample code included below under applying the address control demonstrates how to use the updatesheet method for 'addresscontrol' in the payment sheet payment credential sample the paymentcredential is the resulting output of the startinapppaywithcustomsheet method the structure varies depending on the pg you’re using and the integration model—direct or indirect the following paymentcredential is for a visa card for pg using direct network token mode – e g first data, adyen, cybs sample paymentcredential json output using jwe-only { "billing_address" {"city" "billingcity","country" "usa","state_province" "ca","street" "billingaddr1","zip_postal_code" "123456"}, "card_last4digits" "1122", "3ds" {"data" "eyjhbgcioijsu0exxzuilcjrawqioijcak91a1h2afv4wu5wofiwvgs2y25oactzwwfqzxhiehrvz0vfdhlhyy9npsisinr5cci6ikppu0uilcjjagfubmvsu2vjdxjpdhldb250zxh0ijoiulnbx1blssisimvuyyi6ikexmjhhq00ifq fg2oouvhdgkkivyba2s5kturpwueujkzeyxz7n6kalhqahszv3p5jabaoj-rokcznfjdg3qierzjktu7zxst9gwv4oclahpfdw64w0x6ttaxeyjiivkjug-edxxtwajeyeikgc68wehf1cltsqg4zlwi6upvcaywdppbn0hl0c5wcf5az4wabytv_fda5ahguypne70keqrtwdlacw9mzejx2xth7msd9ohoulr8luq-7gha17jhoobwgmoq9q0haocnm0ljwiuhkoryyu-njulnbkk8fzus_aiumgdv2yn9ygfqilmculb0vwuf0yekx6isgaxi0zqhliusjkcz_w auzzxog46lnrtk3q qe2llws30vzh-zduue8b045cnfrm2p-rjzgbnzchels3v26n64cfg1av5mtp5f-fswbj3ntp5x4v1nk8fmdy0uspxzemfvl5badgac7w9frxt6x5xv1fqu6-q-zkbxcb9bygownt983bckoe1bd5djxfbodlrc4j68ikdjc5m3lebdx6hv0aqzkmilch-jevl3awqykbny4vj7m3fizw7u1prli2zfwukxdfs4vwv3bpm4qudemvnhxj qtymdmn4ne93juljnmwkjg","type" "s","version" "100"}, "merchant_ref" "merchantid", "method" "3ds", "recurring_payment" false } decrypt using the merchant’s private key below is sample private key -----begin rsa private key----- miieowibaakcaqea4lzyjqr+dqd/xleoxct9jwtjxhd2ptjke9djtmijki0h2oc2ghow4ujhhy/1jvft2+zcnjtoxuvlp+76/dwa3bcwfrj+fpp6x5kkylpb+djdyo1ttumltnqcwymjb3u7jbc+xr4vkfrzqjxke7xhn/sbb82ue8c3smzvkynuji<…> -----end rsa private key----- the decrypted output will be similar to this { "amount" "1000", "currency_code" "usd", "utc" "1490266732173", "eci_indicator" "5", "tokenpan" "1234567890123456", "tokenpanexpiration" "0420", "cryptogram" "ak+zkbpmcorcabcd3agraoacfa==" } processing the payload depending on the structure of the payment processing api provided by your pg, your merchant app can send either of these directly to the pg entire paymentcredential output extracted “3ds” part only consult your pg documentation for specific guidance when using indirect model e g stripe in indirect gateway token mode, paymentcredential is the pg’s token reference id and its status here’s a sample of the json output { "reference" "tok_18rje5e6szui23f2mefakep7", "status" "authorized" } for stripe, your merchant app should be able to pass this token object directly to charge or another appropriate payment processing api provided by the pg
Develop Samsung Wallet
docimplementing vww button for samsung wallet integration, partners will need to insert an "verify with samsung wallet" script into their systems to implement an "verify with samsung wallet" button, partner should follow the procedure below first, proceed with script composition with the sample script on the partner portal or refer to the integration sample code create the tokenized card data cdata card data is the actual content of the wallet card and it has several formats based on the card type refer to the cdata generation sample code for details [important] the card data token expires in 30 seconds after creation, so it needs to be created right after the user clicks the "verify with samsung wallet” button for "verify with samsung wallet" integration, you may also need some base data you can find that and other necessary information on partners portal implementing vww button on the web this section explains how to implement an "verify with samsung wallet" button using javascript in a web view web button reference with importing api javascript if partner implement the "verify with samsung wallet" button using this script, the button is shown only on the devices that support samsung wallet to automatically parse <samsung wallet> html tags when the page is loaded, partners should include the following standard javascript <script src="https //us-cdn-gpp mcsvc samsung com/lib/wallet-card js" type="text/javascript"></script> partners can use these tags or javascript functions for the web button if they are rendering html and have proper partner permissions partners can also use the script by referring to the various attributes samsung wallet html tag the ‘samsung wallet’ namespace tag defines the placement and various attributes of the "verify with samsung wallet" web button for samsung wallet <samsung wallet type="vww" cardid="card_id" cdata="cdata" partnercode="partner_code" buttonid="button_id" buttontype="btnvwsw" rdclickurl="rd_click_url" rdimpressionurl="rd_impression_url"></samsung wallet> button attributes 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 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
events mobile, ai
blog#sdc2017 wrapped up today and it was our best conference yet. the day started off with keynote speeches from arianna huffington, stan lee and rain paris. the action continued on the floor with lots of activity at the samsung pay, galaxy apps and samsung health booths, just to name a few. however, the talk of the conference was the announcement of bixby 2.0, which introduces deep linking capabilities and enhanced natural language abilities to better recognize individual users and create a predictive, personalized experience that better anticipates needs. the bixby sdk will be available to select developers and through a private beta program, with general availability coming in 2018. this afternoon, we sat down with the samsung bixby home team to learn more about bixby home and what developers can expect from its newly launched sdk. tell us about bixby home. bixby home helps you navigate your smartphone and make your day easier. it learns and adapts to show you the content you care about. it allows for easier access to apps, important information and personalized daily content. essentially, you get what you need when you need it. when you interact with bixby home, you’ll engage with cards that contain the information you want. social media cards contain all your important social feeds news cards carry the information that you want to read media cards show you the videos you want to interact with international cards allow you to book travel it’s available on the s8, s8+ and the note 8. it will be available on all galaxy flagships devices coming out in the new year. tell us about the sdk you just launched for bixby home here at sdc. the new sdk gives developers two different ways to develop content cards for bixby home: the first way is app-based integration, which pulls content from partner mobile apps. this creates app-based cards. for this type of development, devs will need to add an api library into their mobile apps. the second way is server-based integration, which pulls content from partner servers. here, developers are required to map endpoints from their server to the bixby home server through a server api. the creation process is simple enough: first devs need to register as a developer and then they need to submit their card plan. next, they create, configure, submit the card for approval, conduct an integration test and deploy. currently, there are six different types of cards they can create: utility, multimedia, news cards, location cards, communications cards and commerce cards – more to come in the near future. what’s the value proposition for devs? why develop bixby home cards? well, there are a few reasons why devs would want to develop for not only for bixby home, but also for samsung mobile: they get access to all samsung customers, they see increased engagement with apps and services and they extend consumer reach across multiple devices. what kind of support will devs receive when developing with the new sdk? with the sdk, partners control their content. however, there are api libraries for both app-based cards and server-based cards. they receive a developer guide, a ux guide, and sample cards and apps to review. through the partner portal, devs can manage their cards. here they can propose, design and create their cards, as well as track card analytics. they’re supported every step of the way. we’re very excited about this new sdk and want to set our developer partners up for success. thanks to all the developers, designers, creators, partners, sponsors and everyone else who joined us at #sdc2017. it truly was a great event and we can wait to start working with you all this year to bring our announcements to life. follow us on @samsung_dev to keep the conversation going and keep an eye on our blog for technical content that will bring your dev game to the next level. and see you next year!
Samsung Developer Program
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.