YocoReceiptDelegate

public protocol YocoReceiptDelegate : AnyObject

Undocumented

  • Required function to implement. Return an array of the different receipt types you want to support. Implement the corresponding delegate callback method associated with your receipt type to be notified when a user presses the receipt button.

    Declaration

    Swift

    func supportedReceiptTypes() -> [SupportedReceiptType]
  • The delegate callback for when the SMS receipt button is pressed by the user.

    Default Implementation

    Declaration

    Swift

    func sendSMSReceipt(phoneNumber: String, paymentResult: PaymentResult, progress: @escaping UpdateReceiptProgress)

    Parameters

    phoneNumber

    The text the user typed into the textfield. Can be an empty string.

    paymentResult

    Info about the result of the payment.

    progress

    Call this function with a ReceiptState to change the state of the button. You should hold onto this until a new one is made from this function to give user feedback on the success or failure of sending the receipt.

  • The delegate callback for when the email receipt button is pressed by the user.

    Default Implementation

    Declaration

    Swift

    func sendEmailReceipt(address: String, paymentResult: PaymentResult, progress: @escaping UpdateReceiptProgress)

    Parameters

    address

    The text the user typed into the textfield. Can be an empty string.

    paymentResult

    Info about the result of the payment.

    progress

    Call this function with a ReceiptState to change the state of the button. You should hold onto this until a new one is made from this function to give user feedback on the success or failure of sending the receipt.

  • printReceipt(paymentResult:progress:) Default implementation

    The delegate callback for when the print receipt button is pressed by the user.

    Default Implementation

    Declaration

    Swift

    func printReceipt(paymentResult: PaymentResult, progress: @escaping UpdateReceiptProgress)

    Parameters

    paymentResult

    Info about the result of the payment.

    progress

    Call this function with a ReceiptState to change the state of the button. You should hold onto this until a new one is made from this function to give user feedback on the success or failure of printing the receipt.