Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Venmo payment details #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions riskified-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.8.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<release>11</release>
<source>11</source>
<target>11</target>
</configuration>
</plugin>

Expand Down
4 changes: 3 additions & 1 deletion riskified-sdk/src/main/java/com/riskified/JSONFormater.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import com.riskified.models.CreditCardPaymentDetails;
import com.riskified.models.IPaymentDetails;
import com.riskified.models.PaypalPaymentDetails;
import com.riskified.models.VenmoPaymentDetails;
import com.riskified.models.StripePaymentDetails;

import sun.security.x509.IPAddressName;
//import sun.security.x509.IPAddressName;

public class JSONFormater {

Expand All @@ -34,6 +35,7 @@ public static RuntimeTypeAdapterFactory paymentDetailsSerializer() {
return RuntimeTypeAdapterFactory
.of(IPaymentDetails.class, "method")
.registerSubtype(PaypalPaymentDetails.class, "paypal")
.registerSubtype(VenmoPaymentDetails.class, "venmo")
.registerSubtype(StripePaymentDetails.class, "stripe")
.registerSubtype(CreditCardPaymentDetails.class, "credit_card")
.registerSubtype(BankWirePaymentDetails.class, "bank_wire");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public class CreditCardPaymentDetails implements IPaymentDetails {
private String acquirerRegion;


public CreditCardPaymentDetails(String creditCardBin,
public CreditCardPaymentDetails(){};

public CreditCardPaymentDetails(
String creditCardBin,
String avsResultCode,
String cvvResultCode,
String creditCardNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void validate(Validation validationType) throws FieldBadFormatException {
Validate.notNullOrEmpty(this, this.email, "Email");
Validate.notNullOrEmpty(this, this.firstName, "First Name");
Validate.notNullOrEmpty(this, this.lastName, "Last Name");
Validate.notNullOrEmpty(this, this.id, "Id");
Validate.notNull(this, this.createdAt, "Created At");
//Validate.notNullOrEmpty(this, this.id, "Id");
//Validate.notNull(this, this.createdAt, "Created At");
Validate.notNull(this, this.verifiedEmail, "Verified Email");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package com.riskified.models;

import com.riskified.validations.FieldBadFormatException;
import com.riskified.validations.Validate;
import com.riskified.validations.Validation;

public class VenmoPaymentDetails implements IPaymentDetails {

private String venmoEmail;
private String venmoUsername;
private String venmoAccountId;
private String authorizationId;
private AuthorizationError authorizationError;
private AuthenticationResult authenticationResult;
private String id;
private String gateway;
private String acquirerBin;
private String mid;
private AuthorizationType authorizationType;


public VenmoPaymentDetails(String venmoEmail) {
this.venmoEmail = venmoEmail;
}

public void validate(Validation validationType)
throws FieldBadFormatException {
if (validationType == validationType.ALL) {
Validate.emailAddress(this, this.venmoEmail, "Venmo Email");
Validate.notNullOrEmpty(this, this.venmoUsername, "Venmo Username");
}

}

public String getVenmoEmail() {
return venmoEmail;
}

public void setVenmoEmail(String venmoEmail) {
this.venmoEmail = venmoEmail;
}

public String getVenmoUsername() {
return venmoUsername;
}

public void setVenmoAccountId(String venmoAccountId) {
this.venmoAccountId = venmoAccountId;
}

public String getVenmoAccountId() {
return venmoAccountId;
}

public void setVenmoUsername(String venmoUsername) {
this.venmoUsername = venmoUsername;
}

public String getAuthorizationId() {
return authorizationId;
}

public void setAuthorizationId(String authorizationId) {
this.authorizationId = authorizationId;
}

public AuthenticationResult getAuthenticationResult() {
return authenticationResult;
}

public void setAuthenticationResult(AuthenticationResult authenticationResult) {
this.authenticationResult = authenticationResult;
}

public AuthorizationError getAuthorizationError() {
return authorizationError;
}

public void setAuthorizationError(AuthorizationError authorizationError) {
this.authorizationError = authorizationError;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getGateway() {
return gateway;
}

public void setGateway(String gateway) {
this.gateway = gateway;
}

public String getAcquirerBin() {
return acquirerBin;
}

public void setAcquirerBin(String acquirerBin) {
this.acquirerBin = acquirerBin;
}

public String getMid() {
return mid;
}

public void setMid(String mid) {
this.mid = mid;
}

public AuthorizationType getAuthorizationType() {return authorizationType;}

public void setAuthorizationType(AuthorizationType authorizationType) { this.authorizationType = authorizationType; }

}