Class PlatformPay.Result
- Enclosing class:
PlatformPay
#requestPayment(Request, SuccessCallback).-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete(boolean success) Reports whether the app's server charged the token, which closes the Apple Pay sheet with a success or a failure mark.static PlatformPay.ResultDecodes the string a port reports:ok:followed by the token,cancel, orerror:followed by a message.getError()The error message of a failed payment.intThe status:SUCCESS,CANCELLEDorFAILED.getToken()The payment token to forward to the PSP: the Apple PaypaymentDataJSON, or the Google PayPaymentDataJSON.
-
Field Details
-
SUCCESS
public static final int SUCCESSThe user authorized the payment;#getToken()holds the token.- See Also:
-
CANCELLED
public static final int CANCELLEDThe user dismissed the sheet.- See Also:
-
FAILED
public static final int FAILEDThe wallet failed;#getError()says why.- See Also:
-
-
Method Details
-
complete
public void complete(boolean success) Reports whether the app's server charged the token, which closes the Apple Pay sheet with a success or a failure mark. Call it once, after a
SUCCESSresult, when the payment service provider has answered. Later calls, and calls on any other result, do nothing. Without a call the iOS sheet reports a failure after 30 seconds. Google Pay needs no call; it does nothing there.Parameters
success: true when the charge went through
-
decode
Decodes the string a port reports:
ok:followed by the token,cancel, orerror:followed by a message.Parameters
s: the encoded result
Returns
the result
-
getStatus
public int getStatus()The status:
SUCCESS,CANCELLEDorFAILED.Returns
the status
-
getToken
The payment token to forward to the PSP: the Apple Pay
paymentDataJSON, or the Google PayPaymentDataJSON.Returns
the token, or null unless the status is
SUCCESS -
getError
The error message of a failed payment.
Returns
the message, or null
-