The isReadyToPay() method performs a series of checks to determine whether the Samsung Pay button should be displayed. It verifies device and platform compatibility, checks supported card brands, and, when used on a mobile website, detects whether the customer is using a Samsung device.
Syntax
isReadyToPay(paymentMethods)
Parameters
Field
Type
Required/Optional
Description
paymentMethods
Object
Required
Information used to verify device and browser compatibility with Samsung Pay. For details, see PaymentMethods.
Return value
Resolves to the Promise object that indicates whether Samsung Pay is supported. The object contains the following fields:
Field
Type
Required/Optional
Description
result
Boolean
Required
Whether the device supports Samsung Pay.
resultMessage
String
Optional
Message that explains the compatibility verification result; for example, "Invalid allowedBrands" or "Not supported device".
Example
const paymentMethods = {
version: "2",
serviceId: "dcc1cbb25d6a470bb42926",
protocol: "PROTOCOL_3DS",
allowedBrands: ["visa", "mastercard"]
};
paymentClient.isReadyToPay(paymentMethods)
.then(response => {
if (response.result) {
console.log("Device is ready to pay with Samsung Pay.");
// Proceed to load the payment sheet
} else {
console.error("Device is not ready:", response.resultMessage);
// Hide Samsung Pay button or show an alternative payment method
}
})
.catch(error => {
console.error("Error checking readiness:", error);
});
loadPaymentSheet()
The loadPaymentSheet() method initiates the Samsung Pay checkout flow. It detects the customer’s context (desktop browser, mobile browser, or Android WebView), displays the appropriate UI for payment authentication, and then returns the generated payment credentials.
Service-level configurations for the payment request. For details, see PaymentMethods.
transactionDetail
Object
Required
Transaction details for the purchase. For details, see TransactionDetail.
modalOptions
Object
Optional
Modal layout settings when the payment sheet is displayed on the desktop. If omitted, default values are used. For details, see ModalOptions.
Return value
onSuccess: Resolves with the payment data returned from Samsung Pay. The data includes encrypted payment credentials, and other relevant information required for payment processing.
onFailure: Rejects with an error object or message:
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
developer.samsung.com, .samsung.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
Samsung Electronics
.samsung.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
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.