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
22471fc
commit 52c728f
Showing
20 changed files
with
556 additions
and
285 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
107 changes: 107 additions & 0 deletions
107
src/main/java/com/braintreegateway/CreditCardVerificationBillingAddressRequest.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,107 @@ | ||
package com.braintreegateway; | ||
|
||
public class CreditCardVerificationBillingAddressRequest extends Request { | ||
private CreditCardVerificationCreditCardRequest parent; | ||
private String company; | ||
private String countryCodeAlpha2; | ||
private String countryCodeAlpha3; | ||
private String countryCodeNumeric; | ||
private String countryName; | ||
private String extendedAddress; | ||
private String firstName; | ||
private String lastName; | ||
private String locality; | ||
private String postalCode; | ||
private String region; | ||
private String streetAddress; | ||
|
||
public CreditCardVerificationBillingAddressRequest(CreditCardVerificationCreditCardRequest parent) { | ||
this.parent = parent; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest company(String company) { | ||
this.company = company; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest countryCodeAlpha2(String countryCodeAlpha2) { | ||
this.countryCodeAlpha2 = countryCodeAlpha2; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest countryCodeAlpha3(String countryCodeAlpha3) { | ||
this.countryCodeAlpha3 = countryCodeAlpha3; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest countryCodeNumeric(String countryCodeNumeric) { | ||
this.countryCodeNumeric = countryCodeNumeric; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest countryName(String countryName) { | ||
this.countryName = countryName; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest extendedAddress(String extendedAddress) { | ||
this.extendedAddress = extendedAddress; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest firstName(String firstName) { | ||
this.firstName = firstName; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest lastName(String lastName) { | ||
this.lastName = lastName; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest locality(String locality) { | ||
this.locality = locality; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest postalCode(String postalCode) { | ||
this.postalCode = postalCode; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest region(String region) { | ||
this.region = region; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest streetAddress(String streetAddress) { | ||
this.streetAddress = streetAddress; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest done() { | ||
return parent; | ||
} | ||
|
||
@Override | ||
public String toXML() { | ||
return buildRequest("billingAddress").toXML(); | ||
} | ||
|
||
protected RequestBuilder buildRequest(String root) { | ||
RequestBuilder builder = new RequestBuilder(root). | ||
addElement("company", company). | ||
addElement("countryCodeAlpha2", countryCodeAlpha2). | ||
addElement("countryCodeAlpha3", countryCodeAlpha3). | ||
addElement("countryCodeNumeric", countryCodeNumeric). | ||
addElement("countryName", countryName). | ||
addElement("extendedAddress", extendedAddress). | ||
addElement("firstName", firstName). | ||
addElement("lastName", lastName). | ||
addElement("locality", locality). | ||
addElement("postalCode", postalCode). | ||
addElement("region", region). | ||
addElement("streetAddress", streetAddress); | ||
return builder; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
src/main/java/com/braintreegateway/CreditCardVerificationCreditCardRequest.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,71 @@ | ||
package com.braintreegateway; | ||
|
||
public class CreditCardVerificationCreditCardRequest extends Request { | ||
private CreditCardVerificationRequest parent; | ||
private String cardholderName; | ||
private String cvv; | ||
private String expirationDate; | ||
private String expirationMonth; | ||
private String expirationYear; | ||
private String number; | ||
private CreditCardVerificationBillingAddressRequest billingAddress; | ||
|
||
public CreditCardVerificationCreditCardRequest(CreditCardVerificationRequest parent) { | ||
this.parent = parent; | ||
} | ||
|
||
public CreditCardVerificationRequest done() { | ||
return parent; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest cardholderName(String cardholderName) { | ||
this.cardholderName = cardholderName; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest cvv(String cvv) { | ||
this.cvv = cvv; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest expirationDate(String expirationDate) { | ||
this.expirationDate = expirationDate; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest expirationMonth(String expirationMonth) { | ||
this.expirationMonth = expirationMonth; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest expirationYear(String expirationYear) { | ||
this.expirationYear = expirationYear; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest number(String number) { | ||
this.number = number; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationBillingAddressRequest billingAddress() { | ||
billingAddress = new CreditCardVerificationBillingAddressRequest(this); | ||
return billingAddress; | ||
} | ||
|
||
@Override | ||
public String toXML() { | ||
return buildRequest("creditCard").toXML(); | ||
} | ||
|
||
protected RequestBuilder buildRequest(String root) { | ||
return new RequestBuilder(root). | ||
addElement("cardholderName", cardholderName). | ||
addElement("cvv", cvv). | ||
addElement("number", number). | ||
addElement("expirationDate", expirationDate). | ||
addElement("expirationMonth", expirationMonth). | ||
addElement("expirationYear", expirationYear). | ||
addElement("billingAddress", billingAddress); | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/braintreegateway/CreditCardVerificationOptionsRequest.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,37 @@ | ||
package com.braintreegateway; | ||
|
||
public class CreditCardVerificationOptionsRequest extends Request { | ||
private CreditCardVerificationRequest parent; | ||
private String merchantAccountId; | ||
private String amount; | ||
|
||
public CreditCardVerificationOptionsRequest(CreditCardVerificationRequest parent) { | ||
this.parent = parent; | ||
} | ||
|
||
public CreditCardVerificationOptionsRequest merchantAccountId(String merchantAccountId) { | ||
this.merchantAccountId = merchantAccountId; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationOptionsRequest amount(String amount) { | ||
this.amount = amount; | ||
return this; | ||
} | ||
|
||
public CreditCardVerificationRequest done() { | ||
return parent; | ||
} | ||
|
||
@Override | ||
public String toXML() { | ||
return buildRequest("options").toXML(); | ||
} | ||
|
||
protected RequestBuilder buildRequest(String root) { | ||
RequestBuilder builder = new RequestBuilder(root). | ||
addElement("merchantAccountId", merchantAccountId). | ||
addElement("amount", amount); | ||
return builder; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/braintreegateway/CreditCardVerificationRequest.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,32 @@ | ||
package com.braintreegateway; | ||
|
||
public class CreditCardVerificationRequest extends Request { | ||
|
||
private CreditCardVerificationCreditCardRequest creditCardRequest; | ||
private CreditCardVerificationOptionsRequest optionsRequest; | ||
|
||
public CreditCardVerificationRequest() { | ||
} | ||
|
||
public CreditCardVerificationCreditCardRequest creditCard() { | ||
creditCardRequest = new CreditCardVerificationCreditCardRequest(this); | ||
return creditCardRequest; | ||
} | ||
|
||
public CreditCardVerificationOptionsRequest options() { | ||
optionsRequest = new CreditCardVerificationOptionsRequest(this); | ||
return optionsRequest; | ||
} | ||
|
||
@Override | ||
public String toXML() { | ||
return buildRequest("verification").toXML(); | ||
} | ||
|
||
protected RequestBuilder buildRequest(String root) { | ||
RequestBuilder builder = new RequestBuilder(root). | ||
addElement("creditCard", creditCardRequest). | ||
addElement("options", optionsRequest); | ||
return builder; | ||
} | ||
} |
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
Oops, something went wrong.