Once setup is complete, you’re ready to add the Samsung Pay SDK Flutter Plugin code within your partner app for calling the Samsung Pay SDK’s APIs and receiving callbacks. The following functionalities are ready to call through APIs:
Checking Samsung Wallet Status
Activating the Samsung Wallet App
Updating the Samsung Wallet App
Checking Samsung Wallet Status
The first step in implementing the Samsung Pay SDK Flutter Plugin within your partner app is to create the SamsungPaySdkFlutter instance, this will check the Samsung Wallet status on the device. It's determine the support for Samsung Wallet (or lack thereof), and whether or not to display the Samsung Pay button to the user for selection as a payment option. The Samsung Pay button also lets issuer apps add a card to Samsung Wallet. In both instances, the partner app must have valid PartnerInfo to pass to SamsungPay for caller verification.
To set its PartnerInfo, the partner app passes its serviceId (SID) and ServiceType, both of which are assigned by the Samsung Pay Developers portal when you create the service. This will be used for checking blocked list and version control between the Samsung Pay SDK Flutter Plugin and the Samsung Wallet app on the device. You must set the ServiceType in PartnerInfo to call other Samsung Wallet APIs.
After setting PartnerInfo, your partner app can now call getSamsungPayStatus(). This method of the SamsungPay class must be called before using any other feature in the Samsung Pay SDK Flutter Plugin.
The SamsungPaySdkFlutter class provides the following API method to activate the Samsung Wallet app on a device:
Future<void> activateSamsungPay()
activateSamsungPay() is called to activate the Samsung Wallet app on the same device on which the partner app is running. First, the partner app must check the Samsung Wallet status with a getSamsungPayStatus() call. If the status is SPAY_NOT_READY and EXTRA_ERROR_REASON is ERROR_SPAY_SETUP_NOT_COMPLETE, the partner app needs to display an appropriate message to user, then call activateSamsungPay() to launch the Samsung Wallet app so the user can sign in.
Here’s an example of how to code this
samsungPaySdkFlutterPlugin.activateSamsungPay();
Updating the Samsung Wallet App
The SamsungPaySdkFlutter class provides the following API method to update the Samsung Wallet app on the device:
Future<void> goToUpdatePage()
goToUpdatePage() is called to update Samsung Wallet app on the same device on which the partner app is running.
As with all API calls, the partner app must first check the Samsung Wallet status with getSamsungPayStatus(). If this returns SPAY_NOT_READY and EXTRA_ERROR_REASON is ERROR_SPAY_APP_NEED_TO_UPDATE, then the partner app needs to display an appropriate message to the user and call goToUpdatePage(), which launches the Samsung Wallet update page.
The following code sample reflects how to update Samsung Wallet:
samsungPaySdkFlutterPlugin.goToUpdatePage();
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
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.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
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.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.