-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from stripe/remi-countryspec-support
Added support for CountrySpec
- Loading branch information
Showing
6 changed files
with
231 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.stripe.model; | ||
|
||
import com.stripe.exception.APIConnectionException; | ||
import com.stripe.exception.APIException; | ||
import com.stripe.exception.AuthenticationException; | ||
import com.stripe.exception.CardException; | ||
import com.stripe.exception.InvalidRequestException; | ||
import com.stripe.net.APIResource; | ||
import com.stripe.net.RequestOptions; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class CountrySpec extends APIResource implements HasId { | ||
String id; | ||
Map<String, List<String>> supportedBankAccountCurrencies; | ||
List<String> supportedPaymentCurrencies; | ||
List<String> supportedPaymentMethods; | ||
VerificationFields verificationFields; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public Map<String, List<String>> getSupportedBankAccountCurrencies() { | ||
return supportedBankAccountCurrencies; | ||
} | ||
|
||
public void setSupportedBankAccountCurrencies(Map<String, List<String>> supportedBankAccountCurrencies) { | ||
this.supportedBankAccountCurrencies = supportedBankAccountCurrencies; | ||
} | ||
|
||
public List<String> getSupportedPaymentCurrencies() { | ||
return supportedPaymentCurrencies; | ||
} | ||
|
||
public void setSupportedPaymentCurrencies(List<String> supportedPaymentCurrencies) { | ||
this.supportedPaymentCurrencies = supportedPaymentCurrencies; | ||
} | ||
|
||
public List<String> getSupportedPaymentMethods() { | ||
return supportedPaymentMethods; | ||
} | ||
|
||
public void setSupportedPaymentMethods(List<String> supportedPaymentMethods) { | ||
this.supportedPaymentMethods = supportedPaymentMethods; | ||
} | ||
|
||
public VerificationFields getVerificationFields() { | ||
return verificationFields; | ||
} | ||
|
||
public void setVerificationFields(VerificationFields verificationFields) { | ||
this.verificationFields = verificationFields; | ||
} | ||
|
||
public static CountrySpec retrieve(String country) throws AuthenticationException, | ||
InvalidRequestException, APIConnectionException, CardException, | ||
APIException { | ||
return retrieve(country, (RequestOptions) null); | ||
} | ||
|
||
public static CountrySpec retrieve(String country, RequestOptions options) | ||
throws AuthenticationException, InvalidRequestException, | ||
APIConnectionException, CardException, APIException { | ||
return request( | ||
RequestMethod.GET, | ||
instanceURL(CountrySpec.class, country), | ||
null, | ||
CountrySpec.class, | ||
options); | ||
} | ||
|
||
public static CountrySpecCollection list(Map<String, Object> params) | ||
throws AuthenticationException, InvalidRequestException, | ||
APIConnectionException, CardException, APIException { | ||
return list(params, (RequestOptions) null); | ||
} | ||
|
||
public static CountrySpecCollection list(Map<String, Object> params, RequestOptions options) | ||
throws AuthenticationException, InvalidRequestException, | ||
APIConnectionException, CardException, APIException { | ||
return requestCollection(classURL(CountrySpec.class), params, CountrySpecCollection.class, options); | ||
} | ||
} |
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,4 @@ | ||
package com.stripe.model; | ||
|
||
public class CountrySpecCollection extends StripeCollection<CountrySpec> { | ||
} |
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,48 @@ | ||
package com.stripe.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import java.util.List; | ||
|
||
public final class VerificationFields extends StripeObject { | ||
protected VerificationFieldsDetails individual; | ||
protected VerificationFieldsDetails company; | ||
|
||
public VerificationFieldsDetails getIndividual() { | ||
return individual; | ||
} | ||
|
||
public VerificationFields setIndividual(VerificationFieldsDetails individual) { | ||
this.individual = individual; | ||
return this; | ||
} | ||
|
||
public VerificationFieldsDetails getCompany() { | ||
return company; | ||
} | ||
|
||
public VerificationFields setCompany(VerificationFieldsDetails company) { | ||
this.company = company; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
VerificationFields verificationFields = (VerificationFields) o; | ||
|
||
if (individual != null ? !individual.equals(verificationFields.individual) : verificationFields.individual != null) { | ||
return false; | ||
} | ||
if (company != null ? !company.equals(verificationFields.company) : verificationFields.company != null) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/com/stripe/model/VerificationFieldsDetails.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,48 @@ | ||
package com.stripe.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import java.util.List; | ||
|
||
public final class VerificationFieldsDetails extends StripeObject { | ||
protected List<String> additional; | ||
protected List<String> minimum; | ||
|
||
public List<String> getAdditional() { | ||
return additional; | ||
} | ||
|
||
public VerificationFieldsDetails setAdditional(List<String> additional) { | ||
this.additional = additional; | ||
return this; | ||
} | ||
|
||
public List<String> getMinimum() { | ||
return minimum; | ||
} | ||
|
||
public VerificationFieldsDetails setMinimum(List<String> minimum) { | ||
this.additional = minimum; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
VerificationFieldsDetails verificationFieldsDetails = (VerificationFieldsDetails) o; | ||
|
||
if (additional != null ? !additional.equals(verificationFieldsDetails.additional) : verificationFieldsDetails.additional != null) { | ||
return false; | ||
} | ||
if (minimum != null ? !minimum.equals(verificationFieldsDetails.minimum) : verificationFieldsDetails.minimum != null) { | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
} |
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