Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Filter
Develop Samsung IAP
docgrace period a grace period is the time given to a subscriber to update their payment method if there is an issue with it during an automatic renewal if the subscriber's automatic renewal payment fails, galaxy store automatically attempts another payment transaction after 24 hours additionally, you can extend this grace period to beyond 24 hours a grace period allows the subscriber time to update their payment method, increasing overall stability of auto-renewal and minimizing cancellations subscriptions remain active during a grace period if the subscriber's automatic renewal payment succeeds during the grace period, automatic payments continue on the same renewal date the renewal date is not reset and the payment cycle remains the same when the grace period ends and the subscriber's final automatic renewal payment attempt fails, the subscription is cancelled there are two types of grace periods silent seller-defined silent grace period the silent grace period is the minimum amount of time galaxy store waits before attempting another payment transaction after the initial automatic renewal payment transaction failed the default time is 24 hours and cannot be changed during the silent grace period, instant server notifications are not sent the silent grace period is automatically applied to all automatic renewals that initially fail and cannot be disabled if the seller-defined grace period is set to none and the payment transaction attempt fails after the silent grace period, the subscription is automatically cancelled seller-defined grace period the seller-defined grace period is the additional amount of time you can give the subscriber to update their payment method when there is an issue with it during an automatic renewal the seller-defined grace period is set in seller portal for any subscription and is simply referred to as "grace period" in seller portal you can choose an additional 3, 7, 14, or 30-day grace period for your subscription however, this grace period must be equal to or shorter than the subscription's payment cycle galaxy store attempts a payment transaction once a day during this grace period if you change the grace period, any subscriptions already in a seller-defined grace period are not impacted that is, if you change the grace period from 14 to 7 days, any user whose subscription is currently in a seller-defined grace period still has 14 days to update their payment method when a subscription enters the seller-defined grace period, galaxy store sends a notice to the user about payment failure through email and app notifications asking them to change their payment method additionally, if you have configured the samsung in-app purchase instant server notification isn service, galaxy store sends you a notification with the grace period status ars_in_grace_period and data claim you can use this information to send your own email or notification and encourage the user to update their payment method to prevent cancellation of the subscription and include the deep link to the subscription detail page so they can quickly and easily update their payment method examples the following are examples of the events that occur during the grace period the user subscribes to a subscription on jan 15 it is a monthly subscription with a monthly payment cycle the seller-defined grace period is set to 7 days the automatic renewal fails on feb 15 after the 1-day silent grace period, an email and app notification is sent to the user asking them to update their payment method and an isn is sent to the seller if the isn service has been configured monthly subscription, payment method updated the user updates their payment method during the seller-defined grace period and the automatic renewal payment is successful monthly subscription, payment method not updated the user does not update their payment method, all automatic renewal payment attempts fail, and the subscription is cancelled
Develop Samsung IAP
docsubscription guide the samsung in-app purchase iap subscription guide explains the pricing options of subscriptions configured in seller portal and the api calls used to manage subscriptions what is a subscription? a subscription is a type of in-app product that is offered through your app in galaxy store when a user purchases the subscription, the subscription can be used for a specified amount of time called a subscription period or payment cycle when the subscription period ends, the subscription is automatically renewed that is, the subscription can again be used for another subscription period and the user is automatically billed the subscription price additionally, a grace period for subscribers can be set for automatic renewals if there is an issue with their payment method a grace period gives the subscriber time to update their payment method before the subscription is cancelled a subscription can be any kind of content such as an e-zine or app game board the user can cancel the subscription at any time the user pays for a subscription by credit card, samsung pay, phone bill, or paypal rewards points or other non-monetary discount methods cannot be used for the purchase or auto-payment of subscriptions the samsung iap payment system manages the sale of subscriptions after your app is published in galaxy store notein compliance with a regulation issued by the reserve bank of india, customers in india must consent to renew a subscription at the end of a subscription period auto-recurring automatically renewed subscriptions are not allowed if you are using samsung iap, your subscription customers in india will automatically receive an email notification to renew their subscription this email notification is sent seven 7 days before the end of the subscription period and describes the steps required by the customer to renew their subscription if you are using another payment service provider for your subscription, you must consult with this payment service provider about the changes you need to make to comply with the regulation consider using samsung iap instead so that we can help you comply with this regulation
Develop Samsung IAP
doctest guide 1 overview samsung in-app purchase iap supports your app iap-integration and in-app product development testing of in-app product offering, purchase, and payment functionality before you submit your apps and in-app products consumable and non-consumable items and subscriptions to validation testing and normal publication in galaxy store iap testing of in-app product offerings when your app gets and presents current product prices and details to app users is the same as for normal publication iap testing of in-app product purchase and payment is the same as for normal publication except for subscription testing changes, and some testers get products for free 2 iap test environment determine the iap tests and type of purchase and payment transactions to test products with in your app code, set the iap operating mode indicated below in the seller portal register your app and in-app products, set up closed beta testing if used , and set the app status indicated below iap test transactions iap operating mode app status always successful side load no charge operation_mode_test registering always fail side load no charge operation_mode_test_failure registering production closed beta no charge or charge depends on type of tester operation_mode_production beta deployed cautiondo not test when the iap operating mode is operation_mode_production and the app status is registering iap functionality is not supported under these conditions 2 1 iap test transaction types iap testing supports no charge and charge transactions for product purchases 1 no charge transactions product payments are not reported to the payment gateway pg card company or payment agency for successful transactions, purchase emails, with amounts, are sent to testers in the product purchase ui popup, the sandbox icon is displayed details depend on the iap test environment and type of tester iap operating mode tester type details operation_mode_test license tester testers always get purchased products - iap always reports successful purchases for non-consumable items, the purchase record is initialized every 10 minutes to allow repurchase for subscriptions, the subscription cycle is automatically renewed every 10 minutes and the subscription is automatically canceled after 12 renewals operation_mode_test_failure all types testers never get purchased products - iap always reports failed purchases operation_mode_production all types for successful purchases, testers get products - iap reports success 2 charge transactions for successful transactions, product payments are reported to and authorized by the payment gateway pg card company or payment agency , and iap reports purchase amounts only occurs for beta test with operation_mode_production and non-license tester for successful purchases, testers get products and are charged, and iap reports successful purchases 2 2 license tester a license tester can purchase in-app products without charge in operation_mode_test mode or closed beta test to be a license tester, testers must be registered as a license tester in the seller's seller portal profile for a closed beta test, license tester can also be added from the binary tab 3 iap testing when creating tests of your app, in-app products, and samsung iap, the iap tests are guidelines for test setup and initiating and verifying iap functionality you can test your app and in-app products with one or more iap tests 3 1 preparation for all iap tests, prepare your testers, app, and in-app products ensure each tester has a valid credit card for payment side load tester and license tester credit cards are not billed for any product purchases non-license tester credit cards are billed for all product purchases in your app code set the iap operating mode for the selected iap test iaphelper setoperationmode helperdefine operationmode [iap operating mode for the selected test] build the app apk for details, see the programmingguide in the samsung galaxy store seller portal register the app and in-app products set the app status for the selected iap test 3 2 test type 1 always successful side load test purpose and use test offerings, purchases, and payments of all products test subscriptions at iap test periods commonly used during app, in-app product, and iap integration development prepare the app and in-app products for testing iap operating mode is set to operation_mode_test install the app on a test device by an independent method such as side loading test product offering and purchase a testers always get purchased products and are not charged b iap reports all purchases as successful and the purchase amounts test subscriptions 2 always fail side load test purpose and use test offerings and failed purchases and payments of all products commonly used during app, in-app product, and iap integration development prepare the app and in-app products for testing iap operating mode is set to operation_mode_test_failure install the app on a test device by an independent method such as side loading test product offering and purchase a testers always do not get products and are not charged b iap reports all product purchases and payments as failed 3 closed beta test caution apps deployed for beta testing must only be installed using the beta testing url if sideloaded, product information is not accessible if the beta test app is updated and a newer version is deployed, testers must delete the earlier beta test app from their device and re-install the app purpose and use all beta testers can test offerings, and successful and failed purchases and payments of all products consumable items, nonconsumable items, and subscriptions non-license testers test subscriptions at registered subscription periods license testers test subscriptions at iap test periods commonly used to test initial versions and update versions of apps and their products as a last development phase before normal publication notethe following steps are used for beta test setup and testing to be performed by the same person typically, a beta test conductor sets up a beta test to be run by many beta testers if the app was previously side loaded onto the test device, uninstall the app prepare the app and in-app products for testing iap operating mode is set to operation_mode_production in seller portal a register the app and its products for details, see the app registration guide and in-app purchase guide b set up the closed beta test in the binary tab of the seller portal app registration, register all testers license and non-license and the feedback channel for the closed beta test c submit the app and its products for beta release by clicking submit beta test for more details, see the app registration guide on each beta tester’s device, download the beta app from a beta test url test product offering and purchase non-license testers can get purchased products and are charged registered subscription periods apply to subscriptions license testers can get purchased products and are not charged iap test periods apply to subscriptions iap reports successful and failed transactions, and actual product purchase amounts for successful transactions 6 test purchased subscriptions 3 3 testing product offering and purchase the following steps can be run for each tested in-app product test in-app product offering a in the app, initiate the display of the current price and details for each product b verify that product information matches the price and details registered in seller portal test in-app product purchase a in the app, initiate the purchase of an in-app product b for license testers, click ok c for always successful side load and always fail side load testers, click continue d in the purchase popup no charge transactions charge transactions 1 verify the product details match those registered in seller portal noteproduct coupons, free trial periods, lower-tier prices, and auto payment due dates are displayed but do not apply during iap testing 2 select payment method and verify payment information is correct 3 select ‘point and coupons’ and verify displayed information is correct 4 click the [item purchase button] e verify the following noteiap test preparation sets whether or not payment-complete or payment-failed messages are displayed test descriptions always success side load testing a payment-complete message is displayed when configured - the purchased product is added to your account - a product purchased email is sent to you always fail side load testing a payment-failed message is displayed when configured - the in-app product is not added to your account production closed beta testing for successful purchases - a payment-complete message is displayed when configured - the purchased product is added to your account - a product purchased email is sent to you - if you are a non-license tester, you are charged - if you are a license tester, you are not charged for failed purchased - a payment-failed message is displayed when configured - the in-app product is not added to your account - you are not charged 3 4 testing subscriptions for auto-recurring subscriptions ars , you can test their offering, purchase, free trials, lower and regular tier pricing, automatic payments, manual subscription cancellation, and repurchase noteeach subscription can have 1 free trial period optional , 1 to 100 lower-tier price periods optional , and regular-tier price periods required, but they can be canceled at any time by testers, or are automatically canceled after 12 periods when iap test periods apply depending on the iap test environment, free trial and subscription periods end after either registered subscription periods free trial and subscription periods end as specified in the subscription’s seller portal registration, which can be weeks, months, or years apply during production closed beta tests for non-license testers iap test periods free trial and subscription periods end every 10 minutes on the hour at hh 10, hh 20, hh 30, … the first period after purchase or repurchase ends at the next 10-minute time for example, if a subscription with a free trial is first purchased at 11 08, free trial ends at 11 10 apply during always successful side-load tests for all testers, and production closed beta tests for license testers notewhen testing in india, the user's extension status is checked every 10 minutes to test subscriptions set up the test environment always successful side-load test or production closed beta test and non-license testers and/or license testers notethe following steps are for side-load testers and license testers who are not charged for purchases, and free trials and subscriptions end at iap test periods non-license testers are charged for purchases, and periods end as registered purchase a subscription noteif a subscription with a free trial and/or lower-tier pricing is purchased in an iap test, and the same tester purchases the same subscription in another iap test, the free trial and lower-tier pricing will not be in effect to test a free trial or lower-tier pricing again, either re-register a new subscription for example, with a different name , and have the same tester purchase the subscription have another tester purchase the subscription test subscription after initial purchase verify the following occur according to the diagrams below for the applicable scenario free or registered purchase price, and other purchase details, in the purchase email sent to you first auto-payment email is sent at the next 10 minutes on the hour and the first auto-payment price registered lower-tier or regular-tier additional auto-payment emails are sent every 10 minutes on the hour and the auto-payment price registered lower-tier or regular-tier test subscription auto-payment a auto-payments are made 12 times every 10 minutes b verify the following occur according to the diagram below for all subscription types • regular-tier price in the purchase email sent to you soon after purchase • first auto-payment email is sent 10 minutes on the hour after purchase • regular-tier price in all auto-payment emails sent every 10 minutes on the hour test manual subscription cancellation a in galaxy store at any time before auto-cancellation, click menu > subscription > [select a subscription] > unsubscribe b verify a cancellation email is sent to you test re-subscription a cancelled subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour for example, hh 00, hh 10, hh 20, hh 30, hh 40, hh 50 before expiring, you can re-subscribe to the cancelled subscription a to re-subscribe, in galaxy store, click menu > subscription > [select a canceled subscription] > resubscribe example subscription testing non-introductory subscription with purchase, free trial and automatic cancellation after 12th auto-payment the test subscription has a 7-day free trial period and a regular $4 99 monthly subscription price times hh mm local time are for listed events * after 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases introductory subscription with purchase, free trial and automatic cancellation after 12th auto-payment the test subscription has a 7-day free trial period, a $2 99 introductory monthly subscription price for 3 months, and a $4 99 regular-tier monthly subscription price times hh mm local time are for the listed actions and events * after 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases non-introductory subscription with purchase, free trial, manual cancellation the test subscription has a 7-day free trial period and a $4 99 regular-tier monthly subscription price times hh mm local time are for listed events * when a subscription is cancelled in test mode, the subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour for example, hh 00, hh 10, hh 20, hh 30, hh 40, hh 50 non-introductory subscription with purchase, free trial, manual cancellation, and re-subscribe from galaxy store the test subscription has a 7-day free trial period and a $4 99 regular-tier monthly subscription price times hh mm local time are for listed events * when a subscription is cancelled in test mode, the subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour for example, hh 00, hh 10, hh 20, hh 30, hh 40, hh 50 ** re-subscription is only possible before the end of the current test cycle after cancellation *** after 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases 4 after iap testing after you complete all iap testing and before you submit your app and its in-app products for validation testing, you must prepare them for normal publication noteyou can only track the purchase history of a beta test app during beta testing when the app is updated to a regular non-beta installation, the beta test purchase history is no longer available to prepare for normal publication for subscriptions purchased during iap testing, ensure their subscriptions are canceled delete the tested app from the tester mobile device s in the app code to be submitted for validation testing, ensure that the iap operating mode is operation_mode_production cautionif an app with the iap operating mode set to operation_mode_test is normally published, license testers are not charged for in-app product purchases all other users receive an error message in seller portal a delete all license testers that are registered in your profile b if the app was changed after iap testing, update the app registration with the production version of the app and change the registration information as necessary c submit the app for validation testing by samsung and normal publication in the galaxy store for details, see the application registration guide
Learn Code Lab
codelabintegrate samsung pay web checkout with merchant sites objective learn how to integrate the samsung pay payment system into your merchant sites using the samsung pay web checkout sdk partnership request to use the samsung pay web checkout sdk, you must become an official samsung pay partner once done, you can fully utilize this code lab you can learn more about the partnership process by visiting the samsung pay page here in samsung developers notein accordance with the applicable samsung pay partners agreements, this code lab covers the setup and use of the samsung pay web checkout sdk for purposes of integrating samsung pay with merchant sites the use cases and corresponding code samples included are representative examples only and should not be considered as either recommended or required overview the samsung pay web checkout service enables users to pay for purchases on your website with payment cards saved in the samsung wallet app on their mobile device it supports browser-based payments on both computers and mobile devices a mobile device with samsung wallet installed is required to make purchases through samsung pay web checkout when the user chooses to pay with samsung pay, they must provide their samsung account id email id or scan the qr code on the screen with their mobile device the user then authorizes the purchase within the samsung wallet application, which generates the payment credential on the device and transmits it to your website through the web checkout for more information, see samsung pay web checkout set up your environment you will need the following access to samsung pay developers site samsung wallet test app from samsung pay developers site samsung galaxy device that supports samsung wallet app internet browser, such as google chrome codesandbox account notein this code lab, you can use the samsung wallet test app to try the functionality of the samsung pay web checkout service in a staging environment you can use the official samsung wallet app from the galaxy store once your service is in the production environment start your project and register your service in your browser, open the link below to access the project file of the sample merchant site codesandbox io/s/virtual-store-sample-fnydk5 click the fork button to create an editable copy of the project next, follow the steps below to register your sample merchant site in the samsung pay developers site go to my projects > service management click create new service select web online payment as your service type enter your service name and select your service country select your payment gateway from the list of supported payment gateways pg if your pg uses the network token mode, upload the certificate signing request csr or privacy enhanced mail pem file you obtained from your pg contact your pg for details enter the payment domain name s for your website in the service domain field and click add for example, if your domain is mywebstore com, but the checkout page is hosted on the subdomain payments mywebstore com, you will need to enter payments mywebstore com as the service domain for each additional domain url, click add in this code lab, the generated preview url of the forked project is your service domain click the name of the newly created service to see its details, such as the generated service id that you can use for all the registered service domains include the samsung pay web checkout javascript sdk the samsung pay web checkout sdk uses javascript to integrate the samsung pay payment system to your website this sdk allows users to purchase items via web browser in the <head> section of the index html file of the project, include the samsung pay web checkout javascript sdk file <script src="https //img mpay samsung com/gsmpi/sdk/samsungpay_web_sdk js"></script> initialize the samsung pay client to initiate payments using the samsung pay api, create a new instance of the paymentclient class and pass an argument specifying that the environment as stage write the code below in the <script> tag of the <body> section const samsungpayclient = new samsungpay paymentclient { environment "stage" } ; when the service is still in debug or test mode, you can only use the staging environment to test payment functionality without processing live transactions noteby default, the service is initially set to debug or test mode during creation to switch the service status to release mode, a request must be made through the samsung pay developers site after successfully transitioning to release mode, change the environment to production next, define the service id, security protocol, and card brands that the merchant can support as payment methods the service id is the unique id assigned to your service upon creation in the samsung pay developers site let paymentmethods = { version "2", serviceid "", //input your service id here protocol "protocol_3ds", allowedbrands ["visa", "mastercard"] }; check whether the samsung pay client is ready to pay using the given payment method call the createandaddbutton function if the response indicates that the client is ready samsungpayclient isreadytopay paymentmethods then function response { if response result { createandaddbutton ; } } catch function err { console error err ; } ; create and implement the samsung pay button go to the <body> section and, inside the page-container div, create a container for the samsung pay button <div align="center" id="samsungpay-container"></div> next, go back to the <script> tag and write the createandaddbutton function inside this function, generate the samsung pay button by calling the createbutton method ensure that the button appears on the page by appending it to the container you created function createandaddbutton { const samsungpaybutton = samsungpayclient createbutton { onclick onsamsungpaybuttonclicked, buttonstyle "black"} ; document getelementbyid "samsungpay-container" appendchild samsungpaybutton ; } function onsamsungpaybuttonclicked { // create the transaction information //launch the payment sheet } from the createandaddbutton function, call the onsamsungpaybuttonclicked function when the user clicks the generated button create the transaction information in the onsamsungpaybuttonclicked function, create the transactiondetail object for the user’s purchase input your service domain in the url key let transactiondetail = { ordernumber "sample0n1y123", merchant { name "virtual shop", url "", //input your service domain countrycode "us" }, amount { option "format_total_estimated_amount", currency "usd", total 2019 99 } }; below are the descriptions of the keys included in the transactiondetail object key type description ordernumber string order number of the transaction allowed characters [a-z][a-z][0-9,-] merchant object data structure containing the merchant information merchant name string merchant name merchant url string merchant domain url e g , samsung com the maximum length is 100 characters merchant countrycode string merchant country code e g , us for united states iso-3166-1 alpha-2 amount object data structure containing the payment amount amount option string display format for the total amount on the payment sheet format_total_estimated_amount = displays "total estimated amount " with the total amountformat_total_price_only = displays the total amount only amount currency string currency code e g , usd for us dollar the maximum length is 3 character amount total string total payment amount in the currency specified by amount currencythe amount must be an integer e g , 300 or in a format valid for the currency, such as 2 decimal places after a separator e g , 300 50 notefor the complete list of specifications for the transactiondetail object, see samsung pay web checkout api reference launch the payment sheet after creating the transaction information, call the loadpaymentsheet method to display the web checkout ui the user can either input their email address or scan the generated qr code a timer screen in the web checkout ui is displayed after the user input, while a payment sheet is launched in the user's samsung wallet app the payment sheet contains the payment card option s and the transaction details when the user confirms their payment on their mobile device, you will receive the paymentcredential object generated by the device then, inform the samsung server of the payment result using the notify method the paymentresult object contains the payment result information during transaction processing and after the payment is processed with the pg network notefor real transactions, you need to extract the payment credential information from the 3ds data key within the paymentcredential object and process it through your payment provider however, in this code lab, you only need to print the paymentcredential to the console samsungpayclient loadpaymentsheet paymentmethods, transactiondetail then function paymentcredential { console log "paymentcredential ", paymentcredential ; const paymentresult = { status "charged", provider "test pg" }; samsungpayclient notify paymentresult ; } catch function error { console log "error ", error ; } ; other possible values of the status key are charged - payment was charged successfully canceled - payment was canceled by either the user, merchant, or the acquiring bank rejected - payment was rejected by the acquiring bank erred - an error occurred during the payment process test the samsung pay button after integrating the samsung pay web checkout service into your sample merchant site, follow the steps below to test the functionality of the integrated service open your sample merchant site in a new tab then, click the pay with samsung pay button in the web checkout ui, enter the email address of your samsung account to send a payment request to samsung pay tap the push notification sent to the samsung wallet app installed on your mobile device then, click accept when the payment sheet is loaded, tap on pin and enter your pin to proceed a verified message will display in both the samsung wallet app and web checkout ui to indicate that the payment was processed successfully you're done! congratulations! you have successfully achieved the goal of this code lab topic now, you can integrate the samsung pay web checkout service into your website by yourself if you're having trouble, you may check the complete code below codesandbox io/s/virtual-store-complete-dkhzfx to learn more about developing apps for samsung pay devices, visit developer samsung com/pay
Develop Samsung IAP
websamsung in-app purchase seamless integration with galaxy store for your in-app purchase products what is samsung in-app purchase? samsung in-app purchase (iap) is a payment service that makes it possible to sell a variety of products in applications for samsung galaxy store and internally manages communication with supporting iap services in the samsung ecosystem, such as samsung account, samsung checkout, and samsung rewards. learn more four basic steps to selling in-app products start selling in-app products by integrating with samsung iap. 1. develop your app using our sdk download the samsung in-app purchase sdk and integrate it into your app. 2. request commercial seller status you must be a commercial seller in order to sell your in-app products. 3. register your app upload your binary file to samsung galaxy store seller portal. 4. add in-app products to your app add in-app products and register product-related information. technical documents programming guide how to integrate and configure iap, the iap sdk and iap server apis, and what to do before submitting your app to galaxy store. subscription guide how to manage subscriptions and an explanation of the pricing options configured in samsung galaxy store seller portal. test guide how to test in-app product purchase and payment. iap api guides how to view, register, modify, and remove samsung iap products and view all payments and refunds on a specific date. sdk and plugins sdk samsung iap libraries and sample app. unity plugin samsung iap-related scripts and libraries used to integrate with the unity engine. unreal plugin samsung iap-related scripts and libraries used to integrate with the unreal engine. videos samsung developers youtube nov 6, 2019 maximize your revenue with samsung in-app purchase learn about the new features and improvements released in samsung iap 6.0. review the steps to register your app in seller portal, test samsung iap integration, and how to publish your app in galaxy store. nov 6, 2019 nov 11, 2018 monetize your games with samsung in-app purchase introduction to samsung iap plug-in functionality for unity and unreal game engines. learn how to integrate, register and publish your game with samsung iap. nov 11, 2018 have questions? samsung answers your frequently asked questions and provides a forum to communicate with other developers. faq forum
Develop Samsung Pay
doc1 1 introduction samsung pay is a mobile payment and digital wallet service developed by samsung, enabling users to make secure payments using their galaxy devices—both in-store and online as part of the broader samsung wallet ecosystem, it supports not only contactless payments but also digital card management, loyalty programs, and more for developers and technology partners, samsung pay provides a set of sdks and tools that enable seamless integration of payment capabilities into mobile apps and web platforms this empowers merchants, card issuers, and financial institutions to deliver fast, secure, and user-friendly payment experiences overview and components of samsung pay samsung pay is designed as a flexible and secure platform with multiple integration options tailored for different use cases it consists of the following core components key features of samsung pay the key features of samsung pay are uses advanced tokenization and samsung knox security to safeguard user data and transaction integrity enables in-app, online, and contactless payments using nfc and mst where supported verifies transactions with fingerprint, iris, or face recognition—enhancing convenience and safety works across a wide range of samsung smartphones, tablets, and wearables allows card issuance from web and mobile environments using save to pay market-specific adaptations ensure compliance with regional regulatory requirements benefits of samsung pay for developers & partners
Develop Samsung IAP
docmanage subscriptions subscriptions are assigned a unique product id before or after a subscription’s purchase, your app can request app-related details about the subscription using this product id when a subscription purchase and payment transaction is successful, samsung iap assigns a unique purchase id to the subscription your app server uses this purchase id to get app-related or user-related details about the subscription app-related details can be requested before or after a subscription is purchased and include the information you configured for the subscription in seller portal such as subscription period length, pricing options, availability period, and price user-related details can be requested after a subscription is purchased and include current details about the user’s subscription such as the subscription status, current price paid, and number of renewals if your app does not receive the purchase id for example, due to network issues , you can use getownedlist to request it the following api calls are used to manage your subscriptions click on the api call to see more detailed information getownedlist iap sdk api – get a list of subscriptions owned by the user that are currently in a free trial or active subscription period the response is an array of objects ownedproductvo the app can check the availability of a subscription by referring to the ongetownedproducts data this api provides meaningful information after a subscription is purchased use this call when the app is launched to determine if the user has successfully subscribed to or auto-renewed a subscription subscriptions that have been cancelled are included in the response until the active subscription period has ended subscription-related objects include the product id, purchase id, current price, purchase date, and current subscription period end date getproductsdetails iap sdk api – get details about a subscription that was configured in seller portal this call requires the product id of the subscription the response is an array of objects productvo this api can be called before or after a subscription is purchased subscription-related objects include the current price, subscription period length, subscription pricing option, availability period, duration of free trial period iap/v6/receipt iap server api – verify a subscription purchase and payment transaction were successfully completed this call requires the purchase id of the subscription information is returned in a soap response this api can be called before or after a subscription is purchased subscription-related content include the subscription identifier, payment transaction identifier, purchase receipt identifier, name of the subscription, description of the subscription, date and time of purchase and payment transaction, total amount billed includes subscription price and all applicable taxes , and payment transaction status iap/seller/subscription iap server api – get the subscription status, subscription information, and purchase information, used to verify the purchase of a subscription this call requires the purchase id of the subscription and a service token for authentication and checks the user’s subscription information on the seller’s back-end server information is returned in a rest response this api provides meaningful information after a subscription is purchased subscription-related content include the purchase date, current subscription status, current price, current subscription pricing option, number of renewals, paid subscription start date, subscription end date, and reason for cancellation for more details about these and other api calls, see the samsung iap programming guide email receipts samsung iap sends subscription purchasers emails about significant events free trial sign-up email sent after initial purchase of a subscription with a free trial contains subscription and order information subscription purchase email sent after initial purchase of a subscription without a free trial, when a subscription is renewed, and after subscription repurchases contains subscription and payment information, including the price paid for the subscription’s first period of use for example, a free trial $0 , a lower-tier price, or a regular-tier price free trial expiration email sent 7 days before the end of a free trial period contains subscription information subscription renewal email india customers only sent seven 7 days before the end of the subscription period and indicates that their consent is needed to renew the subscription details about the steps needed to renew the subscription in galaxy store are included contains subscription information subscription renewal email all customers, except those in india sent near the end of each lower-tier or regular subscription period, which indicates that an auto-payment for the next subscription period will happen soon contains product and subscription information grace period email sent during the renewal process if there is an issue with the payment method the customer is asked to update their payment method in galaxy store menu > subscriptions > subscription details page > payment method by default, the customer has one day to update their payment method before the subscription is cancelled a longer grace period 3, 7, 14, or 30 days for the subscription can be configured in seller portal if the issue continues after the grace period the customer does not update their payment method , the subscription is automatically cancelled subscription cancellation email sent after a subscription is cancelled, either by the user or for another reason contains subscription information register a subscription see register an app and in-app products in seller portal in the iap programming guide for more information re-subscribe to a cancelled subscription if a customer has cancelled their subscription but the current subscription hasn't expired, they are able to reconsider their decision and reactivate the subscription the customer must resubscribe before the end of the current subscription period customers can resubscribe by launching the galaxy store app on their phone and tapping menu > subscriptions > subscription details page > resubscribe the subscription uses the same payment cycle and method as before if you send a notification to the customer about resubscribing before the end of the current subscription period, you can include a link that opens the subscription detail page of your app in galaxy store see deep link to subscription detail page in galaxy store below for more information about the deep link deep link to subscription detail page in galaxy store you can provide a link directly to the subscription detail page of your app in galaxy store this allows your customers to quickly manage their subscription, such as consenting to a price change, resubscribing, or updating their payment method use the following deep link to the app's subscription detail page samsungapps //subscriptiondetail?purchaseid={purchaseid} where {purchaseid} is the unique purchase id of the subscription we suggest that you include this deep link in the settings menu of your app so that users can easily find the subscription detail page in galaxy store test subscriptions see testing subscriptions in the iap test guide for more information
Develop Samsung Pay
apioverview package class tree index help package com samsung android sdk samsungpay v2 payment class customsheetpaymentinfo java lang object com samsung android sdk samsungpay v2 payment customsheetpaymentinfo all implemented interfaces android os parcelable public class customsheetpaymentinfo extends object implements android os parcelable this class provides apis to fetch payment information details with custom payment sheet information that is, transaction details set by the merchant app since api level 1 3 see also paymentmanager startinapppaywithcustomsheet customsheetpaymentinfo, paymentmanager customsheettransactioninfolistener nested class summary nested classes modifier and type class description static class customsheetpaymentinfo address this class provides apis to create address parcel object static enum customsheetpaymentinfo addressinpaymentsheet this enumeration provides types of address ui on the payment sheet, based on merchant requirement static class customsheetpaymentinfo builder this is builder class for constructing customsheetpaymentinfo object nested classes/interfaces inherited from interface android os parcelable android os parcelable classloadercreator<t extends object>, android os parcelable creator<t extends object> field summary fields inherited from interface android os parcelable contents_file_descriptor, parcelable_write_return_value method summary all methodsinstance methodsconcrete methods modifier and type method description customsheetpaymentinfo addressinpaymentsheet getaddressinpaymentsheet api to return the address display option on the payment sheet list<spaysdk brand> getallowedcardbrands api to return the brand of cards supported by merchant cardinfo getcardinfo api to return the selected card information in samsung pay customsheet getcustomsheet api to return customsheet android os bundle getextrapaymentinfo api to return the configured extra paymentinfo boolean getiscardholdernamerequired api to return whether card holder's name should be displayed on the card list on the payment sheet boolean getisrecurring api to return whether the payment is recurring or not string getmerchantcountrycode api to return the country code, where merchant is operating string getmerchantid api to return the merchant reference id string getmerchantname api to return the merchant name string getordernumber api to return the order number for transaction spaysdk brand getpaymentcardbrand api to return the card brand which was used in the current transaction partner can get this information if needed string getpaymentcardlast4dpan api to return the last 4 digits of dpan which was used in the current transaction partner can get this information if needed string getpaymentcardlast4fpan api to return the last 4 digits of fpan which was used in the current transaction partner can get this information if needed string getpaymentcurrencycode api to return the iso currency code which was used in the current transaction partner can get this information if needed customsheetpaymentinfo address getpaymentshippingaddress api to return the shipping/delivery address which was used in the current transaction partner can get this information if needed string getpaymentshippingmethod api to return the shipping method which was used in the current transaction partner can get this information if needed string getversion api to return the version name of the samsung pay package methods inherited from class java lang object equals, getclass, hashcode, notify, notifyall, tostring, wait, wait, wait method details getversion public string getversion api to return the version name of the samsung pay package returns sdk version name since api level 1 3 getmerchantid public string getmerchantid api to return the merchant reference id returns merchant reference id which can be used for merchant's own purpose for example, if merchant uses a payment gateway which requires payment gateway user id, then merchantid field can be set with a payment gateway user id since api level 1 3 getmerchantname public string getmerchantname api to return the merchant name returns merchant name since api level 1 3 getordernumber public string getordernumber api to return the order number for transaction returns order number which is sent by merchant for records since api level 1 3 getaddressinpaymentsheet public customsheetpaymentinfo addressinpaymentsheet getaddressinpaymentsheet api to return the address display option on the payment sheet returns one of the following values to indicate if the address needs to be displayed on the payment sheet or not customsheetpaymentinfo addressinpaymentsheet need_billing_and_shipping customsheetpaymentinfo addressinpaymentsheet need_billing_send_shipping customsheetpaymentinfo addressinpaymentsheet need_billing_spay customsheetpaymentinfo addressinpaymentsheet need_shipping_spay customsheetpaymentinfo addressinpaymentsheet send_shipping customsheetpaymentinfo addressinpaymentsheet do_not_show since api level 1 3 getallowedcardbrands public list<spaysdk brand> getallowedcardbrands api to return the brand of cards supported by merchant returns list of card brands supported since api level 1 3 getcardinfo public cardinfo getcardinfo api to return the selected card information in samsung pay returns cardinfo object since api level 1 3 getiscardholdernamerequired public boolean getiscardholdernamerequired api to return whether card holder's name should be displayed on the card list on the payment sheet returns true, if card holder's name is to be displayed on the payment sheet else, returns false since api level 1 3 getisrecurring public boolean getisrecurring api to return whether the payment is recurring or not returns true, if payment is recurring else, returns false since api level 1 3 getmerchantcountrycode public string getmerchantcountrycode api to return the country code, where merchant is operating returns country code for region where merchant is operating since api level 1 3 getextrapaymentinfo public android os bundle getextrapaymentinfo api to return the configured extra paymentinfo returns extra paymentinfo configured by merchant app since api level 1 3 getcustomsheet public customsheet getcustomsheet api to return customsheet returns customsheet configured by merchant app since api level 1 3 getpaymentcardlast4dpan public string getpaymentcardlast4dpan api to return the last 4 digits of dpan which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns the last 4 digits of dpan which was used in the current transaction since api level 1 7 getpaymentcardlast4fpan public string getpaymentcardlast4fpan api to return the last 4 digits of fpan which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns the last 4 digits of fpan which was used in the current transaction since api level 1 7 getpaymentcardbrand @nonnull public spaysdk brand getpaymentcardbrand api to return the card brand which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns card brand which was used in the current transaction since api level 1 7 see also spaysdk brand getpaymentcurrencycode public string getpaymentcurrencycode api to return the iso currency code which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns currency code which was used in the current transaction since api level 1 7 getpaymentshippingaddress public customsheetpaymentinfo address getpaymentshippingaddress api to return the shipping/delivery address which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns shipping address which was used in the current transaction since api level 1 7 see also customsheetpaymentinfo address getpaymentshippingmethod public string getpaymentshippingmethod api to return the shipping method which was used in the current transaction partner can get this information if needed they can use this for their own purpose this api method can be used in paymentmanager customsheettransactioninfolistener onsuccess customsheetpaymentinfo, string, bundle callback only this api is available only with us samsung pay app returns shipping method which was used in the current transaction since api level 1 7 samsung electronics samsung pay sdk 2 22 00 - nov 19 2024
Develop Samsung Browser
docweb payments integration guide overview to help standardize and streamline how payments are done on the web, the worldwide web consortium w3c has introduced a payment request api to provide an interface between a merchant web page and a mobile payment app, like samsung pay, to facilitate payment transactions samsung internet browser leverages the w3c payment request api to support samsung pay as a payment method for web purchases chrome also supports a samsung pay web payment method why integrate samsung pay into your website? samsung pay is accepted at more retail locations than any other mobile payment service available because of its unique ability to transact with newer nfc-supported payment terminals and legacy payment terminals it continues to enjoy the best user reviews among mobile payment apps now available for mobile website integration, samsung pay is secure, easy to set up, simple to use, and pre-installed on all new samsung galaxy-class smartphones when integrated with your website, samsung pay presents your users with a common checkout process that leverages samsung pay’s secure purchase authentication technology, eliminating manual entry or re-entry of card details and shipping destinations checkout is streamlined, conversions are maximized, and the exposure of sensitive data is kept to the absolute minimum simplifying the transaction process the benefits of the new process, certainly from an end-user perspective, is that the previous tedium ― request, authorization, payment, and result ― can now be handled in a single step for the web developer, it entails a single javascript api call for samsung pay users, there’s no change at all in the way a payment card is selected and authenticated after selecting the desired merchandise from the merchant’s web site, the user initiates checkout, selects samsung pay as the preferred payment method, authenticates with a fingerprint or pin, and voila ― payment complete that’s the user experience at its most basic when properly implemented, the api also supports editing the billing/shipping address in samsung pay and selecting a different enrolled card before approving the transaction with a fingerprint scan or entering a pin in terms of convenience, it’s a remote shopper’s dream ― no complicated, input-intensive forms to fill out, no fumbling for a plastic card to enter the account number, card expiration, and security code, and no worrying that someone other than the legitimate cardholder is attempting to make the payment meanwhile, samsung pay’s tokenized payload securely protects the transaction from intercept and replay attacks about this guide intended for web developers with a working knowledge of javascript and json, this guide takes you through the complete process of onboarding as a samsung pay merchant partner, creating/registering the w3c service for your domain, adding the w3c payment request object to your website, then testing and releasing your merchant website offering samsung pay as a payment method let's get started determining your gateway integration mode the api methods for integrating samsung pay with your website depend on the type of payment token your payment gateway pg handles — either gateway tokens or network tokens samsung pay supports requests for both types for instance, if stripe is your pg, you will want to request a gateway token from samsung pay on the other hand, if you’re using first data, you’ll want to request an encrypted network token bundle, for which you handle the token decryption yourself or work with the pg first data in this case to handle decrypting the token bundle the process begins when your merchant website makes a payment request and passes all required information to the browser, which then determines compatibility between the accepted payment methods for your website and the methods apps installed on the target device let’s take a brief look at how each integration mode — gateway token and network token — works with samsung pay gateway token mode although samsung pay doesn’t process the payment, your merchant website will still need to invoke the appropriate payment gateway apis to charge and process the token returned by your pg hence, when samsung pay returns a gateway token from stripe, for example, the recommended flow looks like this user selects samsung pay as the payment method at checkout in the merchant's website and the samsung pay app requests partner verification from the samsung pay online payment server encrypted payment information and the partner id are passed to the samsung-pg interface server samsung-pg interface server sends a transaction authorization request to the pg on behalf of the merchant; pg authenticates the partner id before generating a transaction reference id samsung-pg interface server returns the payment token to the pg i e , the gateway token it received from the samsung pay app in step 2 pg continues payment processing with the acquirer and payment network the result approved/declined is returned to the merchant website on the device for display to the user in this mode, samsung pay makes a call to your pg on your behalf and returns a chargeable gateway token network token mode under network token mode, the samsung pay api returns an encrypted network token bundle, which you can then either decrypt yourself or leverage the apis of your pg first data, for example to handle decryption and charge the token user selects samsung pay as the payment method at checkout in the merchant's website and the samsung pay app requests partner verification from the samsung pay online payment server encrypted payment information is passed from the samsung pay app to the pg through the merchant app via the pg sdk applying the merchant's private key, pg decrypts the payment information structure and processes the payment through the acquirer and payment network upon receiving authorization or rejection, pg notifies the merchant website through its pg sdk to simplify integration of network tokens, you can pass the encrypted payload directly to your pg and let it handle decryption in general, decrypting the payload yourself is more complex and involves private key management see your particular pg’s documentation for details once you determine which mode your pg supports, you're ready to register with the portal first, however, there are a number of prerequisites you'll need to satisfy prerequisites registering with the samsung pay developers portal and adapting the appropriate payment request apis for your website in accordance with the guidance contained herein will help to ensure a successful implementation to that end, the following requirements apply release contents minimum samsung pay app version 2 8 xx minimum samsung internet browser version 5 4 minimum chrome browser version 61 supported device models samsung galaxy-class smartphones running minimum version of the wallet app and browser supported payment gateways pgs view the most current list in the portal's payment gateway drop-down menu in service create/edit mode see step 5 under registering your domain for the w3c service registering with the portal through the samsung pay developers portal you can access valuable resources to help you manage the samsung pay features you incorporate into you partner app, including the ability to create multiple samsung pay service groups so you can use different services without the need to create multiple accounts invite co-workers to the portal to help you manage samsung pay features for your website register your website with samsung pay configure your samsung pay w3c service s to create a member account on the samsung pay developers portal open a browser like chrome, go to https //pay samsung com/developers, click sign up and confirm/acknowledge that you accept the samsung pay terms and conditions and understand the privacy policy, then do one of the following a if you already have a valid samsung account, click sign up and enter your samsung account id and password b if you do not have a samsung account, click create a samsung account to create one open the account activation email you receive and click the account activation link if you’re the first samsung pay member of your company to register, select the first option, click next, and complete a company and user profile if, on the other hand, you were given a samsung pay partner id by a co-worker, select the second option — my company is already registered — and enter your company’s partner id in the field provided, then click next after you receive notification by email that your membership is approved, typically within 2 business days, return to https //pay samsung com/developers, click sign in and enter your samsung account id and password for site access as a new member registering your domain for the w3c service your domain is the url associated with your website, whether in test or production the service type specifically associates w3c with your domain once you create the service, you will be prompted to configure the domain you want associated with it to create a new service go to my projects > service management and click create a new service select for test to define the service for initial integration with samsung pay, then click next select w3c mobile web payments as the service type and click next enter a service name and select “united states” as the service country select a payment gateway from the list of supported pgs if your payment gateway uses the network token mode, upload the certificate signing request csr you obtained from your pg supported formats are csr or pem contact your pg for details otherwise, key management is already established for pgs supporting samsung pay’s gateway token mode; hence, click connect with to create a new service connection with the pg and click ok enter the payment domain name s for your website in the service domain field and click add for example, if your domain is mywebstore com but the checkout page is hosted on the subdomain payments mywebstore com, you’ll need to enter payments mywebstore com as the service domain in the portal for each additional domain name, click add notewhen entering the domain name on the portal, do not include an https // prefix confirm your agreement with the terms and conditions, then click next adding w3c payment requests objects to your website in order to accept payments from samsung pay, your website must adhere to the w3c payment request api specification you can get started with the basics by completing the steps that follow and making the appropriate substitutions for your website step 1 feature detect prior making a w3c payment request, it’s wise to run a feature detect to ensure the browser in use supports the w3c payment request api if not, you should fall back to your traditional/normal checkout page example if window paymentrequest { // use payment request api } else { // fallback to traditional checkout window location href = ‘/checkout/traditional’; } step 2 create the paymentrequest constructor the first step is to create a paymentrequest object by calling the paymentrequest constructor, which has the following parameters methoddata – contains a list of payment methods that the website supports e g , visa, amex, samsung pay details – contains information about the shopping cart purchases e g , total, tax, fees, etc options – details pertaining to shipping address, user contact information, etc example var request = new paymentrequest methoddata, // required payment method data details, // required information about transaction options // optional parameter for things like shipping, etc ; step 3 add samsung pay to the methoddata parameter the methoddata parameter contains a list of payment methods supported by the merchant to support samsung pay, you’ll need to add it as a supported payment method notebasic-card is an optional supportedmethod for credit and debit cards saved in the browser, the card details of which are returned directly to the website from the browser before configuring this method, make sure your website and pg can handle generic payment information received from the browser and process with required pci compliance, if applicable see the [w3c basic card payment specification][7] for additional details be aware, however, that if you intend to support a branded samsung pay button, only samsung pay can be enabled as a payment method within the paymentrequest object; basic-card or any other payment method cannot be included if you already offer a generic payment request method, you can continue to do so — and include samsung pay as a payment method within that paymentrequest object from a user experience standpoint, the two distinct pathways look like this standard w3c implementation a standard w3c implementation adds samsung pay to your standard paymentrequest object as one of many supportedmethods available for user selection tapping checkout or its equivalent launches the standard browser payment sheet for user selection of the payment method and/or to add a debit/credit card to the list of options selecting samsung pay as the payment method and tapping pay launches the samsung pay payment sheet branded samsung pay implementation a branded implementation displays a "buy with samsung pay" button in place of your standard checkout button tapping the button will skip directly to the samsung pay payment sheet for authentication unless you specify paymentoptions if paymentoptions is not null, the browser payment sheet is launched see paymentoptions in step 7 for additional guidance first launching your website's checkout page is recommended for branded implementations this is because the samsung pay payment sheet only provides the user's billing address, which means your website will need to capture the user's preferred shipping address, where applicable for physical delivery of purchased goods if no shipping address and/or other options are needed, set the paymentoptions parameter to null as mentioned above, if you populate paymentoptions, the browser payment sheet is automatically launched keeping the foregoing implementations in mind, let's look at how to construct the methoddata argument for the network token mode and gateway token mode, respectively the fields in methoddata comprise supportedmethods – required; specifies https //spay samsung com/ i e , the samsung pay app and other methods suppored by your website data – values specific to the method; for samsung pay, these include version specifies the data structure being used by the merchant; should always be set to 1 until further notice required productid the service id obtained from the samsung pay partner portal required for partner verification; see step #8 under registering your domain for the w3c service merchantgatewayparameter this is the userid value registered with your pg required for gateway token mode in addition, userid should be set in the request parameter for mada token if a merchan request mada token, this field is mandatory as this filed should be included in the payload for mada token, there is a 15-character length limit paymentprotocol defaults to “protocol_3ds,” the only protocol currently supported by samsung pay optional allowedcardnetworks specifies the card brands/networks accepted by the merchant and supported by the pg required merchantname the name of the merchant to be displayed on the payment sheet; must be identical to the merchant name registered on the samsung pay partner portal required ordernumber unique value for merchant use as an external reference id optional isrecurring specifies transaction on subscription basis optional; default = false billingaddressrequired determines if a billing address must be filled-in by the user optional; default = false shown next are examples of the methoddata parameter for each of the supported token modes please note that samsung pay's w3c support for card brands is currently limited to mastercard, visa and american express discover is scheduled for support soon example – network token mode var methoddata = [ { supportedmethods ['https //spay samsung com'], data { 'version' '1', // always 1 until further notice 'productid' '2bc3e6da781e4e458b18bc', // service id from partner portal 'allowedcardnetworks' ['mastercard','visa'], 'merchantname' 'shop samsung demo ', // merchantname must be identical to merchant name on portal 'ordernumber' '1233123', } }] example – gateway token mode var methoddata = [ { supportedmethods ['https //spay samsung com'], data { 'version' '1', // always 1 until further notice 'productid' '7qr7h9ws1872bc3e6da781', // service id from partner portal 'merchantgatewayparameter' {"userid" "acct_ 17irf7f6ypzj7wor"}, 'allowedcardnetworks' ['mastercard','visa'], 'merchantname' 'shop samsung demo ', //merchantname must be identical with merchant name on portal 'ordernumber' '1233123', } }] step 4 fill out the transaction details parameter the details parameter contains information about the transaction there are two major components a total, which reflects the total amount and currency to be charged, and an optional set of displayitems that indicate how the final amount was calculated this parameter is not intended to be a line-item list, but is rather a summary of the order’s major components subtotal, discounts, tax, shipping costs, etc example var details = { displayitems [ { label "total of all items", amount { currency "usd", value "65 00" }, // us$65 00 }, { label "friends & family discount", amount { currency "usd", value "-10 00" }, // -us$10 00 pending true // the price is not yet determined } ], total { label "total", amount { currency "usd", value "55 00" }, // us$55 00 } } step 5 check eligibility to display samsung pay button if you do not support basic-card and you try to call show in step 6 when samsung pay or any other supportedmethod is not present on the device, the returned promise will reject with the following error domexception the payment method is not supported you can, however, check beforehand to see if the user has an available/supported method set up this is done with the canmakepayment method, which tells you whether the user has a payment method that can fulfill the current payment request example – canmakepayment const paymentrequest = new paymentrequest supportedpaymentmethods, transactiondetails, options ; // if canmakepayment isn’t available, default to assume the method is supported const canmakepaymentpromise = promise resolve true ; // feature detect canmakepayment if request canmakepayment { canmakepaymentpromise = paymentrequest canmakepayment ; } canmakepaymentpromise then result => { if !result { // the user does not have a supported payment method // todo redirect to traditional checkout flow return; } // todo the user has a payment - call show } catch err => { // todo either fall back to traditional checkout or call show } ; notebranded samsung pay buttons can be found on the [samsung pay developers][8] portal under the resources tab direct cdn links will be available soon step 6 call the show method to display the payment sheet the payment sheet can be activated by calling its show method this method invokes the browser’s native ui so the user can examine the details of the purchase, add or change the information, and submit it for payment a promise, indicated by its then method and callback function, resolves what will be returned when the user accepts or rejects the payment request example – show request show then function paymentresponse { // process paymentresponse here paymentresponse complete "success" ; } catch function err { console error "uh oh, something bad happened", err message ; } ; step 7 handle the paymentresponse once the user approves the payment request by verifying the payment option and shipping option if provided , the show method’s promise resolves, resulting in a paymentresponse object comprised of the following fields methodname string indicating the chose payment method e g , visa details dictionary containing information for methodname shippingaddress shipping address of the user, if requested shippingoption id of the selected shipping option, if requested payeremail email address of the payer, if requested payerphone telephone number of the payer, if requested payername name of the payer, if requested here, it’s important to remember that the response from the payment request api must be submitted by the merchant in accordance with the pg’s integration model and apis in all cases, the samsung pay response is encapsulated within the paymentresponse details parameter, which comprises the following fields paymentcredential – contains the payment credential information necessary for processing the transaction with the pg in network token mode, this field includes 3ds data in gateway token mode, it includes token information network token mode type use “s” version 1 0 0; standard for payment authentication aka mastercard securecode, verified by visa, and american express safekey data encrypted payload value gateway token mode reference token id reference status authorized or rejected/declined billingaddress – contains the billing address and related attributes for the cardholder, possibly including country [iso3166] alpha-2 code; canonical form is upper case for example, “us” addressline[n] most specific part of the address; can include a street name, a house number, apartment number, a rural delivery route, descriptive instructions, or a post office box number region top level administrative subdivision of the country; can be a state, a province, an oblast, or a prefecture city city/town portion of the address dependentlocality dependent locality or sub-locality within a city; fused for neighborhoods, boroughs, districts, or uk dependent localities postalcode postal code or zip code, also known as pin code in india sortingcode bank sorting code; for example, in the british and irish banking industries, the sort code is a six-digit number, is usually formatted as three pairs of numbers, for example 12-34-56, identifying both the bank and the branch where the account is held languagecode [bcp47] language tag for the address, in canonical form; used to determine the field separators and the order of fields when formatting the address for display organization organization, firm, company, or institution at this address recipient name of the recipient or contact person this member may, under certain circumstances, contain multiline information; for example, it might contain “care of” information phone telephone number of the recipient or contact person paymentinfo – contains the payment information, including card_last4digits last four digits of the card’s dpan cardbrand currently, either mastercard or visa ordernumber merchant’s unique external reference id supplied in the original request’s methoddata parameter if the user pays with a credit card using the basic-card method, then the details response returned directly to your website from the browser will contain cardholdername, cardnumber, expirymonth, expiryyear, cardsecuritycode, billingaddress example request show then paymentresponse => { var paymentdata = { // payment method string, e g “amex” method paymentresponse methodname, // payment details contains payment information details paymentresponse details /* request details depends on pg token mode network - e g , first data; or gateway - e g , stripe ---------------------------------------------------------|------------------------------------------------------| * gateway token mode |* network token mode | * “details” { |* “details { | * “paymentcredential” { |* “method” “3ds”, | * “reference” “tok_1asceoyf6ypzj7f8se6grp0i”, |* “paymentcredential” { | * “status” “authorized” |* “type” “s”, | * }, |* “version” “100”, | * |* “data” “long_encrypted_payload_value”, | * |* }, | *--------------------------------------------------------|------------------------------------------------------| * “paymentinfo” { * “card_last4digits” “1489”, * “cardbrand” “mastercard”, * “ordernumber” “1233123”, * “billingaddress” { * “country” “usa”, * “addressline” [“chhccy”, “hdyxych”], * “region” “ca”, * “city” “mountain view”, * “dependentlocality” “”, * “postalcode” “94043”, * “sortingcode” “”, * “languagecode” “en”, * “organization” “”, * “recipient” “”, * “phone” “” * } * } * } * */ }; return fetch ‘/validatepayment’, { method ‘post’, headers { ‘content-type’ ‘application/json’ }, body json stringify paymentdata } then res => { if res status === 200 { return res json ; } else { throw ‘payment error’; } } then res => { paymentresponse complete “success” ; }, err => { paymentresponse complete “fail” ; } ; } catch err => { console error “error, something went wrong”, err message ; } ; once payment information is received from samsung pay, the website should submit the payment information to the merchant’s pg for transaction processing the ui will show a spinner while the request takes place when a response is received, the website should call complete to close the ui the website is then free to show an order complete or order confirmation page for user feedback as previously mentioned, you can simplify integration of network tokens by passing the encrypted payload directly to your pg and letting it handle decryption in all cases, how you handle a submitted network token depends on the payment gateway refer to your particular pg’s documentation for details paymentoptions is an optional parameter in thepaymentrequest constructor depending on your particular requirements, you may want additional information, such as the user’s shipping address for physical goods purchased and contact details for guest users paymentoptions currently comprises the following requestpayername true if payer name is required; otherwise, false requestpayeremail true if payer email address is required; otherwise, false requestpayerphone true if payer telephone number is required; otherwise, false requestshipping true if shipping address is required; otherwise, false shippingtype available label options “shipping/pickup/delivery” for indicating to user; solely for display purposes example var options = { requestpayeremail false, requestpayername true, requestpayerphone false, requestshipping true, shippingtype "delivery" } noteif any of the elements listed above are set to true, the browser payment sheet is launched; otherwise, the samsung pay payment sheet is displayed putting it all together let’s assemble the various code blocks into a prototype to demonstrate the w3c payment request api in action function onbuyclicked { const samsung_pay = 'https //spay samsung com'; if !window paymentrequest { // paymentrequest api is not available - forwarding to legacy form based experience location href = '/checkout'; } // setup var supportedinstruments = [{ supportedmethods [ samsung_pay ], // 'https //spay samsung com' data { "version" "1", "productid" "2bc3e6da781e4e458b18bc", //service id from partner portal "allowedcardnetworks" ['mastercard','visa'], "ordernumber" "1233123", "merchantname" "shop samsung demo ", //merchant name in partner portal "merchantgatewayparameter" {"userid" "acct_17irf7f6ypzj7wor"}, "isrecurring" false, "billingaddressrequired" false, "paymentprotocol" "protocol_3ds" } }]; var details = { displayitems [{ label 'original donation amount', amount { currency 'usd', value '65 00' } }, { label 'friends and family discount', amount { currency 'usd', value '-10 00' } }], total { label 'total due', amount { currency 'usd', value '55 00' } }; var options = { requestshipping true, requestpayeremail true, requestpayerphone true, requestpayername true }; // initialization var request = new paymentrequest supportedinstruments, details, options ; // when user selects a shipping address request addeventlistener 'shippingaddresschange', e => { e updatewith details, addr => { var shippingoption = { id '', label '', amount { currency ‘usd’, value ‘0 00’ }, selected true}; // shipping to us is supported if addr country === 'us' { shippingoption id = 'us'; shippingoption label = 'standard shipping in us'; shippingoption amount value = '0 00'; details total amount value = '55 00'; // shipping to jp is supported } else if addr country === 'jp' { shippingoption id = 'jp'; shippingoption label = 'international shipping'; shippingoption amount value = '10 00'; details total amount value = '65 00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details shippingoptions = []; return promise resolve details ; { // hardcoded for simplicity if details displayitems length === 2 { details displayitems[2] = shippingoption; } else { details displayitems push shippingoption ; } details shippingoptions = [shippingoption]; return promise resolve details ; } details, request shippingaddress ; } ; // when user selects a shipping option request addeventlistener 'shippingoptionchange', e => { e updatewith details => { // there should be only one option do nothing return promise resolve details ; } details ; } ; // show ui then continue with user payment info request show then result => { // post the result to the server return fetch '/pay', { method 'post', credentials ‘include’, headers { 'content-type' 'application/json' }, body json stringify result tojson } then res => { // only if successful if res status === 200 { return res json ; } else { throw 'failure'; } } then response => { // you should have received a json object if response success == true { return result complete 'success' ; } else { return result complete 'fail' ; } } then => { console log 'thank you!', result shippingaddress tojson , result methodname, result details tojson ; } catch => { return result complete 'fail' ; } ; } catch function err { console error 'uh oh, something bad happened ' + err message ; } ; } document queryselector '#start' addeventlistener 'click', onbuyclicked ; refer to the official w3c integration specs for additional details and definition testing once you have the code saved and loaded, you’re ready to test be sure to test your website or test domain on a device running samsung internet browser and with the samsung pay wallet app already set up and ready to go in accordance with the prerequisites cited above if you use a separate subdomain for your test environment, be sure to add it as an eligible service domain for the service you configured under registering your domain for the w3c service remember that any/all subdomains for production must also be added to the service, up to a maximum of 10 service domains again, please note that samsung pay’s webpay api currently supports mastercard and visa only support for american express and discover is under development and will be available soon be sure to test using the samsung internet and chrome mobile browser apps to test select samsung pay as the payment method by clicking on the branded samsung pay button branded implementations or the samsung pay radio button standard w3c implementations this should launch the samsung pay payment sheet authenticate payment validate your results end to end isolate issues in the log, debug, and test again contact your samsung pay rm to coordinate assistance with troubleshooting recommended test cases check if the samsung pay is available in the payment option on the website verify samsung pay logo on browser sheet verify order summary on the payment sheet verify “edit” and “pay” buttons on payment sheet verify purchased item in the summary verify the billing address on the payment sheet change the billing address try to change the card in payment sheet when only one card is enrolled in samsung pay try to change the card when multiple cards is enrolled in samsung pay verify the payment amount verify the payment options verify the payment completion screen verify merchant name on the payment sheet verify merchant domain name on the payments sheet verify “cancel” and “pay” buttons on browser sheet try to make payment with large amount larger than max allowed amount and verify the behavior make a payment using samsung pay with a card already added for the merchant’s website basic-card verify transaction notification after w3c purchase verify transaction notification after refund set payment options for shipping address and verify that browser payment sheet launches and captures shipping address input/changes by user verify that the shipping cost is updated based on a shipping address change and is reflected in the updated total amount release once your tests are successful and you are satisfied with the results, take the following steps to ready your integrated with samsung pay website for release go to the samsung pay developers portaland create a new release service sharing identical attributes with the service you successfully tested a click on service management, then click create new service b select for release pictured , then click next c select w3c mobile web payments as the service type, then click next d enter a "release" service name and select "united states" as the service country e select united states as the service country f select your payment gateway from the drop-down menu, then click connect with for gateway token mode or provide a valid csr for network token mode g enter your service domain and click add for each additional domain name, click add remember, when entering domain names on the portal, do not include a "https"//" prefix h confirm your agreement with the terms and conditions, then click next retrieve the service id from the service details page and enter copy-paste it into your website's methoddata object in place of the current testing service id when your service is approved by your samsung pay rm — as indicated in the status column of your service management dashboard — you're ready to release your integrated website to the public send queries concerning service package approval to webpayment@samsungpay com
Develop Samsung IAP
docexamples the following are examples of upgrades and downgrades, with and without free trials for all examples, the following applies standard subscription price $30/month daily price = $30/30 days = $1/day premium subscription price $60/month daily price = $60/30 days = $2/day each example includes a table, timeline, and detailed description of how each proration mode is calculated example 1 upgrade, no free trial in this example, the customer signs up for a standard subscription on september 1 on september 15, the customer changes to the premium subscription proration mode proration premium subscription start date premium subscription first payment date instant_prorated_date 8 days of premium subscription sep 15 sep 23 instant_prorated_charge extra payment of $15 by customer on sep 15 sep 15 oct 1 instant_no_proration none sep 15 oct 1 deferred none oct 1 oct 1 the initial payment made by the customer on september 1 for the standard subscription is $30 the customer changes the subscription on september 15, therefore the customer has used $15 of their initial payment 15 days * $1/day the customer has $15 remaining of their initial payment $30 - $15 instant_prorated_date mode calculation example 1 the remaining initial payment $15 is applied towards the premium subscription the number of prorated days of the premium subscription is calculated as follows remaining initial payment / premium subscription daily price = $15 / $2 / day = 7 5 days round up = 8 days these 8 days are applied immediately, starting on september 15 and ending on september 23 on september 23, the subscription is automatically renewed and the customer is billed $60 automatic renewal occurs on the 23rd of each month instant_prorated_charge mode calculation example 1 there are 15 days left in the subscription period after the subscription is changed charge for remainder of month at premium subscription price = days remaining in subscription period * daily price of premium subscription = 15 days * $2 / day = $30 the prorated extra payment for the customer is calculated as follows charge for remainder of month at premium subscription price - remaining initial payment = $30 - $15 = $15 the premium subscription starts immediately and the customer is billed $15 on september 15 the subscription period and automatic renewal date remain the same on october 1, the customer is automatically billed $60 and automatic renewal occurs on the 1st of each month instant_no_proration mode calculation example 1 the premium subscription starts immediately and the subscription period and automatic renewal date remain the same on october 1, the customer is automatically billed $60 and automatic renewal occurs on the 1st of each month deferred mode calculation example 1 the customer continues with the standard subscription until october 1 on october 1, the premium subscription is started and the customer is automatically billed $60 automatic renewal occurs on the 1st of each month example 2 downgrade, no free trial in this example, the customer signs up for a premium subscription on june 1 on june 15, the customer changes to the standard subscription noteinstant_prorated_charge and instant_no_proration modes do not apply to downgraded subscriptions proration mode proration standard subscription start date standard subscription first payment date instant_prorated_date 30 days of standard subscription jun 15 jul 15 instant_prorated_charge n/a instant_no_proration deferred none jul 1 jul 1 the initial payment made by the customer for the premium subscription is $60 the customer changes the subscription on june 15, therefore the customer has used $30 of their initial payment 15 days * $2/day the customer has $30 remaining of their initial payment $60 - $30 instant_prorated_date mode calculation example 2 the remaining initial payment $30 is applied towards the standard subscription the number of prorated days of the standard subscription is calculated as follows remaining initial payment / standard subscription daily price = $30 / $1 / day = 30 days these 30 days are applied immediately, starting on june 15 on july 15, the subscription is automatically renewed and the customer is billed $30 automatic renewal occurs on the 15th of each month instant_prorated_charge mode calculation example 2 not applicable for downgrades instant_no_proration mode calculation example 2 not applicable for downgrades deferred mode calculation example 2 the customer continues with the premium subscription until july 1 on july 1, the standard subscription is started and the customer is automatically billed $30 automatic renewal occurs on the 1st of each month example 3 upgrade, both subscriptions have free trial periods in this example, the customer signs up for a standard subscription on november 1 both the standard subscription and premium subscription have a 10-day free trial period the free trial period for the standard subscription starts on november 1 and ends on november 11 the standard subscription starts on november 11 on november 15 after the free trial period has ended, 4 days into the standard subscription , the customer changes to the premium subscription notea free trial period may be set up once per subscription or once per app when a free trial period is set once per subscription, when a subscription is upgraded, the free trial period for the premium subscription is honored as long as the customer has not previously purchased the premium subscription when a free trial period is set once per app, when a subscription is upgraded, the free trial period for the premium subscription is not applicable because it has already been used with the standard subscription free trial periods are not applicable to the upgraded/downgraded subscription for subscriptions set to the instant_prorated_charge mode proration mode free trial scope proration premium subscription start date premium subscription free trial period premium subscription first payment date instant_prorated_date once per subscription 13 days of premium subscription nov 15 nov 28 - dec 8 dec 81 once per app nov 15 n/a nov 282 instant_prorated_charge once per subscription extra payment of $26 by customer on nov 15 nov 15 n/a3 dec 114 once per app instant_no_proration once per subscription none nov 15 dec 11 ‑ dec 21 dec 215 once per app nov 15 n/a dec 114 deferred once per subscription none dec 116 dec 11 - dec 21 dec 215 once per app dec 116 n/a dec 114 1automatic renewal occurs on the 8th each month after the free trial period for the premium subscription 11/28 - 12/8 2automatic renewal occurs on the 28th each month 3free trial periods are not applicable for subscriptions set to the instant_prorated_charge mode 4automatic renewal occurs on the 11th of each month based on the payment date of the standard subscription 11/11 - 12/11 5automatic renewal occurs on the 21st of each month after the free trial period for the premium subscription 12/11 - 12/21 6the premium subscription starts after the standard subscription period finishes 11/11 - 12/11 the free trial period is applicable as long as the customer has not previously purchased the premium subscription the initial payment made by the customer for the standard subscription is $30 the customer changes the subscription on november 15 therefore the customer has used $4 of their initial payment 4 days * $1/day the customer has $26 remaining of their initial payment $30 - $4 instant_prorated_date mode calculation example 3 the remaining initial payment $26 is applied towards the premium subscription the number of prorated days of the premium subscription is calculated as follows remaining initial payment / premium subscription daily price = $26 / $2 / day = 13 days these 13 days are applied immediately, starting on november 15 and ending on november 28 if a free trial period is set once per subscription and the customer has not previously purchased the premium subscription, the free trial period starts on november 28 and ends on december 8 the customer is billed $60 on december 8, after the free trial has ended the first full non-prorated subscription period starts on december 8 and automatic renewal occurs on the 8th of each month if a free trial period is set once per app, the free trial is not applicable to the premium subscription as it has been used with the standard subscription on november 28, the subscription is automatically renewed and the customer is billed $60 automatic renewal occurs on the 28th of each month instant_prorated_charge mode calculation example 3 there are 26 days left in the subscription period after the subscription is changed free trial periods are not applicable to the upgraded/downgraded subscription for subscriptions set to the instant_prorated_charge mode charge for remainder of month at premium subscription price = days remaining in subscription period * daily price of premium subscription = 26 days * $2 / day = $52 the prorated extra payment for the customer is calculated as follows charge for remainder of month at premium subscription price - remaining initial payment = $52 - $26 = $26 the premium subscription starts immediately and the customer is billed $26 on november 15 the subscription period starts and is automatically renewed on december 11 and the customer is automatically billed $60 automatic renewal occurs on the 11th of each month instant_no_proration mode calculation example 3 the premium subscription starts immediately if a free trial period is set once per subscription and the customer has not previously purchased the premium subscription, the free trial period of premium starts on december 11 and ends on december 21 the customer is billed $60 on december 21, after the free trial has ended automatic renewal occurs on the 21st of each month if a free trial period is set once per app, the free trial is not applicable to the premium subscription as it has been used with the standard subscription on december 11, the subscription is automatically renewed and the customer is billed $60 automatic renewal occurs on the 11th of each month deferred mode calculation example 3 the customer continues with the standard subscription until december 10 if a free trial period is set once per subscription and the customer has not previously purchased the premium subscription, the free trial period starts on december 11 and ends on december 21 the customer is billed $60 on december 21, after the free trial has ended automatic renewal occurs on the 21st of each month if a free trial period is set once per app, the free trial is not applicable to the premium subscription as it has been used with the standard subscription on december 11, the subscription is automatically renewed and the customer is billed $60 automatic renewal occurs on the 11th of each month example 4 downgrade, both subscriptions have free trial periods in this example, the customer signs up for a premium subscription on september 1 both the standard subscription and premium subscription have a 10-day free trial period on september 7, the customer changes to the standard subscription, during the free trial period notea free trial period may be set up once per subscription or once per app free trial periods are not applied when a subscription is downgraded however, the remaining days in the free trial period are prorated and applied to the downgraded subscription instant_prorated_charge and instant_no_proration modes do not apply to downgraded subscriptions because the free trial period has not ended for the premium subscription, the customer was not initially billed for the premium subscription proration mode free trial scope proration standard subscription start date standard subscription free trial period standard subscription first payment date instant_prorated_date once per subscription 6 days of standard subscription sep 7 n/a sep 13 once per app sep 7 n/a sep 13 instant_prorated_charge n/a instant_no_proration deferred once per subscription none sep 11 n/a sep 11 once per app sep 11 n/a sep 11 instant_prorated_date mode calculation example 4 the customer has 3 days remaining in their trial period and it is applied towards the standard subscription the number of prorated days of the standard subscription is calculated as follows remaining free trial days * premium subscription daily price = 3 days * $2 / day = 6 days these 6 days are applied immediately, starting on september 7 and ending on september 13 the customer is billed $30 on september 13, after the number of prorated days have been used because the subscription was changed during the free trial period, the customer was not initially billed for the premium subscription the subscription period starts and automatic renewal occurs on the 13th of each month instant_prorated_charge mode calculation example 4 not applicable for downgrades instant_no_proration mode calculation example 4 not applicable for downgrades deferred mode calculation example 4 the customer continues with the premium subscription until the date the free trial ends september 11 on september 11, the standard subscription is started and the customer is automatically billed $30 because the subscription was changed during the free trial, the customer was not initially billed for the premium subscription automatic renewal occurs on the 11th of each month
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.