Instance Method

handle(intent:completion:)

Handles transferring the money between accounts.

Required.

Declaration

func handle(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void)

Parameters

intent

The intent object containing details about the user’s request. The information in this object has already been resolved and confirmed 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. This handler has no return value and takes the following parameter:

response

The INSendPaymentIntentResponse object containing the status of the request. This parameter must not be nil.

Discussion

Your implementation of this method must transfer the specified money to the designated payee. The response object you provide should include the transaction details and indicate whether or not the transaction was successful.

You specify the transaction details using an INPaymentRecord object, which you include in your response object. For more information about configuring the response object, see INSendPaymentIntentResponse.