forked from braintree/braintree_java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3696b4c
commit 690d135
Showing
11 changed files
with
221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.braintreegateway; | ||
|
||
import com.braintreegateway.util.NodeWrapper; | ||
import java.util.Calendar; | ||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
public class VenmoAccount implements PaymentMethod { | ||
private String token; | ||
private String username; | ||
private String venmoUserId; | ||
private String sourceDescription; | ||
private String imageUrl; | ||
private Calendar createdAt; | ||
private Calendar updatedAt; | ||
private List<Subscription> subscriptions; | ||
private String customerId; | ||
private Boolean isDefault; | ||
|
||
public VenmoAccount(NodeWrapper node) { | ||
this.token = node.findString("token"); | ||
this.username = node.findString("username"); | ||
this.venmoUserId = node.findString("venmo-user-id"); | ||
this.sourceDescription = node.findString("source-description"); | ||
this.imageUrl = node.findString("image-url"); | ||
|
||
this.createdAt = node.findDateTime("created-at"); | ||
this.updatedAt = node.findDateTime("updated-at"); | ||
this.subscriptions = new ArrayList<Subscription>(); | ||
for (NodeWrapper subscriptionResponse : node.findAll("subscriptions/subscription")) { | ||
this.subscriptions.add(new Subscription(subscriptionResponse)); | ||
} | ||
|
||
this.customerId = node.findString("customer-id"); | ||
this.isDefault = node.findBoolean("default"); | ||
} | ||
|
||
public String getToken() { | ||
return token; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getVenmoUserId() { | ||
return venmoUserId; | ||
} | ||
|
||
public String getSourceDescription() { | ||
return sourceDescription; | ||
} | ||
|
||
public String getImageUrl() { | ||
return imageUrl; | ||
} | ||
|
||
public Calendar getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
public Calendar getUpdatedAt() { | ||
return updatedAt; | ||
} | ||
|
||
public List<Subscription> getSubscriptions() { | ||
return subscriptions; | ||
} | ||
|
||
public String getCustomerId() { | ||
return customerId; | ||
} | ||
|
||
public boolean isDefault() { | ||
return isDefault; | ||
} | ||
} | ||
|
41 changes: 41 additions & 0 deletions
41
src/main/java/com/braintreegateway/VenmoAccountDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.braintreegateway; | ||
|
||
import com.braintreegateway.util.NodeWrapper; | ||
|
||
public class VenmoAccountDetails { | ||
|
||
private String token; | ||
private String username; | ||
private String venmoUserId; | ||
private String imageUrl; | ||
private String sourceDescription; | ||
|
||
public VenmoAccountDetails(NodeWrapper node) { | ||
this.token = node.findString("token"); | ||
this.username = node.findString("username"); | ||
this.venmoUserId = node.findString("venmo-user-id"); | ||
this.imageUrl = node.findString("image-url"); | ||
this.sourceDescription = node.findString("source-description"); | ||
} | ||
|
||
public String getToken() { | ||
return token; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getVenmoUserId() { | ||
return venmoUserId; | ||
} | ||
|
||
public String getImageUrl() { | ||
return imageUrl; | ||
} | ||
|
||
public String getSourceDescription() { | ||
return sourceDescription; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters