collectPayment()

Collect a payment using the selected payment method.

  • CollectPaymentOptions-An object described by these attributes.
    • amount-(Required) A text field that shows the amount intended to be collected in a decimal format (for example, 150.00).
    • paymentMethod-(Required) A text field that shows the requested payment method (for example, TAP_TO_PAY).
    • currencyIsoCode-(Required) A text field that represents the currency ISO code.
    • merchantAccountId-(Required) A text field that represents the ID of the Merchant Account object.
    • merchantName-(Required) A text field that shows the text that’s presented as the product/service name being paid for (for example, “Power Connector”).
    • payerAccountId-(Required) A text field that represents the ID of the Account object requesting to collect the payment.
    • sourceObjectIds-(Optional) A text field that represents the ID of the originating object for the payment (for example, ServiceAppointment ID, WorkOrder ID).
    • permissionRationaleText-(Optional) A text field that’s presented to the user if permission is missing (for example, location permission) and must be requested from the user. Defaults to a predefined text if it’s empty.

A Promise object that resolves as a CollectPaymentResult object. If there’s an error, a rejected promise returns the error type of PaymentsServiceFailure.