Skip to content

Commit

Permalink
Venmo kotlin conversion (#1138)
Browse files Browse the repository at this point in the history
* VenmoApi class to Kotlin

* VenmoPaymentAuthRequestParams class to Kotlin

* VenmoPaymentAuthResultInfo class to Kotlin

* VenmoSharedPrefsWriter class to Kotlin

* VenmoClient class to Kotlin

* cleared lint errors and fixed unit test cases

* VenmoLineItem class to Kotlin

* VenmoPaymentMethodUsage class to Kotlin

* cleared lint errors

* VenmoRequest class to Kotlin

minor changes

* VenmoClient constructor updates

* Cleanup newlines

* Update string formatting

* Update Venmo/src/main/java/com/braintreepayments/api/venmo/VenmoLineItem.kt

Co-authored-by: Tim Chow <[email protected]>

* Refactor request object

* update api unit tests

* Refactor line item enums

* update payment auth classes

* Make browserSwitchSucess internal

* Add CHANGELOG

* remove unnecessary changelog

* Update to named parameters

* Fix lint

* Update Demo/src/main/java/com/braintreepayments/demo/VenmoFragment.java

Co-authored-by: Jax DesMarais-Leder <[email protected]>

* Add doc strings for VenmoPaymentMethodUsage

---------

Co-authored-by: Sarah Koop <[email protected]>
Co-authored-by: Tim Chow <[email protected]>
Co-authored-by: Jax DesMarais-Leder <[email protected]>
  • Loading branch information
4 people authored Sep 10, 2024
1 parent cbab9bb commit 90fdcf8
Show file tree
Hide file tree
Showing 26 changed files with 833 additions and 3,322 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Braintree Android SDK Release Notes

## unreleased

* Breaking Changes
* Venmo
* Convert `VenmoPaymentMethodUsage` to an enum
* Convert `VenmoLineItemKind` to an enum

## 5.0.0-beta2 (2024-08-28)

* All Modules
* Upgrade Gradle version to `8.5.2`
* Upgrade `compileSdkVersion` and `targetSdkVersion` to API 35
Expand Down
2,047 changes: 0 additions & 2,047 deletions CHANGELOG.md.orig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.braintreepayments.api.venmo.VenmoClient;
import com.braintreepayments.api.venmo.VenmoLauncher;
import com.braintreepayments.api.venmo.VenmoLineItem;
import com.braintreepayments.api.venmo.VenmoLineItemKind;
import com.braintreepayments.api.venmo.VenmoPaymentAuthRequest;
import com.braintreepayments.api.venmo.VenmoPaymentAuthResult;
import com.braintreepayments.api.venmo.VenmoPaymentMethodUsage;
Expand Down Expand Up @@ -88,7 +89,7 @@ public void launchVenmo(View v) {
boolean shouldVault =
Settings.vaultVenmo(activity) && !TextUtils.isEmpty(Settings.getCustomerId(activity));

int venmoPaymentMethodUsage = shouldVault ?
VenmoPaymentMethodUsage venmoPaymentMethodUsage = shouldVault ?
VenmoPaymentMethodUsage.MULTI_USE : VenmoPaymentMethodUsage.SINGLE_USE;
VenmoRequest venmoRequest = new VenmoRequest(venmoPaymentMethodUsage);
venmoRequest.setProfileId(null);
Expand All @@ -100,8 +101,8 @@ public void launchVenmo(View v) {
venmoRequest.setTaxAmount("1");
venmoRequest.setShippingAmount("1");
ArrayList<VenmoLineItem> lineItems = new ArrayList<>();
lineItems.add(new VenmoLineItem(VenmoLineItem.KIND_CREDIT, "Some Item", 1, "2"));
lineItems.add(new VenmoLineItem(VenmoLineItem.KIND_DEBIT, "Two Items", 2, "10"));
lineItems.add(new VenmoLineItem(VenmoLineItemKind.CREDIT, "Some Item", 1, "2"));
lineItems.add(new VenmoLineItem(VenmoLineItemKind.DEBIT, "Two Items", 2, "10"));
venmoRequest.setLineItems(lineItems);

startVenmoFlow(venmoRequest);
Expand Down
164 changes: 0 additions & 164 deletions Venmo/src/main/java/com/braintreepayments/api/venmo/VenmoApi.java

This file was deleted.

Loading

0 comments on commit 90fdcf8

Please sign in to comment.