use of com.braintreepayments.api.models.VenmoAccountBuilder in project braintree_android by braintree.
the class TokenizationClientUnitTest method tokenize_tokenizesNonCardPaymentMethodsWithRestWhenGraphQLIsEnabled.
@Test
public void tokenize_tokenizesNonCardPaymentMethodsWithRestWhenGraphQLIsEnabled() {
BraintreeFragment fragment = new MockFragmentBuilder().configuration(new TestConfigurationBuilder().graphQL().build()).build();
TokenizationClient.tokenize(fragment, new PayPalAccountBuilder(), null);
TokenizationClient.tokenize(fragment, new UnionPayCardBuilder(), null);
TokenizationClient.tokenize(fragment, new VenmoAccountBuilder(), null);
verifyZeroInteractions(fragment.getGraphQLHttpClient());
}
use of com.braintreepayments.api.models.VenmoAccountBuilder in project braintree_android by braintree.
the class Venmo method vault.
private static void vault(final BraintreeFragment fragment, String nonce) {
VenmoAccountBuilder vaultBuilder = new VenmoAccountBuilder().nonce(nonce);
TokenizationClient.tokenize(fragment, vaultBuilder, new PaymentMethodNonceCallback() {
@Override
public void success(PaymentMethodNonce paymentMethodNonce) {
fragment.postCallback(paymentMethodNonce);
fragment.sendAnalyticsEvent("pay-with-venmo.vault.success");
}
@Override
public void failure(Exception exception) {
fragment.postCallback(exception);
fragment.sendAnalyticsEvent("pay-with-venmo.vault.failed");
}
});
}
Aggregations