MerchantRequestReceiver

public final class MerchantRequestReceiver<Payload> : PaymentRequestReceiver

A concrete, generic implementation of PaymentRequestReceiver.

This class is generic over a Payload type, allowing it to be configured to process a specific kind of payment request.

  • The closure executed upon successful payment processing.

    Declaration

    Swift

    public var onSuccess: (Payload) async -> PaymentProcessResult

    Parameters

    payload

    The payload containing payment details of the generic Payload type.

    Return Value

    A PaymentProcessResult after processing the request.

  • The closure executed when the payment process fails.

    Declaration

    Swift

    public var onFailure: () -> Void
  • Initializes a MerchantRequestReceiver with success and failure handlers.

    Declaration

    Swift

    public init(
        onSuccess: @escaping (Payload) async -> PaymentProcessResult,
        onFailure: @escaping () -> Void
    )

    Parameters

    onSuccess

    A closure handling successful payment processing for the specific Payload.

    onFailure

    A closure handling payment failures.