Class

PKPaymentRequest

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

Declaration

class PKPaymentRequest : NSObject

Topics

Selecting the Payment Networks

class func availableNetworks() -> [PKPaymentNetwork]

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 and card types that 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 payment summary item 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?) -> Error

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

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

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

class func paymentShippingAddressInvalidError(withKey: String, localizedDescription: String?) -> Error

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

class func paymentShippingAddressUnserviceableError(withLocalizedDescription: String?) -> Error

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software