Skip to content

Commit

Permalink
Update Venmo demo to send MULTI_USE when vault is enabled (#890)
Browse files Browse the repository at this point in the history
* Update Venmo demo to send MULTI_USE when vault is enabled

* Update setShouldVault docstring to call out setting VenmoPaymentMethodUsage to MULTI_USE when vault is enabled
  • Loading branch information
tdchow authored Jan 17, 2024
1 parent 8a7d0b2 commit e5a1b52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ public void launchVenmo(View v) {
boolean shouldVault =
Settings.vaultVenmo(activity) && !TextUtils.isEmpty(Settings.getCustomerId(activity));

int venmoPaymentMethodUsage = shouldVault ?
VenmoPaymentMethodUsage.MULTI_USE : VenmoPaymentMethodUsage.SINGLE_USE;

braintreeClient.getConfiguration((configuration, error) -> {
if (venmoClient.isVenmoAppSwitchAvailable(activity)) {
VenmoRequest venmoRequest = new VenmoRequest(VenmoPaymentMethodUsage.SINGLE_USE);
VenmoRequest venmoRequest = new VenmoRequest(venmoPaymentMethodUsage);
venmoRequest.setProfileId(null);
venmoRequest.setShouldVault(shouldVault);
venmoRequest.setCollectCustomerBillingAddress(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public VenmoRequest(@VenmoPaymentMethodUsage int paymentMethodUsage) {
* @param shouldVault Optional - Whether or not to automatically vault the Venmo Account.
* Vaulting will only occur if a client token with a customer ID is being used.
* Defaults to false.
*
* Also when shouldVault is true, {@link VenmoPaymentMethodUsage} on the
* {@link VenmoRequest} must be set to
* {@link VenmoPaymentMethodUsage.MULTI_USE}.
*/
public void setShouldVault(boolean shouldVault) {
this.shouldVault = shouldVault;
Expand Down

0 comments on commit e5a1b52

Please sign in to comment.