Instance Method

activate(_:withActivationData:completion:)

Activates a payment pass using the provided activation code.

Declaration

func activate(_ paymentPass: PKPaymentPass, withActivationData activationData: Data, completion: ((Bool, Error) -> Void)? = nil)

Parameters

paymentPass

The payment pass being activated.

activationData

The cryptographic one-time password.

This data is Base64 encoded and then sent to the payment network. The framework treats this data as an opaque value.

completion

The completion block called after activation.

This block takes the following parameters:

success

true if the pass was authorized; otherwise, false.

error

If success is false, a description of the error.

Discussion

The pass must already be provisioned, and it must currently be in the PKPaymentPassActivationState.requiresActivation state.

See Also

Activating Payment Passes

func isPaymentPassActivationAvailable() -> Bool

A Boolean value that indicates whether the device supports adding payment passes.