Skip to main content

Overview

Set the PrimerDelegate in order to receive different callbacks from Primer SDK.

primerDidCompleteCheckoutWithData

SWIFT
This method will be called with the when the payment has been completed, returning the payment’s data.

⚠️ This method won’t be called when you are using manual payment handling, or the vault manager.

Parameters

Example

SWIFT

primerDidTokenizePaymentMethod

SWIFT
This method will be called with the when the payment method has been tokenized, returning the payment method’s tokenization data. Use the token to create a payment on your backend. Make sure that you call the decisionHandler once your operation has been completed.

⚠️ This method will be called only on the manual flow, or when vaulting.

Parameters

Example

SWIFT

primerDidResumeWith

SWIFT
This method will be called providing a resumeToken so you can resume the payment.

⚠️ This method will be called only on the manual flow when the payment is in a .PENDING state..

Parameters

Example

SWIFT

primerClientSessionWillUpdate

This method will be called to notify you that the client session will be updated, e.g. a surcharge needs to be applied when a payment method has been chosen.
SWIFT

primerClientSessionDidUpdate

SWIFT
This method will be called to notify you that the client session has been updated, e.g. surcharge has been applied when a payment method has been chosen.

Parameters

primerWillCreatePaymentWithData

This method will be called with just before the payment gets created, and lets you decide whether you want to proceed with the payment creation. ⚠️ This method will be called only when checking out using the auto flow.
SWIFT

Parameters

Example

SWIFT

Example with Idempotency Key

SWIFT

primerDidEnterResumePendingWithPaymentAdditionalInfo

SWIFT
This method will be called when the payment cannot get settled at this time, and will get settled in the future (e.g. a voucher)

primerDidFailWithError

SWIFT
This method will be called when an error occurs. It may return PrimerCheckoutData if the occurs after the payment creation. Make sure you call the decisionHandler to finalize the flow.

Parameters

Example

SWIFT

primerDidDismiss

This method will be called to notify you that the Primer SDK has been dismissed.
SWIFT