Braintree/src/main/java/com/braintreepayments/api/UnionPay.java
public static void tokenize(final BraintreeFragment fragment, final UnionPayCardBuilder unionPayCardBuilder) {
        TokenizationClient.tokenize(fragment, unionPayCardBuilder, new PaymentMethodNonceCallback() {
            @Override
            public void success(PaymentMethodNonce paymentMethodNonce) {
                fragment.postCallback(paymentMethodNonce);
                fragment.sendAnalyticsEvent("union-pay.nonce-received");
            }

            @Override
            public void failure(Exception exception) {
                fragment.postCallback(exception);
                fragment.sendAnalyticsEvent("union-pay.nonce-failed");
            }
        });
    }
public static void tokenize(final BraintreeFragment fragment, final UnionPayCardBuilder unionPayCardBuilder) {
        TokenizationClient.tokenize(fragment, unionPayCardBuilder, new PaymentMethodNonceCallback() {
            @Override
            public void success(PaymentMethodNonce paymentMethodNonce) {
                fragment.postCallback(paymentMethodNonce);
                fragment.sendAnalyticsEvent("union-pay.nonce-received");
            }

            @Override
            public void failure(Exception exception) {
                fragment.postCallback(exception);
                fragment.sendAnalyticsEvent("union-pay.nonce-failed");
            }
        });
    }
Create a {@link com.braintreepayments.api.models.CardNonce}. Note that if the card is a UnionPay card,
{@link UnionPayCardBuilder#enrollmentId(String)} and {@link UnionPayCardBuilder#smsCode(String)}
need to be set for tokenization to succeed.
<p/>
On completion, returns the {@link com.braintreepayments.api.models.PaymentMethodNonce} to {@link
com.braintreepayments.api.interfaces.PaymentMethodNonceCreatedListener}.
<p/>
If creation fails validation, {@link com.braintreepayments.api.interfaces.BraintreeErrorListener#onError(Exception)}
will be called with the resulting {@link com.braintreepayments.api.exceptions.ErrorWithResponse}.
<p/>
If an error not due to validation (server error, network issue, etc.) occurs, {@link
com.braintreepayments.api.interfaces.BraintreeErrorListener#onError(Exception)} will be called with the {@link
Exception} that occurred.

@param fragment {@link BraintreeFragment}
@param unionPayCardBuilder {@link UnionPayCardBuilder}