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

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

    • 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.

    Default Implementation

    Declaration

    Swift

    func sendSMSReceipt(phoneNumber: String,
                        paymentResult: PaymentResult,
                        progress: @escaping UpdateReceiptProgress)
  • The delegate callback for when the email receipt button is pressed by the user.

    • 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.

    Default Implementation

    Declaration

    Swift

    func sendEmailReceipt(address: String,
                          paymentResult: PaymentResult,
                          progress: @escaping UpdateReceiptProgress)
  • The delegate callback for when the print receipt button is pressed by the user.

    • canPrintOnTerminal: true if the connected yoco terminal supports printing and ready to print, otherwise false.
    • message: message from SDK regarding printer availability
    • 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.

    Default Implementation

    Declaration

    Swift

    func printReceipt(canPrintOnTerminal: Bool,
                      message: String?,
                      paymentResult: PaymentResult,
                      progress: @escaping UpdateReceiptProgress)