Class

PKPaymentRequest

Encapsulates a request for payment, including information about payment processing capabilities, the payment amount, and shipping information.

Topics

Selecting the Payment Networks

class func availableNetworks()

Returns the list of available payment networks that are supported by Apple Pay.

var supportedNetworks: [PKPaymentNetwork]

The payment networks that you support.

struct PKPaymentNetwork

Payment networks.

Setting Merchant Information

var merchantIdentifier: String

Your merchant identifier.

var merchantCapabilities: PKMerchantCapability

A bit field of the payment processing protocols you support.

struct PKMerchantCapability

Capabilities for processing payment.

var countryCode: String

The two-letter ISO 3166 country code.

var supportedCountries: Set<String>?

A list of ISO 3166 country codes to limit payments to cards from specific countries.

var currencyCode: String

The three-letter ISO 4217 currency code.

Setting the Payment Summary Items

var paymentSummaryItems: [PKPaymentSummaryItem]

An array of PKPaymentSummaryItem objects that summarize the amount of the payment.

class PKPaymentSummaryItem

Defines a summary item in a payment request—for example, total, tax, discount, or grand total.

Requesting Billing and Shipping Contact Fields

var requiredBillingContactFields: Set<PKContactField>

A list of fields that you need for a billing contact in order to process the transaction.

var requiredShippingContactFields: Set<PKContactField>

A list of fields that you need for a shipping contact in order to process the transaction.

struct PKContactField

The fields that describe a contact.

Providing Known Contact Information

var billingContact: PKContact?

A prepopulated billing address.

var shippingContact: PKContact?

A prepopulated shipping address.

class PKContact

Encapsulates contact information needed for billing and shipping.

Setting the Shipping Methods and Types

var shippingMethods: [PKShippingMethod]?

An array of PKShippingMethod objects that describe the supported shipping methods.

class PKShippingMethod

Defines a shipping method for delivering physical goods.

var shippingType: PKShippingType

The type of shipping used by this request.

enum PKShippingType

Complete list of valid shipping types.

Adding Custom Data

var applicationData: Data?

Application-specific data or state.

Providing Error Information

Create common payment errors using these simple convenience functions.

class func paymentBillingAddressInvalidError(withKey: String, localizedDescription: String?)

Creates a billing address error with the supplied key and user-facing error message.

class func paymentContactInvalidError(withContactField: PKContactField, localizedDescription: String?)

Creates a contact error with the supplied field and user-facing error message.

class func paymentShippingAddressInvalidError(withKey: String, localizedDescription: String?)

Creates a shipping address error with the supplied key and user-facing error message.

class func paymentShippingAddressUnserviceableError(withLocalizedDescription: String?)

Creates an error for an unserviceable address, with the supplied user-facing error message.

Deprecated

var requiredBillingAddressFields: PKAddressField

A bit field of billing address fields that you need in order to process the transaction.

Deprecated
var requiredShippingAddressFields: PKAddressField

A bit field of shipping address fields that you need in order to process the transaction.

Deprecated
struct PKAddressField

Billing or shipping address fields.

Deprecated
var billingAddress: ABRecord?

A prepopulated billing address.

Deprecated
var shippingAddress: ABRecord?

A prepopulated shipping address.

Deprecated

Relationships

Inherits From

Conforms To