ApplePayOrderData
public struct ApplePayOrderData
A data structure representing the order details required for an Apple Pay transaction.
This struct encapsulates the essential information needed to construct a PKPaymentRequest
internally within the SDK, such as the country code, currency, total amount, and a label describing the payment.
Usage Example:
let orderData = ApplePayOrderData(
merchantId: "merchant.com.example.mystore",
countryCode: "US",
currency: "USD",
total: 120.50, // Represents $120.50 directly
label: "My Merchant Store"
)
-
Initializes a new
ApplePayOrderDatainstance with the specified order details.Declaration
Swift
public init(merchantId: String, countryCode: String, currency: String, total: Decimal, label: String)Parameters
merchantIdApple Pay Merchant ID
countryCodeThe two-letter ISO 3166 country code (e.g., “US”).
currencyThe three-letter ISO 4217 currency code (e.g., “USD”).
totalThe total transaction amount in major units (e.g., 50.25).
labelA label representing the merchant or the total charge description.