public abstract class PaymentMethodNonce
extends java.lang.Object
implements android.os.Parcelable
PaymentMethodNonce represents the
common interface of all payment method nonces, and can be handled by a server interchangeably.| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DATA_KEY |
protected boolean |
mDefault |
protected java.lang.String |
mDescription |
protected java.lang.String |
mNonce |
protected static java.lang.String |
TOKEN_KEY |
| Modifier | Constructor and Description |
|---|---|
|
PaymentMethodNonce() |
protected |
PaymentMethodNonce(android.os.Parcel in) |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
protected void |
fromJson(org.json.JSONObject json) |
java.lang.String |
getDescription() |
protected static org.json.JSONObject |
getJsonObjectForType(java.lang.String apiResourceKey,
org.json.JSONObject json) |
java.lang.String |
getNonce() |
abstract java.lang.String |
getTypeLabel() |
boolean |
isDefault() |
static PaymentMethodNonce |
parsePaymentMethodNonces(org.json.JSONObject json,
java.lang.String type)
Parses a
PaymentMethodNonce from json. |
static java.util.List<PaymentMethodNonce> |
parsePaymentMethodNonces(java.lang.String jsonBody)
Parses a response from the Braintree gateway for a list of payment method nonces.
|
static PaymentMethodNonce |
parsePaymentMethodNonces(java.lang.String json,
java.lang.String type)
Parses a
PaymentMethodNonce from json. |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
protected static final java.lang.String DATA_KEY
protected static final java.lang.String TOKEN_KEY
protected java.lang.String mNonce
protected java.lang.String mDescription
protected boolean mDefault
public PaymentMethodNonce()
protected PaymentMethodNonce(android.os.Parcel in)
protected static org.json.JSONObject getJsonObjectForType(java.lang.String apiResourceKey,
org.json.JSONObject json)
throws org.json.JSONException
org.json.JSONExceptionprotected void fromJson(org.json.JSONObject json)
throws org.json.JSONException
org.json.JSONExceptionpublic java.lang.String getNonce()
public java.lang.String getDescription()
public boolean isDefault()
true if this payment method is the default for the current customer, false otherwisepublic abstract java.lang.String getTypeLabel()
public static java.util.List<PaymentMethodNonce> parsePaymentMethodNonces(java.lang.String jsonBody) throws org.json.JSONException
jsonBody - Json-formatted String containing a list of PaymentMethodNoncesPaymentMethodNonces contained in jsonBodyorg.json.JSONExceptionpublic static PaymentMethodNonce parsePaymentMethodNonces(java.lang.String json, java.lang.String type) throws org.json.JSONException
PaymentMethodNonce from json.json - String representation of a PaymentMethodNonce.type - The String type of the PaymentMethodNonce.PaymentMethodNonceorg.json.JSONExceptionpublic static PaymentMethodNonce parsePaymentMethodNonces(org.json.JSONObject json, java.lang.String type) throws org.json.JSONException
PaymentMethodNonce from json.json - JSONObject representation of a PaymentMethodNonce.type - The String type of the PaymentMethodNonce.PaymentMethodNonceorg.json.JSONExceptionpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable