use of com.google.android.gms.wallet.CardInfo in project braintree_android by braintree.
the class GooglePaymentCardNonceUnitTest method getPaymentData.
private PaymentData getPaymentData(String email, UserAddress billingAddress, UserAddress shippingAddress, String response) throws Exception {
Constructor<PaymentMethodToken> paymentMethodTokenConstructor = PaymentMethodToken.class.getDeclaredConstructor(int.class, String.class);
paymentMethodTokenConstructor.setAccessible(true);
PaymentMethodToken paymentMethodToken = paymentMethodTokenConstructor.newInstance(0, response);
Constructor<CardInfo> cardInfoConstructor = CardInfo.class.getDeclaredConstructor(String.class, String.class, String.class, int.class, UserAddress.class);
cardInfoConstructor.setAccessible(true);
CardInfo cardInfo = cardInfoConstructor.newInstance("MasterCard 0276", null, null, 0, billingAddress);
Constructor<PaymentData> paymentDataConstructor = PaymentData.class.getDeclaredConstructor(String.class, CardInfo.class, UserAddress.class, PaymentMethodToken.class);
paymentDataConstructor.setAccessible(true);
return paymentDataConstructor.newInstance(email, cardInfo, shippingAddress, paymentMethodToken);
}
Aggregations