public class UnionPay
extends java.lang.Object
| Constructor and Description |
|---|
UnionPay() |
| Modifier and Type | Method and Description |
|---|---|
static void |
enroll(BraintreeFragment fragment,
UnionPayCardBuilder unionPayCardBuilder)
Enrolls a Union Pay card.
|
static void |
fetchCapabilities(BraintreeFragment fragment,
java.lang.String cardNumber)
Fetches the capabilities of a card.
|
static void |
tokenize(BraintreeFragment fragment,
UnionPayCardBuilder unionPayCardBuilder)
Create a
CardNonce. |
public static void fetchCapabilities(BraintreeFragment fragment, java.lang.String cardNumber)
enroll(BraintreeFragment, UnionPayCardBuilder).
On completion, returns the UnionPayCapabilities to
UnionPayListener.onCapabilitiesFetched(UnionPayCapabilities)
On error, an exception will be passed back to
BraintreeErrorListener.onError(Exception)
fragment - BraintreeFragmentcardNumber - The card number to check for Union Pay capabilities.public static void enroll(BraintreeFragment fragment, UnionPayCardBuilder unionPayCardBuilder)
fetchCapabilities(BraintreeFragment, String) if your card needs to be enrolled.
On completion, returns a enrollmentId to
UnionPayListener.onSmsCodeSent(String, boolean)
This enrollmentId needs to be applied to UnionPayCardBuilder along with the SMS code
collected from the merchant before invoking tokenize(BraintreeFragment, UnionPayCardBuilder)
On error, an exception will be passed back to
BraintreeErrorListener.onError(Exception)
fragment - BraintreeFragmentunionPayCardBuilder - UnionPayCardBuilderpublic static void tokenize(BraintreeFragment fragment, UnionPayCardBuilder unionPayCardBuilder)
CardNonce. Note that if the card is a UnionPay card,
UnionPayCardBuilder.enrollmentId(String) and UnionPayCardBuilder.smsCode(String)
need to be set for tokenization to succeed.
On completion, returns the PaymentMethodNonce to PaymentMethodNonceCreatedListener.
If creation fails validation, BraintreeErrorListener.onError(Exception)
will be called with the resulting ErrorWithResponse.
If an error not due to validation (server error, network issue, etc.) occurs, BraintreeErrorListener.onError(Exception) will be called with the Exception that occurred.
fragment - BraintreeFragmentunionPayCardBuilder - UnionPayCardBuilder