use of com.braintreepayments.api.models.CardBuilder in project braintree_android by braintree.
the class CardActivity method onPurchase.
public void onPurchase(View v) {
setProgressBarIndeterminateVisibility(true);
if (mIsUnionPay) {
UnionPayCardBuilder unionPayCardBuilder = new UnionPayCardBuilder().cardNumber(mCardForm.getCardNumber()).expirationMonth(mCardForm.getExpirationMonth()).expirationYear(mCardForm.getExpirationYear()).cvv(mCardForm.getCvv()).postalCode(mCardForm.getPostalCode()).mobileCountryCode(mCardForm.getCountryCode()).mobilePhoneNumber(mCardForm.getMobileNumber()).smsCode(mSmsCode.getText().toString()).enrollmentId(mEnrollmentId);
UnionPay.tokenize(mBraintreeFragment, unionPayCardBuilder);
} else {
CardBuilder cardBuilder = new CardBuilder().cardNumber(mCardForm.getCardNumber()).expirationMonth(mCardForm.getExpirationMonth()).expirationYear(mCardForm.getExpirationYear()).cvv(mCardForm.getCvv()).postalCode(mCardForm.getPostalCode());
Card.tokenize(mBraintreeFragment, cardBuilder);
}
}
Aggregations