Search in sources :

Example 1 with CardInfo

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);
}
Also used : PaymentData(com.google.android.gms.wallet.PaymentData) PaymentMethodToken(com.google.android.gms.wallet.PaymentMethodToken) CardInfo(com.google.android.gms.wallet.CardInfo)

Aggregations

CardInfo (com.google.android.gms.wallet.CardInfo)1 PaymentData (com.google.android.gms.wallet.PaymentData)1 PaymentMethodToken (com.google.android.gms.wallet.PaymentMethodToken)1