Finishing a payment
The charge
and refund
function have a completion handler that has a PaymentResult
object as a parameter. You can get info about the result of the transaction from this object. The completion handler will always be called when the payment flow is closing. Alternatively you can also get a payment result returned to you inside any of the ReceiptDelegate
methods.
The PaymentResult
object has a property called result
which is one of the following ResultCode
This result
is useful to know if the payment was successful or not and why it may have been unsuccessful.
Handling Tips
The charge
function also accepts a parameter askForTip
. When this feature is used you will need to account for any tip amount entered after a payment started.
You will get back 3 amounts in the paymentResult: