BTApplePayClient

@objc
public class BTApplePayClient : NSObject

Used to process Apple Pay payments

Initializer

Public Methods

  • Creates a PKPaymentRequest with values from your Braintree Apple Pay configuration. It populates the following values of PKPaymentRequest: countryCode, currencyCode, merchantIdentifier, supportedNetworks.

    Declaration

    Swift

    @objc(makePaymentRequest:)
    public func makePaymentRequest(completion: @escaping (PKPaymentRequest?, Error?) -> Void)

    Parameters

    completion

    A completion block that returns the payment request or an error.

  • makePaymentRequest() Asynchronous

    Creates a PKPaymentRequest with values from your Braintree Apple Pay configuration. It populates the following values of PKPaymentRequest: countryCode, currencyCode, merchantIdentifier, supportedNetworks.

    Throws

    An Error describing the failure

    Declaration

    Swift

    public func makePaymentRequest() async throws -> PKPaymentRequest

    Return Value

    A PKPaymentRequest

  • Tokenizes an Apple Pay payment.

    Declaration

    Swift

    @objc(tokenizeApplePayPayment:completion:)
    public func tokenize(_ payment: PKPayment, completion: @escaping (BTApplePayCardNonce?, Error?) -> Void)

    Parameters

    payment

    A PKPayment instance, typically obtained by presenting a PKPaymentAuthorizationViewController

    completion

    A completion block that is invoked when tokenization has completed. If tokenization succeeds, we will return a BTApplePayCardNonce and error will be nil; if it fails, BTApplePayCardNonce will be nil and error will describe the failure.

  • tokenize(_:) Asynchronous

    Tokenizes an Apple Pay payment.

    Throws

    An Error describing the failure

    Declaration

    Swift

    public func tokenize(_ payment: PKPayment) async throws -> BTApplePayCardNonce

    Parameters

    payment

    A PKPayment instance, typically obtained by presenting a PKPaymentAuthorizationViewController

    Return Value

    A BTApplePayCardNonce