Every returning intent will return a serializable
PaymentResult object. It can be retrieved from the Intent data by using the
transactionId: String- id set to the result transaction
amount: Long- amount that was charged (in cents)
paymentType: PaymentType- payment type that was executed
currency: SupportedCurrency- currency that was used
staffMember: YocoStaff?- Optional: staff member performing the transaction
userInfo: Map<String, Any>?- (Optional) user info map containing additional user info that is returned based on what was passed in if any
errorMessage: String?- (Optional) (Optional) error message when transaction fails/cancels/aborts
Response Result Codes
Every returning intent will pass back a result code which will provide specific info on the result of the transaction.
After a successful or failed payment from YocoSDK.charge() flow an Intent result will be returned, containing info related to the transaction.
The standard way of handling an intent result:
So there is a new way to handle intent results, by using the Activity Results API with androidx.
Instantiate the result contract, which may be passed to the
YocoSDK as the result. There is no need to use the request code, as we tie the contract to the