Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Filter
Learn Code Lab
codelabimplement in-app subscriptions using samsung iap objective learn how to integrate the samsung in-app purchase sdk into your application so that users can purchase and upgrade subscriptions directly within the app overview the samsung in-app purchase iap service provides developers with a reliable solution for managing digital purchases within mobile applications it guarantees a smooth and secure experience for users when buying digital goods, managing subscriptions, or processing refunds and consumed products the iap sdk enables easy integration of the iap functionality into your app, such as configuring iap, retrieving product details, offering and selling products, and managing purchased products to successfully sell in-app products, follow these four basic steps download and integrate the samsung iap sdk into your application request for commercial seller status in the samsung galaxy store seller portal upload your application's binary file in the seller portal add in-app products to your app by integrating in-app purchases iap , your apps can sell in-app products, including subscriptions a subscription is a specific type of in-app product available for purchase through your app in the galaxy store when a user buys a subscription, it grants access for a set duration known as the subscription period or payment cycle at the end of this period, the subscription automatically renews, allowing the user to continue using the product for another subscription period and to be automatically billed with the subscription price for more information, go to samsung iap set up your environment you will need the following android studio latest version recommended samsung iap sdk latest version samsung galaxy device android 6 0 or higher samsung galaxy store seller portal commercial seller account sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! in-app subscription bookspot sample code 1 5 mb start your project in android studio, click open to open an existing project locate the downloaded sample project and click ok register the app and its associated subscriptions in the seller portal to register the sample app along with the in-app products in the samsung galaxy store seller portal, follow these steps sign in using your commercial seller account in android studio, modify the package name of the sample app navigate to app > kotlin + java > com example bookspot view, and in the mainactivity java file, refactor the application name bookspot from the package name com example bookspot for all directories notethe package name com example bookspot is already registered in the seller portal to avoid any conflicts, rename it with a different package name next, open the app > manifests > androidmanifest xml file and check that all necessary permissions are present com samsung android iap permission billing to connect to iap and enable in-app product registration in the seller portal android permission internet because iap uses the internet <uses-permission android name="com samsung android iap permission billing" /> <uses-permission android name="android permission internet" /> build the apk from android studio and upload the binary to the seller portal once the testing process is complete and the app functions smoothly as intended, return to this step and upload the final apk file in the in app purchase tab, click on add new item and select subscription add the subscriptions with item ids as basic and standard these are the item ids of the subscriptions created in the sample app next, set the subscription price by clicking on set new price noteto learn more about pricing, see manage subscription pricing provide the details for the payment cycle, grace period, free trial period, and free trial/tiered pricing limit as shown below noteincluding a free trial promotion for your app is optional to test the functionality of the getpromotioneligibility api, you can add a free trial select all subscriptions you added and click on activate lastly, add a license tester to enable purchasing within the app edit your seller portal profile and include your samsung account in the license test field on the test device, sign in with the same samsung account initialize the samsung iap sdk before using the samsung iap sdk library samsung-iap-6 5 0 aar , ensure that it is added to the app > libs folder and included as a dependency in the module-level build gradle file dependencies { implementation filetree dir 'libs', include ['* aar'] } next, open the mainactivity java file in the oncreate function, create an instance of iaphelper and set the operation mode to operation_mode_test this mode enables only license testers to test the application without incurring charges iaphelper = iaphelper getinstance getapplicationcontext ; iaphelper setoperationmode helperdefine operationmode operation_mode_test ; notebefore submitting the app for beta testing or release, change the operation mode to operation_mode_production get product details and check the promotion eligibility to obtain information about subscriptions registered in the store related to your app, use the getproductsdetails api you can retrieve details about a specific subscription by providing the argument named itemid with values such as basic or standard you can use an empty string "" as the argument to obtain all product details iaphelper getproductsdetails itemid, new ongetproductsdetailslistener { @override public void ongetproducts @nonnull errorvo errorvo, @nonnull arraylist<productvo> productlist { if errorvo geterrorcode == iaphelper iap_error_none { for productvo item productlist { itemname settext item getitemname +" level course" ; itemtype settext "item type "+item gettype ; itemprice settext "item price "+item getitemprice +item getcurrencyunit ; itemduration settext "item duration "+item getsubscriptiondurationunit ; subscriptiondialogbutton setonclicklistener dialogbtnlistener ; getpromotioneligibility item getitemid ; } } else { log e "ongetproducts error ", errorvo geterrorstring ; } } } ; after getting the product details, check the promotion eligibility use the getpromotioneligibility api to return the pricing options for a subscription, including free trials and introductory prices that may apply to the user iaphelper getpromotioneligibility itemid, new ongetpromotioneligibilitylistener { @override public void ongetpromotioneligibility @nonnull errorvo errorvo, @nonnull arraylist<promotioneligibilityvo> pricinglist { if errorvo geterrorcode == iaphelper iap_error_none { for promotioneligibilityvo pricing pricinglist { itempricing settext "promotion eligibility "+pricing getpricing ; } } else { log e "ongetpromotioneligibility error ", errorvo geterrorstring ; } } } ; initiate the payment process and acknowledge the subscription to initiate a purchase and complete the payment transaction process, use the startpayment api the result of the purchase is specified through the onpaymentlistener interface, which provides detailed purchase information in the event of a successful transaction use obfuscatedaccountid and obfuscatedprofileid value is up to 64 bytes to detect fraudulent payments these values are returned in purchasevo that contains the purchase results you can find more details about it in the purchase an in-app product section of the programming guide once the app has granted entitlement to the user, notify samsung iap of the successful transaction using the acknowledgepurchases api additionally, call the handlechangeplan function to make the change plan button visible and to set the onclicklistener iaphelper startpayment itemid, obfuscatedaccountid, obfuscatedprofileid, new onpaymentlistener { @override public void onpayment @nonnull errorvo errorvo, @nullable purchasevo purchasevo { if errorvo geterrorcode == iaphelper iap_error_none && purchasevo != null { acknowledgepurchases purchasevo getpurchaseid ; handlechangeplan itemid ; } else { log e "onpayment error ", errorvo geterrorstring ; } } } ; use the acknowledgepurchases api as below iaphelper acknowledgepurchases purchaseid, errorvo, acknowledgedlist -> { if errorvo geterrorcode == iaphelper iap_error_none { for acknowledgevo item acknowledgedlist { log e "onacknowledgepurchases ", item getstatusstring ; } } else { log e "onacknowledgepurchases error ", errorvo geterrorstring ; } } ; manage changes to subscription plans the changesubscriptionplan api allows users to switch between different tiers of the same subscription changes can be categorized as follows upgrade - moving from a lower-priced tier to a higher-priced tier, or switching between tiers of equal value downgrade - transitioning from a higher-priced tier to a lower-priced tier you can use proration modes to set the payment and current subscription period settings there are four proration modes available instant_prorated_date, instant_prorated_charge, instant_no_proration, and deferred in this code lab, use instant_prorated_date so that the current subscription is changed instantly, allowing the user to start using the new subscription tier right away also, use obfuscatedaccountid and obfuscatedprofileid to detect fraudulent payments iaphelper changesubscriptionplan itemid, newitemid, helperdefine prorationmode instant_prorated_date, obfuscatedaccountid, obfuscatedprofileid, new onchangesubscriptionplanlistener { @override public void onchangesubscriptionplan @nonnull errorvo errorvo, @nullable purchasevo purchasevo { if errorvo geterrorcode == iaphelper iap_error_none && purchasevo != null { handlechangeplan newitemid ; updatechangeplanview newitemid ; } else { log e "onchangesubscriptionplan error ", errorvo geterrorstring ; } } } ; notefor more details on handling changes to subscription plans, see manage subscription plan changes retrieve and process the list of subscriptions the getownedlist api retrieves a list of in-app products that the user has previously purchased, including active subscriptions and free trials call the getownedlist api from the iaphelper class and obtain the results through the ongetownedlistlistener interface utilize the helperdefine product_type_subscription parameter to fetch only subscription data after acquiring the subscription list, check the acknowledgment status of each subscription using the getacknowledgedstatus function and check whether all of the subscriptions are being acknowledged by samsung iap if any of the subscription status is not acknowledged, then call the acknowledgepurchases function to notify the acknowledgement to samsung iap if the subscription price has changed in the seller portal, it may be necessary for existing subscribers to consent to the price increase before the next subscription period, depending on certain conditions to determine if consent is required from the subscriber, use the getpricechangemode and isconsented functions if consent is needed, call the handleconsent function to make the consent button visible, and set the onclicklistener for the button accordingly iaphelper getownedlist helperdefine product_type_subscription, new ongetownedlistlistener { @override public void ongetownedproducts @nonnull errorvo errorvo, @nonnull arraylist<ownedproductvo> ownedlist { if errorvo geterrorcode == iaphelper iap_error_none { for ownedproductvo item ownedlist { // check the acknowledgedstatus helperdefine acknowledgedstatus acknowledgedstatus = item getacknowledgedstatus ; if acknowledgedstatus equals helperdefine acknowledgedstatus not_acknowledged { acknowledgepurchases item getpurchaseid ; } // handle the price change if item getitemid equals item1 || item getitemid equals item2 { handlechangeplan item getitemid ; subscriptionpricechangevo subscriptionpricechangevo = item getsubscriptionpricechange ; if subscriptionpricechangevo != null && subscriptionpricechangevo getpricechangemode equals helperdefine pricechangemode price_increase_user_agreement_required && !subscriptionpricechangevo isconsented { handleconsent item getitemid , item getpurchaseid ; } } } } else { log e "getownlist error ", errorvo geterrorstring ; } } } ; to create a deep link to the consent page when needed, use the following code uri deeplinkuri = uri parse "samsungapps //subscriptiondetail?purchaseid="+purchasedid ; intent intent = new intent intent action_view, deeplinkuri ; startactivity intent ; run the app after building the apk, install the app on a samsung galaxy device to test the app, click on view details in the basic tab this displays the purchase details, including promotion eligibility, item type, duration, and price then, click on continue to subscribe in the samsung checkout pop-up, select your payment method and click the subscribe button a payment confirmation screen appears upon successful completion of the transaction when the change plan button appears, click on it a pop-up shows the changes in your subscription plan click next and then subscribe using your payment method a payment confirmation screen appears, and the view changes to the standard tab, where you can see the details of your new subscription noteto test and display the consent button, you must increase the price of any subscription in the seller portal the price update will be applied in the galaxy store after a waiting period of 7 days the subscription renews every 10 minutes and will expire in operation_mode_test mode to test the change in the subscription price, set the operation mode to operation_mode_production you're done congratulations! you have successfully achieved the goal of this code lab now, you can implement in-app subscriptions using samsung iap into your application by yourself! if you are having trouble, you may download this file in-app subscription bookspot complete code 1 5 mb to learn more about developing apps with samsung iap sdk, visit developer samsung com/iap
tutorials digital payments
blogthe samsung pay sdk offers developers the ability to seamlessly incorporate mobile and online payment solutions and push provisioning capabilities into their applications, enhancing functionality and user experience. for samsung pay partners, mastering the development lifecycle and proactively addressing potential challenges are essential best practices for ensuring a smooth and successful integration. by adopting these strategies, developers can enhance the reliability of their implementations and minimize disruptions, ultimately delivering a superior user experience. this guide outlines the partnership process, best practices for development, testing strategies, and release process to ensure a smooth integration experience. setting up your partnership to begin integrating the samsung pay sdk, follow these steps: create a samsung account: use your company email to register your samsung account. personal emails may lead to rejection. register in the partner portal: to prevent rejection of your partnership request, ensure the following mandatory company details are provided accurately: business account name company name company legal structure company country number of employees company address company phone number company introduction company data universal numbering system (duns) number company website url collaborator access: your colleagues can also sign up to be a member of your business account using either the business account name or the manager's email address to collaborate on your projects. review process: a relationship manager (rm) will review your application within 2-3 business days. if no response is received, contact samsung developer support with your company name, country, and samsung account details. while awaiting for approval, you can explore the samsung pay sdk programming guide. once your partnership request has been approved, you're ready to configure your project by creating a new service and registering your application. you can find more details of the service creation process in the samsung pay documentation. key considerations and troubleshooting in the development phase follow the development guide, sample applications and code labs while integrating the samsung pay sdk. to avoid common pitfalls during implementation, make sure the following preparations have been implemented: verify the manifest configuration: verify the inclusion of necessary queries. <queries> <package android:name="com.samsung.android.spay" /> </queries> apply optimizer rules: make sure you have applied the correct proguard or dexguard rules to prevent runtime errors. proguard rules: dontwarn com.samsung.android.sdk.samsungpay.** -keep class com.samsung.android.sdk.** { *; } -keep interface com.samsung.android.sdk.** { *; } dexguard rules: -keepresourcexmlelements manifest/application/meta-data@name=spay_sdk_api_level for banks and financial institutions, verify the issuer name for push provisioning: confirm the issuer name matches your setup. if you are getting an empty list from the getallcard() method, check that the issuer name on the samsung pay portal matches the issuer name of the card. you can ensure the correct issuer name is used by adding the card to the samsung wallet application and retrieve the information from it: open the samsung wallet. tap on the card. tap on the three-dot menu. select the customer services option. the issuer name can be found under the title. figure 1: retrieving the issuer name from the samsung wallet application for merchants/payment gateways supporting samsung pay online payment, check the service id and package name configuration: ensure alignment with partner portal configuration. detailed information about the configuration can be found in the partner onboarding guide. check the allow list configuration: ensure you have added the samsung test accounts in the allow list. follow these steps to add the test accounts to your service: log into the partner portal. go to my projects > service management. click on your service name > add samsung account on the service details page. figure 2:adding test accounts to the allow list check the service expiration date: make sure that your service id is currently valid. to generate or extend the validity date of the service: go to my projects > service management. select the service name to open the service details page. click generate new date. provide samsung accounts for testing the application. these accounts are 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. figure 3: generating the service expiration date for merchants supporting samsung pay online payment, provide a valid csr: for in-app payment services, you must upload a valid certificate signing request (csr) in the partner portal. this csr is provided to you by your payment gateway (pg). if issues persist check the faq: samsung pay guide has an extensive list of common error codes and solutions for common issues. check this faq to help you resolve your issue: samsung pay faq submit a support ticket: you can reach out to the samsung engineers directly by creating a support ticket from samsung developer support. include detailed issue descriptions, affected apis, expected vs. actual responses from the api, and attach dumpstate logs. to capture dumpstate logs, follow the below steps: dial *#9900# > set debug level to mid > restart the device. reproduce the issue and re-enter *#9900# > run dumpstate/logcat > save logs to sd card. package the logs in a zip file and submit them. notelogs expire after 15 minutes. testing with the samsung wallet application the service status flow for samsung pay sdk begins with the debugging stage, where the service is still under internal testing and can only be accessed by authorized samsung accounts in the allow list. once testing is complete, the partner submits the service along with the release version of the apk for approval, transitioning it to the pending state. at this stage, the service still remains accessible only to the authorized samsung accounts while awaiting review. the relationship manager (rm) then evaluates the submission. if the service meets all requirements, it is marked as approved and becomes eligible for public use. however, if the service fails to meet the necessary standards, it is rejected, indicating that further improvements are needed before resubmission. samsung offers both production and staging environments to test your application with the samsung pay partner portal. for testing using the staging environment, you need the service id from the partner portal, the staging version of the samsung wallet application, and test cards. you can find the staging version of the samsung wallet application from the partner portal by navigating to support > request test app then clicking galaxy app url to copy the test application link. make sure that you have registered your test accounts to use the samsung pay stg application. you can access the test cards for the staging environment at test cards on samsung pay. release your application the release process of your application can begin as soon as you upload a release version of your application. after that, keep an eye on the status of the release version under app details on your portal dashboard. to begin the release process, upload a new release version of your application: go to my projects > app management. click on the application name to open its details, then click add new release version. you can also click the add new version button corresponding to the application from the app management dashboard. drag and drop your apk file in the field provided or click the paperclip icon to browse for it. drag and drop up to three screenshots demonstrating your application's compliance with samsung pay's branding guidelines. click register. when the service status is approved, you're ready to publish the application. summary integrating the samsung pay sdk streamlines mobile payment solutions, offering partners a robust and scalable platform. by adhering to the onboarding guidelines, addressing development challenges proactively, and rigorously testing in both environments, you can ensure a successful deployment. samsung’s dedicated support team and resources are readily available to assist at every stage. leverage them to optimize your integration journey. visit the samsung pay developer portal for official documentation and additional resources.
Ummey Habiba Bristy
events iot, health, game, design, mobile, galaxy watch, foldable
blogthe samsung developer conference 2023 (sdc23) happened on october 5, 2023, at moscone north in san francisco and online. among the many exciting activities at the conference for developers and tech enthusiasts, code lab offered a unique opportunity to learn about the latest samsung sdks and tools. code lab is a hands-on learning experience, providing participants with a platform to explore the diverse world of samsung development. code lab activities are accessible for developers of all skill levels and interests, ensuring that everyone, from beginners to experts, can find something exciting to explore. covering a wide array of topics within the code lab, the conference catered to the diverse interests of the participants. here's a quick look at some of the sdc23 topics: 1. smartthings participants had the chance to build a matter iot app using the smartthings home api and create virtual devices that they could control using the smartthings app or their own iot apps. they also learned how to develop a smartthings find-compatible device. these topics are all about connecting and enhancing the smart home experience. 2. galaxy z participants, who are interested in foldable technology, were able to develop a widget for the flex window. this topic opens new possibilities in app design and user interaction. 3. samsung wallet participants learned to integrate the "add to samsung wallet" button into sample partner services. they also learned to implement in-app payment into a sample merchant app using the samsung pay sdk. these topics focus on enhancing the mobile wallet experience for samsung users. 4. gamedev game developers and enthusiasts had the opportunity to optimize game performance with adaptive performance in unity. they also learned to implement flex mode into unity games for foldable phones. these topics offer insights into the gaming industry's latest trends and technologies. 5. watch face studio code lab also provided an activity for participants to create a watch face design with customized styles using watch face studio. participants also learned how to convert the watch face design for galaxy z flip5's flex window display using the good lock plugin. 6. samsung health the health-focused code lab topics covered measuring skin temperature on galaxy watch and transferring heart rate data from galaxy watch to a mobile device with the samsung privileged health sdk. participants also learned how to create health research apps using the samsung health stack. these topics provide valuable insights into the health and fitness tech landscape. from creating virtual devices to building health-related apps, participants left the conference with new knowledge they could apply to their development projects. the samsung developer conference is a celebration of innovation and collaboration in the tech world. with a diverse range of topics in code lab, participants were equipped with the tools and knowledge to push the boundaries of what is possible in samsung's ecosystem. though sdc23 has ended, the innovation lives on! whether you missed the event or just want to try other activities, you can visit the code lab page anytime, anywhere. we can't wait to see you and the innovations that will emerge from this conference in the coming years. see you at sdc24!
Christopher Marquez
Learn Code Lab
codelabadd samsung in-app purchase service to your app objective learn how to integrate samsung in-app purchase iap service into your app so that users can purchase digital consumable and non-consumable items within the app registered in the galaxy store overview the samsung in-app purchase iap service offers developers a robust solution for handling digital products purchased within mobile apps it ensures a smooth and secure experience when purchasing digital goods or products, managing subscriptions, or dealing with refunds and consumed products the iap sdk makes integrating the iap functionality into your app simple, allowing you to configure iap settings, retrieve product details, offer and sell products, and manage purchased products effortlessly to successfully sell in-app products, follow these four basic steps download and integrate the samsung iap sdk into your application request for commercial seller status in the samsung galaxy store seller portal upload your application’s binary file in the seller portal add in-app products to your app in-app products can be categorized into two types item and subscription item goods and services that charge users on a one-time basis item is a consumable or non-consumable type based on whether it can be repurchased or not subscription a set of benefits that charges users on a recurring basis users can use subscription products as many times as they want during the free trial period or when a paid subscription is active this code lab focuses only on item as the in-app product for more information, go to samsung iap set up your environment you will need the following android studio latest version recommended samsung iap sdk latest version samsung galaxy device android 6 0 or higher samsung galaxy store seller portal commercial seller account sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! in-app purchase turbobike sample code 708 6 kb start your project in android studio, click open to open an existing project locate the downloaded sample project and click ok register the app and its items in the seller portal to register the sample app along with the in-app items in the samsung galaxy store seller portal, follow these steps sign in using your commercial seller account in android studio, modify the package name of the sample app navigate to app > kotlin + java > com example turbobike view, and in the mainactivity java file, refactor the application name turbobike from the package name com example turbobike for all directories notethe package name com example turbobike is already registered in the seller portal to avoid any conflicts, rename it with a different package name build the apk from android studio and upload the binary to the seller portal once the testing process is complete and the app functions smoothly as intended, return to this step and upload the final apk file under the in app purchase tab, add three items named bike, booster, and fuel these are item ids of the in-app items created in the sample app where the bike is a non-consumable item, while both booster and fuel are consumable items refer to the step-by-step guide for detailed instructions lastly, add a licensed tester to enable purchasing within the app edit your seller portal profile and include your samsung account in the license test field on the test device, sign in with the same samsung account initialize the samsung iap sdk before using the samsung iap sdk library, certain configurations are necessary, which are already applied in the sample code provided the samsung-iap-6 5 0 aar library is added to the app > libs folder, and included as a dependency in the module-level build gradle file dependencies { … implementation filetree dir 'libs', include ['* aar'] } these necessary permissions are already added in the androidmanifest xml file com samsung android iap permission billing to connect to iap and enable in-app product registration in seller portal android permission internet because iap uses the internet <uses-permission android name="com samsung android iap permission billing" /> <uses-permission android name="android permission internet" /> go to mainactivity java and in the oncreate function, create an instance of the samsung iap sdk to utilize the functionalities it offers set the operating mode to operation_mode_test to purchase products without payment and enable only licensed testers to test without incurring charges iaphelper = iaphelper getinstance getapplicationcontext ; iaphelper setoperationmode helperdefine operationmode operation_mode_test ; notebefore submitting the app for beta testing or release, change the operating mode to operation_mode_production get the list of all products owned by the user the getownedlist function returns a list of products that the user has previously purchased, including items purchased with a single charge to the user's payment method items are either consumable or non-consumable consumable items that have not yet been used and not yet reported as consumed non-consumable items subscriptions that are in a free trial or an active state call the getownedlist function from the iaphelper class also, check if there are any consumable items in the returned list and call the handleconsumableitems function for each consumable items which handles consumepurchaseitems api for non-consumable items call handlenonconsumableitems function which handle acknowledgepurchases api iaphelper getownedlist iaphelper product_type_all, new ongetownedlistlistener { @override public void ongetownedproducts @nonnull errorvo errorvo, @nonnull arraylist<ownedproductvo> arraylist { if errorvo geterrorcode == iaphelper iap_error_none { for ownedproductvo item arraylist { if item getitemid equals "fuel" || item getitemid equals "booster" { // consume the purchased item handleconsumableitems item getpurchaseid ; } else if item getitemid equals "bike" { helperdefine acknowledgedstatus acknowledgedstatus = item getacknowledgedstatus ; if acknowledgedstatus equals helperdefine acknowledgedstatus not_acknowledged { handlenonconsumableitems item getpurchaseid ; } } } } else { log d "getownedproducts failed ", errorvo tostring ; } } } ; notecall getownedlist whenever launching the application to check for unconsumed items or subscription availability use the acknowledgepurchases api as below iaphelper acknowledgepurchases purchaseid, new onacknowledgepurchaseslistener { @override public void onacknowledgepurchases @nonnull errorvo errorvo, @nonnull arraylist<acknowledgevo> acknowledgedlist { if errorvo geterrorcode == iaphelper iap_error_none { for acknowledgevo item acknowledgedlist { log i "acknowledged purchases ", item getstatusstring ; } } else { log e "acknowledged purchases error ", errorvo geterrorstring ; } } } ; report consumable items as consumed mark the consumable items returned from getownedlist and those successfully purchased with startpayment as consumed by calling the consumepurchaseditems function iaphelper consumepurchaseditems purchaseid, new onconsumepurchaseditemslistener { @override public void onconsumepurchaseditems @nonnull errorvo errorvo, @nonnull arraylist<consumevo> arraylist { if errorvo geterrorcode == iaphelper iap_error_none { toast maketext getapplicationcontext ,"consumed successfully now you can purchase another item ", toast length_short show ; } else { toast maketext getapplicationcontext , "consume failed " + errorvo geterrorstring , toast length_short show ; } } } ; this makes the items available for repurchase, regardless of whether they are used or not in the sample app, consumable items cannot be used and it only stores the total count of the items purchased get item details to retrieve information about some or all in-app products registered to the app, use the getproductsdetails function by specifying an item id such as bike or booster, you can fetch details for a particular in-app item to obtain information about all in-app products available in the seller portal for the user, pass an empty string "" as the argument iaphelper getproductsdetails "bike, booster, fuel", new ongetproductsdetailslistener { @override public void ongetproducts @nonnull errorvo errorvo, @nonnull arraylist<productvo> arraylist { if errorvo geterrorcode == iaphelper iap_error_none { for productvo item arraylist { if item getitemid equals itemid { // set product details value to ui product settext "product name " + item getitemname ; price settext "product price " + item getitempricestring ; currency settext "currency " + item getcurrencycode ; // click continue button to purchase dialogbutton setonclicklistener dialogbtnlistener ; } } } else { toast maketext getapplicationcontext , "getproductdetails failed " + errorvo geterrorstring , toast length_short show ; } } } ; handle item purchase and payment process to initiate a purchase and complete the payment transaction process, use the startpayment function use obfuscatedaccountid and obfuscatedprofileid value is up to 64 bytes to detect fraudulent payments these values are returned in purchasevo the result of the purchase is specified in the onpaymentlistener interface, which includes the detailed purchase information purchasevo in case of a successful transaction if there's an error during the payment process, an error code -1003 indicates that the non-consumable item is already purchased for further information on error responses, refer to the documentation on response codes iaphelper startpayment itemid, obfuscatedaccountid, obfuscatedprofileid, new onpaymentlistener { @override public void onpayment @nonnull errorvo errorvo, @nullable purchasevo purchasevo { if errorvo geterrorcode == iaphelper iap_error_none { log d "purchaseid " , purchasevo getpurchaseid ; // non-consumable item, can purchase single time if itemid equals "bike" { handlenonconsumableitems purchasevo getpurchaseid ; // update ui purchasebikebtn settext "already purchased" ; } // consumable item, can purchase multiple time else if itemid equals "booster" { handleconsumableitems purchasevo getpurchaseid ; // update booster count in ui boostercount+=1; boostercountertv settext "⚡ "+boostercount+" ev" ; }else if itemid equals "fuel" { handleconsumableitems purchasevo getpurchaseid ; // update fuel count in ui fuelcount+=1; fuelcountertv settext "⛽ "+ fuelcount+" ltr" ; } }else { // non-consumable item, already purchase if errorvo geterrorcode == -1003 { purchasebikebtn settext "already purchased" ; } } } } ; upon successfully purchasing a consumable item, the consumepurchaseditems api is called through the handleconsumableitems function for a non-consumable item, the acknowledgepurchases api is called through the handlenonconsumableitems function the total number of purchased boosters and fuel is displayed on the app ui using the boostercountertv settext and fuelcountertv settext methods respectively run the app after building the apk, install the app on a samsung galaxy device test the app by making purchases the turbo bike can only be bought once, while either the booster or fuel can be purchased multiple times after purchasing in-app items, the app shows that the bike has already been purchased along with the number of boosters and fuel bought you're done congratulations! you have successfully achieved the goal of this code lab now, you can integrate samsung iap sdk into your application by yourself! if you are having trouble, you may download this file in-app purchase turbobike complete code 710 1 kb to learn more about developing apps with samsung iap sdk, visit developer samsung com/iap
Learn Code Lab
codelabdevelop a blockchain shopping app objective create a shopping application with samsung blockchain platform sdk and pay using ethereum network overview the blockchain industry is expanding in many ways it is growing the most as a means of payment samsung blockchain platform sdk helps to make payments easily with cryptocurrency you can interact with blockchain through a simple api call to create a transaction in this code lab, you can pay for a product using the ethereum network in a simple shopping app, which is a decentralized application dapp dapps run and store data on the blockchain network instead of a central server for more information, go to samsung blockchain platform sdk set up your environment you will need the following java se development kit 8 or later android studio latest version recommended mobile phone with samsung blockchain sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! shopping app sample code 3 6 mb enable developer mode to activate developer mode on your mobile device, follow the steps below navigate through settings > biometrics and security > samsung blockchain keystore and click about blockchain keystore tap the samsung blockchain keystore app name quickly, ten times or more if succeeded, developer mode will show start your project in android studio, click open to open an existing project locate the downloaded sample project and click ok initialize the instance create an sblockchain instance this is the first step since sblockchain is the initial base class of sdk along with that are hardwarewalletmanager responsible for wallet operations accountmanager responsible for account operations msblockchain = new sblockchain ; msblockchain initialize mcontext ; maccountmanager = msblockchain getaccountmanager ; mhardwarewalletmanager = msblockchain gethardwarewalletmanager ; mcoinnetworkinfo = new coinnetworkinfo cointype eth, ethereumnetworktype sepolia, rpcurl ; connecttokeystore ; connect to samsung blockchain keystore you can get hardware wallet instance from hardwarewalletmanager hardwarewallettype refers to the type of cold wallet to be connected, such as samsung blockchain keystore and ledger nano s mhardwarewalletmanager connect hardwarewallettype samsung, false setcallback new listenablefuturetask callback<hardwarewallet> { @override public void onsuccess hardwarewallet hardwarewallet { handler post new runnable { @override public void run { log i tag,"hardwarewallet is connected successfully" ; mprogressbar setvisibility view invisible ; setaccountstatus ; } } ; } @override public void onfailure @notnull executionexception e { mprogressbar setvisibility view invisible ; e printstacktrace ; } @override public void oncancelled @notnull interruptedexception e { mprogressbar setvisibility view invisible ; e printstacktrace ; } } ; the second parameter of connect api refers to reset if you do not want to reset the wallet then keep it false, otherwise true manage your account now, your shopping dapp is connected to the keystore it means that if you have your own account with balance, you can now buy using ether or eth let's create an ethereum account to be used for payment for generating a new account with samsung blockchain platform sdk you need an instance of the accountmanager from sblockchain accountmanager provides methods for fetching, creating, restoring accounts, and other more once you have an instance of accountmanager, you can call generatenewaccount as shown below it has methods regarding accounts such as get, create, and restore refer to the samsung blockchain platform sdk documentations for more details hardwarewallet connectedhardwarewallet = mhardwarewalletmanager getconnectedhardwarewallet ; if connectedhardwarewallet != null { try { maccountmanager generatenewaccount connectedhardwarewallet, mcoinnetworkinfo get ; } catch interruptedexception e { e printstacktrace ; } catch executionexception e { e printstacktrace ; } } if an account is already created, textview is shown at the top of the app and the create account button is disabled to prevent further account creation list<account> accounts = maccountmanager getaccounts null, cointype eth, ethereumnetworktype sepolia ; if !accounts isempty { methereumaccount = ethereumaccount accounts get accounts size - 1 ; tvaccountstatus settext methereumaccount getaddress ; btncreateaccount setenabled false ; } get instance for ledger service after creating an account, you can use it for payment in your shopping dapp each coin blockchain ledgers has its own system to be stored in blocks samsung blockchain platform sdk provides abstracted api sets to developers for signing and sending supported cryptocurrency transactions over the blockchain network create coinservicefactory and just use any ledger you want in this scenario, use ethereumservice ethereumservice service = ethereumservice coinservicefactory getcoinservice mcontext, mcoinnetworkinfo ; at this point, your shopping dapp is ready to provide payment methods working on ethereum notebefore the next step, you need at least one valid ethereum account show payment sheet when a user selects an item, the app should show the payment screen it must show “who will pay how much amount of ether to whom” in the blockchain world, ethereum ledgers require more information, such as transaction nonce, to record that transaction into ledgers with samsung blockchain platform sdk, developers can do everything needed to show the payment sheet, intent should be created, which is to call the payment activity on click event of product object fill the parameters required and startactivityforresult to show a payment sheet item item = itemlist get position ; biginteger price = ethereumutils convertethtowei item getprice ; hardwarewallet connectedhardwarewallet = mhardwarewalletmanager getconnectedhardwarewallet ; intent intent = service createethereumpaymentsheetactivityintent mcontext, connectedhardwarewallet, ethereumtransactiontype eip1559, methereumaccount, sample_to_adderss, price, null, null ; startactivityforresult intent, 0 ; run the app after building the apk, install the app on a samsung galaxy device from the payment tab, click create account to generate your wallet address copy the generated address you need currency to make any purchases a free faucet site is provided in the webview tab to obtain ether go to the webview tab and log in using your google account enter the copied wallet address and press get 0 05 sepolia eth return to the payment tab and select any product from the list in the payment information screen, select a fee to pay to the ethereum network and click next to proceed confirm the transaction a success toast message will appear upon a successful transaction see the result of transaction if the payment was performed successfully from the payment screen, the result of transaction can be received from onactivityresult if the transaction is performed properly, you can find the result_ok at resultcode from the intent, a txid is shown which can be used to check your transaction's status call gettransactiondetail txid string api method in ethereumservice and check the block# if there's any valid countable number, your transaction is stored in blocks successfully and the payment is done if you can't find it, just wait it's processing among ethereum nodes alternatively, simply find the txid in sepolia testnet explorer you're done! congratulations! you have successfully achieved the goal of this code lab now, you can develop a shopping dapp using samsung blockchain platform sdk by yourself! if you're having trouble, you may download this file shopping app complete code 3 6 mb to learn more about developing apps with samsung blockchain, visit developer samsung com/blockchain
tutorials
blogintroduction smartphones have become an essential part of our everyday lives. users are continually searching for more convenient ways to perform their tasks on their smartphones, driving them toward services with greater usability. as smartphones advance, our lives become simpler. galaxy users have completely embraced the convenience of paying with samsung pay, and no longer carry physical payment cards. this led to the evolution of samsung pay into samsung wallet, incorporating biometric-authentication-based security solutions and adding various features to replace conventional wallets. since june 2022, samsung wallet has been expanding its service area based on the existing samsung pay launching countries. this article aims to introduce samsung wallet and guide you through the integration process of the "add to samsung wallet" feature, which allows you to digitize various content and offer them as wallet cards. notice this article introduces non-payment service cards. if you want to learn more about the payment service of samsung wallet, visit the samsung pay page. you can get information on online payment services such as in-app payments, web checkout, and w3c payments. add to samsung wallet service let's delve deeper into the "add to samsung wallet" feature. digitized content registered in samsung wallet comes in the form of cards called wallet cards. registering a wallet card is effortless: simply click the "add to samsung wallet" button, and the card is stored securely on users’ galaxy smartphones. "add to samsung wallet" button and wallet card notice the benefits of using wallet cards can be found in the commercial video forgetting can be awesome. wallet cards the "add to samsung wallet" service is an open platform that supports offering various types of content such as wallet cards. we are streamlining service integration with content providers across different regions and adding useful features. boarding pass event ticket loyalty gift card coupon id card generic card pay as you go (in progress) reservation (in progress) digital key (in progress) notice generic card supports unstructured forms of cards. be a samsung wallet partner partner onboarding to begin offering content through samsung wallet, you must first register as a partner on the samsung wallet partner portal. the integration process is detailed on the samsung developer portal. to join the samsung wallet partner portal, create a samsung account that is used as the service administrator. wallet card management once enrolled, you can create service cards on the wallet cards menu. each card is assigned a card id representing the service, and you can set the card type and linking information. you can manage cards according to their status – test or live. configuring wallet card notice after completing all required forms for the wallet card, click the launch button to request card activation. before providing the service to actual users, remember to turn off the 'test mode.' how to safely secure user data key generation and certificate request the registration process includes certificate exchange to securely transmit service data. refer to the diagram and developer guide, security key & certificate creation guide, to complete the certificate registration and partner enrollment smoothly. certificates exchange process ensuring data security to prevent forgery and leakage of user card data, secure tokenization processing is required. json web token (jwt), which includes encryption and signature, has a validity time basis for verification, thus providing enhanced security. in particular, when generating this token, the key and certificate previously obtained through the certificate exchange process are used. process of generating and verifying security tokens notice depending on how partners provide content services to users, you can choose how to deliver data to the samsung wallet service. two ways to transfer wallet card data add to samsung wallet interface provides two methods for partners to deliver users digital content as wallet cards. data transmit link the general way to transfer wallet card data is to organize tokenized data in the link attached to the button, and the card data is transmitted to the samsung wallet service when the user clicks the button. as long as samsung wallet support is confirmed, you can generate a link containing the user's card data and configure the "add to samsung wallet" button to run the link when pressed, either on an application or web page. data transmit process data fetch link another method to transfer wallet card data is to include only the refid, which represents the user's content, in the "add to samsung wallet" link and transmit it to the samsung wallet service. when a user clicks the "add to samsung wallet" button, samsung servers refer to the get card data api information set on the wallet card and retrieve user content using the received refid to complete registration. data fetch process this method is suitable for providing user's data through email or mms messages where static links cannot be avoided. there is an option to secure these static links. data fetch process for static links setting up data synchronization on the partner portal, you can set up the wallet card information and configure the server interaction api that the content provider needs to prepare. this api is an interface for managing card registrations, deletions, information, and state changes to sync with those registered on samsung wallet. register wallet cards when a user card is added to samsung wallet, samsung wallet servers use the send card state api to communicate card registration and deletion status to the content provider, allowing them to manage content that needs to be synchronized with samsung wallet. when a wallet card is registered, added event is sent to the partner's server update wallet cards changes to the synchronization target content can be notified to the samsung wallet service through the update notification api. here, the value that distinguishes each piece of content is the refid that the partner must provide when registering the users’ wallet card. through the get card data api, samsung wallet servers can check the latest content information any time. if updates occur on the partner's side, updated event notifications should be sent to the samsung server in case users withdraw content from the partner's side in case users delete cards from samsung wallet notice both servers should verify requests using the authorization header of the api request. this authorization token is in jwt format, familiar from card data security. effortless wallet card registration with just one click this feature is primarily composed of a link-connected button and can be provided through the content provider's application, web page, email, or mms message. various service channels javascript library for web developers we provide a javascript library and a user guide, implement the button, to help integrate your web pages. creating buttons and links in your app for configuring buttons in applications, utilize the button image resources. providing services via mms, email, or qr codes to provide services through fixed links, check out the details of the data fetch link. these static links can also be used by scanning qr codes. experience the service and practice you can experience service integration development using the codelab and use the testing tool to preregister the wallet cards created on the partner portal, which could be helpful. conclusion we've looked at how to provide digital content through the "add to samsung wallet" feature. we continuously update the guides on the developer portal, so please refer to them when preparing for integration. summary the "add to samsung wallet" service welcomes participation from content service partners and developers. for inquiries or technical support, please contact us through the form provided on the developer portal. i hope this post has been helpful, and now i'll conclude my writing here. thank you. this post was written based on the sdc23 korea session.
Choi, Jonghwa
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 class spaysdk java lang object com samsung android sdk samsungpay v2 spaysdk direct known subclasses cardmanager, paymentmanager public abstract class spaysdk extends object this class allows to define samsung pay sdk information, common error codes, and constants since api level 1 1 nested class summary nested classes modifier and type class description static enum spaysdk brand this enumeration provides sdk supported card brands such as american express, mastercard, visa, discover, china unionpay, octopus, eci, pagobancomat, mada and elo static enum spaysdk servicetype this enumeration provides service types partners must set their service type in the partnerinfo when they call any apis static enum spaysdk transactiontype this value is specifically supported for mada tokens and will not apply to other token types field summary fields modifier and type field description static final string common_status_table this table shows the status codes used commonly status bundle keys bundle values spay_not_supported 0 extra_error_reason error_device_not_samsung -350 error_spay_pkg_not_found -351 error_spay_sdk_service_not_available -352 error_device_integrity_check_fail -353 error_spay_app_integrity_check_fail -360 error_android_platform_check_fail -361 spay_not_ready 1 extra_error_reason error_spay_setup_not_completed -356 error_spay_app_need_to_update -357 error_spay_internal -1 extra_error_reason error_server_internal -311 n/a n/a error_not_allowed -6 extra_error_reason error_invalid_parameter -12 error_sdk_not_supported_for_this_region -300 error_service_id_invalid -301 error_service_unavailable_for_this_region -302 error_partner_app_signature_mismatch -303 error_partner_app_version_not_supported -304 error_partner_app_blocked -305 error_user_not_registered_for_debug -306 error_service_not_approved_for_release -307 error_partner_not_approved -308 error_unauthorized_request_type -309 error_expired_or_invalid_debug_key -310 error_missing_information -354 error_unable_to_verify_caller -359 error_invalid_parameter -12 n/a n/a error_no_network -21 n/a n/a error_server_no_response -22 n/a n/a error_partner_info_invalid -99 extra_error_reason error_partner_sdk_api_level -10 error_partner_service_type -11 error_partner_sdk_version_not_allowed -358 error_initiation_fail -103 n/a n/a spay_not_allowed_temporally 3 extra_error_reason error_spay_connected_with_external_display -605 error_spay_fmm_lock -604 n/a n/a paymentmanager error_making_sheet_failed -115 n/a n/a static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard static final string device_id key to represent unique device id static final string device_type_gear device type is gear static final string device_type_phone device type is phone static final int error_android_platform_check_fail this error indicates that android platform version check has failed for in-app payment, the samsung pay sdk requires android 6 0 m android api level 23 or later versions of the android os this is returned as extra_error_reason for spay_not_supported error static final int error_device_integrity_check_fail this error indicates that device integrity check has failed this is returned as extra_error_reason for spay_not_supported error static final int error_device_not_samsung this error indicates that the device is not a samsung device this is returned as extra_error_reason for spay_not_supported error static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired this is returned as extra_error_reason for error_not_allowed error for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed static final int error_initiation_fail this error indicates that session initiation or service binding has failed for example, if the service connection with samsung pay was not successful static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value static final int error_missing_information this error indicates that some information of partner is missing this error code is returned as an extra_error_reason of error_not_allowed error for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network for example, partner app tries to verify with server while network is not connected static final int error_none this error indicates that requested operation is success with no error static final int error_not_allowed this error indicates that requested operation is not allowed for example, partner app verification has failed in samsung pay server static final int error_not_found this error indicates that given card id is not found in samsung pay static final int error_not_supported this error indicates that requested operation is not supported in samsung pay static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is blocked, then the partner app verification will be failed static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if different signature is used for signing apk, the partner app verification will be failed checking signature logic will be activated in case debug mode is "n" static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay this is returned as extra_error_reason for error_not_allowed error for example, if the version registered from developer portal is higher than current version or no any version registered , then the partner app verification will be failed static final int error_partner_info_invalid this error indicates that partner information is invalid for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is submitted but not approved, then the partner app verification will be failed static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid partner must set valid api level in the androidmanifest file static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed this is returned as extra_error_reason for error_partner_info_invalid error static final int error_partner_service_type this error indicates that the service type is invalid partner must set valid service type in partnerinfo when calling apis this is returned as extra_error_reason for spay_not_ready error static final int error_registration_fail this error indicates that the card provisioning has failed static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region this is returned as extra_error_reason for error_not_allowed error for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error this is returned as extra_error_reason for error_spay_internal error for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed static final int error_server_no_response this error indicates that server did not respond to the samsung pay request static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if invalid service id was used in partner app, then the partner app verification will be failed static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is not registered for release mode, then the partner app verification will be failed static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed this is returned as extra_error_reason for spay_not_supported error static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated partner app need to ask user to update samsung pay app static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display due to security reason, samsung pay cannot be launched at this moment in this case, partner can guide user to disconnect any external display if connected static final int error_spay_fmm_lock this error indicates that device is locked due to fmm find my mobile partner app needs to ask user to unlock the samsung pay app static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device this is returned as extra_error_reason for spay_not_supported error this could mean that the device does not support samsung pay static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device this is returned as extra_error_reason for spay_not_supported error static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed partner app need to ask user to set up samsung pay app static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment this is returned as extra_error_reason for error_not_allowed error for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment this is returned as extra_error_reason for error_not_allowed error for example, if the merchant app calls enrollment api, then the partner app verification will be failed static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation for example, user taps the cancel or back key on the payment sheet static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed static final string extra_accept_combo_card key to represent that a merchant accepts combo card partner can use this key to let customers to choose debit/credit in case of combo card static final string extra_card_type key to represent card type the possible values are card card_type_credit_debit card card_type_credit card card_type_debit card card_type_gift card card_type_loyalty card card_type_transit static final string extra_country_code key to represent country code device country code iso 3166-1 alpha-2 static final string extra_cpf_holder_name key to get cpf holder name in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback static final string extra_cpf_number key to get cpf number in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback static final string extra_cryptogram_type key to represent the dsrp digital secure remote payments cryptogram type of mastercard static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not static final string extra_device_type key to represent type of the device mobile or gear static final string extra_error_reason key to represent extra error reasons static final string extra_error_reason_message key to represent extra error reason messages static final string extra_issuer_name key to represent name of the issuer this key can be used in the bundle for partnerinfo string, bundle static final string extra_issuer_pkgname key to represent package name of the issuer app on android static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number dpan static final string extra_last4_fpan key to represent the last four digits of funding personal identification number fpan static final string extra_member_id key to represent member id of the issuer this is for korean issuers only static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service i e static final string extra_online_transaction_type static final string extra_partner_name key to represent name of the partner app this key can be used in the bundle for partnerinfo string, bundle static final string extra_request_id key to represent request id when a request is failed, tr will send this key to partner app static final string extra_require_cpf key to represent that a partner requires cpf partner can use this key to ask samsung pay to show cpf information in the payment sheet static final string extra_resolved_1 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_2 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_3 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_4 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_5 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_6 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string extra_resolved_7 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay static final string partner_service_type key to represent unique service type this key must be set in the bundle for partnerinfo string, bundle static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card this is for korean issuers only static final int spay_not_allowed_temporally samsung pay is not allowed temporally refer extra reason delivered with extra_error_reason static final int spay_not_ready samsung pay is not completely activated usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet in this case, partner app can call samsungpay activatesamsungpay api to launch samsung pay or can call samsungpay gotoupdatepage api to update samsung pay app static final int spay_not_supported samsung pay is not supported on this device usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed static final int spay_ready samsung pay is activated and ready to use usually, this status code is returned after user completes all the mandatory updates and is signed in static final string wallet_dm_id key to represent unique device management id static final string wallet_user_id key to represent user's wallet id method summary all methodsstatic methodsconcrete methods modifier and type method description static int getversioncode returns the version code of the samsung pay sdk static string getversionname returns the version name of the samsung pay sdk methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait field details error_none public static final int error_none this error indicates that requested operation is success with no error see also constant field values error_spay_internal public static final int error_spay_internal this error indicates that internal error has occurred while the requested operation is going on see also constant field values error_not_supported public static final int error_not_supported this error indicates that requested operation is not supported in samsung pay see also constant field values error_not_found public static final int error_not_found this error indicates that given card id is not found in samsung pay see also constant field values error_not_allowed public static final int error_not_allowed this error indicates that requested operation is not allowed for example, partner app verification has failed in samsung pay server see also constant field values error_user_canceled public static final int error_user_canceled this error indicates that user has cancelled before completing the requested operation for example, user taps the cancel or back key on the payment sheet see also constant field values error_partner_sdk_api_level public static final int error_partner_sdk_api_level this error indicates that sdk api level is missing or invalid partner must set valid api level in the androidmanifest file minimum possible version is 1 4 also if the partner set the values defined in higher api level, samsung pay will send this error to partner app this is returned as extra_error_reason for error_partner_info_invalid error since api level 1 4 see also constant field values error_partner_service_type public static final int error_partner_service_type this error indicates that the service type is invalid partner must set valid service type in partnerinfo when calling apis this is returned as extra_error_reason for spay_not_ready error since api level 1 4 see also constant field values error_invalid_parameter public static final int error_invalid_parameter this error indicates that requested operation contains invalid parameter or invalid bundle key/value since api level 2 3 see also constant field values error_no_network public static final int error_no_network this error indicates that samsung pay is unable to connect to the server since there is no network for example, partner app tries to verify with server while network is not connected see also constant field values error_server_no_response public static final int error_server_no_response this error indicates that server did not respond to the samsung pay request see also constant field values error_partner_info_invalid public static final int error_partner_info_invalid this error indicates that partner information is invalid for example, partner app is using sdk version not allowed, invalid service type, wrong api level, and so on since api level 2 5 see also constant field values error_initiation_fail public static final int error_initiation_fail this error indicates that session initiation or service binding has failed for example, if the service connection with samsung pay was not successful see also constant field values error_registration_fail public static final int error_registration_fail this error indicates that the card provisioning has failed since api level 1 2 see also constant field values error_duplicated_sdk_api_called public static final int error_duplicated_sdk_api_called this error indicates that duplicate api called by partner since api level 2 1 see also constant field values error_sdk_not_supported_for_this_region public static final int error_sdk_not_supported_for_this_region this error indicates that the samsung pay sdk is not supported in particular region this is returned as extra_error_reason for error_not_allowed error for example, if the device is from the country that samsung pay sdk is not supported, then the partner app verification will be failed see also constant field values error_service_id_invalid public static final int error_service_id_invalid this error indicates that service id is not registered with the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if invalid service id was used in partner app, then the partner app verification will be failed since api level 2 5 see also constant field values error_service_unavailable_for_this_region public static final int error_service_unavailable_for_this_region this error indicates that sdk support is not available for partner's service in particular region since api level 2 5 see also constant field values error_partner_app_signature_mismatch public static final int error_partner_app_signature_mismatch this error indicates that the app signature is different from the one registered from samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if different signature is used for signing apk, the partner app verification will be failed checking signature logic will be activated in case debug mode is "n" since api level 2 9 see also constant field values error_partner_app_version_not_supported public static final int error_partner_app_version_not_supported this error indicates that app version is not supported by samsung pay this is returned as extra_error_reason for error_not_allowed error for example, if the version registered from developer portal is higher than current version or no any version registered , then the partner app verification will be failed since api level 2 9 see also constant field values error_partner_app_blocked public static final int error_partner_app_blocked this error indicates that partner app version is removed/blocked by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is blocked, then the partner app verification will be failed since api level 2 9 see also constant field values error_user_not_registered_for_debug public static final int error_user_not_registered_for_debug this error indicates that user account is not registered for using debug mode on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is in debug mode but the samsung account is not registered for the debug-api-key, then the partner app verification will be failed see also constant field values error_service_not_approved_for_release public static final int error_service_not_approved_for_release this error indicates that service version is not approved for release by the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is not registered for release mode, then the partner app verification will be failed since api level 2 5 see also constant field values error_partner_not_approved public static final int error_partner_not_approved this error indicates that partner registration is not done on the samsung pay developers this is returned as extra_error_reason for error_not_allowed error for example, if the partner app is submitted but not approved, then the partner app verification will be failed see also constant field values error_unauthorized_request_type public static final int error_unauthorized_request_type this error indicates that the partner is not authorized for this request type such as payment or enrollment this is returned as extra_error_reason for error_not_allowed error for example, if the merchant app calls enrollment api, then the partner app verification will be failed see also constant field values error_expired_or_invalid_debug_key public static final int error_expired_or_invalid_debug_key this error indicates that debug key is invalid or expired this is returned as extra_error_reason for error_not_allowed error for example, if the partner app uses expired debug-api-key, then the partner app verification will be failed see also constant field values error_server_internal public static final int error_server_internal this error indicates that server fails to proceed request due to unknown internal error this is returned as extra_error_reason for error_spay_internal error for example, if the server error occurred while the partner verification is going on, then the partner app verification will be failed since api level 2 5 see also constant field values error_device_not_samsung public static final int error_device_not_samsung this error indicates that the device is not a samsung device this is returned as extra_error_reason for spay_not_supported error see also constant field values error_spay_pkg_not_found public static final int error_spay_pkg_not_found this error indicates that the samsung pay application is not on the device this is returned as extra_error_reason for spay_not_supported error this could mean that the device does not support samsung pay see also constant field values error_spay_sdk_service_not_available public static final int error_spay_sdk_service_not_available this error indicates that sdk service is not available on this device this is returned as extra_error_reason for spay_not_supported error see also constant field values error_device_integrity_check_fail public static final int error_device_integrity_check_fail this error indicates that device integrity check has failed this is returned as extra_error_reason for spay_not_supported error see also constant field values error_spay_app_integrity_check_fail public static final int error_spay_app_integrity_check_fail this error indicates that samsung pay app integrity check has failed this is returned as extra_error_reason for spay_not_supported error see also constant field values error_android_platform_check_fail public static final int error_android_platform_check_fail this error indicates that android platform version check has failed for in-app payment, the samsung pay sdk requires android 6 0 m android api level 23 or later versions of the android os this is returned as extra_error_reason for spay_not_supported error since api level 1 5 see also constant field values error_missing_information public static final int error_missing_information this error indicates that some information of partner is missing this error code is returned as an extra_error_reason of error_not_allowed error for example, if the partner app does not deliver a required information to samsung pay to get the wallet information, then samsung pay will send this error to partner app also if the partner does not define the issuer name in samsung pay developer portal, samsung pay will send this error to partner app see also constant field values error_spay_setup_not_completed public static final int error_spay_setup_not_completed this error indicates that the samsung pay setup was not completed partner app need to ask user to set up samsung pay app if user agrees, call samsungpay activatesamsungpay api this is returned as extra_error_reason for spay_not_ready error see also constant field values error_spay_app_need_to_update public static final int error_spay_app_need_to_update this error indicates that the samsung pay should be updated partner app need to ask user to update samsung pay app if user agrees, call samsungpay gotoupdatepage api this is returned as extra_error_reason for spay_not_ready error since api level 1 1 see also constant field values error_partner_sdk_version_not_allowed public static final int error_partner_sdk_version_not_allowed this error indicates that the partner app is using samsung pay sdk not allowed this is returned as extra_error_reason for error_partner_info_invalid error since api level 2 5 see also constant field values error_unable_to_verify_caller public static final int error_unable_to_verify_caller this error indicates that samsung pay is unable to verify partner app at this moment this is returned as extra_error_reason for error_not_allowed error for example, samsung pay tried to connect to the server and validate partner id, but the device does not have the network connectivity see also constant field values error_spay_fmm_lock public static final int error_spay_fmm_lock this error indicates that device is locked due to fmm find my mobile partner app needs to ask user to unlock the samsung pay app if user agrees, call samsungpay activatesamsungpay to unlock the samsung pay app since api level 2 1 see also samsungpay activatesamsungpay constant field values error_spay_connected_with_external_display public static final int error_spay_connected_with_external_display this error indicates that device is connected with an external display due to security reason, samsung pay cannot be launched at this moment in this case, partner can guide user to disconnect any external display if connected since api level 2 7 see also constant field values spay_not_supported public static final int spay_not_supported samsung pay is not supported on this device usually, this status code is returned if the device is not compatible to run samsung pay or if the samsung pay app is not installed since api level 1 1 see also constant field values spay_not_ready public static final int spay_not_ready samsung pay is not completely activated usually, this status code is returned if the user did not complete the mandatory update or if the user is not signed in with the samsung account yet in this case, partner app can call samsungpay activatesamsungpay api to launch samsung pay or can call samsungpay gotoupdatepage api to update samsung pay app since api level 1 1 see also constant field values spay_ready public static final int spay_ready samsung pay is activated and ready to use usually, this status code is returned after user completes all the mandatory updates and is signed in since api level 1 1 see also constant field values spay_not_allowed_temporally public static final int spay_not_allowed_temporally samsung pay is not allowed temporally refer extra reason delivered with extra_error_reason since api level 2 7 see also constant field values spay_has_transit_card public static final int spay_has_transit_card this code is returned if samsung pay has a registered transit card this is for korean issuers only since api level 2 8 see also constant field values spay_has_no_transit_card public static final int spay_has_no_transit_card this code is returned if samsung pay doesn't have a registered transit card this is for korean issuers only since api level 2 8 see also constant field values device_type_phone public static final string device_type_phone device type is phone since api level 1 1 see also constant field values device_type_gear public static final string device_type_gear device type is gear since api level 1 1 see also constant field values extra_last4_dpan public static final string extra_last4_dpan key to represent the last four digits of digitalized personal identification number dpan since api level 1 1 see also constant field values extra_last4_fpan public static final string extra_last4_fpan key to represent the last four digits of funding personal identification number fpan since api level 1 1 see also constant field values extra_issuer_name public static final string extra_issuer_name key to represent name of the issuer this key can be used in the bundle for partnerinfo string, bundle since api level 1 1 see also constant field values extra_issuer_pkgname public static final string extra_issuer_pkgname key to represent package name of the issuer app on android since api level 1 1 see also constant field values extra_partner_name public static final string extra_partner_name key to represent name of the partner app this key can be used in the bundle for partnerinfo string, bundle since api level 2 6 see also constant field values extra_error_reason public static final string extra_error_reason key to represent extra error reasons since api level 1 1 see also constant field values extra_error_reason_message public static final string extra_error_reason_message key to represent extra error reason messages since api level 2 9 see also constant field values extra_card_type public static final string extra_card_type key to represent card type the possible values are card card_type_credit_debit card card_type_credit card card_type_debit card card_type_gift card card_type_loyalty card card_type_transit since api level 1 1 see also constant field values extra_device_type public static final string extra_device_type key to represent type of the device mobile or gear the possible values are device_type_phone device_type_gear since api level 1 1 see also constant field values extra_member_id public static final string extra_member_id key to represent member id of the issuer this is for korean issuers only since api level 1 1 see also constant field values extra_country_code public static final string extra_country_code key to represent country code device country code iso 3166-1 alpha-2 since api level 1 1 see also constant field values extra_device_card_limit_reached public static final string extra_device_card_limit_reached key to represent the maximum registered card number has reached or not since api level 1 1 see also constant field values extra_cryptogram_type public static final string extra_cryptogram_type key to represent the dsrp digital secure remote payments cryptogram type of mastercard cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo since api level 2 4 see also constant field values extra_resolved_1 public static final string extra_resolved_1 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_2 public static final string extra_resolved_2 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_3 public static final string extra_resolved_3 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_4 public static final string extra_resolved_4 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_5 public static final string extra_resolved_5 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_6 public static final string extra_resolved_6 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_resolved_7 public static final string extra_resolved_7 key to represent additional data partner can use this key to put tagged data to a bundle before sending to samsung pay since api level 2 4 see also constant field values extra_request_id public static final string extra_request_id key to represent request id when a request is failed, tr will send this key to partner app request id would be helpful for debugging a failed request between partner and tr since api level 2 5 see also constant field values cryptogram_type_ucaf public static final string cryptogram_type_ucaf key to represent the ucaf cryptogram type of mastercard ucaf cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo ucaf is a default cryptogram type if not specified in the extrapaymentinfo bundle since api level 2 4 see also constant field values cryptogram_type_icc public static final string cryptogram_type_icc key to represent the icc cryptogram type of mastercard icc cryptogram type is supported by mastercard only, can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo since api level 2 4 see also constant field values extra_accept_combo_card public static final string extra_accept_combo_card key to represent that a merchant accepts combo card partner can use this key to let customers to choose debit/credit in case of combo card it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo the possible value is the boolean since api level 2 9 see also constant field values extra_require_cpf public static final string extra_require_cpf key to represent that a partner requires cpf partner can use this key to ask samsung pay to show cpf information in the payment sheet it can be put as an optional value in extrapaymentinfo of customsheetpaymentinfo the possible value is the boolean this is for brazil partners only since api level 2 11 see also constant field values extra_cpf_holder_name public static final string extra_cpf_holder_name key to get cpf holder name in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback since api level 2 11 see also constant field values extra_cpf_number public static final string extra_cpf_number key to get cpf number in extra payment data when partner requests cpf by extra_require_cpf key, the samsung pay would bundle cpf information in the extrapaymentdata parameter of paymentmanager customsheettransactioninfolistener onsuccess com samsung android sdk samsungpay v2 payment customsheetpaymentinfo, java lang string, android os bundle callback since api level 2 11 see also constant field values extra_merchant_ref_id public static final string extra_merchant_ref_id key to set/get merchant reference id beyond marketplace app or service i e bixby when marketplace apps request in-app payment, they can set merchant reference id so that samsung pay app can get detail information about the merchant using the id since api level 2 11 see also constant field values extra_online_transaction_type public static final string extra_online_transaction_type see also constant field values wallet_user_id public static final string wallet_user_id key to represent user's wallet id since api level 1 2 see also constant field values device_id public static final string device_id key to represent unique device id since api level 1 2 see also constant field values wallet_dm_id public static final string wallet_dm_id key to represent unique device management id since api level 1 2 see also constant field values partner_service_type public static final string partner_service_type key to represent unique service type this key must be set in the bundle for partnerinfo string, bundle since api level 1 4 see also constant field values common_status_table public static final string common_status_table this table shows the status codes used commonly status bundle keys bundle values spay_not_supported 0 extra_error_reason error_device_not_samsung -350 error_spay_pkg_not_found -351 error_spay_sdk_service_not_available -352 error_device_integrity_check_fail -353 error_spay_app_integrity_check_fail -360 error_android_platform_check_fail -361 spay_not_ready 1 extra_error_reason error_spay_setup_not_completed -356 error_spay_app_need_to_update -357 error_spay_internal -1 extra_error_reason error_server_internal -311 n/a n/a error_not_allowed -6 extra_error_reason error_invalid_parameter -12 error_sdk_not_supported_for_this_region -300 error_service_id_invalid -301 error_service_unavailable_for_this_region -302 error_partner_app_signature_mismatch -303 error_partner_app_version_not_supported -304 error_partner_app_blocked -305 error_user_not_registered_for_debug -306 error_service_not_approved_for_release -307 error_partner_not_approved -308 error_unauthorized_request_type -309 error_expired_or_invalid_debug_key -310 error_missing_information -354 error_unable_to_verify_caller -359 error_invalid_parameter -12 n/a n/a error_no_network -21 n/a n/a error_server_no_response -22 n/a n/a error_partner_info_invalid -99 extra_error_reason error_partner_sdk_api_level -10 error_partner_service_type -11 error_partner_sdk_version_not_allowed -358 error_initiation_fail -103 n/a n/a spay_not_allowed_temporally 3 extra_error_reason error_spay_connected_with_external_display -605 error_spay_fmm_lock -604 n/a n/a paymentmanager error_making_sheet_failed -115 n/a n/a see also constant field values method details getversioncode public static int getversioncode returns the version code of the samsung pay sdk returns sdk version code since api level 1 1 getversionname @nonnull public static string getversionname returns the version name of the samsung pay sdk returns sdk version name since api level 1 1 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
webinar game, mobile
eventscontinuing our webinar series for game developers, join this samsung developer program online talk and learn how to integrate the samsung in-app purchase (iap) sdk in your unity games. the galaxy store is a premium store to make galaxy phones come alive in their own, unique way. discover how to use samsung’s payment service that makes it possible to sell a variety of items in applications for the galaxy store. at the end of this talk you will have the knowledge to modify your unity games and have a new way to monetize them, whether it is with one-off payments or subscriptions. additionally, we will check the samsung iap unity plugin’s methods and functionalities, facilitating a rapid integration with your existing games.
Learn Code Lab
codelabcreate an android automotive operating system aaos app with payments via samsung checkout objective create a shopping app for android automotive os aaos , which uses templates from aaos and ignite store, and processes payments via the ignite payment sdk powered by samsung checkout partnership request to use the ignite payment sdk and have access to development tools and resources, such as ignite aaos emulators, you must become an official partner once done, you can fully utilize this code lab you can learn more about the partnership process by visiting the ignite store developer portal overview android automotive os android automotive os aaos is a base android platform that runs directly on the car and is deeply integrated with the underlying vehicle hardware unlike the android auto platform, users can download compatible apps with aaos directly into their cars, without needing a phone, and utilize an interface specifically designed for the car screen aaos can run both system and third-party android applications as aaos is not a fork and shares the same codebase as android for mobile devices, developers can easily adapt existing smartphone apps to function on aaos the diagram below illustrates the architecture of aaos at the hardware abstraction layer hal level, aaos incorporates additional components such as the vehicle hal vhal , exterior view system evs , and broadcast radio br to handle vehicle properties and connectivity at the framework level, car service and webview modules are included at the application level, the main system applications include car system ui, car launcher, and car input method editor ime additionally, car media and automotive host are incorporated as system apps third-party apps are classified into three categories audio media, car templated, and parked car templates the car templated apps use templates specified by the car app library, which are rendered by the automotive host, customized by original equipment manufacturers oem the library consists of approximately 10 templates list, grid, message, pane, navigation and is utilized in both android auto aa and android automotive os aaos apps to target aaos, you must incorporate an additional app-automotive library that injects the carappactivity into the app the carappactivity needs to be included in the manifest and can be set as distractionoptimized upon launching the application, the carappactivity provides a surface that is employed by the automotive host to render the template models additionally, on the harman ignite store, you can optionally integrate the ignite-car-app-lib, which adds supplementary templates such as explore, listdetails, routeoverview, and poistreaming harman ignite store the harman ignite store is a white-labeled and modular aaos-based automotive app store by connecting app developers with car manufacturers, harman creates unique in-vehicle experiences the ignite store has a rich app ecosystem with unique content, growth opportunities, and long-term partnerships it facilitates future-proof monetization with a payments api powered by samsung checkout after registering at the ignite store developer portal, developers can submit their apps for certification and testing by harman upon approval from the oem, the developer can proceed with publishing their app comprehensive developer documentation and tools are available to support app developers throughout the development process payments api the ignite store comes enabled with payment features empowering developers to monetize their apps developers are now able to offer their apps as paid apps the payment sdk exposes apis for goods and services, in-app purchases, and subscriptions developers can also integrate their own payment service providers psps , to sell goods or services, and receive the money directly in their bank account for a frictionless in-car payment experience, ignite provides a dedicated digital wallet app for end-users to securely store their credit card information the payment processor is powered by the industry proven samsung checkout the developer portal provides additional documentation to allow developers to access ignite aaos emulators, vim3, tablet or cuttlefish ignite images, and additional guidelines set up your environment you will need the following ignite aaos system image running on android emulator or on reference devices android studio latest version recommended java se development kit jdk 11 or later sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! aaos ignite shopping app sample code 11 7 mb prepare your ignite aaos emulator add the ignite aaos emulator to your android studio by following the guide provided in the ignite store developer console open the device manager and start the emulator configure the emulator to use fake data for payments, as instructed in the ignite store developer console under the offline mode tab in the payment sdk section the sample app requires navigation from point a starting location to point b destination location the destination addresses are predefined and near san jose mcenery convention center to shorten the distance between two locations, follow the steps below to set the starting location a open the extended controls in the emulator panel b go to location, search for a location near the destination location, and click set location next, in the emulator, go to the ignite navigation app's settings and enable the following enable navigation simulation enable mock location provider go to settings > system > developer options > location and set ignite navigation as mock location app start your project after downloading the sample code containing the project files, open your android studio and click open to open an existing project locate the downloaded android project igniteautomotivepaymentssdc202488 from the directory and click ok check the ignite payment sdk dependency verify that the ignite payment sdk library is included in the dependencies section of the module's build gradle file dependencies { implementation files 'libs/ignite-payment-sdk-3 13 0 24030417-0-snapshot aar' } add payment permission next, go to the manifests folder and, in the androidmanifest xml file, include the payment_request permission to perform in-app purchases <uses-permission android name="com harman ignite permission payment_request" /> this ensures that the app has the necessary permissions to perform transactions and handle sensitive financial data show the payment screen when an item is added to the cart, the shopping cart screen displays the select store button, selected pickup store address, total amount to pay, and details of each item added the screen also includes the pay button go to kotlin + java > com harman ignite pickupstore > screens > shoppingcartscreen kt in the docheckout function, use the car app's screenmanager to navigate to the payment screen from the shopping cart screen after clicking the pay button getscreenmanager push paymentscreen carcontext, session notethe screenmanager class provides a screen stack you can use to push screens that can be popped automatically when the user selects a back button in the car screen or uses the hardware back button available in some cars instantiate the ignite payment client the ignite payment api provides a singleton class called ignitepaymentclientsingleton, which enables performing and tracking transactions navigate to the paymentscreen kt file and instantiate the ignite payment client private val mipc = ignitepaymentclientsingleton getinstance carcontext define the ignite payment transaction callback the ignite payment transaction provides three callback methods onsuccess, oncanceled, and onfailure after each callback, make sure to set the ispaymentfailed variable to track whether a payment is successful or not update the session which owns the shopping cart screen to reflect the status of the payment transaction call the updatetemplate function to invalidate the current template and create a new one with updated information private val mipctcb = object iignitepaymentclienttransactioncallback { override fun onsuccess requestuuid string?, sessionid string?, successmessage string?, paymentadditionalproperties hashmap<string, string>? { log d tag, log_prefix + "onsuccess rid $requestuuid, sid $sessionid, sm $successmessage" cartoast maketext carcontext, "payment successful", cartoast length_short show ispaymentfailed = false session paymentdone requestuuid, sessionid, successmessage updatetemplate } override fun oncanceled requestuuid string?, sessionid string? { log d tag, log_prefix + "oncanceled rid $requestuuid, sid $sessionid" cartoast maketext carcontext, "payment canceled", cartoast length_long show ispaymentfailed = true session paymenterror requestuuid, sessionid, null updatetemplate } override fun onfailure requestuuid string?, sessionid string?, wallererrorcode int, errormessage string { log d tag, log_prefix + "onfailure rid $requestuuid, sid $sessionid, wec $wallererrorcode, em $errormessage" cartoast maketext carcontext, "payment failed", cartoast length_long show ispaymentfailed = true session paymenterror requestuuid, sessionid, errormessage updatetemplate } } define the ignite payment client connection callback the ignite payment client needs to be connected in order to perform a payment request once the client connects successfully, retrieve the names of the shopping cart items and use them to create an order summary afterwards, construct an ignite payment request containing the total amount, currency code, merchant id, and details of the order summary then, initiate the payment process by invoking the readytopay function of the ignite payment client api private val mipccb = iignitepaymentclientconnectioncallback { connected -> log d tag, log_prefix + "onpaymentclientconnected $connected" if connected { val textsummary = session shoppingcart cartitems jointostring ", " { item -> item name } val ipr = ignitepaymentrequest builder setamount session shoppingcart gettotal * 100 setcurrencycode currencycode usd setpaymentoperation paymentoperation purchase setmerchantid constants merchant_id setordersummary ordersummary builder setordersummarybitmapimage bitmapfactory decoderesource carcontext resources, session shoppingcart store largeicon setordersummarylabel1 "${carcontext getstring r string pickupstore_app_title } ${session shoppingcart store title}" setordersummarysublabel1 session shoppingcart store address setordersummarylabel2 textsummary setordersummarysublabel2 carcontext getstring r string pickupstore_payment_sublabel2 build build try { mipc readytopay ipr, mipctcb } catch e exception { log d tag, log_prefix + "payment exception $e" e printstacktrace } catch e error { log d tag, log_prefix + "payment error $e" e printstacktrace } } } start the payment process and go back to previous screen after the transaction next, in the startpayment function, connect the ignite payment client and the connection callback to start the payment process mipc connect mipccb after the transaction is completed, the updatetemplate function refreshes the template used in the payment screen before calling the schedulegoback function modify the schedulegoback function to navigate back to the previous template screen shopping cart you can use the pop method of the screenmanager screenmanager pop start the navigation to the store to collect the paid pickup the shopping cart screen shows the pickup store location, details of the order, and go to store button after a successful payment go to kotlin + java > com harman ignite pickupstore > pickupstoresession kt modify the navigatetostore geofence geofence function to trigger the navigation to the pickup store when the go to store button is clicked you can use the intent carcontext action_navigate with geo schema rfc 5879 data, containing latitude and longitude e g , geo 12 345, 14 8767 to send the intent, use the carcontext startcarapp api call val geouristring = "geo ${geofence latitude},${geofence longitude}" val uri = uri parse geouristring val navintent = intent carcontext action_navigate, uri try { carcontext startcarapp navintent } catch e exception { log e tag, log_prefix + "navigatetostore exception starting navigation" e printstacktrace cartoast maketext carcontext, "failure starting navigation", cartoast length_short show } run the app on ignite aaos emulator run the pickup-store-app on ignite aaos emulator when the app starts for the first time, it requests for user permissions click grant permissions choose allow all the time for location permission and click the return button 4 browse the pickup store catalog and add items to shopping cart open the shopping cart and click pay you can also change the pickup store by clicking select store check the order summary and billing information then, click confirm and pay to process payment after a successful payment, the app returns to shopping cart screen with the updated transaction information click go to store to start the navigation to the store the app displays a notification when the car is near the store click the notification to show a reference qr code to present to the store upon pick up you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can create an aaos templated app, which supports payments by yourself! if you're having trouble, you may download this file aaos ignite shopping app complete code 11 7 mb learn more by going to the developer console section of the ignite store developer portal
Develop Samsung IAP
docsamsung iap orders api the samsung in-app purchase iap orders api is used to view all payments and refunds on a specific date before you can start using the iap orders api, you must meet all requirements and use the required authorization header parameters in your requests see get started with the iap apis for more information view payments and refunds view all payments and refunds on a specific date request post /iap/seller/orders name type description sellerseq string required your seller deeplink in seller portal, a 12-digit number to find your seller deeplink, log in to seller portal and go to profile > information for seller page packagename string optional the package name of the app for which you want to view payment and refund data if no packagename is specified, data is returned for all apps to find an app's package name, log in to seller portal, go to apps, select the app, open the binary tab, and click the file name requestdate string optional the specific day for which you want to view payments and refunds if no date is specified, yesterday's date is used format yyyymmdd continuationtoken string optional request the next page of payment/refund data a page contains up to 100 products if a continuationtoken is not specified, the first page of data is displayed if more than one page of data is available, the response includes a continuationtoken use this token to request the next page of data if the continuationtoken returned in the response is null, this means the previous page of data is the last page to contain product information curl \ -x post \ -h "content-type application/json" \ -h "authorization bearer <your-access-token>" \ -h "service-account-id <your-service-account-id>" \ -d '{"sellerseq" "000123456789","packagename" "com samsung android sample","requestdate" "20230615","continuationtoken" "e5ec039730164c50277f9a231b74c1b6e035d9184160d8b3d6b3de1f62691328fbe4c0c4863da52b3bcecef44a4c7acb974c674728c3cb173cb339bd41783f2c"}' \ "https //devapi samsungapps com/iap/seller/orders" use cases parameters included data retrieved sellerseq yesterday's payments and refunds for all apps sellerseq, packagename yesterday's payments and refunds for the specified app sellerseq, requestdate payments and refunds for all apps for the specified date sellerseq, packagename, requestdate payments and refunds for the specified app and the specified date response parameters name type description continuationtoken string if more than 1 page of data 100 products is available to view, a continuationtoken is sent in order to request and view the next page of data if the continuationtoken is null, this means the previous page of data is the last page to contain product information orderid string unique identifier assigned to the purchase receipt purchaseid string unique identifier of the in-app product purchase transaction contentid string content id of the application registered in seller portal countryid string three-character country code iso 3166 of the country where the product is sold packagename string package name of the application registered in seller portal itemid string unique identifier of the in-app product registered in seller portal itemtitle string title of the in-app product registered in seller portal status string order status 2 payment successfully completed3 payment canceled refund if you want to test the "payment canceled" status, contact customer support at seller portal > help > contact us > contact us at the customer center include the orderid of the purchase so that we can change the order status to "payment canceled " ordertime datetime timestamp utc when the order was requested completiontime datetime timestamp utc when the payment was successfully completed refundtime datetime timestamp utc when the payment was canceled by the admin localcurrency string currency symbol of the country's currency where the product was purchased for example, $ localcurrencycode string three-character currency code iso 4217 of the country's currency where the product was purchased for example, eur, gbp, usd localprice string price of the product in the country where the product was purchased usdprice string price in u s dollars usd exchangerate string usd exchange rate at the time of purchase mcc string sim card country code subscriptionorderid string if the purchased product is a subscription, the origin order id of the subscription freetrialyn string if the subscription is purchased during a free trial period y the subscription was purchased during a free trial period n the subscription was not purchased during a free trial period tieredsubscriptionyn string if the subscription is purchased as a lower-tier/introductory or regular-tier/regular subscription y the subscription was purchased as a lower-tier or introductory subscription n the subscription was purchased as a regular-tier or regular subscription { "continuationtoken" "5b5496f44417c9f6b42c8768cbd3f5b5621cdd4021308af81c1e49b77602e9074ab", "orderitemlist" [ { "orderid" "s20230210kr01922227", "purchaseid" "a778b928b32ed0871958e8bcfb757e54f0bc894fa8df7dd8dbb553c81b048343", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, { "orderid" "s20230210kr01922227", "purchaseid" "90a5df78f7815623eb34f567eb0413fb0209bb04dad1367d7877edfa136321", "contentid" "000005059222", "countryid" "usa", "packagename" "com samsung android sample" }, ] } see failure response codes for a list of possible response codes when a request fails failure response codes the following are response codes you may see when the request fails status code and message 400bad request slr_4001 seller is not matchedslr_4009 continuation token is invalidslr_4010 decrypted continuation token consists of invalid data typeslr_4011 date format is invalid use the format yyyymmdd 401unauthorized slr_4008 failed to verify gateway server authorization
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.
You have successfully updated your cookie preferences.