Instance Method

confirm(intent:completion:)

Confirms the transaction details.

Declaration

optional func confirm(intent: INPayBillIntent, completion: @escaping (INPayBillIntentResponse) -> Void)

Parameters

intent

The intent object containing details about the user's request. The properties of this object have already been resolved by your handler object.

completion

The handler block to execute with your response. You must execute this handler at some point during your implementation of this method. The handler has no return value and takes the following parameter:

response

The INPayBillIntentResponse object containing the details to confirm with the user. This parameter must not be nil.

Discussion

Use this method to validate that scheduling payment for the specified bill is possible. You might use this method to validate the following information:

  • The user has logged in to your app, and is therefore authorized to make payments.

  • The payee is valid and provided a bill that requires payment.

  • The user’s payment account is valid and contains sufficient funds to pay the bill.

  • The amount paid by the user is greater than the minimum amount associated with the bill.

  • The date for making the payment occurs before the bill’s due date.

At some point in your implementation, execute the provided completion block with a response object containing the transaction details. Siri displays this information to the user during the confirmation process.

When configuring your response object, specify the bill details and the user account to transfer the money from. You also specify the scheduled transaction date. For more information about creating the response object, see INPayBillIntentResponse.