diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f55dfdf..62733cb 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -29,6 +29,9 @@ src/main/java/com/gr4vy/api/auth/HttpBasicAuth.java src/main/java/com/gr4vy/api/auth/HttpBearerAuth.java src/main/java/com/gr4vy/api/model/APIKeyPairCreate.java src/main/java/com/gr4vy/api/model/APIKeyPairUpdate.java +src/main/java/com/gr4vy/api/model/AccountUpdaterInquirySummary.java +src/main/java/com/gr4vy/api/model/AccountUpdaterJob.java +src/main/java/com/gr4vy/api/model/AccountUpdaterJobCreate.java src/main/java/com/gr4vy/api/model/Address.java src/main/java/com/gr4vy/api/model/AntiFraudDecisionErrorEvent.java src/main/java/com/gr4vy/api/model/AntiFraudDecisionErrorEventContext.java @@ -68,7 +71,6 @@ src/main/java/com/gr4vy/api/model/BuyerUpdate.java src/main/java/com/gr4vy/api/model/Buyers.java src/main/java/com/gr4vy/api/model/CardDetails.java src/main/java/com/gr4vy/api/model/CardRequest.java -src/main/java/com/gr4vy/api/model/CardScheme.java src/main/java/com/gr4vy/api/model/CardSchemeDefinition.java src/main/java/com/gr4vy/api/model/CardSchemeDefinitions.java src/main/java/com/gr4vy/api/model/CartItem.java @@ -78,6 +80,7 @@ src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethod.java src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethodDetails.java src/main/java/com/gr4vy/api/model/CheckoutSessionRequest.java src/main/java/com/gr4vy/api/model/CheckoutSessionUpdateRequest.java +src/main/java/com/gr4vy/api/model/ClickToPaySessionRequest.java src/main/java/com/gr4vy/api/model/Connection.java src/main/java/com/gr4vy/api/model/ConnectionDefinition.java src/main/java/com/gr4vy/api/model/ConnectionDefinitions.java @@ -85,6 +88,16 @@ src/main/java/com/gr4vy/api/model/ConnectionOptions.java src/main/java/com/gr4vy/api/model/ConnectionOptionsAdyenCard.java src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraud.java src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraud.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudAddress.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBasicItemData.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBeneficiaries.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCartItems.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudComments.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudDeliveryDetails.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPersonalDetails.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPhone.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscount.java +src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.java src/main/java/com/gr4vy/api/model/ConnectionOptionsPaypalPaypal.java src/main/java/com/gr4vy/api/model/ConnectionOptionsPaypalPaypalAdditionalData.java src/main/java/com/gr4vy/api/model/Connections.java @@ -110,16 +123,35 @@ src/main/java/com/gr4vy/api/model/Error404PendingCreation.java src/main/java/com/gr4vy/api/model/Error409DuplicateRecord.java src/main/java/com/gr4vy/api/model/ErrorDetail.java src/main/java/com/gr4vy/api/model/ErrorGeneric.java +src/main/java/com/gr4vy/api/model/GiftCard.java +src/main/java/com/gr4vy/api/model/GiftCardBalanceNewRequest.java +src/main/java/com/gr4vy/api/model/GiftCardBalanceRequest.java +src/main/java/com/gr4vy/api/model/GiftCardBalanceStoredRequest.java +src/main/java/com/gr4vy/api/model/GiftCardBalancesRequest.java +src/main/java/com/gr4vy/api/model/GiftCardRedemption.java +src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailed.java +src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailedContext.java +src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceeded.java +src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceededContext.java +src/main/java/com/gr4vy/api/model/GiftCardRefundFailed.java +src/main/java/com/gr4vy/api/model/GiftCardRefundFailedContext.java +src/main/java/com/gr4vy/api/model/GiftCardRefundSucceeded.java src/main/java/com/gr4vy/api/model/GiftCardService.java src/main/java/com/gr4vy/api/model/GiftCardServiceCreateRequest.java src/main/java/com/gr4vy/api/model/GiftCardServiceCreateRequestFields.java src/main/java/com/gr4vy/api/model/GiftCardServiceDefinition.java src/main/java/com/gr4vy/api/model/GiftCardServiceDefinitionFields.java src/main/java/com/gr4vy/api/model/GiftCardServiceFields.java +src/main/java/com/gr4vy/api/model/GiftCardServiceSnapshot.java src/main/java/com/gr4vy/api/model/GiftCardServiceUpdateRequest.java src/main/java/com/gr4vy/api/model/GiftCardServiceUpdateRequestFields.java src/main/java/com/gr4vy/api/model/GiftCardServiceVerifyRequest.java src/main/java/com/gr4vy/api/model/GiftCardServiceVerifyRequestFields.java +src/main/java/com/gr4vy/api/model/GiftCardSnapshot.java +src/main/java/com/gr4vy/api/model/GiftCardStoreRequest.java +src/main/java/com/gr4vy/api/model/GiftCardSummary.java +src/main/java/com/gr4vy/api/model/GiftCards.java +src/main/java/com/gr4vy/api/model/GiftCardsSummary.java src/main/java/com/gr4vy/api/model/GooglePayRequest.java src/main/java/com/gr4vy/api/model/GooglePayRequestAssuranceDetails.java src/main/java/com/gr4vy/api/model/GooglePaySessionRequest.java @@ -236,6 +268,9 @@ src/main/java/com/gr4vy/api/model/Transaction.java src/main/java/com/gr4vy/api/model/TransactionCaptureRequest.java src/main/java/com/gr4vy/api/model/TransactionCardRequest.java src/main/java/com/gr4vy/api/model/TransactionCheckoutSessionRequest.java +src/main/java/com/gr4vy/api/model/TransactionGiftCardNewRequest.java +src/main/java/com/gr4vy/api/model/TransactionGiftCardRequest.java +src/main/java/com/gr4vy/api/model/TransactionGiftCardStoredRequest.java src/main/java/com/gr4vy/api/model/TransactionHistoryEvent.java src/main/java/com/gr4vy/api/model/TransactionHistoryEvents.java src/main/java/com/gr4vy/api/model/TransactionPaymentMethodRequest.java @@ -250,6 +285,7 @@ src/main/java/com/gr4vy/api/model/UserCurrentUpdate.java src/main/java/com/gr4vy/api/model/UserRequest.java src/main/java/com/gr4vy/api/model/UserRole.java src/main/java/com/gr4vy/api/model/UserUpdate.java +src/main/java/com/gr4vy/api/openapi/AccountUpdaterApi.java src/main/java/com/gr4vy/api/openapi/ApiLogsApi.java src/main/java/com/gr4vy/api/openapi/AuditLogsApi.java src/main/java/com/gr4vy/api/openapi/BuyersApi.java @@ -258,6 +294,7 @@ src/main/java/com/gr4vy/api/openapi/CheckoutSessionsApi.java src/main/java/com/gr4vy/api/openapi/DigitalWalletsApi.java src/main/java/com/gr4vy/api/openapi/GiftCardServiceDefinitionsApi.java src/main/java/com/gr4vy/api/openapi/GiftCardServicesApi.java +src/main/java/com/gr4vy/api/openapi/GiftCardsApi.java src/main/java/com/gr4vy/api/openapi/MerchantAccountsApi.java src/main/java/com/gr4vy/api/openapi/PaymentMethodDefinitionsApi.java src/main/java/com/gr4vy/api/openapi/PaymentMethodsApi.java @@ -271,6 +308,9 @@ src/main/java/com/gr4vy/api/openapi/TransactionsApi.java src/main/java/com/gr4vy/api/openapi/VaultForwardApi.java src/test/java/com/gr4vy/api/model/APIKeyPairCreateTest.java src/test/java/com/gr4vy/api/model/APIKeyPairUpdateTest.java +src/test/java/com/gr4vy/api/model/AccountUpdaterInquirySummaryTest.java +src/test/java/com/gr4vy/api/model/AccountUpdaterJobCreateTest.java +src/test/java/com/gr4vy/api/model/AccountUpdaterJobTest.java src/test/java/com/gr4vy/api/model/AddressTest.java src/test/java/com/gr4vy/api/model/AntiFraudDecisionErrorEventContextTest.java src/test/java/com/gr4vy/api/model/AntiFraudDecisionErrorEventTest.java @@ -312,7 +352,6 @@ src/test/java/com/gr4vy/api/model/CardDetailsTest.java src/test/java/com/gr4vy/api/model/CardRequestTest.java src/test/java/com/gr4vy/api/model/CardSchemeDefinitionTest.java src/test/java/com/gr4vy/api/model/CardSchemeDefinitionsTest.java -src/test/java/com/gr4vy/api/model/CardSchemeTest.java src/test/java/com/gr4vy/api/model/CartItemTest.java src/test/java/com/gr4vy/api/model/CheckoutSessionCreateRequestTest.java src/test/java/com/gr4vy/api/model/CheckoutSessionPaymentMethodDetailsTest.java @@ -320,11 +359,22 @@ src/test/java/com/gr4vy/api/model/CheckoutSessionPaymentMethodTest.java src/test/java/com/gr4vy/api/model/CheckoutSessionRequestTest.java src/test/java/com/gr4vy/api/model/CheckoutSessionTest.java src/test/java/com/gr4vy/api/model/CheckoutSessionUpdateRequestTest.java +src/test/java/com/gr4vy/api/model/ClickToPaySessionRequestTest.java src/test/java/com/gr4vy/api/model/ConnectionDefinitionTest.java src/test/java/com/gr4vy/api/model/ConnectionDefinitionsTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsAdyenCardTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraudTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudAddressTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBasicItemDataTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBeneficiariesTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCartItemsTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCommentsTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudDeliveryDetailsTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPersonalDetailsTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPhoneTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmountTest.java +src/test/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsPaypalPaypalAdditionalDataTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsPaypalPaypalTest.java src/test/java/com/gr4vy/api/model/ConnectionOptionsTest.java @@ -352,16 +402,35 @@ src/test/java/com/gr4vy/api/model/Error404PendingCreationTest.java src/test/java/com/gr4vy/api/model/Error409DuplicateRecordTest.java src/test/java/com/gr4vy/api/model/ErrorDetailTest.java src/test/java/com/gr4vy/api/model/ErrorGenericTest.java +src/test/java/com/gr4vy/api/model/GiftCardBalanceNewRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardBalanceRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardBalanceStoredRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardBalancesRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardRedemptionFailedContextTest.java +src/test/java/com/gr4vy/api/model/GiftCardRedemptionFailedTest.java +src/test/java/com/gr4vy/api/model/GiftCardRedemptionSucceededContextTest.java +src/test/java/com/gr4vy/api/model/GiftCardRedemptionSucceededTest.java +src/test/java/com/gr4vy/api/model/GiftCardRedemptionTest.java +src/test/java/com/gr4vy/api/model/GiftCardRefundFailedContextTest.java +src/test/java/com/gr4vy/api/model/GiftCardRefundFailedTest.java +src/test/java/com/gr4vy/api/model/GiftCardRefundSucceededTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceCreateRequestFieldsTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceCreateRequestTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceDefinitionFieldsTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceDefinitionTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceFieldsTest.java +src/test/java/com/gr4vy/api/model/GiftCardServiceSnapshotTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceUpdateRequestFieldsTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceUpdateRequestTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceVerifyRequestFieldsTest.java src/test/java/com/gr4vy/api/model/GiftCardServiceVerifyRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardSnapshotTest.java +src/test/java/com/gr4vy/api/model/GiftCardStoreRequestTest.java +src/test/java/com/gr4vy/api/model/GiftCardSummaryTest.java +src/test/java/com/gr4vy/api/model/GiftCardTest.java +src/test/java/com/gr4vy/api/model/GiftCardsSummaryTest.java +src/test/java/com/gr4vy/api/model/GiftCardsTest.java src/test/java/com/gr4vy/api/model/GooglePayRequestAssuranceDetailsTest.java src/test/java/com/gr4vy/api/model/GooglePayRequestTest.java src/test/java/com/gr4vy/api/model/GooglePaySessionRequestTest.java @@ -477,6 +546,9 @@ src/test/java/com/gr4vy/api/model/TokenizedRequestTest.java src/test/java/com/gr4vy/api/model/TransactionCaptureRequestTest.java src/test/java/com/gr4vy/api/model/TransactionCardRequestTest.java src/test/java/com/gr4vy/api/model/TransactionCheckoutSessionRequestTest.java +src/test/java/com/gr4vy/api/model/TransactionGiftCardNewRequestTest.java +src/test/java/com/gr4vy/api/model/TransactionGiftCardRequestTest.java +src/test/java/com/gr4vy/api/model/TransactionGiftCardStoredRequestTest.java src/test/java/com/gr4vy/api/model/TransactionHistoryEventTest.java src/test/java/com/gr4vy/api/model/TransactionHistoryEventsTest.java src/test/java/com/gr4vy/api/model/TransactionPaymentMethodRequestTest.java @@ -492,6 +564,7 @@ src/test/java/com/gr4vy/api/model/UserCurrentUpdateTest.java src/test/java/com/gr4vy/api/model/UserRequestTest.java src/test/java/com/gr4vy/api/model/UserRoleTest.java src/test/java/com/gr4vy/api/model/UserUpdateTest.java +src/test/java/com/gr4vy/api/openapi/AccountUpdaterApiTest.java src/test/java/com/gr4vy/api/openapi/ApiLogsApiTest.java src/test/java/com/gr4vy/api/openapi/AuditLogsApiTest.java src/test/java/com/gr4vy/api/openapi/BuyersApiTest.java @@ -500,6 +573,7 @@ src/test/java/com/gr4vy/api/openapi/CheckoutSessionsApiTest.java src/test/java/com/gr4vy/api/openapi/DigitalWalletsApiTest.java src/test/java/com/gr4vy/api/openapi/GiftCardServiceDefinitionsApiTest.java src/test/java/com/gr4vy/api/openapi/GiftCardServicesApiTest.java +src/test/java/com/gr4vy/api/openapi/GiftCardsApiTest.java src/test/java/com/gr4vy/api/openapi/MerchantAccountsApiTest.java src/test/java/com/gr4vy/api/openapi/PaymentMethodDefinitionsApiTest.java src/test/java/com/gr4vy/api/openapi/PaymentMethodsApiTest.java diff --git a/openapi-generator-generate.sh b/openapi-generator-generate.sh index 021e5d7..029e607 100755 --- a/openapi-generator-generate.sh +++ b/openapi-generator-generate.sh @@ -39,7 +39,7 @@ var1='DigitalWalletFields' rep1='DigitalWalletClickToPayFields' sed -i '' "s/$var1/$rep1/g" src/main/java/com/gr4vy/api/model/DigitalWallet.java -var1='AnyOfBINLookupRequestThreeDSecureAuthenticationRequestEventThreeDSecureSuccessEventThreeDSecureRequestErrorEventThreeDSecurePreparationRequestEventThreeDSecureResultRequestEventAntiFraudDecisionEventAntiFraudDecisionErrorEventAntiFraudDecisionSkippedEventAntiFraudTransactionStatusUpdateEventAntiFraudTransactionStatusUpdateErrorEventAntiFraudWebhookEventDigitalWalletApplePayTokenDecryptedDigitalWalletClickToPayTokenDecryptedDigitalWalletGooglePayTokenDecryptedPaymentConnectorResponseTransactionAuthorizationSucceededEventPaymentConnectorResponseTransactionDeclinedEventPaymentConnectorResponseTransactionAuthorizationFailedEventPaymentConnectorResponseTransactionCaptureDeclinedEventPaymentConnectorResponseTransactionCaptureFailedEventPaymentConnectorResponseTransactionCaptureSucceededEventPaymentConnectorResponseTransactionVoidDeclinedEventPaymentConnectorResponseTransactionVoidFailedEventPaymentConnectorResponseTransactionVoidSucceededEventPaymentConnectorExternalTransactionRequest' +var1='AnyOfBINLookupRequestThreeDSecureAuthenticationRequestEventThreeDSecureSuccessEventThreeDSecureRequestErrorEventThreeDSecurePreparationRequestEventThreeDSecureResultRequestEventAntiFraudDecisionEventAntiFraudDecisionErrorEventAntiFraudDecisionSkippedEventAntiFraudTransactionStatusUpdateEventAntiFraudTransactionStatusUpdateErrorEventAntiFraudWebhookEventDigitalWalletApplePayTokenDecryptedDigitalWalletClickToPayTokenDecryptedDigitalWalletGooglePayTokenDecryptedGiftCardRedemptionFailedGiftCardRedemptionSucceededGiftCardRefundFailedGiftCardRefundSucceededPaymentConnectorResponseTransactionAuthorizationSucceededEventPaymentConnectorResponseTransactionDeclinedEventPaymentConnectorResponseTransactionAuthorizationFailedEventPaymentConnectorResponseTransactionCaptureDeclinedEventPaymentConnectorResponseTransactionCaptureFailedEventPaymentConnectorResponseTransactionCaptureSucceededEventPaymentConnectorResponseTransactionVoidDeclinedEventPaymentConnectorResponseTransactionVoidFailedEventPaymentConnectorResponseTransactionVoidSucceededEventPaymentConnectorExternalTransactionRequest' rep1='TransactionHistoryEvent' sed -i '' "s/$var1/$rep1/g" src/main/java/com/gr4vy/api/model/TransactionHistoryEvents.java diff --git a/src/main/java/com/gr4vy/api/model/AccountUpdaterInquirySummary.java b/src/main/java/com/gr4vy/api/model/AccountUpdaterInquirySummary.java new file mode 100644 index 0000000..20f777c --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/AccountUpdaterInquirySummary.java @@ -0,0 +1,203 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * An Account Updater inquiry summary. + */ +@ApiModel(description = "An Account Updater inquiry summary.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AccountUpdaterInquirySummary { + /** + * The type of this resource. Is always `account-updater-inquiry`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNT_UPDATER_INQUIRY("account-updater-inquiry"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_ID = "payment_method_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_ID) + private UUID paymentMethodId; + + + public AccountUpdaterInquirySummary type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `account-updater-inquiry`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "account-updater-inquiry", value = "The type of this resource. Is always `account-updater-inquiry`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public AccountUpdaterInquirySummary id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this Account Updater inquiry. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "d038f8bf-f1fd-45b3-9948-e1fbb58e8d62", value = "The unique identifier for this Account Updater inquiry.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public AccountUpdaterInquirySummary paymentMethodId(UUID paymentMethodId) { + + this.paymentMethodId = paymentMethodId; + return this; + } + + /** + * The ID of the payment method associated with this Account Updater inquiry. + * @return paymentMethodId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "497f6eca-6276-4993-bfeb-53cbbbba6f08", value = "The ID of the payment method associated with this Account Updater inquiry.") + + public UUID getPaymentMethodId() { + return paymentMethodId; + } + + + public void setPaymentMethodId(UUID paymentMethodId) { + this.paymentMethodId = paymentMethodId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdaterInquirySummary accountUpdaterInquirySummary = (AccountUpdaterInquirySummary) o; + return Objects.equals(this.type, accountUpdaterInquirySummary.type) && + Objects.equals(this.id, accountUpdaterInquirySummary.id) && + Objects.equals(this.paymentMethodId, accountUpdaterInquirySummary.paymentMethodId); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, paymentMethodId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdaterInquirySummary {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" paymentMethodId: ").append(toIndentedString(paymentMethodId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/AccountUpdaterJob.java b/src/main/java/com/gr4vy/api/model/AccountUpdaterJob.java new file mode 100644 index 0000000..c65678d --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/AccountUpdaterJob.java @@ -0,0 +1,302 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.AccountUpdaterInquirySummary; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + + +/** + * An Account Updater job. + */ +@ApiModel(description = "An Account Updater job.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AccountUpdaterJob { + /** + * The type of this resource. Is always `account-updater-job`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNT_UPDATER_JOB("account-updater-job"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_INQUIRIES = "inquiries"; + @SerializedName(SERIALIZED_NAME_INQUIRIES) + private List inquiries = null; + + + public AccountUpdaterJob type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `account-updater-job`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "account-updater-job", value = "The type of this resource. Is always `account-updater-job`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public AccountUpdaterJob id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this Account Updater job. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this Account Updater job.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public AccountUpdaterJob merchantAccountId(String merchantAccountId) { + + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The unique ID for a merchant account. + * @return merchantAccountId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + + public String getMerchantAccountId() { + return merchantAccountId; + } + + + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; + } + + + public AccountUpdaterJob createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this Account Updater job was created. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this Account Updater job was created.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public AccountUpdaterJob updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when this Account Updater job was last updated. + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this Account Updater job was last updated.") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + public AccountUpdaterJob inquiries(List inquiries) { + + this.inquiries = inquiries; + return this; + } + + public AccountUpdaterJob addInquiriesItem(AccountUpdaterInquirySummary inquiriesItem) { + if (this.inquiries == null) { + this.inquiries = new ArrayList(); + } + this.inquiries.add(inquiriesItem); + return this; + } + + /** + * A list of inquiries associated with this Account Updater job. + * @return inquiries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of inquiries associated with this Account Updater job.") + + public List getInquiries() { + return inquiries; + } + + + public void setInquiries(List inquiries) { + this.inquiries = inquiries; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdaterJob accountUpdaterJob = (AccountUpdaterJob) o; + return Objects.equals(this.type, accountUpdaterJob.type) && + Objects.equals(this.id, accountUpdaterJob.id) && + Objects.equals(this.merchantAccountId, accountUpdaterJob.merchantAccountId) && + Objects.equals(this.createdAt, accountUpdaterJob.createdAt) && + Objects.equals(this.updatedAt, accountUpdaterJob.updatedAt) && + Objects.equals(this.inquiries, accountUpdaterJob.inquiries); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, merchantAccountId, createdAt, updatedAt, inquiries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdaterJob {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" inquiries: ").append(toIndentedString(inquiries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/AccountUpdaterJobCreate.java b/src/main/java/com/gr4vy/api/model/AccountUpdaterJobCreate.java new file mode 100644 index 0000000..cc2c245 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/AccountUpdaterJobCreate.java @@ -0,0 +1,106 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * A request to create an Account Updater job. + */ +@ApiModel(description = "A request to create an Account Updater job.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AccountUpdaterJobCreate { + public static final String SERIALIZED_NAME_PAYMENT_METHOD_IDS = "payment_method_ids"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_IDS) + private List paymentMethodIds = new ArrayList(); + + + public AccountUpdaterJobCreate paymentMethodIds(List paymentMethodIds) { + + this.paymentMethodIds = paymentMethodIds; + return this; + } + + public AccountUpdaterJobCreate addPaymentMethodIdsItem(UUID paymentMethodIdsItem) { + this.paymentMethodIds.add(paymentMethodIdsItem); + return this; + } + + /** + * A list of unique payment method identifiers used to create the Account Updater job. A payment method will be considered only if it qualifies for an inquiry. + * @return paymentMethodIds + **/ + @ApiModelProperty(example = "[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]", required = true, value = "A list of unique payment method identifiers used to create the Account Updater job. A payment method will be considered only if it qualifies for an inquiry.") + + public List getPaymentMethodIds() { + return paymentMethodIds; + } + + + public void setPaymentMethodIds(List paymentMethodIds) { + this.paymentMethodIds = paymentMethodIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountUpdaterJobCreate accountUpdaterJobCreate = (AccountUpdaterJobCreate) o; + return Objects.equals(this.paymentMethodIds, accountUpdaterJobCreate.paymentMethodIds); + } + + @Override + public int hashCode() { + return Objects.hash(paymentMethodIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountUpdaterJobCreate {\n"); + sb.append(" paymentMethodIds: ").append(toIndentedString(paymentMethodIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ApplePayRequest.java b/src/main/java/com/gr4vy/api/model/ApplePayRequest.java index 3b65046..09d2664 100644 --- a/src/main/java/com/gr4vy/api/model/ApplePayRequest.java +++ b/src/main/java/com/gr4vy/api/model/ApplePayRequest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; /** * Details for a Apple Pay payment method. @@ -84,14 +83,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TOKEN) private Object token; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public ApplePayRequest method(MethodEnum method) { @@ -137,52 +128,6 @@ public void setToken(Object token) { } - public ApplePayRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public ApplePayRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -193,14 +138,12 @@ public boolean equals(Object o) { } ApplePayRequest applePayRequest = (ApplePayRequest) o; return Objects.equals(this.method, applePayRequest.method) && - Objects.equals(this.token, applePayRequest.token) && - Objects.equals(this.buyerId, applePayRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, applePayRequest.buyerExternalIdentifier); + Objects.equals(this.token, applePayRequest.token); } @Override public int hashCode() { - return Objects.hash(method, token, buyerId, buyerExternalIdentifier); + return Objects.hash(method, token); } @Override @@ -209,8 +152,6 @@ public String toString() { sb.append("class ApplePayRequest {\n"); sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/BINLookupRequestContext.java b/src/main/java/com/gr4vy/api/model/BINLookupRequestContext.java index e6f7858..a323037 100644 --- a/src/main/java/com/gr4vy/api/model/BINLookupRequestContext.java +++ b/src/main/java/com/gr4vy/api/model/BINLookupRequestContext.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * BIN lookup request context. @@ -50,14 +52,200 @@ public class BINLookupRequestContext { @SerializedName(SERIALIZED_NAME_TYPE) private String type; + /** + * The card scheme result from the lookup response. + */ + @JsonAdapter(SchemeEnum.Adapter.class) + public enum SchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + SchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SchemeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SCHEME = "scheme"; @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; + private SchemeEnum scheme; + + /** + * Gets or Sets additionalSchemes + */ + @JsonAdapter(AdditionalSchemesEnum.Adapter.class) + public enum AdditionalSchemesEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + AdditionalSchemesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AdditionalSchemesEnum fromValue(String value) { + for (AdditionalSchemesEnum b : AdditionalSchemesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AdditionalSchemesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AdditionalSchemesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AdditionalSchemesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ADDITIONAL_SCHEMES = "additional_schemes"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_SCHEMES) + private List additionalSchemes = null; public static final String SERIALIZED_NAME_COUNTRY_CODE = "country_code"; @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; + public static final String SERIALIZED_NAME_ACCOUNT_UPDATER = "account_updater"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_UPDATER) + private Boolean accountUpdater; + + public static final String SERIALIZED_NAME_ISSUER_TOKENIZATION = "issuer_tokenization"; + @SerializedName(SERIALIZED_NAME_ISSUER_TOKENIZATION) + private Boolean issuerTokenization; + public BINLookupRequestContext response(String response) { @@ -174,7 +362,7 @@ public void setType(String type) { } - public BINLookupRequestContext scheme(String scheme) { + public BINLookupRequestContext scheme(SchemeEnum scheme) { this.scheme = scheme; return this; @@ -185,18 +373,49 @@ public BINLookupRequestContext scheme(String scheme) { * @return scheme **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The card scheme result from the lookup response.") + @ApiModelProperty(example = "visa", value = "The card scheme result from the lookup response.") - public String getScheme() { + public SchemeEnum getScheme() { return scheme; } - public void setScheme(String scheme) { + public void setScheme(SchemeEnum scheme) { this.scheme = scheme; } + public BINLookupRequestContext additionalSchemes(List additionalSchemes) { + + this.additionalSchemes = additionalSchemes; + return this; + } + + public BINLookupRequestContext addAdditionalSchemesItem(AdditionalSchemesEnum additionalSchemesItem) { + if (this.additionalSchemes == null) { + this.additionalSchemes = new ArrayList(); + } + this.additionalSchemes.add(additionalSchemesItem); + return this; + } + + /** + * The card additional schemes from the lookup response. + * @return additionalSchemes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The card additional schemes from the lookup response.") + + public List getAdditionalSchemes() { + return additionalSchemes; + } + + + public void setAdditionalSchemes(List additionalSchemes) { + this.additionalSchemes = additionalSchemes; + } + + public BINLookupRequestContext countryCode(String countryCode) { this.countryCode = countryCode; @@ -220,6 +439,52 @@ public void setCountryCode(String countryCode) { } + public BINLookupRequestContext accountUpdater(Boolean accountUpdater) { + + this.accountUpdater = accountUpdater; + return this; + } + + /** + * Whether Account Updater is enabled for this card. + * @return accountUpdater + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether Account Updater is enabled for this card.") + + public Boolean getAccountUpdater() { + return accountUpdater; + } + + + public void setAccountUpdater(Boolean accountUpdater) { + this.accountUpdater = accountUpdater; + } + + + public BINLookupRequestContext issuerTokenization(Boolean issuerTokenization) { + + this.issuerTokenization = issuerTokenization; + return this; + } + + /** + * Whether the issuing bank supports network tokenization for this card. + * @return issuerTokenization + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Whether the issuing bank supports network tokenization for this card.") + + public Boolean getIssuerTokenization() { + return issuerTokenization; + } + + + public void setIssuerTokenization(Boolean issuerTokenization) { + this.issuerTokenization = issuerTokenization; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -235,12 +500,15 @@ public boolean equals(Object o) { Objects.equals(this.bin, biNLookupRequestContext.bin) && Objects.equals(this.type, biNLookupRequestContext.type) && Objects.equals(this.scheme, biNLookupRequestContext.scheme) && - Objects.equals(this.countryCode, biNLookupRequestContext.countryCode); + Objects.equals(this.additionalSchemes, biNLookupRequestContext.additionalSchemes) && + Objects.equals(this.countryCode, biNLookupRequestContext.countryCode) && + Objects.equals(this.accountUpdater, biNLookupRequestContext.accountUpdater) && + Objects.equals(this.issuerTokenization, biNLookupRequestContext.issuerTokenization); } @Override public int hashCode() { - return Objects.hash(response, responseStatusCode, success, bin, type, scheme, countryCode); + return Objects.hash(response, responseStatusCode, success, bin, type, scheme, additionalSchemes, countryCode, accountUpdater, issuerTokenization); } @Override @@ -253,7 +521,10 @@ public String toString() { sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" additionalSchemes: ").append(toIndentedString(additionalSchemes)).append("\n"); sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" accountUpdater: ").append(toIndentedString(accountUpdater)).append("\n"); + sb.append(" issuerTokenization: ").append(toIndentedString(issuerTokenization)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/Buyer.java b/src/main/java/com/gr4vy/api/model/Buyer.java index e2fd38d..08378d4 100644 --- a/src/main/java/com/gr4vy/api/model/Buyer.java +++ b/src/main/java/com/gr4vy/api/model/Buyer.java @@ -85,18 +85,6 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; - public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; - @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) - private String merchantAccountId; - - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - public static final String SERIALIZED_NAME_BILLING_DETAILS = "billing_details"; @SerializedName(SERIALIZED_NAME_BILLING_DETAILS) private BillingDetails billingDetails; @@ -105,6 +93,18 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CREATED_AT) private String createdAt; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; @SerializedName(SERIALIZED_NAME_UPDATED_AT) private String updatedAt; @@ -156,49 +156,49 @@ public void setId(UUID id) { } - public Buyer merchantAccountId(String merchantAccountId) { + public Buyer billingDetails(BillingDetails billingDetails) { - this.merchantAccountId = merchantAccountId; + this.billingDetails = billingDetails; return this; } /** - * The unique ID for a merchant account. - * @return merchantAccountId + * The billing details associated with a buyer. + * @return billingDetails **/ @javax.annotation.Nullable - @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + @ApiModelProperty(value = "The billing details associated with a buyer.") - public String getMerchantAccountId() { - return merchantAccountId; + public BillingDetails getBillingDetails() { + return billingDetails; } - public void setMerchantAccountId(String merchantAccountId) { - this.merchantAccountId = merchantAccountId; + public void setBillingDetails(BillingDetails billingDetails) { + this.billingDetails = billingDetails; } - public Buyer externalIdentifier(String externalIdentifier) { + public Buyer createdAt(String createdAt) { - this.externalIdentifier = externalIdentifier; + this.createdAt = createdAt; return this; } /** - * An external identifier that can be used to match the buyer against your own records. - * @return externalIdentifier + * The date and time when this buyer was created in our system. + * @return createdAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the buyer against your own records.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this buyer was created in our system.") - public String getExternalIdentifier() { - return externalIdentifier; + public String getCreatedAt() { + return createdAt; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; } @@ -225,49 +225,49 @@ public void setDisplayName(String displayName) { } - public Buyer billingDetails(BillingDetails billingDetails) { + public Buyer externalIdentifier(String externalIdentifier) { - this.billingDetails = billingDetails; + this.externalIdentifier = externalIdentifier; return this; } /** - * The billing details associated with a buyer. - * @return billingDetails + * An external identifier that can be used to match the buyer against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The billing details associated with a buyer.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the buyer against your own records.") - public BillingDetails getBillingDetails() { - return billingDetails; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setBillingDetails(BillingDetails billingDetails) { - this.billingDetails = billingDetails; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } - public Buyer createdAt(String createdAt) { + public Buyer merchantAccountId(String merchantAccountId) { - this.createdAt = createdAt; + this.merchantAccountId = merchantAccountId; return this; } /** - * The date and time when this buyer was created in our system. - * @return createdAt + * The unique ID for a merchant account. + * @return merchantAccountId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this buyer was created in our system.") + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") - public String getCreatedAt() { - return createdAt; + public String getMerchantAccountId() { + return merchantAccountId; } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; } @@ -305,17 +305,17 @@ public boolean equals(Object o) { Buyer buyer = (Buyer) o; return Objects.equals(this.type, buyer.type) && Objects.equals(this.id, buyer.id) && - Objects.equals(this.merchantAccountId, buyer.merchantAccountId) && - Objects.equals(this.externalIdentifier, buyer.externalIdentifier) && - Objects.equals(this.displayName, buyer.displayName) && Objects.equals(this.billingDetails, buyer.billingDetails) && Objects.equals(this.createdAt, buyer.createdAt) && + Objects.equals(this.displayName, buyer.displayName) && + Objects.equals(this.externalIdentifier, buyer.externalIdentifier) && + Objects.equals(this.merchantAccountId, buyer.merchantAccountId) && Objects.equals(this.updatedAt, buyer.updatedAt); } @Override public int hashCode() { - return Objects.hash(type, id, merchantAccountId, externalIdentifier, displayName, billingDetails, createdAt, updatedAt); + return Objects.hash(type, id, billingDetails, createdAt, displayName, externalIdentifier, merchantAccountId, updatedAt); } @Override @@ -324,11 +324,11 @@ public String toString() { sb.append("class Buyer {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); - sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" billingDetails: ").append(toIndentedString(billingDetails)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/gr4vy/api/model/BuyerSnapshot.java b/src/main/java/com/gr4vy/api/model/BuyerSnapshot.java index 7250045..48ef8c0 100644 --- a/src/main/java/com/gr4vy/api/model/BuyerSnapshot.java +++ b/src/main/java/com/gr4vy/api/model/BuyerSnapshot.java @@ -85,17 +85,17 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; + public static final String SERIALIZED_NAME_BILLING_DETAILS = "billing_details"; + @SerializedName(SERIALIZED_NAME_BILLING_DETAILS) + private BillingDetails billingDetails; public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) private String displayName; - public static final String SERIALIZED_NAME_BILLING_DETAILS = "billing_details"; - @SerializedName(SERIALIZED_NAME_BILLING_DETAILS) - private BillingDetails billingDetails; + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; public BuyerSnapshot type(TypeEnum type) { @@ -144,26 +144,26 @@ public void setId(UUID id) { } - public BuyerSnapshot externalIdentifier(String externalIdentifier) { + public BuyerSnapshot billingDetails(BillingDetails billingDetails) { - this.externalIdentifier = externalIdentifier; + this.billingDetails = billingDetails; return this; } /** - * An external identifier that can be used to match the buyer against your own records. - * @return externalIdentifier + * The billing details associated with the buyer, which include the address and tax ID. + * @return billingDetails **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the buyer against your own records.") + @ApiModelProperty(value = "The billing details associated with the buyer, which include the address and tax ID.") - public String getExternalIdentifier() { - return externalIdentifier; + public BillingDetails getBillingDetails() { + return billingDetails; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setBillingDetails(BillingDetails billingDetails) { + this.billingDetails = billingDetails; } @@ -190,26 +190,26 @@ public void setDisplayName(String displayName) { } - public BuyerSnapshot billingDetails(BillingDetails billingDetails) { + public BuyerSnapshot externalIdentifier(String externalIdentifier) { - this.billingDetails = billingDetails; + this.externalIdentifier = externalIdentifier; return this; } /** - * The billing details associated with the buyer, which include the address and tax ID. - * @return billingDetails + * An external identifier that can be used to match the buyer against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The billing details associated with the buyer, which include the address and tax ID.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the buyer against your own records.") - public BillingDetails getBillingDetails() { - return billingDetails; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setBillingDetails(BillingDetails billingDetails) { - this.billingDetails = billingDetails; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } @@ -224,14 +224,14 @@ public boolean equals(Object o) { BuyerSnapshot buyerSnapshot = (BuyerSnapshot) o; return Objects.equals(this.type, buyerSnapshot.type) && Objects.equals(this.id, buyerSnapshot.id) && - Objects.equals(this.externalIdentifier, buyerSnapshot.externalIdentifier) && + Objects.equals(this.billingDetails, buyerSnapshot.billingDetails) && Objects.equals(this.displayName, buyerSnapshot.displayName) && - Objects.equals(this.billingDetails, buyerSnapshot.billingDetails); + Objects.equals(this.externalIdentifier, buyerSnapshot.externalIdentifier); } @Override public int hashCode() { - return Objects.hash(type, id, externalIdentifier, displayName, billingDetails); + return Objects.hash(type, id, billingDetails, displayName, externalIdentifier); } @Override @@ -240,9 +240,9 @@ public String toString() { sb.append("class BuyerSnapshot {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" billingDetails: ").append(toIndentedString(billingDetails)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/CardDetails.java b/src/main/java/com/gr4vy/api/model/CardDetails.java index f21f7e1..d3ac432 100644 --- a/src/main/java/com/gr4vy/api/model/CardDetails.java +++ b/src/main/java/com/gr4vy/api/model/CardDetails.java @@ -135,9 +135,96 @@ public CardTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CARD_TYPE) private CardTypeEnum cardType; + /** + * The scheme/brand of the card. + */ + @JsonAdapter(SchemeEnum.Adapter.class) + public enum SchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + SchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SchemeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SCHEME = "scheme"; @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; + private SchemeEnum scheme; public static final String SERIALIZED_NAME_SCHEME_ICON_URL = "scheme_icon_url"; @SerializedName(SERIALIZED_NAME_SCHEME_ICON_URL) @@ -221,7 +308,7 @@ public void setCardType(CardTypeEnum cardType) { } - public CardDetails scheme(String scheme) { + public CardDetails scheme(SchemeEnum scheme) { this.scheme = scheme; return this; @@ -234,12 +321,12 @@ public CardDetails scheme(String scheme) { @javax.annotation.Nullable @ApiModelProperty(example = "visa", value = "The scheme/brand of the card.") - public String getScheme() { + public SchemeEnum getScheme() { return scheme; } - public void setScheme(String scheme) { + public void setScheme(SchemeEnum scheme) { this.scheme = scheme; } diff --git a/src/main/java/com/gr4vy/api/model/CartItem.java b/src/main/java/com/gr4vy/api/model/CartItem.java index f917d80..45cc866 100644 --- a/src/main/java/com/gr4vy/api/model/CartItem.java +++ b/src/main/java/com/gr4vy/api/model/CartItem.java @@ -189,12 +189,12 @@ public CartItem unitAmount(Integer unitAmount) { } /** - * The amount for an individual item represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` USD cents represents `$12.99`. + * The amount for an individual item represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` USD cents represents `$12.99`. The amount sent through to the payment processor as unitary amount will be calculated to include the discount and tax values sent as part of this cart item. * minimum: 0 * maximum: 99999999 * @return unitAmount **/ - @ApiModelProperty(example = "37999", required = true, value = "The amount for an individual item represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` USD cents represents `$12.99`.") + @ApiModelProperty(example = "37999", required = true, value = "The amount for an individual item represented as a monetary amount in the smallest currency unit for the given currency, for example `1299` USD cents represents `$12.99`. The amount sent through to the payment processor as unitary amount will be calculated to include the discount and tax values sent as part of this cart item.") public Integer getUnitAmount() { return unitAmount; diff --git a/src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethod.java b/src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethod.java index c0afcce..166d65a 100644 --- a/src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethod.java +++ b/src/main/java/com/gr4vy/api/model/CheckoutSessionPaymentMethod.java @@ -20,7 +20,6 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import com.gr4vy.api.model.CardScheme; import com.gr4vy.api.model.CheckoutSessionPaymentMethodDetails; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -89,9 +88,96 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; + /** + * The scheme/brand of the card. + */ + @JsonAdapter(SchemeEnum.Adapter.class) + public enum SchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + SchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SchemeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SCHEME = "scheme"; @SerializedName(SERIALIZED_NAME_SCHEME) - private CardScheme scheme; + private SchemeEnum scheme; public static final String SERIALIZED_NAME_LABEL = "label"; @SerializedName(SERIALIZED_NAME_LABEL) @@ -171,25 +257,25 @@ public void setMethod(MethodEnum method) { } - public CheckoutSessionPaymentMethod scheme(CardScheme scheme) { + public CheckoutSessionPaymentMethod scheme(SchemeEnum scheme) { this.scheme = scheme; return this; } /** - * Get scheme + * The scheme/brand of the card. * @return scheme **/ @javax.annotation.Nullable - @ApiModelProperty(example = "visa", value = "") + @ApiModelProperty(example = "visa", value = "The scheme/brand of the card.") - public CardScheme getScheme() { + public SchemeEnum getScheme() { return scheme; } - public void setScheme(CardScheme scheme) { + public void setScheme(SchemeEnum scheme) { this.scheme = scheme; } diff --git a/src/main/java/com/gr4vy/api/model/ClickToPaySessionRequest.java b/src/main/java/com/gr4vy/api/model/ClickToPaySessionRequest.java new file mode 100644 index 0000000..9b800d5 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ClickToPaySessionRequest.java @@ -0,0 +1,99 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * Return digital payment application details for Click to Pay. + */ +@ApiModel(description = "Return digital payment application details for Click to Pay.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ClickToPaySessionRequest { + public static final String SERIALIZED_NAME_CHECKOUT_SESSION_ID = "checkout_session_id"; + @SerializedName(SERIALIZED_NAME_CHECKOUT_SESSION_ID) + private UUID checkoutSessionId; + + + public ClickToPaySessionRequest checkoutSessionId(UUID checkoutSessionId) { + + this.checkoutSessionId = checkoutSessionId; + return this; + } + + /** + * The identifier for the current checkout session. + * @return checkoutSessionId + **/ + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", required = true, value = "The identifier for the current checkout session.") + + public UUID getCheckoutSessionId() { + return checkoutSessionId; + } + + + public void setCheckoutSessionId(UUID checkoutSessionId) { + this.checkoutSessionId = checkoutSessionId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClickToPaySessionRequest clickToPaySessionRequest = (ClickToPaySessionRequest) o; + return Objects.equals(this.checkoutSessionId, clickToPaySessionRequest.checkoutSessionId); + } + + @Override + public int hashCode() { + return Objects.hash(checkoutSessionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClickToPaySessionRequest {\n"); + sb.append(" checkoutSessionId: ").append(toIndentedString(checkoutSessionId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraud.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraud.java index 9461979..503ef6c 100644 --- a/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraud.java +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceAntiFraud.java @@ -33,11 +33,38 @@ @ApiModel(description = "Additional options for Cybersource Decision Manager (anti-fraud).") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectionOptionsCybersourceAntiFraud { + public static final String SERIALIZED_NAME_META_KEY_MERCHANT_ID = "meta_key_merchant_id"; + @SerializedName(SERIALIZED_NAME_META_KEY_MERCHANT_ID) + private String metaKeyMerchantId; + public static final String SERIALIZED_NAME_MERCHANT_DEFINED_DATA = "merchant_defined_data"; @SerializedName(SERIALIZED_NAME_MERCHANT_DEFINED_DATA) private Map merchantDefinedData = null; + public ConnectionOptionsCybersourceAntiFraud metaKeyMerchantId(String metaKeyMerchantId) { + + this.metaKeyMerchantId = metaKeyMerchantId; + return this; + } + + /** + * An override for the merchant ID configured for the connector, used in combination with meta keys. + * @return metaKeyMerchantId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "An override for the merchant ID configured for the connector, used in combination with meta keys.") + + public String getMetaKeyMerchantId() { + return metaKeyMerchantId; + } + + + public void setMetaKeyMerchantId(String metaKeyMerchantId) { + this.metaKeyMerchantId = metaKeyMerchantId; + } + + public ConnectionOptionsCybersourceAntiFraud merchantDefinedData(Map merchantDefinedData) { this.merchantDefinedData = merchantDefinedData; @@ -78,18 +105,20 @@ public boolean equals(Object o) { return false; } ConnectionOptionsCybersourceAntiFraud connectionOptionsCybersourceAntiFraud = (ConnectionOptionsCybersourceAntiFraud) o; - return Objects.equals(this.merchantDefinedData, connectionOptionsCybersourceAntiFraud.merchantDefinedData); + return Objects.equals(this.metaKeyMerchantId, connectionOptionsCybersourceAntiFraud.metaKeyMerchantId) && + Objects.equals(this.merchantDefinedData, connectionOptionsCybersourceAntiFraud.merchantDefinedData); } @Override public int hashCode() { - return Objects.hash(merchantDefinedData); + return Objects.hash(metaKeyMerchantId, merchantDefinedData); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ConnectionOptionsCybersourceAntiFraud {\n"); + sb.append(" metaKeyMerchantId: ").append(toIndentedString(metaKeyMerchantId)).append("\n"); sb.append(" merchantDefinedData: ").append(toIndentedString(merchantDefinedData)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraud.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraud.java index 61b90c7..4d18852 100644 --- a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraud.java +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraud.java @@ -20,9 +20,13 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudCartItems; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudTotalDiscount; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * Additional options for Forter (anti-fraud). @@ -30,16 +34,77 @@ @ApiModel(description = "Additional options for Forter (anti-fraud).") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectionOptionsForterAntiFraud { + /** + * Value to populate the `deliveryType` field in `primaryDeliveryDetails`. Represents the type of delivery. This can be set to `PHYSICAL` for any type of shipped goods, `DIGITAL` for non-shipped goods (services, gift cards etc.), or `HYBRID` for others. + */ + @JsonAdapter(DeliveryTypeEnum.Adapter.class) + public enum DeliveryTypeEnum { + PHYSICAL("PHYSICAL"), + + DIGITAL("DIGITAL"), + + HYBRID("HYBRID"); + + private String value; + + DeliveryTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DeliveryTypeEnum fromValue(String value) { + for (DeliveryTypeEnum b : DeliveryTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DeliveryTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DeliveryTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DeliveryTypeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_DELIVERY_TYPE = "delivery_type"; @SerializedName(SERIALIZED_NAME_DELIVERY_TYPE) - private String deliveryType; + private DeliveryTypeEnum deliveryType; public static final String SERIALIZED_NAME_DELIVERY_METHOD = "delivery_method"; @SerializedName(SERIALIZED_NAME_DELIVERY_METHOD) private String deliveryMethod; + public static final String SERIALIZED_NAME_IS_GUEST_BUYER = "is_guest_buyer"; + @SerializedName(SERIALIZED_NAME_IS_GUEST_BUYER) + private Boolean isGuestBuyer = false; + + public static final String SERIALIZED_NAME_CART_ITEMS = "cart_items"; + @SerializedName(SERIALIZED_NAME_CART_ITEMS) + private List cartItems = null; + + public static final String SERIALIZED_NAME_TOTAL_DISCOUNT = "total_discount"; + @SerializedName(SERIALIZED_NAME_TOTAL_DISCOUNT) + private ConnectionOptionsForterAntiFraudTotalDiscount totalDiscount; + - public ConnectionOptionsForterAntiFraud deliveryType(String deliveryType) { + public ConnectionOptionsForterAntiFraud deliveryType(DeliveryTypeEnum deliveryType) { this.deliveryType = deliveryType; return this; @@ -52,12 +117,12 @@ public ConnectionOptionsForterAntiFraud deliveryType(String deliveryType) { @javax.annotation.Nullable @ApiModelProperty(value = "Value to populate the `deliveryType` field in `primaryDeliveryDetails`. Represents the type of delivery. This can be set to `PHYSICAL` for any type of shipped goods, `DIGITAL` for non-shipped goods (services, gift cards etc.), or `HYBRID` for others.") - public String getDeliveryType() { + public DeliveryTypeEnum getDeliveryType() { return deliveryType; } - public void setDeliveryType(String deliveryType) { + public void setDeliveryType(DeliveryTypeEnum deliveryType) { this.deliveryType = deliveryType; } @@ -85,6 +150,83 @@ public void setDeliveryMethod(String deliveryMethod) { } + public ConnectionOptionsForterAntiFraud isGuestBuyer(Boolean isGuestBuyer) { + + this.isGuestBuyer = isGuestBuyer; + return this; + } + + /** + * Defines if this is a guest check-out. This will redact the `accountId` and `created` fields from the `accountOwner` details sent to Forter. + * @return isGuestBuyer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Defines if this is a guest check-out. This will redact the `accountId` and `created` fields from the `accountOwner` details sent to Forter.") + + public Boolean getIsGuestBuyer() { + return isGuestBuyer; + } + + + public void setIsGuestBuyer(Boolean isGuestBuyer) { + this.isGuestBuyer = isGuestBuyer; + } + + + public ConnectionOptionsForterAntiFraud cartItems(List cartItems) { + + this.cartItems = cartItems; + return this; + } + + public ConnectionOptionsForterAntiFraud addCartItemsItem(ConnectionOptionsForterAntiFraudCartItems cartItemsItem) { + if (this.cartItems == null) { + this.cartItems = new ArrayList(); + } + this.cartItems.add(cartItemsItem); + return this; + } + + /** + * A list of Forter cart item objects. These will be merged into the `cart_items` passed to the transaction. Every cart item here will be merged with a cart item on the transaction with the same index. Together, these will augment the `cartItems` values sent to the Forter validation API. + * @return cartItems + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of Forter cart item objects. These will be merged into the `cart_items` passed to the transaction. Every cart item here will be merged with a cart item on the transaction with the same index. Together, these will augment the `cartItems` values sent to the Forter validation API.") + + public List getCartItems() { + return cartItems; + } + + + public void setCartItems(List cartItems) { + this.cartItems = cartItems; + } + + + public ConnectionOptionsForterAntiFraud totalDiscount(ConnectionOptionsForterAntiFraudTotalDiscount totalDiscount) { + + this.totalDiscount = totalDiscount; + return this; + } + + /** + * Get totalDiscount + * @return totalDiscount + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudTotalDiscount getTotalDiscount() { + return totalDiscount; + } + + + public void setTotalDiscount(ConnectionOptionsForterAntiFraudTotalDiscount totalDiscount) { + this.totalDiscount = totalDiscount; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -95,12 +237,15 @@ public boolean equals(Object o) { } ConnectionOptionsForterAntiFraud connectionOptionsForterAntiFraud = (ConnectionOptionsForterAntiFraud) o; return Objects.equals(this.deliveryType, connectionOptionsForterAntiFraud.deliveryType) && - Objects.equals(this.deliveryMethod, connectionOptionsForterAntiFraud.deliveryMethod); + Objects.equals(this.deliveryMethod, connectionOptionsForterAntiFraud.deliveryMethod) && + Objects.equals(this.isGuestBuyer, connectionOptionsForterAntiFraud.isGuestBuyer) && + Objects.equals(this.cartItems, connectionOptionsForterAntiFraud.cartItems) && + Objects.equals(this.totalDiscount, connectionOptionsForterAntiFraud.totalDiscount); } @Override public int hashCode() { - return Objects.hash(deliveryType, deliveryMethod); + return Objects.hash(deliveryType, deliveryMethod, isGuestBuyer, cartItems, totalDiscount); } @Override @@ -109,6 +254,9 @@ public String toString() { sb.append("class ConnectionOptionsForterAntiFraud {\n"); sb.append(" deliveryType: ").append(toIndentedString(deliveryType)).append("\n"); sb.append(" deliveryMethod: ").append(toIndentedString(deliveryMethod)).append("\n"); + sb.append(" isGuestBuyer: ").append(toIndentedString(isGuestBuyer)).append("\n"); + sb.append(" cartItems: ").append(toIndentedString(cartItems)).append("\n"); + sb.append(" totalDiscount: ").append(toIndentedString(totalDiscount)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudAddress.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudAddress.java new file mode 100644 index 0000000..73160d3 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudAddress.java @@ -0,0 +1,272 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Address details for the beneficiary. + */ +@ApiModel(description = "Address details for the beneficiary.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudAddress { + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_ADDRESS1 = "address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + private String address1; + + public static final String SERIALIZED_NAME_ADDRESS2 = "address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + private String address2; + + public static final String SERIALIZED_NAME_ZIP = "zip"; + @SerializedName(SERIALIZED_NAME_ZIP) + private String zip; + + public static final String SERIALIZED_NAME_REGION = "region"; + @SerializedName(SERIALIZED_NAME_REGION) + private String region; + + public static final String SERIALIZED_NAME_COMPANY = "company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + private String company; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + + public ConnectionOptionsForterAntiFraudAddress country(String country) { + + this.country = country; + return this; + } + + /** + * Country, two-letter ISO 3166-1 alpha 2 country code. + * @return country + **/ + @ApiModelProperty(example = "US", required = true, value = "Country, two-letter ISO 3166-1 alpha 2 country code.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public ConnectionOptionsForterAntiFraudAddress address1(String address1) { + + this.address1 = address1; + return this; + } + + /** + * Street-level address. Required when full address details are available. + * @return address1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "235 Montgomery st.", value = "Street-level address. Required when full address details are available.") + + public String getAddress1() { + return address1; + } + + + public void setAddress1(String address1) { + this.address1 = address1; + } + + + public ConnectionOptionsForterAntiFraudAddress address2(String address2) { + + this.address2 = address2; + return this; + } + + /** + * Unit-level address. + * @return address2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Ste. 1110", value = "Unit-level address.") + + public String getAddress2() { + return address2; + } + + + public void setAddress2(String address2) { + this.address2 = address2; + } + + + public ConnectionOptionsForterAntiFraudAddress zip(String zip) { + + this.zip = zip; + return this; + } + + /** + * Zipcode. + * @return zip + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "94104", value = "Zipcode.") + + public String getZip() { + return zip; + } + + + public void setZip(String zip) { + this.zip = zip; + } + + + public ConnectionOptionsForterAntiFraudAddress region(String region) { + + this.region = region; + return this; + } + + /** + * Top-level administrative subdivision - state/province/department/etc. Can be either abbreviated format or full name (NY/New York). + * @return region + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "CA", value = "Top-level administrative subdivision - state/province/department/etc. Can be either abbreviated format or full name (NY/New York).") + + public String getRegion() { + return region; + } + + + public void setRegion(String region) { + this.region = region; + } + + + public ConnectionOptionsForterAntiFraudAddress company(String company) { + + this.company = company; + return this; + } + + /** + * Company name. + * @return company + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Generic Corp. ltd.", value = "Company name.") + + public String getCompany() { + return company; + } + + + public void setCompany(String company) { + this.company = company; + } + + + public ConnectionOptionsForterAntiFraudAddress city(String city) { + + this.city = city; + return this; + } + + /** + * City. Required when full address details are available. + * @return city + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "San Francisco", value = "City. Required when full address details are available.") + + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudAddress connectionOptionsForterAntiFraudAddress = (ConnectionOptionsForterAntiFraudAddress) o; + return Objects.equals(this.country, connectionOptionsForterAntiFraudAddress.country) && + Objects.equals(this.address1, connectionOptionsForterAntiFraudAddress.address1) && + Objects.equals(this.address2, connectionOptionsForterAntiFraudAddress.address2) && + Objects.equals(this.zip, connectionOptionsForterAntiFraudAddress.zip) && + Objects.equals(this.region, connectionOptionsForterAntiFraudAddress.region) && + Objects.equals(this.company, connectionOptionsForterAntiFraudAddress.company) && + Objects.equals(this.city, connectionOptionsForterAntiFraudAddress.city); + } + + @Override + public int hashCode() { + return Objects.hash(country, address1, address2, zip, region, company, city); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudAddress {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBasicItemData.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBasicItemData.java new file mode 100644 index 0000000..e9a01b9 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBasicItemData.java @@ -0,0 +1,146 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * General data regarding item such as name, price, etc. + */ +@ApiModel(description = "General data regarding item such as name, price, etc.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudBasicItemData { + /** + * Tangible if physical item, non-tangible if any other product. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TANGIBLE("TANGIBLE"), + + NON_TANGIBLE("NON_TANGIBLE"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + + public ConnectionOptionsForterAntiFraudBasicItemData type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Tangible if physical item, non-tangible if any other product. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "TANGIBLE", value = "Tangible if physical item, non-tangible if any other product.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudBasicItemData connectionOptionsForterAntiFraudBasicItemData = (ConnectionOptionsForterAntiFraudBasicItemData) o; + return Objects.equals(this.type, connectionOptionsForterAntiFraudBasicItemData.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudBasicItemData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBeneficiaries.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBeneficiaries.java new file mode 100644 index 0000000..d80212d --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudBeneficiaries.java @@ -0,0 +1,198 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudAddress; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudComments; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudPersonalDetails; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudPhone; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * ConnectionOptionsForterAntiFraudBeneficiaries + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudBeneficiaries { + public static final String SERIALIZED_NAME_PERSONAL_DETAILS = "personal_details"; + @SerializedName(SERIALIZED_NAME_PERSONAL_DETAILS) + private ConnectionOptionsForterAntiFraudPersonalDetails personalDetails; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private ConnectionOptionsForterAntiFraudAddress address; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private List phone = null; + + public static final String SERIALIZED_NAME_COMMENTS = "comments"; + @SerializedName(SERIALIZED_NAME_COMMENTS) + private ConnectionOptionsForterAntiFraudComments comments; + + + public ConnectionOptionsForterAntiFraudBeneficiaries personalDetails(ConnectionOptionsForterAntiFraudPersonalDetails personalDetails) { + + this.personalDetails = personalDetails; + return this; + } + + /** + * Get personalDetails + * @return personalDetails + **/ + @ApiModelProperty(required = true, value = "") + + public ConnectionOptionsForterAntiFraudPersonalDetails getPersonalDetails() { + return personalDetails; + } + + + public void setPersonalDetails(ConnectionOptionsForterAntiFraudPersonalDetails personalDetails) { + this.personalDetails = personalDetails; + } + + + public ConnectionOptionsForterAntiFraudBeneficiaries address(ConnectionOptionsForterAntiFraudAddress address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudAddress getAddress() { + return address; + } + + + public void setAddress(ConnectionOptionsForterAntiFraudAddress address) { + this.address = address; + } + + + public ConnectionOptionsForterAntiFraudBeneficiaries phone(List phone) { + + this.phone = phone; + return this; + } + + public ConnectionOptionsForterAntiFraudBeneficiaries addPhoneItem(ConnectionOptionsForterAntiFraudPhone phoneItem) { + if (this.phone == null) { + this.phone = new ArrayList(); + } + this.phone.add(phoneItem); + return this; + } + + /** + * List of all phone numbers for the beneficiary. + * @return phone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of all phone numbers for the beneficiary.") + + public List getPhone() { + return phone; + } + + + public void setPhone(List phone) { + this.phone = phone; + } + + + public ConnectionOptionsForterAntiFraudBeneficiaries comments(ConnectionOptionsForterAntiFraudComments comments) { + + this.comments = comments; + return this; + } + + /** + * Get comments + * @return comments + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudComments getComments() { + return comments; + } + + + public void setComments(ConnectionOptionsForterAntiFraudComments comments) { + this.comments = comments; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudBeneficiaries connectionOptionsForterAntiFraudBeneficiaries = (ConnectionOptionsForterAntiFraudBeneficiaries) o; + return Objects.equals(this.personalDetails, connectionOptionsForterAntiFraudBeneficiaries.personalDetails) && + Objects.equals(this.address, connectionOptionsForterAntiFraudBeneficiaries.address) && + Objects.equals(this.phone, connectionOptionsForterAntiFraudBeneficiaries.phone) && + Objects.equals(this.comments, connectionOptionsForterAntiFraudBeneficiaries.comments); + } + + @Override + public int hashCode() { + return Objects.hash(personalDetails, address, phone, comments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudBeneficiaries {\n"); + sb.append(" personalDetails: ").append(toIndentedString(personalDetails)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCartItems.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCartItems.java new file mode 100644 index 0000000..f6a4409 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudCartItems.java @@ -0,0 +1,169 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudBasicItemData; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudBeneficiaries; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudDeliveryDetails; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * ConnectionOptionsForterAntiFraudCartItems + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudCartItems { + public static final String SERIALIZED_NAME_BASIC_ITEM_DATA = "basic_item_data"; + @SerializedName(SERIALIZED_NAME_BASIC_ITEM_DATA) + private ConnectionOptionsForterAntiFraudBasicItemData basicItemData; + + public static final String SERIALIZED_NAME_DELIVERY_DETAILS = "delivery_details"; + @SerializedName(SERIALIZED_NAME_DELIVERY_DETAILS) + private ConnectionOptionsForterAntiFraudDeliveryDetails deliveryDetails; + + public static final String SERIALIZED_NAME_BENEFICIARIES = "beneficiaries"; + @SerializedName(SERIALIZED_NAME_BENEFICIARIES) + private List beneficiaries = null; + + + public ConnectionOptionsForterAntiFraudCartItems basicItemData(ConnectionOptionsForterAntiFraudBasicItemData basicItemData) { + + this.basicItemData = basicItemData; + return this; + } + + /** + * Get basicItemData + * @return basicItemData + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudBasicItemData getBasicItemData() { + return basicItemData; + } + + + public void setBasicItemData(ConnectionOptionsForterAntiFraudBasicItemData basicItemData) { + this.basicItemData = basicItemData; + } + + + public ConnectionOptionsForterAntiFraudCartItems deliveryDetails(ConnectionOptionsForterAntiFraudDeliveryDetails deliveryDetails) { + + this.deliveryDetails = deliveryDetails; + return this; + } + + /** + * Get deliveryDetails + * @return deliveryDetails + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudDeliveryDetails getDeliveryDetails() { + return deliveryDetails; + } + + + public void setDeliveryDetails(ConnectionOptionsForterAntiFraudDeliveryDetails deliveryDetails) { + this.deliveryDetails = deliveryDetails; + } + + + public ConnectionOptionsForterAntiFraudCartItems beneficiaries(List beneficiaries) { + + this.beneficiaries = beneficiaries; + return this; + } + + public ConnectionOptionsForterAntiFraudCartItems addBeneficiariesItem(ConnectionOptionsForterAntiFraudBeneficiaries beneficiariesItem) { + if (this.beneficiaries == null) { + this.beneficiaries = new ArrayList(); + } + this.beneficiaries.add(beneficiariesItem); + return this; + } + + /** + * List of all entities receiving or using the purchased cart item. + * @return beneficiaries + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "List of all entities receiving or using the purchased cart item.") + + public List getBeneficiaries() { + return beneficiaries; + } + + + public void setBeneficiaries(List beneficiaries) { + this.beneficiaries = beneficiaries; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudCartItems connectionOptionsForterAntiFraudCartItems = (ConnectionOptionsForterAntiFraudCartItems) o; + return Objects.equals(this.basicItemData, connectionOptionsForterAntiFraudCartItems.basicItemData) && + Objects.equals(this.deliveryDetails, connectionOptionsForterAntiFraudCartItems.deliveryDetails) && + Objects.equals(this.beneficiaries, connectionOptionsForterAntiFraudCartItems.beneficiaries); + } + + @Override + public int hashCode() { + return Objects.hash(basicItemData, deliveryDetails, beneficiaries); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudCartItems {\n"); + sb.append(" basicItemData: ").append(toIndentedString(basicItemData)).append("\n"); + sb.append(" deliveryDetails: ").append(toIndentedString(deliveryDetails)).append("\n"); + sb.append(" beneficiaries: ").append(toIndentedString(beneficiaries)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudComments.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudComments.java new file mode 100644 index 0000000..15e438c --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudComments.java @@ -0,0 +1,157 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Comments to merchant or beneficiary written by customer. + */ +@ApiModel(description = "Comments to merchant or beneficiary written by customer.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudComments { + public static final String SERIALIZED_NAME_USER_COMMENTS_TO_MERCHANT = "user_comments_to_merchant"; + @SerializedName(SERIALIZED_NAME_USER_COMMENTS_TO_MERCHANT) + private String userCommentsToMerchant; + + public static final String SERIALIZED_NAME_MESSAGE_TO_BENEFICIARY = "message_to_beneficiary"; + @SerializedName(SERIALIZED_NAME_MESSAGE_TO_BENEFICIARY) + private String messageToBeneficiary; + + public static final String SERIALIZED_NAME_MERCHANT_COMMENTS = "merchant_comments"; + @SerializedName(SERIALIZED_NAME_MERCHANT_COMMENTS) + private String merchantComments; + + + public ConnectionOptionsForterAntiFraudComments userCommentsToMerchant(String userCommentsToMerchant) { + + this.userCommentsToMerchant = userCommentsToMerchant; + return this; + } + + /** + * Comments the customer left to the merchant. + * @return userCommentsToMerchant + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Please wrap with care!!", value = "Comments the customer left to the merchant.") + + public String getUserCommentsToMerchant() { + return userCommentsToMerchant; + } + + + public void setUserCommentsToMerchant(String userCommentsToMerchant) { + this.userCommentsToMerchant = userCommentsToMerchant; + } + + + public ConnectionOptionsForterAntiFraudComments messageToBeneficiary(String messageToBeneficiary) { + + this.messageToBeneficiary = messageToBeneficiary; + return this; + } + + /** + * Comments the customer left to the beneficiary of the purchase made. + * @return messageToBeneficiary + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Enjoy the gift John!", value = "Comments the customer left to the beneficiary of the purchase made.") + + public String getMessageToBeneficiary() { + return messageToBeneficiary; + } + + + public void setMessageToBeneficiary(String messageToBeneficiary) { + this.messageToBeneficiary = messageToBeneficiary; + } + + + public ConnectionOptionsForterAntiFraudComments merchantComments(String merchantComments) { + + this.merchantComments = merchantComments; + return this; + } + + /** + * Comments by the merchant. + * @return merchantComments + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Shipping delayed", value = "Comments by the merchant.") + + public String getMerchantComments() { + return merchantComments; + } + + + public void setMerchantComments(String merchantComments) { + this.merchantComments = merchantComments; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudComments connectionOptionsForterAntiFraudComments = (ConnectionOptionsForterAntiFraudComments) o; + return Objects.equals(this.userCommentsToMerchant, connectionOptionsForterAntiFraudComments.userCommentsToMerchant) && + Objects.equals(this.messageToBeneficiary, connectionOptionsForterAntiFraudComments.messageToBeneficiary) && + Objects.equals(this.merchantComments, connectionOptionsForterAntiFraudComments.merchantComments); + } + + @Override + public int hashCode() { + return Objects.hash(userCommentsToMerchant, messageToBeneficiary, merchantComments); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudComments {\n"); + sb.append(" userCommentsToMerchant: ").append(toIndentedString(userCommentsToMerchant)).append("\n"); + sb.append(" messageToBeneficiary: ").append(toIndentedString(messageToBeneficiary)).append("\n"); + sb.append(" merchantComments: ").append(toIndentedString(merchantComments)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudDeliveryDetails.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudDeliveryDetails.java new file mode 100644 index 0000000..87d7315 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudDeliveryDetails.java @@ -0,0 +1,177 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * General data regarding item such as name, price, etc. + */ +@ApiModel(description = "General data regarding item such as name, price, etc.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudDeliveryDetails { + /** + * Value to populate the `deliveryType` field for this cart item. This overrides the type set at the wider level. Represents the type of delivery. This can be set to `PHYSICAL` for any type of shipped goods, `DIGITAL` for non-shipped goods (services, gift cards etc.), or `HYBRID` for others. + */ + @JsonAdapter(DeliveryTypeEnum.Adapter.class) + public enum DeliveryTypeEnum { + PHYSICAL("PHYSICAL"), + + DIGITAL("DIGITAL"), + + HYBRID("HYBRID"); + + private String value; + + DeliveryTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DeliveryTypeEnum fromValue(String value) { + for (DeliveryTypeEnum b : DeliveryTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DeliveryTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DeliveryTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DeliveryTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_DELIVERY_TYPE = "delivery_type"; + @SerializedName(SERIALIZED_NAME_DELIVERY_TYPE) + private DeliveryTypeEnum deliveryType; + + public static final String SERIALIZED_NAME_DELIVERY_METHOD = "delivery_method"; + @SerializedName(SERIALIZED_NAME_DELIVERY_METHOD) + private String deliveryMethod; + + + public ConnectionOptionsForterAntiFraudDeliveryDetails deliveryType(DeliveryTypeEnum deliveryType) { + + this.deliveryType = deliveryType; + return this; + } + + /** + * Value to populate the `deliveryType` field for this cart item. This overrides the type set at the wider level. Represents the type of delivery. This can be set to `PHYSICAL` for any type of shipped goods, `DIGITAL` for non-shipped goods (services, gift cards etc.), or `HYBRID` for others. + * @return deliveryType + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "PHYSICAL", value = "Value to populate the `deliveryType` field for this cart item. This overrides the type set at the wider level. Represents the type of delivery. This can be set to `PHYSICAL` for any type of shipped goods, `DIGITAL` for non-shipped goods (services, gift cards etc.), or `HYBRID` for others.") + + public DeliveryTypeEnum getDeliveryType() { + return deliveryType; + } + + + public void setDeliveryType(DeliveryTypeEnum deliveryType) { + this.deliveryType = deliveryType; + } + + + public ConnectionOptionsForterAntiFraudDeliveryDetails deliveryMethod(String deliveryMethod) { + + this.deliveryMethod = deliveryMethod; + return this; + } + + /** + * Value to populate the `deliveryMethod` field for this cart item. This overrides the method set at the wider level. Represents the delivery method chosen by customer such as postal service, email, in game transfer, etc. + * @return deliveryMethod + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "USPS - Ground Mail", value = "Value to populate the `deliveryMethod` field for this cart item. This overrides the method set at the wider level. Represents the delivery method chosen by customer such as postal service, email, in game transfer, etc.") + + public String getDeliveryMethod() { + return deliveryMethod; + } + + + public void setDeliveryMethod(String deliveryMethod) { + this.deliveryMethod = deliveryMethod; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudDeliveryDetails connectionOptionsForterAntiFraudDeliveryDetails = (ConnectionOptionsForterAntiFraudDeliveryDetails) o; + return Objects.equals(this.deliveryType, connectionOptionsForterAntiFraudDeliveryDetails.deliveryType) && + Objects.equals(this.deliveryMethod, connectionOptionsForterAntiFraudDeliveryDetails.deliveryMethod); + } + + @Override + public int hashCode() { + return Objects.hash(deliveryType, deliveryMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudDeliveryDetails {\n"); + sb.append(" deliveryType: ").append(toIndentedString(deliveryType)).append("\n"); + sb.append(" deliveryMethod: ").append(toIndentedString(deliveryMethod)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPersonalDetails.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPersonalDetails.java new file mode 100644 index 0000000..ca668a8 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPersonalDetails.java @@ -0,0 +1,157 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Personal details are those which contribute to building up a picture of the person as an individual, such as name, title, etc. + */ +@ApiModel(description = "Personal details are those which contribute to building up a picture of the person as an individual, such as name, title, etc.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudPersonalDetails { + public static final String SERIALIZED_NAME_FIRST_NAME = "first_name"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "last_name"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + + public ConnectionOptionsForterAntiFraudPersonalDetails firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First name. + * @return firstName + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "John", value = "First name.") + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public ConnectionOptionsForterAntiFraudPersonalDetails lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last name. + * @return lastName + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Smith", value = "Last name.") + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public ConnectionOptionsForterAntiFraudPersonalDetails email(String email) { + + this.email = email; + return this; + } + + /** + * Email address. + * @return email + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "john@example.com", value = "Email address.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudPersonalDetails connectionOptionsForterAntiFraudPersonalDetails = (ConnectionOptionsForterAntiFraudPersonalDetails) o; + return Objects.equals(this.firstName, connectionOptionsForterAntiFraudPersonalDetails.firstName) && + Objects.equals(this.lastName, connectionOptionsForterAntiFraudPersonalDetails.lastName) && + Objects.equals(this.email, connectionOptionsForterAntiFraudPersonalDetails.email); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, email); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudPersonalDetails {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPhone.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPhone.java new file mode 100644 index 0000000..21d891b --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudPhone.java @@ -0,0 +1,97 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ConnectionOptionsForterAntiFraudPhone + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudPhone { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private String phone; + + + public ConnectionOptionsForterAntiFraudPhone phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Phone number including all country and local access codes. + * @return phone + **/ + @ApiModelProperty(example = "15557654321", required = true, value = "Phone number including all country and local access codes.") + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudPhone connectionOptionsForterAntiFraudPhone = (ConnectionOptionsForterAntiFraudPhone) o; + return Objects.equals(this.phone, connectionOptionsForterAntiFraudPhone.phone); + } + + @Override + public int hashCode() { + return Objects.hash(phone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudPhone {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscount.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscount.java new file mode 100644 index 0000000..8abfe05 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscount.java @@ -0,0 +1,186 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * The `totalDiscount` object that's sent to Forter's validation API. It represents the discount that was given to the customer. + */ +@ApiModel(description = "The `totalDiscount` object that's sent to Forter's validation API. It represents the discount that was given to the customer.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudTotalDiscount { + public static final String SERIALIZED_NAME_COUPON_CODE_USED = "coupon_code_used"; + @SerializedName(SERIALIZED_NAME_COUPON_CODE_USED) + private String couponCodeUsed; + + public static final String SERIALIZED_NAME_DISCOUNT_TYPE = "discount_type"; + @SerializedName(SERIALIZED_NAME_DISCOUNT_TYPE) + private String discountType; + + public static final String SERIALIZED_NAME_COUPON_DISCOUNT_AMOUNT = "coupon_discount_amount"; + @SerializedName(SERIALIZED_NAME_COUPON_DISCOUNT_AMOUNT) + private ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount couponDiscountAmount; + + public static final String SERIALIZED_NAME_COUPON_DISCOUNT_PERCENT = "coupon_discount_percent"; + @SerializedName(SERIALIZED_NAME_COUPON_DISCOUNT_PERCENT) + private String couponDiscountPercent; + + + public ConnectionOptionsForterAntiFraudTotalDiscount couponCodeUsed(String couponCodeUsed) { + + this.couponCodeUsed = couponCodeUsed; + return this; + } + + /** + * The coupon code used. + * @return couponCodeUsed + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "FATHERSDAY2015", value = "The coupon code used.") + + public String getCouponCodeUsed() { + return couponCodeUsed; + } + + + public void setCouponCodeUsed(String couponCodeUsed) { + this.couponCodeUsed = couponCodeUsed; + } + + + public ConnectionOptionsForterAntiFraudTotalDiscount discountType(String discountType) { + + this.discountType = discountType; + return this; + } + + /** + * The discount type. + * @return discountType + **/ + @ApiModelProperty(example = "COUPON", required = true, value = "The discount type.") + + public String getDiscountType() { + return discountType; + } + + + public void setDiscountType(String discountType) { + this.discountType = discountType; + } + + + public ConnectionOptionsForterAntiFraudTotalDiscount couponDiscountAmount(ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount couponDiscountAmount) { + + this.couponDiscountAmount = couponDiscountAmount; + return this; + } + + /** + * Get couponDiscountAmount + * @return couponDiscountAmount + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount getCouponDiscountAmount() { + return couponDiscountAmount; + } + + + public void setCouponDiscountAmount(ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount couponDiscountAmount) { + this.couponDiscountAmount = couponDiscountAmount; + } + + + public ConnectionOptionsForterAntiFraudTotalDiscount couponDiscountPercent(String couponDiscountPercent) { + + this.couponDiscountPercent = couponDiscountPercent; + return this; + } + + /** + * Coupon discount percentage. + * @return couponDiscountPercent + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "20%", value = "Coupon discount percentage.") + + public String getCouponDiscountPercent() { + return couponDiscountPercent; + } + + + public void setCouponDiscountPercent(String couponDiscountPercent) { + this.couponDiscountPercent = couponDiscountPercent; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudTotalDiscount connectionOptionsForterAntiFraudTotalDiscount = (ConnectionOptionsForterAntiFraudTotalDiscount) o; + return Objects.equals(this.couponCodeUsed, connectionOptionsForterAntiFraudTotalDiscount.couponCodeUsed) && + Objects.equals(this.discountType, connectionOptionsForterAntiFraudTotalDiscount.discountType) && + Objects.equals(this.couponDiscountAmount, connectionOptionsForterAntiFraudTotalDiscount.couponDiscountAmount) && + Objects.equals(this.couponDiscountPercent, connectionOptionsForterAntiFraudTotalDiscount.couponDiscountPercent); + } + + @Override + public int hashCode() { + return Objects.hash(couponCodeUsed, discountType, couponDiscountAmount, couponDiscountPercent); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudTotalDiscount {\n"); + sb.append(" couponCodeUsed: ").append(toIndentedString(couponCodeUsed)).append("\n"); + sb.append(" discountType: ").append(toIndentedString(discountType)).append("\n"); + sb.append(" couponDiscountAmount: ").append(toIndentedString(couponDiscountAmount)).append("\n"); + sb.append(" couponDiscountPercent: ").append(toIndentedString(couponDiscountPercent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.java new file mode 100644 index 0000000..bdb0c55 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.java @@ -0,0 +1,157 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A monetary amount in USD or local currency. + */ +@ApiModel(description = "A monetary amount in USD or local currency.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount { + public static final String SERIALIZED_NAME_AMOUNT_USD = "amount_usd"; + @SerializedName(SERIALIZED_NAME_AMOUNT_USD) + private String amountUsd; + + public static final String SERIALIZED_NAME_AMOUNT_LOCAL_CURRENCY = "amount_local_currency"; + @SerializedName(SERIALIZED_NAME_AMOUNT_LOCAL_CURRENCY) + private String amountLocalCurrency; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + + public ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount amountUsd(String amountUsd) { + + this.amountUsd = amountUsd; + return this; + } + + /** + * Transaction amount in USD. + * @return amountUsd + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "99.95", value = "Transaction amount in USD.") + + public String getAmountUsd() { + return amountUsd; + } + + + public void setAmountUsd(String amountUsd) { + this.amountUsd = amountUsd; + } + + + public ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount amountLocalCurrency(String amountLocalCurrency) { + + this.amountLocalCurrency = amountLocalCurrency; + return this; + } + + /** + * Transaction amount in currency chosen by the buyer. + * @return amountLocalCurrency + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "105.55", value = "Transaction amount in currency chosen by the buyer.") + + public String getAmountLocalCurrency() { + return amountLocalCurrency; + } + + + public void setAmountLocalCurrency(String amountLocalCurrency) { + this.amountLocalCurrency = amountLocalCurrency; + } + + + public ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * Transaction currency chosen by the buyer, 3-letter ISO-4217 format currency code. + * @return currency + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "CAD", value = "Transaction currency chosen by the buyer, 3-letter ISO-4217 format currency code.") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount connectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount = (ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount) o; + return Objects.equals(this.amountUsd, connectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.amountUsd) && + Objects.equals(this.amountLocalCurrency, connectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.amountLocalCurrency) && + Objects.equals(this.currency, connectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount.currency); + } + + @Override + public int hashCode() { + return Objects.hash(amountUsd, amountLocalCurrency, currency); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionOptionsForterAntiFraudTotalDiscountCouponDiscountAmount {\n"); + sb.append(" amountUsd: ").append(toIndentedString(amountUsd)).append("\n"); + sb.append(" amountLocalCurrency: ").append(toIndentedString(amountLocalCurrency)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/DigitalWallet.java b/src/main/java/com/gr4vy/api/model/DigitalWallet.java index 23f6b16..443cbc3 100644 --- a/src/main/java/com/gr4vy/api/model/DigitalWallet.java +++ b/src/main/java/com/gr4vy/api/model/DigitalWallet.java @@ -165,7 +165,7 @@ public ProviderEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_FIELDS = "fields"; @SerializedName(SERIALIZED_NAME_FIELDS) - private DigitalWalletClickToPayFields fields = null; + private DigitalWalletClickToPayFields fields; public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; @SerializedName(SERIALIZED_NAME_CREATED_AT) diff --git a/src/main/java/com/gr4vy/api/model/GiftCard.java b/src/main/java/com/gr4vy/api/model/GiftCard.java new file mode 100644 index 0000000..cf476a7 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCard.java @@ -0,0 +1,438 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.Buyer; +import com.gr4vy.api.model.GiftCardService; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * A gift card stored for a buyer, or used in a transaction. + */ +@ApiModel(description = "A gift card stored for a buyer, or used in a transaction.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCard { + /** + * The type of this resource. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GIFT_CARD("gift-card"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; + + public static final String SERIALIZED_NAME_SERVICE = "service"; + @SerializedName(SERIALIZED_NAME_SERVICE) + private GiftCardService service; + + public static final String SERIALIZED_NAME_BIN = "bin"; + @SerializedName(SERIALIZED_NAME_BIN) + private String bin; + + public static final String SERIALIZED_NAME_SUB_BIN = "sub_bin"; + @SerializedName(SERIALIZED_NAME_SUB_BIN) + private String subBin; + + public static final String SERIALIZED_NAME_LAST4 = "last4"; + @SerializedName(SERIALIZED_NAME_LAST4) + private String last4; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_BUYER = "buyer"; + @SerializedName(SERIALIZED_NAME_BUYER) + private Buyer buyer; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + + public GiftCard type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card", value = "The type of this resource.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCard id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of this gift card. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", value = "The ID of this gift card.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCard merchantAccountId(String merchantAccountId) { + + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The unique ID for a merchant account. + * @return merchantAccountId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + + public String getMerchantAccountId() { + return merchantAccountId; + } + + + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; + } + + + public GiftCard service(GiftCardService service) { + + this.service = service; + return this; + } + + /** + * Get service + * @return service + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardService getService() { + return service; + } + + + public void setService(GiftCardService service) { + this.service = service; + } + + + public GiftCard bin(String bin) { + + this.bin = bin; + return this; + } + + /** + * The first 6 digits of the full gift card number. + * @return bin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "412345", value = "The first 6 digits of the full gift card number.") + + public String getBin() { + return bin; + } + + + public void setBin(String bin) { + this.bin = bin; + } + + + public GiftCard subBin(String subBin) { + + this.subBin = subBin; + return this; + } + + /** + * The 3 digits after the `bin` of the full gift card number. + * @return subBin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "554", value = "The 3 digits after the `bin` of the full gift card number.") + + public String getSubBin() { + return subBin; + } + + + public void setSubBin(String subBin) { + this.subBin = subBin; + } + + + public GiftCard last4(String last4) { + + this.last4 = last4; + return this; + } + + /** + * The last 4 digits for the gift card. + * @return last4 + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1234", value = "The last 4 digits for the gift card.") + + public String getLast4() { + return last4; + } + + + public void setLast4(String last4) { + this.last4 = last4; + } + + + public GiftCard expirationDate(String expirationDate) { + + this.expirationDate = expirationDate; + return this; + } + + /** + * The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service. + * @return expirationDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service.") + + public String getExpirationDate() { + return expirationDate; + } + + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + + public GiftCard buyer(Buyer buyer) { + + this.buyer = buyer; + return this; + } + + /** + * The optional buyer for which this payment method has been stored. + * @return buyer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The optional buyer for which this payment method has been stored.") + + public Buyer getBuyer() { + return buyer; + } + + + public void setBuyer(Buyer buyer) { + this.buyer = buyer; + } + + + public GiftCard createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this gift card was created in our system. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this gift card was created in our system.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GiftCard updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when this gift card was last updated in our system. + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this gift card was last updated in our system.") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCard giftCard = (GiftCard) o; + return Objects.equals(this.type, giftCard.type) && + Objects.equals(this.id, giftCard.id) && + Objects.equals(this.merchantAccountId, giftCard.merchantAccountId) && + Objects.equals(this.service, giftCard.service) && + Objects.equals(this.bin, giftCard.bin) && + Objects.equals(this.subBin, giftCard.subBin) && + Objects.equals(this.last4, giftCard.last4) && + Objects.equals(this.expirationDate, giftCard.expirationDate) && + Objects.equals(this.buyer, giftCard.buyer) && + Objects.equals(this.createdAt, giftCard.createdAt) && + Objects.equals(this.updatedAt, giftCard.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, merchantAccountId, service, bin, subBin, last4, expirationDate, buyer, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCard {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); + sb.append(" subBin: ").append(toIndentedString(subBin)).append("\n"); + sb.append(" last4: ").append(toIndentedString(last4)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardBalanceNewRequest.java b/src/main/java/com/gr4vy/api/model/GiftCardBalanceNewRequest.java new file mode 100644 index 0000000..4e33e9f --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardBalanceNewRequest.java @@ -0,0 +1,126 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Check the balance for a non-stored gift card. + */ +@ApiModel(description = "Check the balance for a non-stored gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardBalanceNewRequest { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private String pin; + + + public GiftCardBalanceNewRequest number(String number) { + + this.number = number; + return this; + } + + /** + * The 16-19 digit number for this gift card. + * @return number + **/ + @ApiModelProperty(example = "4123455541234561234", required = true, value = "The 16-19 digit number for this gift card.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public GiftCardBalanceNewRequest pin(String pin) { + + this.pin = pin; + return this; + } + + /** + * The PIN for this gift card. + * @return pin + **/ + @ApiModelProperty(example = "1234", required = true, value = "The PIN for this gift card.") + + public String getPin() { + return pin; + } + + + public void setPin(String pin) { + this.pin = pin; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardBalanceNewRequest giftCardBalanceNewRequest = (GiftCardBalanceNewRequest) o; + return Objects.equals(this.number, giftCardBalanceNewRequest.number) && + Objects.equals(this.pin, giftCardBalanceNewRequest.pin); + } + + @Override + public int hashCode() { + return Objects.hash(number, pin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardBalanceNewRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardBalanceRequest.java b/src/main/java/com/gr4vy/api/model/GiftCardBalanceRequest.java new file mode 100644 index 0000000..e5adec2 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardBalanceRequest.java @@ -0,0 +1,158 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * Check the balance for a stored/new gift card. + */ +@ApiModel(description = "Check the balance for a stored/new gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardBalanceRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private String pin; + + + public GiftCardBalanceRequest id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of the gift card to check a balance for. Required if `number` is not set. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", value = "The ID of the gift card to check a balance for. Required if `number` is not set.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardBalanceRequest number(String number) { + + this.number = number; + return this; + } + + /** + * The 16-19 digit number for this gift card. Required if `id` is not set. + * @return number + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "4123455541234561234", value = "The 16-19 digit number for this gift card. Required if `id` is not set.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public GiftCardBalanceRequest pin(String pin) { + + this.pin = pin; + return this; + } + + /** + * The PIN for this gift card. Required if `number` is set. + * @return pin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1234", value = "The PIN for this gift card. Required if `number` is set.") + + public String getPin() { + return pin; + } + + + public void setPin(String pin) { + this.pin = pin; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardBalanceRequest giftCardBalanceRequest = (GiftCardBalanceRequest) o; + return Objects.equals(this.id, giftCardBalanceRequest.id) && + Objects.equals(this.number, giftCardBalanceRequest.number) && + Objects.equals(this.pin, giftCardBalanceRequest.pin); + } + + @Override + public int hashCode() { + return Objects.hash(id, number, pin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardBalanceRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardBalanceStoredRequest.java b/src/main/java/com/gr4vy/api/model/GiftCardBalanceStoredRequest.java new file mode 100644 index 0000000..fa71c22 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardBalanceStoredRequest.java @@ -0,0 +1,99 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * Check the balance for a stored gift card. + */ +@ApiModel(description = "Check the balance for a stored gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardBalanceStoredRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + + public GiftCardBalanceStoredRequest id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of the gift card to check a balance for. + * @return id + **/ + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", required = true, value = "The ID of the gift card to check a balance for.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardBalanceStoredRequest giftCardBalanceStoredRequest = (GiftCardBalanceStoredRequest) o; + return Objects.equals(this.id, giftCardBalanceStoredRequest.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardBalanceStoredRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardBalancesRequest.java b/src/main/java/com/gr4vy/api/model/GiftCardBalancesRequest.java new file mode 100644 index 0000000..6e0beb4 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardBalancesRequest.java @@ -0,0 +1,110 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardBalanceRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * A request to check the balance for a set of stored and non-stored gift cards. + */ +@ApiModel(description = "A request to check the balance for a set of stored and non-stored gift cards.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardBalancesRequest { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + + public GiftCardBalancesRequest items(List items) { + + this.items = items; + return this; + } + + public GiftCardBalancesRequest addItemsItem(GiftCardBalanceRequest itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * One or more gift cards to check balances for. + * @return items + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "One or more gift cards to check balances for.") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardBalancesRequest giftCardBalancesRequest = (GiftCardBalancesRequest) o; + return Objects.equals(this.items, giftCardBalancesRequest.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardBalancesRequest {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRedemption.java b/src/main/java/com/gr4vy/api/model/GiftCardRedemption.java new file mode 100644 index 0000000..a1ffe13 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRedemption.java @@ -0,0 +1,527 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardSnapshot; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * A redemption of a gift card used in a transaction. + */ +@ApiModel(description = "A redemption of a gift card used in a transaction.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRedemption { + /** + * The type of this resource. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GIFT_CARD_REDEMPTION("gift-card-redemption"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + /** + * The status of the gift card redemption for the `payment_method`. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + SUCCEEDED("succeeded"), + + FAILED("failed"), + + SKIPPED("skipped"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; + + public static final String SERIALIZED_NAME_REFUNDED_AMOUNT = "refunded_amount"; + @SerializedName(SERIALIZED_NAME_REFUNDED_AMOUNT) + private Integer refundedAmount; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_REDEMPTION_ID = "gift_card_service_redemption_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_REDEMPTION_ID) + private String giftCardServiceRedemptionId; + + /** + * If this gift card redemption resulted in an error, this will contain the internal code for the error. + */ + @JsonAdapter(ErrorCodeEnum.Adapter.class) + public enum ErrorCodeEnum { + DEACTIVATED_CARD("deactivated_card"), + + EXPIRED_CARD("expired_card"), + + INCORRECT_CURRENCY("incorrect_currency"), + + INSUFFICIENT_FUNDS("insufficient_funds"), + + INVALID_AMOUNT("invalid_amount"), + + INVALID_GIFT_CARD("invalid_gift_card"), + + INVALID_SERVICE_CONFIGURATION("invalid_service_configuration"), + + INVALID_SERVICE_CREDENTIALS("invalid_service_credentials"), + + OPERATION_CANCELED("operation_canceled"), + + SERVICE_ERROR("service_error"), + + SERVICE_NETWORK_ERROR("service_network_error"), + + UNKNOWN_ERROR("unknown_error"); + + private String value; + + ErrorCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ErrorCodeEnum fromValue(String value) { + for (ErrorCodeEnum b : ErrorCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ErrorCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ErrorCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ErrorCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ERROR_CODE = "error_code"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private ErrorCodeEnum errorCode; + + public static final String SERIALIZED_NAME_RAW_ERROR_CODE = "raw_error_code"; + @SerializedName(SERIALIZED_NAME_RAW_ERROR_CODE) + private String rawErrorCode; + + public static final String SERIALIZED_NAME_RAW_ERROR_MESSAGE = "raw_error_message"; + @SerializedName(SERIALIZED_NAME_RAW_ERROR_MESSAGE) + private String rawErrorMessage; + + public static final String SERIALIZED_NAME_GIFT_CARD = "gift_card"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD) + private GiftCardSnapshot giftCard; + + + public GiftCardRedemption type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-redemption", value = "The type of this resource.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardRedemption id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of this gift card redemption. This may be `null` if the no redemption happened. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "bc3f0d5a-3529-4d31-b2b4-848d14926bbc", value = "The ID of this gift card redemption. This may be `null` if the no redemption happened.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardRedemption status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the gift card redemption for the `payment_method`. + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "succeeded", value = "The status of the gift card redemption for the `payment_method`.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public GiftCardRedemption amount(Integer amount) { + + this.amount = amount; + return this; + } + + /** + * The amount redeemed for this gift card. + * minimum: 1 + * maximum: 99999999 + * @return amount + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1299", value = "The amount redeemed for this gift card.") + + public Integer getAmount() { + return amount; + } + + + public void setAmount(Integer amount) { + this.amount = amount; + } + + + public GiftCardRedemption refundedAmount(Integer refundedAmount) { + + this.refundedAmount = refundedAmount; + return this; + } + + /** + * The amount refunded for this gift card. This can not be larger than `amount`. + * minimum: 1 + * maximum: 99999999 + * @return refundedAmount + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1299", value = "The amount refunded for this gift card. This can not be larger than `amount`.") + + public Integer getRefundedAmount() { + return refundedAmount; + } + + + public void setRefundedAmount(Integer refundedAmount) { + this.refundedAmount = refundedAmount; + } + + + public GiftCardRedemption giftCardServiceRedemptionId(String giftCardServiceRedemptionId) { + + this.giftCardServiceRedemptionId = giftCardServiceRedemptionId; + return this; + } + + /** + * The gift card service's unique ID for the redemption. + * @return giftCardServiceRedemptionId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "xYqd43gySMtori", value = "The gift card service's unique ID for the redemption.") + + public String getGiftCardServiceRedemptionId() { + return giftCardServiceRedemptionId; + } + + + public void setGiftCardServiceRedemptionId(String giftCardServiceRedemptionId) { + this.giftCardServiceRedemptionId = giftCardServiceRedemptionId; + } + + + public GiftCardRedemption errorCode(ErrorCodeEnum errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * If this gift card redemption resulted in an error, this will contain the internal code for the error. + * @return errorCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "expired_card", value = "If this gift card redemption resulted in an error, this will contain the internal code for the error.") + + public ErrorCodeEnum getErrorCode() { + return errorCode; + } + + + public void setErrorCode(ErrorCodeEnum errorCode) { + this.errorCode = errorCode; + } + + + public GiftCardRedemption rawErrorCode(String rawErrorCode) { + + this.rawErrorCode = rawErrorCode; + return this; + } + + /** + * If this gift card redemption resulted in an error, this will contain the raw error code received from the gift card provider. + * @return rawErrorCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10001", value = "If this gift card redemption resulted in an error, this will contain the raw error code received from the gift card provider.") + + public String getRawErrorCode() { + return rawErrorCode; + } + + + public void setRawErrorCode(String rawErrorCode) { + this.rawErrorCode = rawErrorCode; + } + + + public GiftCardRedemption rawErrorMessage(String rawErrorMessage) { + + this.rawErrorMessage = rawErrorMessage; + return this; + } + + /** + * If this gift card redemption resulted in an error, this will contain the raw error message received from the gift card provider. + * @return rawErrorMessage + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Card expired.", value = "If this gift card redemption resulted in an error, this will contain the raw error message received from the gift card provider.") + + public String getRawErrorMessage() { + return rawErrorMessage; + } + + + public void setRawErrorMessage(String rawErrorMessage) { + this.rawErrorMessage = rawErrorMessage; + } + + + public GiftCardRedemption giftCard(GiftCardSnapshot giftCard) { + + this.giftCard = giftCard; + return this; + } + + /** + * Get giftCard + * @return giftCard + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardSnapshot getGiftCard() { + return giftCard; + } + + + public void setGiftCard(GiftCardSnapshot giftCard) { + this.giftCard = giftCard; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRedemption giftCardRedemption = (GiftCardRedemption) o; + return Objects.equals(this.type, giftCardRedemption.type) && + Objects.equals(this.id, giftCardRedemption.id) && + Objects.equals(this.status, giftCardRedemption.status) && + Objects.equals(this.amount, giftCardRedemption.amount) && + Objects.equals(this.refundedAmount, giftCardRedemption.refundedAmount) && + Objects.equals(this.giftCardServiceRedemptionId, giftCardRedemption.giftCardServiceRedemptionId) && + Objects.equals(this.errorCode, giftCardRedemption.errorCode) && + Objects.equals(this.rawErrorCode, giftCardRedemption.rawErrorCode) && + Objects.equals(this.rawErrorMessage, giftCardRedemption.rawErrorMessage) && + Objects.equals(this.giftCard, giftCardRedemption.giftCard); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, status, amount, refundedAmount, giftCardServiceRedemptionId, errorCode, rawErrorCode, rawErrorMessage, giftCard); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRedemption {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" refundedAmount: ").append(toIndentedString(refundedAmount)).append("\n"); + sb.append(" giftCardServiceRedemptionId: ").append(toIndentedString(giftCardServiceRedemptionId)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" rawErrorCode: ").append(toIndentedString(rawErrorCode)).append("\n"); + sb.append(" rawErrorMessage: ").append(toIndentedString(rawErrorMessage)).append("\n"); + sb.append(" giftCard: ").append(toIndentedString(giftCard)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailed.java b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailed.java new file mode 100644 index 0000000..ddcf31b --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailed.java @@ -0,0 +1,308 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardRedemptionFailedContext; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * This event logs the request and response details of HTTP calls made to redeem gift cards, in case the call failed. + */ +@ApiModel(description = "This event logs the request and response details of HTTP calls made to redeem gift cards, in case the call failed.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRedemptionFailed { + /** + * The type of this resource. Is always `transaction-event`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TRANSACTION_EVENT("transaction-event"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + /** + * The name of this resource. Is always `gift-card-redemption-failed`. + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + GIFT_CARD_REDEMPTION_FAILED("gift-card-redemption-failed"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String value) { + for (NameEnum b : NameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private NameEnum name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + private GiftCardRedemptionFailedContext context; + + + public GiftCardRedemptionFailed type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `transaction-event`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "transaction-event", value = "The type of this resource. Is always `transaction-event`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardRedemptionFailed id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this event. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this event.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardRedemptionFailed name(NameEnum name) { + + this.name = name; + return this; + } + + /** + * The name of this resource. Is always `gift-card-redemption-failed`. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-redemption-failed", value = "The name of this resource. Is always `gift-card-redemption-failed`.") + + public NameEnum getName() { + return name; + } + + + public void setName(NameEnum name) { + this.name = name; + } + + + public GiftCardRedemptionFailed createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this event was created in our system. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this event was created in our system.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GiftCardRedemptionFailed context(GiftCardRedemptionFailedContext context) { + + this.context = context; + return this; + } + + /** + * Get context + * @return context + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardRedemptionFailedContext getContext() { + return context; + } + + + public void setContext(GiftCardRedemptionFailedContext context) { + this.context = context; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRedemptionFailed giftCardRedemptionFailed = (GiftCardRedemptionFailed) o; + return Objects.equals(this.type, giftCardRedemptionFailed.type) && + Objects.equals(this.id, giftCardRedemptionFailed.id) && + Objects.equals(this.name, giftCardRedemptionFailed.name) && + Objects.equals(this.createdAt, giftCardRedemptionFailed.createdAt) && + Objects.equals(this.context, giftCardRedemptionFailed.context); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, createdAt, context); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRedemptionFailed {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailedContext.java b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailedContext.java new file mode 100644 index 0000000..18f8130 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionFailedContext.java @@ -0,0 +1,304 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; + +/** + * Additional context for this event. + */ +@ApiModel(description = "Additional context for this event.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRedemptionFailedContext { + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_ID = "gift_card_service_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_ID) + private UUID giftCardServiceId; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME = "gift_card_service_name"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME) + private String giftCardServiceName; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID = "gift_card_service_definition_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID) + private String giftCardServiceDefinitionId; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private String request; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private String response; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS_CODE = "response_status_code"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS_CODE) + private BigDecimal responseStatusCode; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + + public GiftCardRedemptionFailedContext giftCardServiceId(UUID giftCardServiceId) { + + this.giftCardServiceId = giftCardServiceId; + return this; + } + + /** + * The unique ID of the Gift Card service used. + * @return giftCardServiceId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The unique ID of the Gift Card service used.") + + public UUID getGiftCardServiceId() { + return giftCardServiceId; + } + + + public void setGiftCardServiceId(UUID giftCardServiceId) { + this.giftCardServiceId = giftCardServiceId; + } + + + public GiftCardRedemptionFailedContext giftCardServiceName(String giftCardServiceName) { + + this.giftCardServiceName = giftCardServiceName; + return this; + } + + /** + * The name of the Gift Card service used. + * @return giftCardServiceName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Gift Card service used.") + + public String getGiftCardServiceName() { + return giftCardServiceName; + } + + + public void setGiftCardServiceName(String giftCardServiceName) { + this.giftCardServiceName = giftCardServiceName; + } + + + public GiftCardRedemptionFailedContext giftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + return this; + } + + /** + * The Gift Card service definition used. + * @return giftCardServiceDefinitionId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Gift Card service definition used.") + + public String getGiftCardServiceDefinitionId() { + return giftCardServiceDefinitionId; + } + + + public void setGiftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + } + + + public GiftCardRedemptionFailedContext url(String url) { + + this.url = url; + return this; + } + + /** + * The endpoint for the request, if performed. + * @return url + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The endpoint for the request, if performed.") + + public String getUrl() { + return url; + } + + + public void setUrl(String url) { + this.url = url; + } + + + public GiftCardRedemptionFailedContext request(String request) { + + this.request = request; + return this; + } + + /** + * The HTTP body sent to the Gift Card provider, if performed. + * @return request + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body sent to the Gift Card provider, if performed.") + + public String getRequest() { + return request; + } + + + public void setRequest(String request) { + this.request = request; + } + + + public GiftCardRedemptionFailedContext response(String response) { + + this.response = response; + return this; + } + + /** + * The HTTP body received from the Gift Card provider, if any. + * @return response + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body received from the Gift Card provider, if any.") + + public String getResponse() { + return response; + } + + + public void setResponse(String response) { + this.response = response; + } + + + public GiftCardRedemptionFailedContext responseStatusCode(BigDecimal responseStatusCode) { + + this.responseStatusCode = responseStatusCode; + return this; + } + + /** + * The HTTP response status code from the Gift Card provider, if any. + * @return responseStatusCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP response status code from the Gift Card provider, if any.") + + public BigDecimal getResponseStatusCode() { + return responseStatusCode; + } + + + public void setResponseStatusCode(BigDecimal responseStatusCode) { + this.responseStatusCode = responseStatusCode; + } + + + public GiftCardRedemptionFailedContext reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * The reason we could not redeem the gift cards. + * @return reason + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Network Error", value = "The reason we could not redeem the gift cards.") + + public String getReason() { + return reason; + } + + + public void setReason(String reason) { + this.reason = reason; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRedemptionFailedContext giftCardRedemptionFailedContext = (GiftCardRedemptionFailedContext) o; + return Objects.equals(this.giftCardServiceId, giftCardRedemptionFailedContext.giftCardServiceId) && + Objects.equals(this.giftCardServiceName, giftCardRedemptionFailedContext.giftCardServiceName) && + Objects.equals(this.giftCardServiceDefinitionId, giftCardRedemptionFailedContext.giftCardServiceDefinitionId) && + Objects.equals(this.url, giftCardRedemptionFailedContext.url) && + Objects.equals(this.request, giftCardRedemptionFailedContext.request) && + Objects.equals(this.response, giftCardRedemptionFailedContext.response) && + Objects.equals(this.responseStatusCode, giftCardRedemptionFailedContext.responseStatusCode) && + Objects.equals(this.reason, giftCardRedemptionFailedContext.reason); + } + + @Override + public int hashCode() { + return Objects.hash(giftCardServiceId, giftCardServiceName, giftCardServiceDefinitionId, url, request, response, responseStatusCode, reason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRedemptionFailedContext {\n"); + sb.append(" giftCardServiceId: ").append(toIndentedString(giftCardServiceId)).append("\n"); + sb.append(" giftCardServiceName: ").append(toIndentedString(giftCardServiceName)).append("\n"); + sb.append(" giftCardServiceDefinitionId: ").append(toIndentedString(giftCardServiceDefinitionId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" responseStatusCode: ").append(toIndentedString(responseStatusCode)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceeded.java b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceeded.java new file mode 100644 index 0000000..4be8a4d --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceeded.java @@ -0,0 +1,308 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardRedemptionSucceededContext; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * This event logs the request and response details of HTTP calls made to redeem gift cards, in case the call succeeded. + */ +@ApiModel(description = "This event logs the request and response details of HTTP calls made to redeem gift cards, in case the call succeeded.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRedemptionSucceeded { + /** + * The type of this resource. Is always `transaction-event`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TRANSACTION_EVENT("transaction-event"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + /** + * The name of this resource. Is always `gift-card-redemption-succeeded`. + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + GIFT_CARD_REDEMPTION_SUCCEEDED("gift-card-redemption-succeeded"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String value) { + for (NameEnum b : NameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private NameEnum name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + private GiftCardRedemptionSucceededContext context; + + + public GiftCardRedemptionSucceeded type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `transaction-event`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "transaction-event", value = "The type of this resource. Is always `transaction-event`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardRedemptionSucceeded id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this event. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this event.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardRedemptionSucceeded name(NameEnum name) { + + this.name = name; + return this; + } + + /** + * The name of this resource. Is always `gift-card-redemption-succeeded`. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-redemption-succeeded", value = "The name of this resource. Is always `gift-card-redemption-succeeded`.") + + public NameEnum getName() { + return name; + } + + + public void setName(NameEnum name) { + this.name = name; + } + + + public GiftCardRedemptionSucceeded createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this event was created in our system. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this event was created in our system.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GiftCardRedemptionSucceeded context(GiftCardRedemptionSucceededContext context) { + + this.context = context; + return this; + } + + /** + * Get context + * @return context + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardRedemptionSucceededContext getContext() { + return context; + } + + + public void setContext(GiftCardRedemptionSucceededContext context) { + this.context = context; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRedemptionSucceeded giftCardRedemptionSucceeded = (GiftCardRedemptionSucceeded) o; + return Objects.equals(this.type, giftCardRedemptionSucceeded.type) && + Objects.equals(this.id, giftCardRedemptionSucceeded.id) && + Objects.equals(this.name, giftCardRedemptionSucceeded.name) && + Objects.equals(this.createdAt, giftCardRedemptionSucceeded.createdAt) && + Objects.equals(this.context, giftCardRedemptionSucceeded.context); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, createdAt, context); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRedemptionSucceeded {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceededContext.java b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceededContext.java new file mode 100644 index 0000000..137be4e --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRedemptionSucceededContext.java @@ -0,0 +1,275 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; + +/** + * Additional context for this event. + */ +@ApiModel(description = "Additional context for this event.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRedemptionSucceededContext { + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_ID = "gift_card_service_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_ID) + private UUID giftCardServiceId; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME = "gift_card_service_name"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME) + private String giftCardServiceName; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID = "gift_card_service_definition_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID) + private String giftCardServiceDefinitionId; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private String request; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private String response; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS_CODE = "response_status_code"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS_CODE) + private BigDecimal responseStatusCode; + + + public GiftCardRedemptionSucceededContext giftCardServiceId(UUID giftCardServiceId) { + + this.giftCardServiceId = giftCardServiceId; + return this; + } + + /** + * The unique ID of the Gift Card service used. + * @return giftCardServiceId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The unique ID of the Gift Card service used.") + + public UUID getGiftCardServiceId() { + return giftCardServiceId; + } + + + public void setGiftCardServiceId(UUID giftCardServiceId) { + this.giftCardServiceId = giftCardServiceId; + } + + + public GiftCardRedemptionSucceededContext giftCardServiceName(String giftCardServiceName) { + + this.giftCardServiceName = giftCardServiceName; + return this; + } + + /** + * The name of the Gift Card service used. + * @return giftCardServiceName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Gift Card service used.") + + public String getGiftCardServiceName() { + return giftCardServiceName; + } + + + public void setGiftCardServiceName(String giftCardServiceName) { + this.giftCardServiceName = giftCardServiceName; + } + + + public GiftCardRedemptionSucceededContext giftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + return this; + } + + /** + * The Gift Card service definition used. + * @return giftCardServiceDefinitionId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Gift Card service definition used.") + + public String getGiftCardServiceDefinitionId() { + return giftCardServiceDefinitionId; + } + + + public void setGiftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + } + + + public GiftCardRedemptionSucceededContext url(String url) { + + this.url = url; + return this; + } + + /** + * The endpoint for the request. + * @return url + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The endpoint for the request.") + + public String getUrl() { + return url; + } + + + public void setUrl(String url) { + this.url = url; + } + + + public GiftCardRedemptionSucceededContext request(String request) { + + this.request = request; + return this; + } + + /** + * The HTTP body sent to the Gift Card provider. + * @return request + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body sent to the Gift Card provider.") + + public String getRequest() { + return request; + } + + + public void setRequest(String request) { + this.request = request; + } + + + public GiftCardRedemptionSucceededContext response(String response) { + + this.response = response; + return this; + } + + /** + * The HTTP body received from the Gift Card provider. + * @return response + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body received from the Gift Card provider.") + + public String getResponse() { + return response; + } + + + public void setResponse(String response) { + this.response = response; + } + + + public GiftCardRedemptionSucceededContext responseStatusCode(BigDecimal responseStatusCode) { + + this.responseStatusCode = responseStatusCode; + return this; + } + + /** + * The HTTP response status code from the Gift Card provider. + * @return responseStatusCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP response status code from the Gift Card provider.") + + public BigDecimal getResponseStatusCode() { + return responseStatusCode; + } + + + public void setResponseStatusCode(BigDecimal responseStatusCode) { + this.responseStatusCode = responseStatusCode; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRedemptionSucceededContext giftCardRedemptionSucceededContext = (GiftCardRedemptionSucceededContext) o; + return Objects.equals(this.giftCardServiceId, giftCardRedemptionSucceededContext.giftCardServiceId) && + Objects.equals(this.giftCardServiceName, giftCardRedemptionSucceededContext.giftCardServiceName) && + Objects.equals(this.giftCardServiceDefinitionId, giftCardRedemptionSucceededContext.giftCardServiceDefinitionId) && + Objects.equals(this.url, giftCardRedemptionSucceededContext.url) && + Objects.equals(this.request, giftCardRedemptionSucceededContext.request) && + Objects.equals(this.response, giftCardRedemptionSucceededContext.response) && + Objects.equals(this.responseStatusCode, giftCardRedemptionSucceededContext.responseStatusCode); + } + + @Override + public int hashCode() { + return Objects.hash(giftCardServiceId, giftCardServiceName, giftCardServiceDefinitionId, url, request, response, responseStatusCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRedemptionSucceededContext {\n"); + sb.append(" giftCardServiceId: ").append(toIndentedString(giftCardServiceId)).append("\n"); + sb.append(" giftCardServiceName: ").append(toIndentedString(giftCardServiceName)).append("\n"); + sb.append(" giftCardServiceDefinitionId: ").append(toIndentedString(giftCardServiceDefinitionId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" responseStatusCode: ").append(toIndentedString(responseStatusCode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRefundFailed.java b/src/main/java/com/gr4vy/api/model/GiftCardRefundFailed.java new file mode 100644 index 0000000..c02db67 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRefundFailed.java @@ -0,0 +1,308 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardRefundFailedContext; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * This event logs the request and response details of HTTP calls made to refund gift cards, in case the call failed. + */ +@ApiModel(description = "This event logs the request and response details of HTTP calls made to refund gift cards, in case the call failed.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRefundFailed { + /** + * The type of this resource. Is always `transaction-event`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TRANSACTION_EVENT("transaction-event"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + /** + * The name of this resource. Is always `gift-card-refund-failed`. + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + GIFT_CARD_REFUND_FAILED("gift-card-refund-failed"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String value) { + for (NameEnum b : NameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private NameEnum name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + private GiftCardRefundFailedContext context; + + + public GiftCardRefundFailed type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `transaction-event`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "transaction-event", value = "The type of this resource. Is always `transaction-event`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardRefundFailed id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this event. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this event.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardRefundFailed name(NameEnum name) { + + this.name = name; + return this; + } + + /** + * The name of this resource. Is always `gift-card-refund-failed`. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-refund-failed", value = "The name of this resource. Is always `gift-card-refund-failed`.") + + public NameEnum getName() { + return name; + } + + + public void setName(NameEnum name) { + this.name = name; + } + + + public GiftCardRefundFailed createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this event was created in our system. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this event was created in our system.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GiftCardRefundFailed context(GiftCardRefundFailedContext context) { + + this.context = context; + return this; + } + + /** + * Get context + * @return context + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardRefundFailedContext getContext() { + return context; + } + + + public void setContext(GiftCardRefundFailedContext context) { + this.context = context; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRefundFailed giftCardRefundFailed = (GiftCardRefundFailed) o; + return Objects.equals(this.type, giftCardRefundFailed.type) && + Objects.equals(this.id, giftCardRefundFailed.id) && + Objects.equals(this.name, giftCardRefundFailed.name) && + Objects.equals(this.createdAt, giftCardRefundFailed.createdAt) && + Objects.equals(this.context, giftCardRefundFailed.context); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, createdAt, context); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRefundFailed {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRefundFailedContext.java b/src/main/java/com/gr4vy/api/model/GiftCardRefundFailedContext.java new file mode 100644 index 0000000..9c599bb --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRefundFailedContext.java @@ -0,0 +1,304 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; + +/** + * Additional context for this event. + */ +@ApiModel(description = "Additional context for this event.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRefundFailedContext { + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_ID = "gift_card_service_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_ID) + private UUID giftCardServiceId; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME = "gift_card_service_name"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_NAME) + private String giftCardServiceName; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID = "gift_card_service_definition_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID) + private String giftCardServiceDefinitionId; + + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + private String url; + + public static final String SERIALIZED_NAME_REQUEST = "request"; + @SerializedName(SERIALIZED_NAME_REQUEST) + private String request; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private String response; + + public static final String SERIALIZED_NAME_RESPONSE_STATUS_CODE = "response_status_code"; + @SerializedName(SERIALIZED_NAME_RESPONSE_STATUS_CODE) + private BigDecimal responseStatusCode; + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + + public GiftCardRefundFailedContext giftCardServiceId(UUID giftCardServiceId) { + + this.giftCardServiceId = giftCardServiceId; + return this; + } + + /** + * The unique ID of the Gift Card service used. + * @return giftCardServiceId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The unique ID of the Gift Card service used.") + + public UUID getGiftCardServiceId() { + return giftCardServiceId; + } + + + public void setGiftCardServiceId(UUID giftCardServiceId) { + this.giftCardServiceId = giftCardServiceId; + } + + + public GiftCardRefundFailedContext giftCardServiceName(String giftCardServiceName) { + + this.giftCardServiceName = giftCardServiceName; + return this; + } + + /** + * The name of the Gift Card service used. + * @return giftCardServiceName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The name of the Gift Card service used.") + + public String getGiftCardServiceName() { + return giftCardServiceName; + } + + + public void setGiftCardServiceName(String giftCardServiceName) { + this.giftCardServiceName = giftCardServiceName; + } + + + public GiftCardRefundFailedContext giftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + return this; + } + + /** + * The Gift Card service definition used. + * @return giftCardServiceDefinitionId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The Gift Card service definition used.") + + public String getGiftCardServiceDefinitionId() { + return giftCardServiceDefinitionId; + } + + + public void setGiftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + } + + + public GiftCardRefundFailedContext url(String url) { + + this.url = url; + return this; + } + + /** + * The endpoint for the request, if performed. + * @return url + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The endpoint for the request, if performed.") + + public String getUrl() { + return url; + } + + + public void setUrl(String url) { + this.url = url; + } + + + public GiftCardRefundFailedContext request(String request) { + + this.request = request; + return this; + } + + /** + * The HTTP body sent to the Gift Card provider, if performed. + * @return request + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body sent to the Gift Card provider, if performed.") + + public String getRequest() { + return request; + } + + + public void setRequest(String request) { + this.request = request; + } + + + public GiftCardRefundFailedContext response(String response) { + + this.response = response; + return this; + } + + /** + * The HTTP body received from the Gift Card provider, if any. + * @return response + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP body received from the Gift Card provider, if any.") + + public String getResponse() { + return response; + } + + + public void setResponse(String response) { + this.response = response; + } + + + public GiftCardRefundFailedContext responseStatusCode(BigDecimal responseStatusCode) { + + this.responseStatusCode = responseStatusCode; + return this; + } + + /** + * The HTTP response status code from the Gift Card provider, if any. + * @return responseStatusCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The HTTP response status code from the Gift Card provider, if any.") + + public BigDecimal getResponseStatusCode() { + return responseStatusCode; + } + + + public void setResponseStatusCode(BigDecimal responseStatusCode) { + this.responseStatusCode = responseStatusCode; + } + + + public GiftCardRefundFailedContext reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * The reason we could not refund the gift cards. + * @return reason + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Network Error", value = "The reason we could not refund the gift cards.") + + public String getReason() { + return reason; + } + + + public void setReason(String reason) { + this.reason = reason; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRefundFailedContext giftCardRefundFailedContext = (GiftCardRefundFailedContext) o; + return Objects.equals(this.giftCardServiceId, giftCardRefundFailedContext.giftCardServiceId) && + Objects.equals(this.giftCardServiceName, giftCardRefundFailedContext.giftCardServiceName) && + Objects.equals(this.giftCardServiceDefinitionId, giftCardRefundFailedContext.giftCardServiceDefinitionId) && + Objects.equals(this.url, giftCardRefundFailedContext.url) && + Objects.equals(this.request, giftCardRefundFailedContext.request) && + Objects.equals(this.response, giftCardRefundFailedContext.response) && + Objects.equals(this.responseStatusCode, giftCardRefundFailedContext.responseStatusCode) && + Objects.equals(this.reason, giftCardRefundFailedContext.reason); + } + + @Override + public int hashCode() { + return Objects.hash(giftCardServiceId, giftCardServiceName, giftCardServiceDefinitionId, url, request, response, responseStatusCode, reason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRefundFailedContext {\n"); + sb.append(" giftCardServiceId: ").append(toIndentedString(giftCardServiceId)).append("\n"); + sb.append(" giftCardServiceName: ").append(toIndentedString(giftCardServiceName)).append("\n"); + sb.append(" giftCardServiceDefinitionId: ").append(toIndentedString(giftCardServiceDefinitionId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" responseStatusCode: ").append(toIndentedString(responseStatusCode)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardRefundSucceeded.java b/src/main/java/com/gr4vy/api/model/GiftCardRefundSucceeded.java new file mode 100644 index 0000000..d7c237b --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardRefundSucceeded.java @@ -0,0 +1,308 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardRedemptionSucceededContext; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * This event logs the request and response details of HTTP calls made to refund gift cards, in case the call succeeded. + */ +@ApiModel(description = "This event logs the request and response details of HTTP calls made to refund gift cards, in case the call succeeded.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardRefundSucceeded { + /** + * The type of this resource. Is always `transaction-event`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TRANSACTION_EVENT("transaction-event"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + /** + * The name of this resource. Is always `gift-card-refund-succeeded`. + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + GIFT_CARD_REFUND_SUCCEEDED("gift-card-refund-succeeded"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String value) { + for (NameEnum b : NameEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private NameEnum name; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CONTEXT = "context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + private GiftCardRedemptionSucceededContext context; + + + public GiftCardRefundSucceeded type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `transaction-event`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "transaction-event", value = "The type of this resource. Is always `transaction-event`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardRefundSucceeded id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this event. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this event.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardRefundSucceeded name(NameEnum name) { + + this.name = name; + return this; + } + + /** + * The name of this resource. Is always `gift-card-refund-succeeded`. + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-refund-succeeded", value = "The name of this resource. Is always `gift-card-refund-succeeded`.") + + public NameEnum getName() { + return name; + } + + + public void setName(NameEnum name) { + this.name = name; + } + + + public GiftCardRefundSucceeded createdAt(String createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when this event was created in our system. + * @return createdAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this event was created in our system.") + + public String getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + + public GiftCardRefundSucceeded context(GiftCardRedemptionSucceededContext context) { + + this.context = context; + return this; + } + + /** + * Get context + * @return context + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public GiftCardRedemptionSucceededContext getContext() { + return context; + } + + + public void setContext(GiftCardRedemptionSucceededContext context) { + this.context = context; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardRefundSucceeded giftCardRefundSucceeded = (GiftCardRefundSucceeded) o; + return Objects.equals(this.type, giftCardRefundSucceeded.type) && + Objects.equals(this.id, giftCardRefundSucceeded.id) && + Objects.equals(this.name, giftCardRefundSucceeded.name) && + Objects.equals(this.createdAt, giftCardRefundSucceeded.createdAt) && + Objects.equals(this.context, giftCardRefundSucceeded.context); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, createdAt, context); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardRefundSucceeded {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardServiceSnapshot.java b/src/main/java/com/gr4vy/api/model/GiftCardServiceSnapshot.java new file mode 100644 index 0000000..03ddfb7 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardServiceSnapshot.java @@ -0,0 +1,232 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * A snapshot of a gift card service used in a transaction. + */ +@ApiModel(description = "A snapshot of a gift card service used in a transaction.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardServiceSnapshot { + /** + * The type of this resource. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GIFT_CARD_SERVICE("gift-card-service"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID = "gift_card_service_definition_id"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE_DEFINITION_ID) + private String giftCardServiceDefinitionId; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + + public GiftCardServiceSnapshot type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-service", value = "The type of this resource.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardServiceSnapshot id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of this gift card service. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "6c020bf3-179b-4f4f-858d-84e39e196e0f", value = "The ID of this gift card service.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardServiceSnapshot giftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + return this; + } + + /** + * The ID of the gift card service definition used to create this service. + * @return giftCardServiceDefinitionId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "qwikcilver-gift-card", value = "The ID of the gift card service definition used to create this service. ") + + public String getGiftCardServiceDefinitionId() { + return giftCardServiceDefinitionId; + } + + + public void setGiftCardServiceDefinitionId(String giftCardServiceDefinitionId) { + this.giftCardServiceDefinitionId = giftCardServiceDefinitionId; + } + + + public GiftCardServiceSnapshot displayName(String displayName) { + + this.displayName = displayName; + return this; + } + + /** + * The custom name set for this service. + * @return displayName + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Qwikcilver UK", value = "The custom name set for this service.") + + public String getDisplayName() { + return displayName; + } + + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardServiceSnapshot giftCardServiceSnapshot = (GiftCardServiceSnapshot) o; + return Objects.equals(this.type, giftCardServiceSnapshot.type) && + Objects.equals(this.id, giftCardServiceSnapshot.id) && + Objects.equals(this.giftCardServiceDefinitionId, giftCardServiceSnapshot.giftCardServiceDefinitionId) && + Objects.equals(this.displayName, giftCardServiceSnapshot.displayName); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, giftCardServiceDefinitionId, displayName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardServiceSnapshot {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" giftCardServiceDefinitionId: ").append(toIndentedString(giftCardServiceDefinitionId)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardSnapshot.java b/src/main/java/com/gr4vy/api/model/GiftCardSnapshot.java new file mode 100644 index 0000000..e96a0d0 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardSnapshot.java @@ -0,0 +1,261 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * A snapshot of a gift card used in a transaction. + */ +@ApiModel(description = "A snapshot of a gift card used in a transaction.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardSnapshot { + /** + * The type of this resource. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GIFT_CARD("gift-card"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_BIN = "bin"; + @SerializedName(SERIALIZED_NAME_BIN) + private String bin; + + public static final String SERIALIZED_NAME_SUB_BIN = "sub_bin"; + @SerializedName(SERIALIZED_NAME_SUB_BIN) + private String subBin; + + public static final String SERIALIZED_NAME_LAST4 = "last4"; + @SerializedName(SERIALIZED_NAME_LAST4) + private String last4; + + + public GiftCardSnapshot type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card", value = "The type of this resource.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardSnapshot id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of this gift card. This may be `null` if the gift card is not stored. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", value = "The ID of this gift card. This may be `null` if the gift card is not stored.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardSnapshot bin(String bin) { + + this.bin = bin; + return this; + } + + /** + * The first 6 digits of the full gift card number. + * @return bin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "412345", value = "The first 6 digits of the full gift card number.") + + public String getBin() { + return bin; + } + + + public void setBin(String bin) { + this.bin = bin; + } + + + public GiftCardSnapshot subBin(String subBin) { + + this.subBin = subBin; + return this; + } + + /** + * The 3 digits after the `bin` of the full gift card number. + * @return subBin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "554", value = "The 3 digits after the `bin` of the full gift card number.") + + public String getSubBin() { + return subBin; + } + + + public void setSubBin(String subBin) { + this.subBin = subBin; + } + + + public GiftCardSnapshot last4(String last4) { + + this.last4 = last4; + return this; + } + + /** + * The last 4 digits for the gift card. + * @return last4 + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1234", value = "The last 4 digits for the gift card.") + + public String getLast4() { + return last4; + } + + + public void setLast4(String last4) { + this.last4 = last4; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardSnapshot giftCardSnapshot = (GiftCardSnapshot) o; + return Objects.equals(this.type, giftCardSnapshot.type) && + Objects.equals(this.id, giftCardSnapshot.id) && + Objects.equals(this.bin, giftCardSnapshot.bin) && + Objects.equals(this.subBin, giftCardSnapshot.subBin) && + Objects.equals(this.last4, giftCardSnapshot.last4); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, bin, subBin, last4); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardSnapshot {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); + sb.append(" subBin: ").append(toIndentedString(subBin)).append("\n"); + sb.append(" last4: ").append(toIndentedString(last4)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardStoreRequest.java b/src/main/java/com/gr4vy/api/model/GiftCardStoreRequest.java new file mode 100644 index 0000000..4670f6f --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardStoreRequest.java @@ -0,0 +1,185 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * The gift card details to store. + */ +@ApiModel(description = "The gift card details to store.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardStoreRequest { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private String pin; + + public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; + @SerializedName(SERIALIZED_NAME_BUYER_ID) + private UUID buyerId; + + public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; + @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) + private String buyerExternalIdentifier; + + + public GiftCardStoreRequest number(String number) { + + this.number = number; + return this; + } + + /** + * The 16-19 digit number for this gift card. + * @return number + **/ + @ApiModelProperty(example = "4123455541234561234", required = true, value = "The 16-19 digit number for this gift card.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public GiftCardStoreRequest pin(String pin) { + + this.pin = pin; + return this; + } + + /** + * The PIN for this gift card. + * @return pin + **/ + @ApiModelProperty(example = "1234", required = true, value = "The PIN for this gift card.") + + public String getPin() { + return pin; + } + + + public void setPin(String pin) { + this.pin = pin; + } + + + public GiftCardStoreRequest buyerId(UUID buyerId) { + + this.buyerId = buyerId; + return this; + } + + /** + * The ID of the buyer to associate this gift card to. If this field is provided then the `buyer_external_identifier` field needs to be unset. + * @return buyerId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this gift card to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") + + public UUID getBuyerId() { + return buyerId; + } + + + public void setBuyerId(UUID buyerId) { + this.buyerId = buyerId; + } + + + public GiftCardStoreRequest buyerExternalIdentifier(String buyerExternalIdentifier) { + + this.buyerExternalIdentifier = buyerExternalIdentifier; + return this; + } + + /** + * The `external_identifier` of the buyer to associate this gift card to. If this field is provided then the `buyer_id` field needs to be unset. + * @return buyerExternalIdentifier + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this gift card to. If this field is provided then the `buyer_id` field needs to be unset.") + + public String getBuyerExternalIdentifier() { + return buyerExternalIdentifier; + } + + + public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { + this.buyerExternalIdentifier = buyerExternalIdentifier; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardStoreRequest giftCardStoreRequest = (GiftCardStoreRequest) o; + return Objects.equals(this.number, giftCardStoreRequest.number) && + Objects.equals(this.pin, giftCardStoreRequest.pin) && + Objects.equals(this.buyerId, giftCardStoreRequest.buyerId) && + Objects.equals(this.buyerExternalIdentifier, giftCardStoreRequest.buyerExternalIdentifier); + } + + @Override + public int hashCode() { + return Objects.hash(number, pin, buyerId, buyerExternalIdentifier); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardStoreRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); + sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardSummary.java b/src/main/java/com/gr4vy/api/model/GiftCardSummary.java new file mode 100644 index 0000000..ed4d1bb --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardSummary.java @@ -0,0 +1,534 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + + +/** + * A gift card stored for a buyer. + */ +@ApiModel(description = "A gift card stored for a buyer.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardSummary { + /** + * The type of this resource. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GIFT_CARD("gift-card"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; + + public static final String SERIALIZED_NAME_BIN = "bin"; + @SerializedName(SERIALIZED_NAME_BIN) + private String bin; + + public static final String SERIALIZED_NAME_SUB_BIN = "sub_bin"; + @SerializedName(SERIALIZED_NAME_SUB_BIN) + private String subBin; + + public static final String SERIALIZED_NAME_LAST4 = "last4"; + @SerializedName(SERIALIZED_NAME_LAST4) + private String last4; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private Integer balance; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + /** + * If the last balance update failed, this will contain the internal code for this error. + */ + @JsonAdapter(BalanceErrorCodeEnum.Adapter.class) + public enum BalanceErrorCodeEnum { + DEACTIVATED_CARD("deactivated_card"), + + EXPIRED_CARD("expired_card"), + + INCORRECT_CURRENCY("incorrect_currency"), + + INSUFFICIENT_FUNDS("insufficient_funds"), + + INVALID_AMOUNT("invalid_amount"), + + INVALID_GIFT_CARD("invalid_gift_card"), + + INVALID_SERVICE_CONFIGURATION("invalid_service_configuration"), + + INVALID_SERVICE_CREDENTIALS("invalid_service_credentials"), + + OPERATION_CANCELED("operation_canceled"), + + SERVICE_ERROR("service_error"), + + SERVICE_NETWORK_ERROR("service_network_error"), + + UNKNOWN_ERROR("unknown_error"); + + private String value; + + BalanceErrorCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BalanceErrorCodeEnum fromValue(String value) { + for (BalanceErrorCodeEnum b : BalanceErrorCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final BalanceErrorCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BalanceErrorCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BalanceErrorCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_BALANCE_ERROR_CODE = "balance_error_code"; + @SerializedName(SERIALIZED_NAME_BALANCE_ERROR_CODE) + private BalanceErrorCodeEnum balanceErrorCode; + + public static final String SERIALIZED_NAME_BALANCE_RAW_ERROR_CODE = "balance_raw_error_code"; + @SerializedName(SERIALIZED_NAME_BALANCE_RAW_ERROR_CODE) + private String balanceRawErrorCode; + + public static final String SERIALIZED_NAME_BALANCE_RAW_ERROR_MESSAGE = "balance_raw_error_message"; + @SerializedName(SERIALIZED_NAME_BALANCE_RAW_ERROR_MESSAGE) + private String balanceRawErrorMessage; + + + public GiftCardSummary type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card", value = "The type of this resource.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public GiftCardSummary id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of this gift card. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", value = "The ID of this gift card.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public GiftCardSummary merchantAccountId(String merchantAccountId) { + + this.merchantAccountId = merchantAccountId; + return this; + } + + /** + * The unique ID for a merchant account. + * @return merchantAccountId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + + public String getMerchantAccountId() { + return merchantAccountId; + } + + + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; + } + + + public GiftCardSummary bin(String bin) { + + this.bin = bin; + return this; + } + + /** + * The first 6 digits of the full gift card number. + * @return bin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "412345", value = "The first 6 digits of the full gift card number.") + + public String getBin() { + return bin; + } + + + public void setBin(String bin) { + this.bin = bin; + } + + + public GiftCardSummary subBin(String subBin) { + + this.subBin = subBin; + return this; + } + + /** + * The 3 digits after the `bin` of the full gift card number. + * @return subBin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "554", value = "The 3 digits after the `bin` of the full gift card number.") + + public String getSubBin() { + return subBin; + } + + + public void setSubBin(String subBin) { + this.subBin = subBin; + } + + + public GiftCardSummary last4(String last4) { + + this.last4 = last4; + return this; + } + + /** + * The last 4 digits for the gift card. + * @return last4 + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1234", value = "The last 4 digits for the gift card.") + + public String getLast4() { + return last4; + } + + + public void setLast4(String last4) { + this.last4 = last4; + } + + + public GiftCardSummary expirationDate(String expirationDate) { + + this.expirationDate = expirationDate; + return this; + } + + /** + * The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service. + * @return expirationDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service.") + + public String getExpirationDate() { + return expirationDate; + } + + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + + public GiftCardSummary balance(Integer balance) { + + this.balance = balance; + return this; + } + + /** + * The amount remaining on the balance for this gift card according to the gift card service. This may be `null` if the balance could not be fetched. + * minimum: 0 + * maximum: 99999999 + * @return balance + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1299", value = "The amount remaining on the balance for this gift card according to the gift card service. This may be `null` if the balance could not be fetched.") + + public Integer getBalance() { + return balance; + } + + + public void setBalance(Integer balance) { + this.balance = balance; + } + + + public GiftCardSummary currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The ISO-4217 currency code that this gift card has a balance for. + * @return currency + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "USD", value = "The ISO-4217 currency code that this gift card has a balance for.") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public GiftCardSummary balanceErrorCode(BalanceErrorCodeEnum balanceErrorCode) { + + this.balanceErrorCode = balanceErrorCode; + return this; + } + + /** + * If the last balance update failed, this will contain the internal code for this error. + * @return balanceErrorCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "incorrect_currency", value = "If the last balance update failed, this will contain the internal code for this error.") + + public BalanceErrorCodeEnum getBalanceErrorCode() { + return balanceErrorCode; + } + + + public void setBalanceErrorCode(BalanceErrorCodeEnum balanceErrorCode) { + this.balanceErrorCode = balanceErrorCode; + } + + + public GiftCardSummary balanceRawErrorCode(String balanceRawErrorCode) { + + this.balanceRawErrorCode = balanceRawErrorCode; + return this; + } + + /** + * If the last balance update failed, this will contain the the raw error code received from the gift card provider. + * @return balanceRawErrorCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10363", value = "If the last balance update failed, this will contain the the raw error code received from the gift card provider.") + + public String getBalanceRawErrorCode() { + return balanceRawErrorCode; + } + + + public void setBalanceRawErrorCode(String balanceRawErrorCode) { + this.balanceRawErrorCode = balanceRawErrorCode; + } + + + public GiftCardSummary balanceRawErrorMessage(String balanceRawErrorMessage) { + + this.balanceRawErrorMessage = balanceRawErrorMessage; + return this; + } + + /** + * If the last balance update failed, this will contain the the raw error message received from the gift card provider. + * @return balanceRawErrorMessage + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "This currency is not supported by the merchant.", value = "If the last balance update failed, this will contain the the raw error message received from the gift card provider.") + + public String getBalanceRawErrorMessage() { + return balanceRawErrorMessage; + } + + + public void setBalanceRawErrorMessage(String balanceRawErrorMessage) { + this.balanceRawErrorMessage = balanceRawErrorMessage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardSummary giftCardSummary = (GiftCardSummary) o; + return Objects.equals(this.type, giftCardSummary.type) && + Objects.equals(this.id, giftCardSummary.id) && + Objects.equals(this.merchantAccountId, giftCardSummary.merchantAccountId) && + Objects.equals(this.bin, giftCardSummary.bin) && + Objects.equals(this.subBin, giftCardSummary.subBin) && + Objects.equals(this.last4, giftCardSummary.last4) && + Objects.equals(this.expirationDate, giftCardSummary.expirationDate) && + Objects.equals(this.balance, giftCardSummary.balance) && + Objects.equals(this.currency, giftCardSummary.currency) && + Objects.equals(this.balanceErrorCode, giftCardSummary.balanceErrorCode) && + Objects.equals(this.balanceRawErrorCode, giftCardSummary.balanceRawErrorCode) && + Objects.equals(this.balanceRawErrorMessage, giftCardSummary.balanceRawErrorMessage); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, merchantAccountId, bin, subBin, last4, expirationDate, balance, currency, balanceErrorCode, balanceRawErrorCode, balanceRawErrorMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardSummary {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); + sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); + sb.append(" subBin: ").append(toIndentedString(subBin)).append("\n"); + sb.append(" last4: ").append(toIndentedString(last4)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" balanceErrorCode: ").append(toIndentedString(balanceErrorCode)).append("\n"); + sb.append(" balanceRawErrorCode: ").append(toIndentedString(balanceRawErrorCode)).append("\n"); + sb.append(" balanceRawErrorMessage: ").append(toIndentedString(balanceRawErrorMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCards.java b/src/main/java/com/gr4vy/api/model/GiftCards.java new file mode 100644 index 0000000..21034ae --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCards.java @@ -0,0 +1,199 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCard; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * A list of stored gift cards. + */ +@ApiModel(description = "A list of stored gift cards.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCards { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + @SerializedName(SERIALIZED_NAME_LIMIT) + private Integer limit = 20; + + public static final String SERIALIZED_NAME_NEXT_CURSOR = "next_cursor"; + @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) + private String nextCursor; + + public static final String SERIALIZED_NAME_PREVIOUS_CURSOR = "previous_cursor"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_CURSOR) + private String previousCursor; + + + public GiftCards items(List items) { + + this.items = items; + return this; + } + + public GiftCards addItemsItem(GiftCard itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of stored gift cards. + * @return items + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of stored gift cards.") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + public GiftCards limit(Integer limit) { + + this.limit = limit; + return this; + } + + /** + * The limit applied to request. This represents the number of items that are at maximum returned by this request. + * minimum: 1 + * maximum: 100 + * @return limit + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1", value = "The limit applied to request. This represents the number of items that are at maximum returned by this request.") + + public Integer getLimit() { + return limit; + } + + + public void setLimit(Integer limit) { + this.limit = limit; + } + + + public GiftCards nextCursor(String nextCursor) { + + this.nextCursor = nextCursor; + return this; + } + + /** + * The cursor that represents the next page of results. Use the `cursor` query parameter to fetch this page of items. + * @return nextCursor + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "ZXhhbXBsZTE", value = "The cursor that represents the next page of results. Use the `cursor` query parameter to fetch this page of items.") + + public String getNextCursor() { + return nextCursor; + } + + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + + public GiftCards previousCursor(String previousCursor) { + + this.previousCursor = previousCursor; + return this; + } + + /** + * The cursor that represents the next page of results. Use the `cursor` query parameter to fetch this page of items. + * @return previousCursor + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The cursor that represents the next page of results. Use the `cursor` query parameter to fetch this page of items.") + + public String getPreviousCursor() { + return previousCursor; + } + + + public void setPreviousCursor(String previousCursor) { + this.previousCursor = previousCursor; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCards giftCards = (GiftCards) o; + return Objects.equals(this.items, giftCards.items) && + Objects.equals(this.limit, giftCards.limit) && + Objects.equals(this.nextCursor, giftCards.nextCursor) && + Objects.equals(this.previousCursor, giftCards.previousCursor); + } + + @Override + public int hashCode() { + return Objects.hash(items, limit, nextCursor, previousCursor); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCards {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append(" previousCursor: ").append(toIndentedString(previousCursor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GiftCardsSummary.java b/src/main/java/com/gr4vy/api/model/GiftCardsSummary.java new file mode 100644 index 0000000..2c5ef90 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/GiftCardsSummary.java @@ -0,0 +1,110 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.gr4vy.api.model.GiftCardSummary; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * A list of gift cards in a short format including the latest balance. + */ +@ApiModel(description = "A list of gift cards in a short format including the latest balance.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GiftCardsSummary { + public static final String SERIALIZED_NAME_ITEMS = "items"; + @SerializedName(SERIALIZED_NAME_ITEMS) + private List items = null; + + + public GiftCardsSummary items(List items) { + + this.items = items; + return this; + } + + public GiftCardsSummary addItemsItem(GiftCardSummary itemsItem) { + if (this.items == null) { + this.items = new ArrayList(); + } + this.items.add(itemsItem); + return this; + } + + /** + * A list of stored gift cards. + * @return items + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of stored gift cards.") + + public List getItems() { + return items; + } + + + public void setItems(List items) { + this.items = items; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GiftCardsSummary giftCardsSummary = (GiftCardsSummary) o; + return Objects.equals(this.items, giftCardsSummary.items); + } + + @Override + public int hashCode() { + return Objects.hash(items); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GiftCardsSummary {\n"); + sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/GooglePayRequest.java b/src/main/java/com/gr4vy/api/model/GooglePayRequest.java index 2ba1e91..b3b425c 100644 --- a/src/main/java/com/gr4vy/api/model/GooglePayRequest.java +++ b/src/main/java/com/gr4vy/api/model/GooglePayRequest.java @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; /** * Details for a Google Pay payment method. @@ -97,14 +96,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REDIRECT_URL) private String redirectUrl; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public GooglePayRequest method(MethodEnum method) { @@ -219,52 +210,6 @@ public void setRedirectUrl(String redirectUrl) { } - public GooglePayRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public GooglePayRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -278,14 +223,12 @@ public boolean equals(Object o) { Objects.equals(this.token, googlePayRequest.token) && Objects.equals(this.assuranceDetails, googlePayRequest.assuranceDetails) && Objects.equals(this.cardHolderName, googlePayRequest.cardHolderName) && - Objects.equals(this.redirectUrl, googlePayRequest.redirectUrl) && - Objects.equals(this.buyerId, googlePayRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, googlePayRequest.buyerExternalIdentifier); + Objects.equals(this.redirectUrl, googlePayRequest.redirectUrl); } @Override public int hashCode() { - return Objects.hash(method, token, assuranceDetails, cardHolderName, redirectUrl, buyerId, buyerExternalIdentifier); + return Objects.hash(method, token, assuranceDetails, cardHolderName, redirectUrl); } @Override @@ -297,8 +240,6 @@ public String toString() { sb.append(" assuranceDetails: ").append(toIndentedString(assuranceDetails)).append("\n"); sb.append(" cardHolderName: ").append(toIndentedString(cardHolderName)).append("\n"); sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/MerchantAccount.java b/src/main/java/com/gr4vy/api/model/MerchantAccount.java index e6dacba..70074eb 100644 --- a/src/main/java/com/gr4vy/api/model/MerchantAccount.java +++ b/src/main/java/com/gr4vy/api/model/MerchantAccount.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** @@ -123,6 +125,105 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_MASTERCARD_NETWORK_TOKENS_APP_ID) private String mastercardNetworkTokensAppId; + public static final String SERIALIZED_NAME_LOON_CLIENT_KEY = "loon_client_key"; + @SerializedName(SERIALIZED_NAME_LOON_CLIENT_KEY) + private String loonClientKey; + + public static final String SERIALIZED_NAME_LOON_SECRET_KEY = "loon_secret_key"; + @SerializedName(SERIALIZED_NAME_LOON_SECRET_KEY) + private String loonSecretKey; + + /** + * Gets or Sets loonAcceptedSchemes + */ + @JsonAdapter(LoonAcceptedSchemesEnum.Adapter.class) + public enum LoonAcceptedSchemesEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + LoonAcceptedSchemesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoonAcceptedSchemesEnum fromValue(String value) { + for (LoonAcceptedSchemesEnum b : LoonAcceptedSchemesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoonAcceptedSchemesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoonAcceptedSchemesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoonAcceptedSchemesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES = "loon_accepted_schemes"; + @SerializedName(SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES) + private List loonAcceptedSchemes = null; + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; @SerializedName(SERIALIZED_NAME_CREATED_AT) private String createdAt; @@ -408,6 +509,83 @@ public void setMastercardNetworkTokensAppId(String mastercardNetworkTokensAppId) } + public MerchantAccount loonClientKey(String loonClientKey) { + + this.loonClientKey = loonClientKey; + return this; + } + + /** + * Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. + * @return loonClientKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "7DD771287D0024BA418F8F7ECC7DF1CD", value = "Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy.") + + public String getLoonClientKey() { + return loonClientKey; + } + + + public void setLoonClientKey(String loonClientKey) { + this.loonClientKey = loonClientKey; + } + + + public MerchantAccount loonSecretKey(String loonSecretKey) { + + this.loonSecretKey = loonSecretKey; + return this; + } + + /** + * Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. If the field is not `null`, the value is masked to avoid exposing sensitive information. + * @return loonSecretKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "********", value = "Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. If the field is not `null`, the value is masked to avoid exposing sensitive information.") + + public String getLoonSecretKey() { + return loonSecretKey; + } + + + public void setLoonSecretKey(String loonSecretKey) { + this.loonSecretKey = loonSecretKey; + } + + + public MerchantAccount loonAcceptedSchemes(List loonAcceptedSchemes) { + + this.loonAcceptedSchemes = loonAcceptedSchemes; + return this; + } + + public MerchantAccount addLoonAcceptedSchemesItem(LoonAcceptedSchemesEnum loonAcceptedSchemesItem) { + if (this.loonAcceptedSchemes == null) { + this.loonAcceptedSchemes = new ArrayList(); + } + this.loonAcceptedSchemes.add(loonAcceptedSchemesItem); + return this; + } + + /** + * Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy. + * @return loonAcceptedSchemes + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[\"mastercard\",\"visa\"]", value = "Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy.") + + public List getLoonAcceptedSchemes() { + return loonAcceptedSchemes; + } + + + public void setLoonAcceptedSchemes(List loonAcceptedSchemes) { + this.loonAcceptedSchemes = loonAcceptedSchemes; + } + + public MerchantAccount createdAt(String createdAt) { this.createdAt = createdAt; @@ -475,13 +653,16 @@ public boolean equals(Object o) { Objects.equals(this.amexNetworkTokensAppId, merchantAccount.amexNetworkTokensAppId) && Objects.equals(this.mastercardNetworkTokensRequestorId, merchantAccount.mastercardNetworkTokensRequestorId) && Objects.equals(this.mastercardNetworkTokensAppId, merchantAccount.mastercardNetworkTokensAppId) && + Objects.equals(this.loonClientKey, merchantAccount.loonClientKey) && + Objects.equals(this.loonSecretKey, merchantAccount.loonSecretKey) && + Objects.equals(this.loonAcceptedSchemes, merchantAccount.loonAcceptedSchemes) && Objects.equals(this.createdAt, merchantAccount.createdAt) && Objects.equals(this.updatedAt, merchantAccount.updatedAt); } @Override public int hashCode() { - return Objects.hash(type, id, displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId, createdAt, updatedAt); + return Objects.hash(type, id, displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId, loonClientKey, loonSecretKey, loonAcceptedSchemes, createdAt, updatedAt); } @Override @@ -500,6 +681,9 @@ public String toString() { sb.append(" amexNetworkTokensAppId: ").append(toIndentedString(amexNetworkTokensAppId)).append("\n"); sb.append(" mastercardNetworkTokensRequestorId: ").append(toIndentedString(mastercardNetworkTokensRequestorId)).append("\n"); sb.append(" mastercardNetworkTokensAppId: ").append(toIndentedString(mastercardNetworkTokensAppId)).append("\n"); + sb.append(" loonClientKey: ").append(toIndentedString(loonClientKey)).append("\n"); + sb.append(" loonSecretKey: ").append(toIndentedString(loonSecretKey)).append("\n"); + sb.append(" loonAcceptedSchemes: ").append(toIndentedString(loonAcceptedSchemes)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); diff --git a/src/main/java/com/gr4vy/api/model/MerchantAccountCreate.java b/src/main/java/com/gr4vy/api/model/MerchantAccountCreate.java index 25c18fd..5a149c3 100644 --- a/src/main/java/com/gr4vy/api/model/MerchantAccountCreate.java +++ b/src/main/java/com/gr4vy/api/model/MerchantAccountCreate.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * A request to create a merchant account. @@ -74,6 +76,105 @@ public class MerchantAccountCreate { @SerializedName(SERIALIZED_NAME_MASTERCARD_NETWORK_TOKENS_APP_ID) private String mastercardNetworkTokensAppId; + public static final String SERIALIZED_NAME_LOON_CLIENT_KEY = "loon_client_key"; + @SerializedName(SERIALIZED_NAME_LOON_CLIENT_KEY) + private String loonClientKey; + + public static final String SERIALIZED_NAME_LOON_SECRET_KEY = "loon_secret_key"; + @SerializedName(SERIALIZED_NAME_LOON_SECRET_KEY) + private String loonSecretKey; + + /** + * Gets or Sets loonAcceptedSchemes + */ + @JsonAdapter(LoonAcceptedSchemesEnum.Adapter.class) + public enum LoonAcceptedSchemesEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + LoonAcceptedSchemesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoonAcceptedSchemesEnum fromValue(String value) { + for (LoonAcceptedSchemesEnum b : LoonAcceptedSchemesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoonAcceptedSchemesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoonAcceptedSchemesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoonAcceptedSchemesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES = "loon_accepted_schemes"; + @SerializedName(SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES) + private List loonAcceptedSchemes = null; + public MerchantAccountCreate id(String id) { @@ -328,6 +429,83 @@ public void setMastercardNetworkTokensAppId(String mastercardNetworkTokensAppId) } + public MerchantAccountCreate loonClientKey(String loonClientKey) { + + this.loonClientKey = loonClientKey; + return this; + } + + /** + * Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonClientKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public String getLoonClientKey() { + return loonClientKey; + } + + + public void setLoonClientKey(String loonClientKey) { + this.loonClientKey = loonClientKey; + } + + + public MerchantAccountCreate loonSecretKey(String loonSecretKey) { + + this.loonSecretKey = loonSecretKey; + return this; + } + + /** + * Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonSecretKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public String getLoonSecretKey() { + return loonSecretKey; + } + + + public void setLoonSecretKey(String loonSecretKey) { + this.loonSecretKey = loonSecretKey; + } + + + public MerchantAccountCreate loonAcceptedSchemes(List loonAcceptedSchemes) { + + this.loonAcceptedSchemes = loonAcceptedSchemes; + return this; + } + + public MerchantAccountCreate addLoonAcceptedSchemesItem(LoonAcceptedSchemesEnum loonAcceptedSchemesItem) { + if (this.loonAcceptedSchemes == null) { + this.loonAcceptedSchemes = new ArrayList(); + } + this.loonAcceptedSchemes.add(loonAcceptedSchemesItem); + return this; + } + + /** + * Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonAcceptedSchemes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy. * If the field is not set or if it's set to `null`, the Account Updater service doesn't get configured. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public List getLoonAcceptedSchemes() { + return loonAcceptedSchemes; + } + + + public void setLoonAcceptedSchemes(List loonAcceptedSchemes) { + this.loonAcceptedSchemes = loonAcceptedSchemes; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -347,12 +525,15 @@ public boolean equals(Object o) { Objects.equals(this.amexNetworkTokensRequestorId, merchantAccountCreate.amexNetworkTokensRequestorId) && Objects.equals(this.amexNetworkTokensAppId, merchantAccountCreate.amexNetworkTokensAppId) && Objects.equals(this.mastercardNetworkTokensRequestorId, merchantAccountCreate.mastercardNetworkTokensRequestorId) && - Objects.equals(this.mastercardNetworkTokensAppId, merchantAccountCreate.mastercardNetworkTokensAppId); + Objects.equals(this.mastercardNetworkTokensAppId, merchantAccountCreate.mastercardNetworkTokensAppId) && + Objects.equals(this.loonClientKey, merchantAccountCreate.loonClientKey) && + Objects.equals(this.loonSecretKey, merchantAccountCreate.loonSecretKey) && + Objects.equals(this.loonAcceptedSchemes, merchantAccountCreate.loonAcceptedSchemes); } @Override public int hashCode() { - return Objects.hash(id, displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId); + return Objects.hash(id, displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId, loonClientKey, loonSecretKey, loonAcceptedSchemes); } @Override @@ -370,6 +551,9 @@ public String toString() { sb.append(" amexNetworkTokensAppId: ").append(toIndentedString(amexNetworkTokensAppId)).append("\n"); sb.append(" mastercardNetworkTokensRequestorId: ").append(toIndentedString(mastercardNetworkTokensRequestorId)).append("\n"); sb.append(" mastercardNetworkTokensAppId: ").append(toIndentedString(mastercardNetworkTokensAppId)).append("\n"); + sb.append(" loonClientKey: ").append(toIndentedString(loonClientKey)).append("\n"); + sb.append(" loonSecretKey: ").append(toIndentedString(loonSecretKey)).append("\n"); + sb.append(" loonAcceptedSchemes: ").append(toIndentedString(loonAcceptedSchemes)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/MerchantAccountUpdate.java b/src/main/java/com/gr4vy/api/model/MerchantAccountUpdate.java index 3e0de32..5800646 100644 --- a/src/main/java/com/gr4vy/api/model/MerchantAccountUpdate.java +++ b/src/main/java/com/gr4vy/api/model/MerchantAccountUpdate.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; /** * A request to update a merchant account. @@ -70,6 +72,105 @@ public class MerchantAccountUpdate { @SerializedName(SERIALIZED_NAME_MASTERCARD_NETWORK_TOKENS_APP_ID) private String mastercardNetworkTokensAppId; + public static final String SERIALIZED_NAME_LOON_CLIENT_KEY = "loon_client_key"; + @SerializedName(SERIALIZED_NAME_LOON_CLIENT_KEY) + private String loonClientKey; + + public static final String SERIALIZED_NAME_LOON_SECRET_KEY = "loon_secret_key"; + @SerializedName(SERIALIZED_NAME_LOON_SECRET_KEY) + private String loonSecretKey; + + /** + * Gets or Sets loonAcceptedSchemes + */ + @JsonAdapter(LoonAcceptedSchemesEnum.Adapter.class) + public enum LoonAcceptedSchemesEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + LoonAcceptedSchemesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LoonAcceptedSchemesEnum fromValue(String value) { + for (LoonAcceptedSchemesEnum b : LoonAcceptedSchemesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoonAcceptedSchemesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LoonAcceptedSchemesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoonAcceptedSchemesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES = "loon_accepted_schemes"; + @SerializedName(SERIALIZED_NAME_LOON_ACCEPTED_SCHEMES) + private List loonAcceptedSchemes = null; + public MerchantAccountUpdate displayName(String displayName) { @@ -301,6 +402,83 @@ public void setMastercardNetworkTokensAppId(String mastercardNetworkTokensAppId) } + public MerchantAccountUpdate loonClientKey(String loonClientKey) { + + this.loonClientKey = loonClientKey; + return this; + } + + /** + * Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonClientKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public String getLoonClientKey() { + return loonClientKey; + } + + + public void setLoonClientKey(String loonClientKey) { + this.loonClientKey = loonClientKey; + } + + + public MerchantAccountUpdate loonSecretKey(String loonSecretKey) { + + this.loonSecretKey = loonSecretKey; + return this; + } + + /** + * Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonSecretKey + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public String getLoonSecretKey() { + return loonSecretKey; + } + + + public void setLoonSecretKey(String loonSecretKey) { + this.loonSecretKey = loonSecretKey; + } + + + public MerchantAccountUpdate loonAcceptedSchemes(List loonAcceptedSchemes) { + + this.loonAcceptedSchemes = loonAcceptedSchemes; + return this; + } + + public MerchantAccountUpdate addLoonAcceptedSchemesItem(LoonAcceptedSchemesEnum loonAcceptedSchemesItem) { + if (this.loonAcceptedSchemes == null) { + this.loonAcceptedSchemes = new ArrayList(); + } + this.loonAcceptedSchemes.add(loonAcceptedSchemesItem); + return this; + } + + /** + * Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well. + * @return loonAcceptedSchemes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service used by Gr4vy. * If the field is not set, the Account Updater service configuration is not updated. * If the field is set to `null`, the Account Updater service is disabled. * If the field is set to `null`, the other `loon_*` fields must be set to `null` as well.") + + public List getLoonAcceptedSchemes() { + return loonAcceptedSchemes; + } + + + public void setLoonAcceptedSchemes(List loonAcceptedSchemes) { + this.loonAcceptedSchemes = loonAcceptedSchemes; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -319,12 +497,15 @@ public boolean equals(Object o) { Objects.equals(this.amexNetworkTokensRequestorId, merchantAccountUpdate.amexNetworkTokensRequestorId) && Objects.equals(this.amexNetworkTokensAppId, merchantAccountUpdate.amexNetworkTokensAppId) && Objects.equals(this.mastercardNetworkTokensRequestorId, merchantAccountUpdate.mastercardNetworkTokensRequestorId) && - Objects.equals(this.mastercardNetworkTokensAppId, merchantAccountUpdate.mastercardNetworkTokensAppId); + Objects.equals(this.mastercardNetworkTokensAppId, merchantAccountUpdate.mastercardNetworkTokensAppId) && + Objects.equals(this.loonClientKey, merchantAccountUpdate.loonClientKey) && + Objects.equals(this.loonSecretKey, merchantAccountUpdate.loonSecretKey) && + Objects.equals(this.loonAcceptedSchemes, merchantAccountUpdate.loonAcceptedSchemes); } @Override public int hashCode() { - return Objects.hash(displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId); + return Objects.hash(displayName, outboundWebhookUrl, outboundWebhookUsername, outboundWebhookPassword, visaNetworkTokensRequestorId, visaNetworkTokensAppId, amexNetworkTokensRequestorId, amexNetworkTokensAppId, mastercardNetworkTokensRequestorId, mastercardNetworkTokensAppId, loonClientKey, loonSecretKey, loonAcceptedSchemes); } @Override @@ -341,6 +522,9 @@ public String toString() { sb.append(" amexNetworkTokensAppId: ").append(toIndentedString(amexNetworkTokensAppId)).append("\n"); sb.append(" mastercardNetworkTokensRequestorId: ").append(toIndentedString(mastercardNetworkTokensRequestorId)).append("\n"); sb.append(" mastercardNetworkTokensAppId: ").append(toIndentedString(mastercardNetworkTokensAppId)).append("\n"); + sb.append(" loonClientKey: ").append(toIndentedString(loonClientKey)).append("\n"); + sb.append(" loonSecretKey: ").append(toIndentedString(loonSecretKey)).append("\n"); + sb.append(" loonAcceptedSchemes: ").append(toIndentedString(loonAcceptedSchemes)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationFailedEventContext.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationFailedEventContext.java index 3fcbf0e..e83ab9b 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationFailedEventContext.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationFailedEventContext.java @@ -162,13 +162,15 @@ public InstrumentTypeEnum read(final JsonReader jsonReader) throws IOException { private InstrumentTypeEnum instrumentType; /** - * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. + * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement. */ @JsonAdapter(RetryRuleEnum.Adapter.class) public enum RetryRuleEnum { FAILURE("failure"), - RETRIABLE_DECLINE("retriable_decline"); + RETRIABLE_DECLINE("retriable_decline"), + + PAYMENT_METHOD_REPLACEMENT("payment_method_replacement"); private String value; @@ -330,6 +332,97 @@ public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) private CvvResponseCodeEnum cvvResponseCode; + /** + * The card scheme sent to the connector. + */ + @JsonAdapter(PaymentMethodSchemeEnum.Adapter.class) + public enum PaymentMethodSchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + PaymentMethodSchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentMethodSchemeEnum fromValue(String value) { + for (PaymentMethodSchemeEnum b : PaymentMethodSchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentMethodSchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentMethodSchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentMethodSchemeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_SCHEME = "payment_method_scheme"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_SCHEME) + private PaymentMethodSchemeEnum paymentMethodScheme; + public PaymentConnectorResponseTransactionAuthorizationFailedEventContext paymentServiceId(UUID paymentServiceId) { @@ -499,11 +592,11 @@ public PaymentConnectorResponseTransactionAuthorizationFailedEventContext retryR } /** - * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. + * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement. * @return retryRule **/ @javax.annotation.Nullable - @ApiModelProperty(example = "failure", value = "Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried.") + @ApiModelProperty(example = "failure", value = "Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement.") public RetryRuleEnum getRetryRule() { return retryRule; @@ -607,6 +700,29 @@ public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { } + public PaymentConnectorResponseTransactionAuthorizationFailedEventContext paymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + + this.paymentMethodScheme = paymentMethodScheme; + return this; + } + + /** + * The card scheme sent to the connector. + * @return paymentMethodScheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "The card scheme sent to the connector.") + + public PaymentMethodSchemeEnum getPaymentMethodScheme() { + return paymentMethodScheme; + } + + + public void setPaymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + this.paymentMethodScheme = paymentMethodScheme; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -627,12 +743,13 @@ public boolean equals(Object o) { Objects.equals(this.rawResponseCode, paymentConnectorResponseTransactionAuthorizationFailedEventContext.rawResponseCode) && Objects.equals(this.rawResponseDescription, paymentConnectorResponseTransactionAuthorizationFailedEventContext.rawResponseDescription) && Objects.equals(this.avsResponseCode, paymentConnectorResponseTransactionAuthorizationFailedEventContext.avsResponseCode) && - Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionAuthorizationFailedEventContext.cvvResponseCode); + Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionAuthorizationFailedEventContext.cvvResponseCode) && + Objects.equals(this.paymentMethodScheme, paymentConnectorResponseTransactionAuthorizationFailedEventContext.paymentMethodScheme); } @Override public int hashCode() { - return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, code, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode); + return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, code, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode, paymentMethodScheme); } @Override @@ -651,6 +768,7 @@ public String toString() { sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" paymentMethodScheme: ").append(toIndentedString(paymentMethodScheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationSucceededEventContext.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationSucceededEventContext.java index 64b134e..cc60d9b 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationSucceededEventContext.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionAuthorizationSucceededEventContext.java @@ -279,6 +279,97 @@ public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) private CvvResponseCodeEnum cvvResponseCode; + /** + * The card scheme sent to the connector. + */ + @JsonAdapter(PaymentMethodSchemeEnum.Adapter.class) + public enum PaymentMethodSchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + PaymentMethodSchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentMethodSchemeEnum fromValue(String value) { + for (PaymentMethodSchemeEnum b : PaymentMethodSchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentMethodSchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentMethodSchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentMethodSchemeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_SCHEME = "payment_method_scheme"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_SCHEME) + private PaymentMethodSchemeEnum paymentMethodScheme; + public PaymentConnectorResponseTransactionAuthorizationSucceededEventContext paymentServiceId(UUID paymentServiceId) { @@ -533,6 +624,29 @@ public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { } + public PaymentConnectorResponseTransactionAuthorizationSucceededEventContext paymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + + this.paymentMethodScheme = paymentMethodScheme; + return this; + } + + /** + * The card scheme sent to the connector. + * @return paymentMethodScheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "The card scheme sent to the connector.") + + public PaymentMethodSchemeEnum getPaymentMethodScheme() { + return paymentMethodScheme; + } + + + public void setPaymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + this.paymentMethodScheme = paymentMethodScheme; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -552,12 +666,13 @@ public boolean equals(Object o) { Objects.equals(this.rawResponseCode, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.rawResponseCode) && Objects.equals(this.rawResponseDescription, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.rawResponseDescription) && Objects.equals(this.avsResponseCode, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.avsResponseCode) && - Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.cvvResponseCode); + Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.cvvResponseCode) && + Objects.equals(this.paymentMethodScheme, paymentConnectorResponseTransactionAuthorizationSucceededEventContext.paymentMethodScheme); } @Override public int hashCode() { - return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode); + return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode, paymentMethodScheme); } @Override @@ -575,6 +690,7 @@ public String toString() { sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" paymentMethodScheme: ").append(toIndentedString(paymentMethodScheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureDeclinedEventContext.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureDeclinedEventContext.java index 85ea7b9..e781404 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureDeclinedEventContext.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureDeclinedEventContext.java @@ -169,6 +169,97 @@ public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) private CvvResponseCodeEnum cvvResponseCode; + /** + * The card scheme sent to the connector. + */ + @JsonAdapter(PaymentMethodSchemeEnum.Adapter.class) + public enum PaymentMethodSchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + PaymentMethodSchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentMethodSchemeEnum fromValue(String value) { + for (PaymentMethodSchemeEnum b : PaymentMethodSchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentMethodSchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentMethodSchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentMethodSchemeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_SCHEME = "payment_method_scheme"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_SCHEME) + private PaymentMethodSchemeEnum paymentMethodScheme; + public PaymentConnectorResponseTransactionCaptureDeclinedEventContext paymentServiceId(UUID paymentServiceId) { @@ -377,6 +468,29 @@ public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { } + public PaymentConnectorResponseTransactionCaptureDeclinedEventContext paymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + + this.paymentMethodScheme = paymentMethodScheme; + return this; + } + + /** + * The card scheme sent to the connector. + * @return paymentMethodScheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "The card scheme sent to the connector.") + + public PaymentMethodSchemeEnum getPaymentMethodScheme() { + return paymentMethodScheme; + } + + + public void setPaymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + this.paymentMethodScheme = paymentMethodScheme; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -394,12 +508,13 @@ public boolean equals(Object o) { Objects.equals(this.rawResponseCode, paymentConnectorResponseTransactionCaptureDeclinedEventContext.rawResponseCode) && Objects.equals(this.rawResponseDescription, paymentConnectorResponseTransactionCaptureDeclinedEventContext.rawResponseDescription) && Objects.equals(this.avsResponseCode, paymentConnectorResponseTransactionCaptureDeclinedEventContext.avsResponseCode) && - Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionCaptureDeclinedEventContext.cvvResponseCode); + Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionCaptureDeclinedEventContext.cvvResponseCode) && + Objects.equals(this.paymentMethodScheme, paymentConnectorResponseTransactionCaptureDeclinedEventContext.paymentMethodScheme); } @Override public int hashCode() { - return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, code, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode); + return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, code, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode, paymentMethodScheme); } @Override @@ -415,6 +530,7 @@ public String toString() { sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" paymentMethodScheme: ").append(toIndentedString(paymentMethodScheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureSucceededEventContext.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureSucceededEventContext.java index d41901f..4192267 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureSucceededEventContext.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionCaptureSucceededEventContext.java @@ -279,6 +279,97 @@ public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) private CvvResponseCodeEnum cvvResponseCode; + /** + * The card scheme sent to the connector. + */ + @JsonAdapter(PaymentMethodSchemeEnum.Adapter.class) + public enum PaymentMethodSchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + PaymentMethodSchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentMethodSchemeEnum fromValue(String value) { + for (PaymentMethodSchemeEnum b : PaymentMethodSchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentMethodSchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentMethodSchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentMethodSchemeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_SCHEME = "payment_method_scheme"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_SCHEME) + private PaymentMethodSchemeEnum paymentMethodScheme; + public PaymentConnectorResponseTransactionCaptureSucceededEventContext paymentServiceId(UUID paymentServiceId) { @@ -533,6 +624,29 @@ public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { } + public PaymentConnectorResponseTransactionCaptureSucceededEventContext paymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + + this.paymentMethodScheme = paymentMethodScheme; + return this; + } + + /** + * The card scheme sent to the connector. + * @return paymentMethodScheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "The card scheme sent to the connector.") + + public PaymentMethodSchemeEnum getPaymentMethodScheme() { + return paymentMethodScheme; + } + + + public void setPaymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + this.paymentMethodScheme = paymentMethodScheme; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -552,12 +666,13 @@ public boolean equals(Object o) { Objects.equals(this.rawResponseCode, paymentConnectorResponseTransactionCaptureSucceededEventContext.rawResponseCode) && Objects.equals(this.rawResponseDescription, paymentConnectorResponseTransactionCaptureSucceededEventContext.rawResponseDescription) && Objects.equals(this.avsResponseCode, paymentConnectorResponseTransactionCaptureSucceededEventContext.avsResponseCode) && - Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionCaptureSucceededEventContext.cvvResponseCode); + Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionCaptureSucceededEventContext.cvvResponseCode) && + Objects.equals(this.paymentMethodScheme, paymentConnectorResponseTransactionCaptureSucceededEventContext.paymentMethodScheme); } @Override public int hashCode() { - return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode); + return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode, paymentMethodScheme); } @Override @@ -575,6 +690,7 @@ public String toString() { sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" paymentMethodScheme: ").append(toIndentedString(paymentMethodScheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEvent.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEvent.java index 66cd038..bc0788a 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEvent.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEvent.java @@ -28,9 +28,9 @@ /** - * This event logs the exact details parsed details for a transaction as reported by our connector when the capture is declined. + * This event logs the exact details parsed details for a declined transaction as reported by our connector. */ -@ApiModel(description = "This event logs the exact details parsed details for a transaction as reported by our connector when the capture is declined.") +@ApiModel(description = "This event logs the exact details parsed details for a declined transaction as reported by our connector.") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class PaymentConnectorResponseTransactionDeclinedEvent { /** diff --git a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEventContext.java b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEventContext.java index 841eb22..24fed2a 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEventContext.java +++ b/src/main/java/com/gr4vy/api/model/PaymentConnectorResponseTransactionDeclinedEventContext.java @@ -100,6 +100,120 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_CODE) private String code; + /** + * The type of instrument used for this transaction. + */ + @JsonAdapter(InstrumentTypeEnum.Adapter.class) + public enum InstrumentTypeEnum { + PAN("pan"), + + CARD_TOKEN("card_token"), + + REDIRECT("redirect"), + + REDIRECT_TOKEN("redirect_token"), + + GOOGLEPAY("googlepay"), + + APPLEPAY("applepay"), + + NETWORK_TOKEN("network_token"); + + private String value; + + InstrumentTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static InstrumentTypeEnum fromValue(String value) { + for (InstrumentTypeEnum b : InstrumentTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final InstrumentTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public InstrumentTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return InstrumentTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_INSTRUMENT_TYPE = "instrument_type"; + @SerializedName(SERIALIZED_NAME_INSTRUMENT_TYPE) + private InstrumentTypeEnum instrumentType; + + /** + * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement. + */ + @JsonAdapter(RetryRuleEnum.Adapter.class) + public enum RetryRuleEnum { + FAILURE("failure"), + + RETRIABLE_DECLINE("retriable_decline"), + + PAYMENT_METHOD_REPLACEMENT("payment_method_replacement"); + + private String value; + + RetryRuleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RetryRuleEnum fromValue(String value) { + for (RetryRuleEnum b : RetryRuleEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RetryRuleEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RetryRuleEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RetryRuleEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_RETRY_RULE = "retry_rule"; + @SerializedName(SERIALIZED_NAME_RETRY_RULE) + private RetryRuleEnum retryRule; + public static final String SERIALIZED_NAME_RAW_RESPONSE_CODE = "raw_response_code"; @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_CODE) private String rawResponseCode; @@ -218,6 +332,97 @@ public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) private CvvResponseCodeEnum cvvResponseCode; + /** + * The card scheme sent to the connector. + */ + @JsonAdapter(PaymentMethodSchemeEnum.Adapter.class) + public enum PaymentMethodSchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + PaymentMethodSchemeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentMethodSchemeEnum fromValue(String value) { + for (PaymentMethodSchemeEnum b : PaymentMethodSchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentMethodSchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentMethodSchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentMethodSchemeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_SCHEME = "payment_method_scheme"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_SCHEME) + private PaymentMethodSchemeEnum paymentMethodScheme; + public PaymentConnectorResponseTransactionDeclinedEventContext paymentServiceId(UUID paymentServiceId) { @@ -357,6 +562,52 @@ public void setCode(String code) { } + public PaymentConnectorResponseTransactionDeclinedEventContext instrumentType(InstrumentTypeEnum instrumentType) { + + this.instrumentType = instrumentType; + return this; + } + + /** + * The type of instrument used for this transaction. + * @return instrumentType + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "pan", value = "The type of instrument used for this transaction.") + + public InstrumentTypeEnum getInstrumentType() { + return instrumentType; + } + + + public void setInstrumentType(InstrumentTypeEnum instrumentType) { + this.instrumentType = instrumentType; + } + + + public PaymentConnectorResponseTransactionDeclinedEventContext retryRule(RetryRuleEnum retryRule) { + + this.retryRule = retryRule; + return this; + } + + /** + * Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement. + * @return retryRule + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "failure", value = "Defines why the transaction might be retried. A retry is not guaranteed because the maximum number of retries might already have been attempted. * `failure` - the transaction will be retried because of a failure calling the payment service. * `retriable_decline` - the transaction will be retried because a decline code was received that can be retried. * `payment_method_replacement` - the transaction will be retried because a decline code was received that triggered a payment method replacement.") + + public RetryRuleEnum getRetryRule() { + return retryRule; + } + + + public void setRetryRule(RetryRuleEnum retryRule) { + this.retryRule = retryRule; + } + + public PaymentConnectorResponseTransactionDeclinedEventContext rawResponseCode(String rawResponseCode) { this.rawResponseCode = rawResponseCode; @@ -449,6 +700,29 @@ public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { } + public PaymentConnectorResponseTransactionDeclinedEventContext paymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + + this.paymentMethodScheme = paymentMethodScheme; + return this; + } + + /** + * The card scheme sent to the connector. + * @return paymentMethodScheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "The card scheme sent to the connector.") + + public PaymentMethodSchemeEnum getPaymentMethodScheme() { + return paymentMethodScheme; + } + + + public void setPaymentMethodScheme(PaymentMethodSchemeEnum paymentMethodScheme) { + this.paymentMethodScheme = paymentMethodScheme; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -464,15 +738,18 @@ public boolean equals(Object o) { Objects.equals(this.paymentServiceTransactionId, paymentConnectorResponseTransactionDeclinedEventContext.paymentServiceTransactionId) && Objects.equals(this.status, paymentConnectorResponseTransactionDeclinedEventContext.status) && Objects.equals(this.code, paymentConnectorResponseTransactionDeclinedEventContext.code) && + Objects.equals(this.instrumentType, paymentConnectorResponseTransactionDeclinedEventContext.instrumentType) && + Objects.equals(this.retryRule, paymentConnectorResponseTransactionDeclinedEventContext.retryRule) && Objects.equals(this.rawResponseCode, paymentConnectorResponseTransactionDeclinedEventContext.rawResponseCode) && Objects.equals(this.rawResponseDescription, paymentConnectorResponseTransactionDeclinedEventContext.rawResponseDescription) && Objects.equals(this.avsResponseCode, paymentConnectorResponseTransactionDeclinedEventContext.avsResponseCode) && - Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionDeclinedEventContext.cvvResponseCode); + Objects.equals(this.cvvResponseCode, paymentConnectorResponseTransactionDeclinedEventContext.cvvResponseCode) && + Objects.equals(this.paymentMethodScheme, paymentConnectorResponseTransactionDeclinedEventContext.paymentMethodScheme); } @Override public int hashCode() { - return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, code, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode); + return Objects.hash(paymentServiceId, paymentServiceDisplayName, paymentServiceDefinitionId, paymentServiceTransactionId, status, code, instrumentType, retryRule, rawResponseCode, rawResponseDescription, avsResponseCode, cvvResponseCode, paymentMethodScheme); } @Override @@ -485,10 +762,13 @@ public String toString() { sb.append(" paymentServiceTransactionId: ").append(toIndentedString(paymentServiceTransactionId)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" instrumentType: ").append(toIndentedString(instrumentType)).append("\n"); + sb.append(" retryRule: ").append(toIndentedString(retryRule)).append("\n"); sb.append(" rawResponseCode: ").append(toIndentedString(rawResponseCode)).append("\n"); sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" paymentMethodScheme: ").append(toIndentedString(paymentMethodScheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentMethod.java b/src/main/java/com/gr4vy/api/model/PaymentMethod.java index 054b008..9d1267b 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentMethod.java +++ b/src/main/java/com/gr4vy/api/model/PaymentMethod.java @@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; @@ -87,26 +89,58 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; - public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; - @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) - private String merchantAccountId; - /** - * The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use. + * Gets or Sets additionalSchemes */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PROCESSING("processing"), + @JsonAdapter(AdditionalSchemesEnum.Adapter.class) + public enum AdditionalSchemesEnum { + ACCEL("accel"), - BUYER_APPROVAL_REQUIRED("buyer_approval_required"), + AMEX("amex"), - SUCCEEDED("succeeded"), + BANCONTACT("bancontact"), - FAILED("failed"); + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); private String value; - StatusEnum(String value) { + AdditionalSchemesEnum(String value) { this.value = value; } @@ -119,8 +153,8 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { + public static AdditionalSchemesEnum fromValue(String value) { + for (AdditionalSchemesEnum b : AdditionalSchemesEnum.values()) { if (b.value.equals(value)) { return b; } @@ -128,23 +162,122 @@ public static StatusEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final AdditionalSchemesEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { + public AdditionalSchemesEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); + return AdditionalSchemesEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_ADDITIONAL_SCHEMES = "additional_schemes"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_SCHEMES) + private List additionalSchemes = null; + + /** + * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + */ + @JsonAdapter(ApprovalTargetEnum.Adapter.class) + public enum ApprovalTargetEnum { + ANY("any"), + + NEW_WINDOW("new_window"); + + private String value; + + ApprovalTargetEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ApprovalTargetEnum fromValue(String value) { + for (ApprovalTargetEnum b : ApprovalTargetEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ApprovalTargetEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ApprovalTargetEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ApprovalTargetEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_APPROVAL_TARGET = "approval_target"; + @SerializedName(SERIALIZED_NAME_APPROVAL_TARGET) + private ApprovalTargetEnum approvalTarget; + + public static final String SERIALIZED_NAME_APPROVAL_URL = "approval_url"; + @SerializedName(SERIALIZED_NAME_APPROVAL_URL) + private String approvalUrl; + + public static final String SERIALIZED_NAME_BUYER = "buyer"; + @SerializedName(SERIALIZED_NAME_BUYER) + private Buyer buyer; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private PaymentMethodDetailsCard details; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; + + public static final String SERIALIZED_NAME_HAS_REPLACEMENT = "has_replacement"; + @SerializedName(SERIALIZED_NAME_HAS_REPLACEMENT) + private Boolean hasReplacement; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_LAST_REPLACED_AT = "last_replaced_at"; + @SerializedName(SERIALIZED_NAME_LAST_REPLACED_AT) + private String lastReplacedAt; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; /** * The type of this payment method. @@ -370,46 +503,113 @@ public ModeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_MODE) private ModeEnum mode; - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; + /** + * The scheme of the card. Only applies to card payments. + */ + @JsonAdapter(SchemeEnum.Adapter.class) + public enum SchemeEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; + private String value; - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; + SchemeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_BUYER = "buyer"; - @SerializedName(SERIALIZED_NAME_BUYER) - private Buyer buyer; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private String label; + @Override + public String toString() { + return String.valueOf(value); + } + + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SchemeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SchemeEnum.fromValue(value); + } + } + } public static final String SERIALIZED_NAME_SCHEME = "scheme"; @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; - - public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; - @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) - private String expirationDate; + private SchemeEnum scheme; /** - * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + * The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use. */ - @JsonAdapter(ApprovalTargetEnum.Adapter.class) - public enum ApprovalTargetEnum { - ANY("any"), + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PROCESSING("processing"), - NEW_WINDOW("new_window"); + BUYER_APPROVAL_REQUIRED("buyer_approval_required"), + + SUCCEEDED("succeeded"), + + FAILED("failed"); private String value; - ApprovalTargetEnum(String value) { + StatusEnum(String value) { this.value = value; } @@ -422,56 +622,36 @@ public String toString() { return String.valueOf(value); } - public static ApprovalTargetEnum fromValue(String value) { - for (ApprovalTargetEnum b : ApprovalTargetEnum.values()) { + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final ApprovalTargetEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public ApprovalTargetEnum read(final JsonReader jsonReader) throws IOException { + public StatusEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return ApprovalTargetEnum.fromValue(value); + return StatusEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_APPROVAL_TARGET = "approval_target"; - @SerializedName(SERIALIZED_NAME_APPROVAL_TARGET) - private ApprovalTargetEnum approvalTarget; + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - public static final String SERIALIZED_NAME_APPROVAL_URL = "approval_url"; - @SerializedName(SERIALIZED_NAME_APPROVAL_URL) - private String approvalUrl; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_COUNTRY = "country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private String country; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private PaymentMethodDetailsCard details; - - public static final String SERIALIZED_NAME_LAST_REPLACED_AT = "last_replaced_at"; - @SerializedName(SERIALIZED_NAME_LAST_REPLACED_AT) - private String lastReplacedAt; - - public static final String SERIALIZED_NAME_HAS_REPLACEMENT = "has_replacement"; - @SerializedName(SERIALIZED_NAME_HAS_REPLACEMENT) - private Boolean hasReplacement; + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; public PaymentMethod type(TypeEnum type) { @@ -520,95 +700,126 @@ public void setId(UUID id) { } - public PaymentMethod merchantAccountId(String merchantAccountId) { + public PaymentMethod additionalSchemes(List additionalSchemes) { - this.merchantAccountId = merchantAccountId; + this.additionalSchemes = additionalSchemes; + return this; + } + + public PaymentMethod addAdditionalSchemesItem(AdditionalSchemesEnum additionalSchemesItem) { + if (this.additionalSchemes == null) { + this.additionalSchemes = new ArrayList(); + } + this.additionalSchemes.add(additionalSchemesItem); return this; } /** - * The unique ID for a merchant account. - * @return merchantAccountId + * Additional schemes of the card. Only applies to card payment methods. + * @return additionalSchemes **/ @javax.annotation.Nullable - @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + @ApiModelProperty(value = "Additional schemes of the card. Only applies to card payment methods.") - public String getMerchantAccountId() { - return merchantAccountId; + public List getAdditionalSchemes() { + return additionalSchemes; } - public void setMerchantAccountId(String merchantAccountId) { - this.merchantAccountId = merchantAccountId; + public void setAdditionalSchemes(List additionalSchemes) { + this.additionalSchemes = additionalSchemes; } - public PaymentMethod status(StatusEnum status) { + public PaymentMethod approvalTarget(ApprovalTargetEnum approvalTarget) { - this.status = status; + this.approvalTarget = approvalTarget; return this; } /** - * The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use. - * @return status + * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + * @return approvalTarget **/ @javax.annotation.Nullable - @ApiModelProperty(example = "succeeded", value = "The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use.") + @ApiModelProperty(example = "any", value = "The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement.") - public StatusEnum getStatus() { - return status; + public ApprovalTargetEnum getApprovalTarget() { + return approvalTarget; } - public void setStatus(StatusEnum status) { - this.status = status; + public void setApprovalTarget(ApprovalTargetEnum approvalTarget) { + this.approvalTarget = approvalTarget; } - public PaymentMethod method(MethodEnum method) { + public PaymentMethod approvalUrl(String approvalUrl) { - this.method = method; + this.approvalUrl = approvalUrl; return this; } /** - * The type of this payment method. - * @return method + * The optional URL that the buyer needs to be redirected to to further authorize their payment. + * @return approvalUrl **/ @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "The type of this payment method.") + @ApiModelProperty(example = "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve", value = "The optional URL that the buyer needs to be redirected to to further authorize their payment.") - public MethodEnum getMethod() { - return method; + public String getApprovalUrl() { + return approvalUrl; } - public void setMethod(MethodEnum method) { - this.method = method; + public void setApprovalUrl(String approvalUrl) { + this.approvalUrl = approvalUrl; } - public PaymentMethod mode(ModeEnum mode) { + public PaymentMethod buyer(Buyer buyer) { - this.mode = mode; + this.buyer = buyer; return this; } /** - * The mode to use with this payment method. - * @return mode + * The optional buyer for which this payment method has been stored. + * @return buyer **/ @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "The mode to use with this payment method.") + @ApiModelProperty(value = "The optional buyer for which this payment method has been stored.") - public ModeEnum getMode() { - return mode; + public Buyer getBuyer() { + return buyer; } - public void setMode(ModeEnum mode) { - this.mode = mode; + public void setBuyer(Buyer buyer) { + this.buyer = buyer; + } + + + public PaymentMethod country(String country) { + + this.country = country; + return this; + } + + /** + * The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. + * @return country + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; } @@ -635,302 +846,302 @@ public void setCreatedAt(String createdAt) { } - public PaymentMethod updatedAt(String updatedAt) { + public PaymentMethod currency(String currency) { - this.updatedAt = updatedAt; + this.currency = currency; return this; } /** - * The date and time when this payment method was last updated in our system. - * @return updatedAt + * The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. + * @return currency **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this payment method was last updated in our system.") + @ApiModelProperty(example = "USD", value = "The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies.") - public String getUpdatedAt() { - return updatedAt; + public String getCurrency() { + return currency; } - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; + public void setCurrency(String currency) { + this.currency = currency; } - public PaymentMethod externalIdentifier(String externalIdentifier) { + public PaymentMethod details(PaymentMethodDetailsCard details) { - this.externalIdentifier = externalIdentifier; + this.details = details; return this; } /** - * An external identifier that can be used to match the payment method against your own records. - * @return externalIdentifier + * Get details + * @return details **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the payment method against your own records.") + @ApiModelProperty(value = "") - public String getExternalIdentifier() { - return externalIdentifier; + public PaymentMethodDetailsCard getDetails() { + return details; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setDetails(PaymentMethodDetailsCard details) { + this.details = details; } - public PaymentMethod buyer(Buyer buyer) { + public PaymentMethod expirationDate(String expirationDate) { - this.buyer = buyer; + this.expirationDate = expirationDate; return this; } /** - * The optional buyer for which this payment method has been stored. - * @return buyer + * The expiration date for the payment method. + * @return expirationDate **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The optional buyer for which this payment method has been stored.") + @ApiModelProperty(example = "07/24", value = "The expiration date for the payment method.") - public Buyer getBuyer() { - return buyer; + public String getExpirationDate() { + return expirationDate; } - public void setBuyer(Buyer buyer) { - this.buyer = buyer; + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; } - public PaymentMethod label(String label) { + public PaymentMethod externalIdentifier(String externalIdentifier) { - this.label = label; + this.externalIdentifier = externalIdentifier; return this; } /** - * A label for the card or the account. For a `paypal` payment method this is the user's email address. For a card it is the last 4 digits of the card. - * @return label + * An external identifier that can be used to match the payment method against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(example = "john@example.com", value = "A label for the card or the account. For a `paypal` payment method this is the user's email address. For a card it is the last 4 digits of the card.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the payment method against your own records.") - public String getLabel() { - return label; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setLabel(String label) { - this.label = label; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } - public PaymentMethod scheme(String scheme) { + public PaymentMethod hasReplacement(Boolean hasReplacement) { - this.scheme = scheme; + this.hasReplacement = hasReplacement; return this; } /** - * The scheme of the card. Only applies to card payments. - * @return scheme + * Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available, existing details are not changed immediately, but this field is set to `true`. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`. + * @return hasReplacement **/ @javax.annotation.Nullable - @ApiModelProperty(example = "visa", value = "The scheme of the card. Only applies to card payments.") + @ApiModelProperty(example = "false", value = "Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available, existing details are not changed immediately, but this field is set to `true`. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`.") - public String getScheme() { - return scheme; + public Boolean getHasReplacement() { + return hasReplacement; } - public void setScheme(String scheme) { - this.scheme = scheme; + public void setHasReplacement(Boolean hasReplacement) { + this.hasReplacement = hasReplacement; } - public PaymentMethod expirationDate(String expirationDate) { + public PaymentMethod label(String label) { - this.expirationDate = expirationDate; + this.label = label; return this; } /** - * The expiration date for the payment method. - * @return expirationDate + * A label for the card or the account. For a `paypal` payment method this is the user's email address. For a card it is the last 4 digits of the card. + * @return label **/ @javax.annotation.Nullable - @ApiModelProperty(example = "07/24", value = "The expiration date for the payment method.") + @ApiModelProperty(example = "john@example.com", value = "A label for the card or the account. For a `paypal` payment method this is the user's email address. For a card it is the last 4 digits of the card.") - public String getExpirationDate() { - return expirationDate; + public String getLabel() { + return label; } - public void setExpirationDate(String expirationDate) { - this.expirationDate = expirationDate; + public void setLabel(String label) { + this.label = label; } - public PaymentMethod approvalTarget(ApprovalTargetEnum approvalTarget) { + public PaymentMethod lastReplacedAt(String lastReplacedAt) { - this.approvalTarget = approvalTarget; + this.lastReplacedAt = lastReplacedAt; return this; } /** - * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. - * @return approvalTarget + * The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`. + * @return lastReplacedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "any", value = "The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement.") + @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`.") - public ApprovalTargetEnum getApprovalTarget() { - return approvalTarget; + public String getLastReplacedAt() { + return lastReplacedAt; } - public void setApprovalTarget(ApprovalTargetEnum approvalTarget) { - this.approvalTarget = approvalTarget; + public void setLastReplacedAt(String lastReplacedAt) { + this.lastReplacedAt = lastReplacedAt; } - public PaymentMethod approvalUrl(String approvalUrl) { + public PaymentMethod merchantAccountId(String merchantAccountId) { - this.approvalUrl = approvalUrl; + this.merchantAccountId = merchantAccountId; return this; } /** - * The optional URL that the buyer needs to be redirected to to further authorize their payment. - * @return approvalUrl + * The unique ID for a merchant account. + * @return merchantAccountId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve", value = "The optional URL that the buyer needs to be redirected to to further authorize their payment.") + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") - public String getApprovalUrl() { - return approvalUrl; + public String getMerchantAccountId() { + return merchantAccountId; } - public void setApprovalUrl(String approvalUrl) { - this.approvalUrl = approvalUrl; + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; } - public PaymentMethod currency(String currency) { + public PaymentMethod method(MethodEnum method) { - this.currency = currency; + this.method = method; return this; } /** - * The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. - * @return currency + * The type of this payment method. + * @return method **/ @javax.annotation.Nullable - @ApiModelProperty(example = "USD", value = "The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies.") + @ApiModelProperty(example = "card", value = "The type of this payment method.") - public String getCurrency() { - return currency; + public MethodEnum getMethod() { + return method; } - public void setCurrency(String currency) { - this.currency = currency; + public void setMethod(MethodEnum method) { + this.method = method; } - public PaymentMethod country(String country) { + public PaymentMethod mode(ModeEnum mode) { - this.country = country; + this.mode = mode; return this; } /** - * The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. - * @return country + * The mode to use with this payment method. + * @return mode **/ @javax.annotation.Nullable - @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries.") + @ApiModelProperty(example = "card", value = "The mode to use with this payment method.") - public String getCountry() { - return country; + public ModeEnum getMode() { + return mode; } - public void setCountry(String country) { - this.country = country; + public void setMode(ModeEnum mode) { + this.mode = mode; } - public PaymentMethod details(PaymentMethodDetailsCard details) { + public PaymentMethod scheme(SchemeEnum scheme) { - this.details = details; + this.scheme = scheme; return this; } /** - * Get details - * @return details + * The scheme of the card. Only applies to card payments. + * @return scheme **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "visa", value = "The scheme of the card. Only applies to card payments.") - public PaymentMethodDetailsCard getDetails() { - return details; + public SchemeEnum getScheme() { + return scheme; } - public void setDetails(PaymentMethodDetailsCard details) { - this.details = details; + public void setScheme(SchemeEnum scheme) { + this.scheme = scheme; } - public PaymentMethod lastReplacedAt(String lastReplacedAt) { + public PaymentMethod status(StatusEnum status) { - this.lastReplacedAt = lastReplacedAt; + this.status = status; return this; } /** - * The date and time when this card was last replaced. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`. - * @return lastReplacedAt + * The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use. + * @return status **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this card was last replaced. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`.") + @ApiModelProperty(example = "succeeded", value = "The state of the payment method. - `processing` - The payment method is stored but has not been used yet. - `buyer_approval_required` - Storing the payment method requires the buyer to provide approval. Follow the `approval_url` for next steps. - `succeeded` - The payment method is stored and has been used. - `failed` - The payment method could not be stored, or failed first use.") - public String getLastReplacedAt() { - return lastReplacedAt; + public StatusEnum getStatus() { + return status; } - public void setLastReplacedAt(String lastReplacedAt) { - this.lastReplacedAt = lastReplacedAt; + public void setStatus(StatusEnum status) { + this.status = status; } - public PaymentMethod hasReplacement(Boolean hasReplacement) { + public PaymentMethod updatedAt(String updatedAt) { - this.hasReplacement = hasReplacement; + this.updatedAt = updatedAt; return this; } /** - * Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately, but this field is set to `true`. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`. - * @return hasReplacement + * The date and time when this payment method was last updated in our system. + * @return updatedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately, but this field is set to `true`. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this payment method was last updated in our system.") - public Boolean getHasReplacement() { - return hasReplacement; + public String getUpdatedAt() { + return updatedAt; } - public void setHasReplacement(Boolean hasReplacement) { - this.hasReplacement = hasReplacement; + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; } @@ -945,29 +1156,30 @@ public boolean equals(Object o) { PaymentMethod paymentMethod = (PaymentMethod) o; return Objects.equals(this.type, paymentMethod.type) && Objects.equals(this.id, paymentMethod.id) && - Objects.equals(this.merchantAccountId, paymentMethod.merchantAccountId) && - Objects.equals(this.status, paymentMethod.status) && - Objects.equals(this.method, paymentMethod.method) && - Objects.equals(this.mode, paymentMethod.mode) && - Objects.equals(this.createdAt, paymentMethod.createdAt) && - Objects.equals(this.updatedAt, paymentMethod.updatedAt) && - Objects.equals(this.externalIdentifier, paymentMethod.externalIdentifier) && - Objects.equals(this.buyer, paymentMethod.buyer) && - Objects.equals(this.label, paymentMethod.label) && - Objects.equals(this.scheme, paymentMethod.scheme) && - Objects.equals(this.expirationDate, paymentMethod.expirationDate) && + Objects.equals(this.additionalSchemes, paymentMethod.additionalSchemes) && Objects.equals(this.approvalTarget, paymentMethod.approvalTarget) && Objects.equals(this.approvalUrl, paymentMethod.approvalUrl) && - Objects.equals(this.currency, paymentMethod.currency) && + Objects.equals(this.buyer, paymentMethod.buyer) && Objects.equals(this.country, paymentMethod.country) && + Objects.equals(this.createdAt, paymentMethod.createdAt) && + Objects.equals(this.currency, paymentMethod.currency) && Objects.equals(this.details, paymentMethod.details) && + Objects.equals(this.expirationDate, paymentMethod.expirationDate) && + Objects.equals(this.externalIdentifier, paymentMethod.externalIdentifier) && + Objects.equals(this.hasReplacement, paymentMethod.hasReplacement) && + Objects.equals(this.label, paymentMethod.label) && Objects.equals(this.lastReplacedAt, paymentMethod.lastReplacedAt) && - Objects.equals(this.hasReplacement, paymentMethod.hasReplacement); + Objects.equals(this.merchantAccountId, paymentMethod.merchantAccountId) && + Objects.equals(this.method, paymentMethod.method) && + Objects.equals(this.mode, paymentMethod.mode) && + Objects.equals(this.scheme, paymentMethod.scheme) && + Objects.equals(this.status, paymentMethod.status) && + Objects.equals(this.updatedAt, paymentMethod.updatedAt); } @Override public int hashCode() { - return Objects.hash(type, id, merchantAccountId, status, method, mode, createdAt, updatedAt, externalIdentifier, buyer, label, scheme, expirationDate, approvalTarget, approvalUrl, currency, country, details, lastReplacedAt, hasReplacement); + return Objects.hash(type, id, additionalSchemes, approvalTarget, approvalUrl, buyer, country, createdAt, currency, details, expirationDate, externalIdentifier, hasReplacement, label, lastReplacedAt, merchantAccountId, method, mode, scheme, status, updatedAt); } @Override @@ -976,24 +1188,25 @@ public String toString() { sb.append("class PaymentMethod {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" additionalSchemes: ").append(toIndentedString(additionalSchemes)).append("\n"); sb.append(" approvalTarget: ").append(toIndentedString(approvalTarget)).append("\n"); sb.append(" approvalUrl: ").append(toIndentedString(approvalUrl)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" details: ").append(toIndentedString(details)).append("\n"); - sb.append(" lastReplacedAt: ").append(toIndentedString(lastReplacedAt)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); sb.append(" hasReplacement: ").append(toIndentedString(hasReplacement)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" lastReplacedAt: ").append(toIndentedString(lastReplacedAt)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentMethodSnapshot.java b/src/main/java/com/gr4vy/api/model/PaymentMethodSnapshot.java index dba5c45..d2830c8 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentMethodSnapshot.java +++ b/src/main/java/com/gr4vy/api/model/PaymentMethodSnapshot.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.UUID; + /** * Snapshot of a payment method, as used when embedded inside other resources. */ @@ -85,6 +86,89 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; + /** + * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + */ + @JsonAdapter(ApprovalTargetEnum.Adapter.class) + public enum ApprovalTargetEnum { + ANY("any"), + + NEW_WINDOW("new_window"); + + private String value; + + ApprovalTargetEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ApprovalTargetEnum fromValue(String value) { + for (ApprovalTargetEnum b : ApprovalTargetEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ApprovalTargetEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ApprovalTargetEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ApprovalTargetEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_APPROVAL_TARGET = "approval_target"; + @SerializedName(SERIALIZED_NAME_APPROVAL_TARGET) + private ApprovalTargetEnum approvalTarget; + + public static final String SERIALIZED_NAME_APPROVAL_URL = "approval_url"; + @SerializedName(SERIALIZED_NAME_APPROVAL_URL) + private String approvalUrl; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + private PaymentMethodDetailsCard details; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + private String expirationDate; + + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; + + public static final String SERIALIZED_NAME_LABEL = "label"; + @SerializedName(SERIALIZED_NAME_LABEL) + private String label; + + public static final String SERIALIZED_NAME_LAST_REPLACED_AT = "last_replaced_at"; + @SerializedName(SERIALIZED_NAME_LAST_REPLACED_AT) + private String lastReplacedAt; + /** * The type of this payment method. */ @@ -254,34 +338,62 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; - - public static final String SERIALIZED_NAME_LABEL = "label"; - @SerializedName(SERIALIZED_NAME_LABEL) - private String label; - - public static final String SERIALIZED_NAME_SCHEME = "scheme"; - @SerializedName(SERIALIZED_NAME_SCHEME) - private String scheme; - - public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; - @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) - private String expirationDate; + public static final String SERIALIZED_NAME_PAYMENT_ACCOUNT_REFERENCE = "payment_account_reference"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ACCOUNT_REFERENCE) + private String paymentAccountReference; /** - * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + * An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction. */ - @JsonAdapter(ApprovalTargetEnum.Adapter.class) - public enum ApprovalTargetEnum { - ANY("any"), + @JsonAdapter(SchemeEnum.Adapter.class) + public enum SchemeEnum { + ACCEL("accel"), - NEW_WINDOW("new_window"); + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); private String value; - ApprovalTargetEnum(String value) { + SchemeEnum(String value) { this.value = value; } @@ -294,8 +406,8 @@ public String toString() { return String.valueOf(value); } - public static ApprovalTargetEnum fromValue(String value) { - for (ApprovalTargetEnum b : ApprovalTargetEnum.values()) { + public static SchemeEnum fromValue(String value) { + for (SchemeEnum b : SchemeEnum.values()) { if (b.value.equals(value)) { return b; } @@ -303,39 +415,23 @@ public static ApprovalTargetEnum fromValue(String value) { return null; } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final ApprovalTargetEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final SchemeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public ApprovalTargetEnum read(final JsonReader jsonReader) throws IOException { + public SchemeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return ApprovalTargetEnum.fromValue(value); + return SchemeEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_APPROVAL_TARGET = "approval_target"; - @SerializedName(SERIALIZED_NAME_APPROVAL_TARGET) - private ApprovalTargetEnum approvalTarget; - - public static final String SERIALIZED_NAME_APPROVAL_URL = "approval_url"; - @SerializedName(SERIALIZED_NAME_APPROVAL_URL) - private String approvalUrl; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_COUNTRY = "country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private String country; - - public static final String SERIALIZED_NAME_DETAILS = "details"; - @SerializedName(SERIALIZED_NAME_DETAILS) - private PaymentMethodDetailsCard details; + public static final String SERIALIZED_NAME_SCHEME = "scheme"; + @SerializedName(SERIALIZED_NAME_SCHEME) + private SchemeEnum scheme; public PaymentMethodSnapshot type(TypeEnum type) { @@ -384,95 +480,118 @@ public void setId(UUID id) { } - public PaymentMethodSnapshot method(MethodEnum method) { + public PaymentMethodSnapshot approvalTarget(ApprovalTargetEnum approvalTarget) { - this.method = method; + this.approvalTarget = approvalTarget; return this; } /** - * The type of this payment method. - * @return method + * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. + * @return approvalTarget **/ @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "The type of this payment method.") + @ApiModelProperty(example = "any", value = "The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement.") - public MethodEnum getMethod() { - return method; + public ApprovalTargetEnum getApprovalTarget() { + return approvalTarget; } - public void setMethod(MethodEnum method) { - this.method = method; + public void setApprovalTarget(ApprovalTargetEnum approvalTarget) { + this.approvalTarget = approvalTarget; } - public PaymentMethodSnapshot externalIdentifier(String externalIdentifier) { + public PaymentMethodSnapshot approvalUrl(String approvalUrl) { - this.externalIdentifier = externalIdentifier; + this.approvalUrl = approvalUrl; return this; } /** - * An external identifier that can be used to match the payment method against your own records. - * @return externalIdentifier + * The optional URL that the buyer needs to be redirected to to further authorize their payment. + * @return approvalUrl **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the payment method against your own records.") + @ApiModelProperty(example = "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve", value = "The optional URL that the buyer needs to be redirected to to further authorize their payment.") - public String getExternalIdentifier() { - return externalIdentifier; + public String getApprovalUrl() { + return approvalUrl; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setApprovalUrl(String approvalUrl) { + this.approvalUrl = approvalUrl; } - public PaymentMethodSnapshot label(String label) { + public PaymentMethodSnapshot country(String country) { - this.label = label; + this.country = country; return this; } /** - * A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method. - * @return label + * The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. + * @return country **/ @javax.annotation.Nullable - @ApiModelProperty(example = "1111", value = "A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method.") + @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries.") - public String getLabel() { - return label; + public String getCountry() { + return country; } - public void setLabel(String label) { - this.label = label; + public void setCountry(String country) { + this.country = country; } - public PaymentMethodSnapshot scheme(String scheme) { + public PaymentMethodSnapshot currency(String currency) { - this.scheme = scheme; + this.currency = currency; return this; } /** - * An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction. - * @return scheme + * The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. + * @return currency **/ @javax.annotation.Nullable - @ApiModelProperty(example = "visa", value = "An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction.") + @ApiModelProperty(example = "USD", value = "The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies.") - public String getScheme() { - return scheme; + public String getCurrency() { + return currency; } - public void setScheme(String scheme) { - this.scheme = scheme; + public void setCurrency(String currency) { + this.currency = currency; + } + + + public PaymentMethodSnapshot details(PaymentMethodDetailsCard details) { + + this.details = details; + return this; + } + + /** + * Get details + * @return details + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public PaymentMethodDetailsCard getDetails() { + return details; + } + + + public void setDetails(PaymentMethodDetailsCard details) { + this.details = details; } @@ -499,118 +618,141 @@ public void setExpirationDate(String expirationDate) { } - public PaymentMethodSnapshot approvalTarget(ApprovalTargetEnum approvalTarget) { + public PaymentMethodSnapshot externalIdentifier(String externalIdentifier) { - this.approvalTarget = approvalTarget; + this.externalIdentifier = externalIdentifier; return this; } /** - * The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement. - * @return approvalTarget + * An external identifier that can be used to match the payment method against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(example = "any", value = "The browser target that an approval URL must be opened in. If `any` or `null`, then there is no specific requirement.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the payment method against your own records.") - public ApprovalTargetEnum getApprovalTarget() { - return approvalTarget; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setApprovalTarget(ApprovalTargetEnum approvalTarget) { - this.approvalTarget = approvalTarget; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } - public PaymentMethodSnapshot approvalUrl(String approvalUrl) { + public PaymentMethodSnapshot label(String label) { - this.approvalUrl = approvalUrl; + this.label = label; return this; } /** - * The optional URL that the buyer needs to be redirected to to further authorize their payment. - * @return approvalUrl + * A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method. + * @return label **/ @javax.annotation.Nullable - @ApiModelProperty(example = "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve", value = "The optional URL that the buyer needs to be redirected to to further authorize their payment.") + @ApiModelProperty(example = "1111", value = "A label for the payment method. This can be the last 4 digits for a card, or the email address for an alternative payment method.") - public String getApprovalUrl() { - return approvalUrl; + public String getLabel() { + return label; } - public void setApprovalUrl(String approvalUrl) { - this.approvalUrl = approvalUrl; + public void setLabel(String label) { + this.label = label; } - public PaymentMethodSnapshot currency(String currency) { + public PaymentMethodSnapshot lastReplacedAt(String lastReplacedAt) { - this.currency = currency; + this.lastReplacedAt = lastReplacedAt; return this; } /** - * The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies. - * @return currency + * The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`. + * @return lastReplacedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "USD", value = "The ISO-4217 currency code that this payment method can be used for. If this value is `null` the payment method may be used for multiple currencies.") + @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`.") - public String getCurrency() { - return currency; + public String getLastReplacedAt() { + return lastReplacedAt; } - public void setCurrency(String currency) { - this.currency = currency; + public void setLastReplacedAt(String lastReplacedAt) { + this.lastReplacedAt = lastReplacedAt; } - public PaymentMethodSnapshot country(String country) { + public PaymentMethodSnapshot method(MethodEnum method) { - this.country = country; + this.method = method; return this; } /** - * The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries. - * @return country + * The type of this payment method. + * @return method **/ @javax.annotation.Nullable - @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country this payment method can be used for. If this value is `null` the payment method may be used in multiple countries.") + @ApiModelProperty(example = "card", value = "The type of this payment method.") - public String getCountry() { - return country; + public MethodEnum getMethod() { + return method; } - public void setCountry(String country) { - this.country = country; + public void setMethod(MethodEnum method) { + this.method = method; } - public PaymentMethodSnapshot details(PaymentMethodDetailsCard details) { + public PaymentMethodSnapshot paymentAccountReference(String paymentAccountReference) { - this.details = details; + this.paymentAccountReference = paymentAccountReference; return this; } /** - * Get details - * @return details + * The payment account reference (PAR) returned by the card scheme. This is a unique reference to the underlying account that has been used to fund this payment method. This value will be unique if the same underlying account was used, regardless of the actual payment method used. For example, a network token or an Apple Pay device token will return the same PAR when possible. The uniqueness of this value will depend on the card scheme, please refer to their documentation for further details. The availability of the PAR in our API depends on the availability of its value in the API of the payment service used for the transaction. + * @return paymentAccountReference **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "V0010014629724763377327521982", value = "The payment account reference (PAR) returned by the card scheme. This is a unique reference to the underlying account that has been used to fund this payment method. This value will be unique if the same underlying account was used, regardless of the actual payment method used. For example, a network token or an Apple Pay device token will return the same PAR when possible. The uniqueness of this value will depend on the card scheme, please refer to their documentation for further details. The availability of the PAR in our API depends on the availability of its value in the API of the payment service used for the transaction.") - public PaymentMethodDetailsCard getDetails() { - return details; + public String getPaymentAccountReference() { + return paymentAccountReference; } - public void setDetails(PaymentMethodDetailsCard details) { - this.details = details; + public void setPaymentAccountReference(String paymentAccountReference) { + this.paymentAccountReference = paymentAccountReference; + } + + + public PaymentMethodSnapshot scheme(SchemeEnum scheme) { + + this.scheme = scheme; + return this; + } + + /** + * An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction. + * @return scheme + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "visa", value = "An additional label used to differentiate different sub-types of a payment method. Most notably this can include the type of card used in a transaction.") + + public SchemeEnum getScheme() { + return scheme; + } + + + public void setScheme(SchemeEnum scheme) { + this.scheme = scheme; } @@ -625,21 +767,23 @@ public boolean equals(Object o) { PaymentMethodSnapshot paymentMethodSnapshot = (PaymentMethodSnapshot) o; return Objects.equals(this.type, paymentMethodSnapshot.type) && Objects.equals(this.id, paymentMethodSnapshot.id) && - Objects.equals(this.method, paymentMethodSnapshot.method) && - Objects.equals(this.externalIdentifier, paymentMethodSnapshot.externalIdentifier) && - Objects.equals(this.label, paymentMethodSnapshot.label) && - Objects.equals(this.scheme, paymentMethodSnapshot.scheme) && - Objects.equals(this.expirationDate, paymentMethodSnapshot.expirationDate) && Objects.equals(this.approvalTarget, paymentMethodSnapshot.approvalTarget) && Objects.equals(this.approvalUrl, paymentMethodSnapshot.approvalUrl) && - Objects.equals(this.currency, paymentMethodSnapshot.currency) && Objects.equals(this.country, paymentMethodSnapshot.country) && - Objects.equals(this.details, paymentMethodSnapshot.details); + Objects.equals(this.currency, paymentMethodSnapshot.currency) && + Objects.equals(this.details, paymentMethodSnapshot.details) && + Objects.equals(this.expirationDate, paymentMethodSnapshot.expirationDate) && + Objects.equals(this.externalIdentifier, paymentMethodSnapshot.externalIdentifier) && + Objects.equals(this.label, paymentMethodSnapshot.label) && + Objects.equals(this.lastReplacedAt, paymentMethodSnapshot.lastReplacedAt) && + Objects.equals(this.method, paymentMethodSnapshot.method) && + Objects.equals(this.paymentAccountReference, paymentMethodSnapshot.paymentAccountReference) && + Objects.equals(this.scheme, paymentMethodSnapshot.scheme); } @Override public int hashCode() { - return Objects.hash(type, id, method, externalIdentifier, label, scheme, expirationDate, approvalTarget, approvalUrl, currency, country, details); + return Objects.hash(type, id, approvalTarget, approvalUrl, country, currency, details, expirationDate, externalIdentifier, label, lastReplacedAt, method, paymentAccountReference, scheme); } @Override @@ -648,16 +792,18 @@ public String toString() { sb.append("class PaymentMethodSnapshot {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" label: ").append(toIndentedString(label)).append("\n"); - sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); - sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" approvalTarget: ").append(toIndentedString(approvalTarget)).append("\n"); sb.append(" approvalUrl: ").append(toIndentedString(approvalUrl)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); + sb.append(" lastReplacedAt: ").append(toIndentedString(lastReplacedAt)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" paymentAccountReference: ").append(toIndentedString(paymentAccountReference)).append("\n"); + sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentMethodTokenized.java b/src/main/java/com/gr4vy/api/model/PaymentMethodTokenized.java index ebf926e..ba3a29a 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentMethodTokenized.java +++ b/src/main/java/com/gr4vy/api/model/PaymentMethodTokenized.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; @@ -267,8 +269,18 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(SchemeEnum.Adapter.class) public enum SchemeEnum { + ACCEL("accel"), + AMEX("amex"), + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + DANKORT("dankort"), DINERS_CLUB("diners-club"), @@ -279,16 +291,24 @@ public enum SchemeEnum { ELO("elo"), + HIPERCARD("hipercard"), + JCB("jcb"), MAESTRO("maestro"), MASTERCARD("mastercard"), + NYCE("nyce"), + OTHER("other"), + PULSE("pulse"), + RUPAY("rupay"), + STAR("star"), + UNIONPAY("unionpay"), VISA("visa"); @@ -335,6 +355,97 @@ public SchemeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_SCHEME) private SchemeEnum scheme; + /** + * Gets or Sets additionalSchemes + */ + @JsonAdapter(AdditionalSchemesEnum.Adapter.class) + public enum AdditionalSchemesEnum { + ACCEL("accel"), + + AMEX("amex"), + + BANCONTACT("bancontact"), + + CARTE_BANCAIRE("carte-bancaire"), + + CIRRUS("cirrus"), + + CULIANCE("culiance"), + + DANKORT("dankort"), + + DINERS_CLUB("diners-club"), + + DISCOVER("discover"), + + EFTPOS_AUSTRALIA("eftpos-australia"), + + ELO("elo"), + + HIPERCARD("hipercard"), + + JCB("jcb"), + + MAESTRO("maestro"), + + MASTERCARD("mastercard"), + + NYCE("nyce"), + + OTHER("other"), + + PULSE("pulse"), + + RUPAY("rupay"), + + STAR("star"), + + UNIONPAY("unionpay"), + + VISA("visa"); + + private String value; + + AdditionalSchemesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AdditionalSchemesEnum fromValue(String value) { + for (AdditionalSchemesEnum b : AdditionalSchemesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AdditionalSchemesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AdditionalSchemesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AdditionalSchemesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ADDITIONAL_SCHEMES = "additional_schemes"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_SCHEMES) + private List additionalSchemes = null; + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "expiration_date"; @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) private String expirationDate; @@ -549,6 +660,37 @@ public void setScheme(SchemeEnum scheme) { } + public PaymentMethodTokenized additionalSchemes(List additionalSchemes) { + + this.additionalSchemes = additionalSchemes; + return this; + } + + public PaymentMethodTokenized addAdditionalSchemesItem(AdditionalSchemesEnum additionalSchemesItem) { + if (this.additionalSchemes == null) { + this.additionalSchemes = new ArrayList(); + } + this.additionalSchemes.add(additionalSchemesItem); + return this; + } + + /** + * Additional schemes of the card. Only applies to card payment methods. + * @return additionalSchemes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional schemes of the card. Only applies to card payment methods.") + + public List getAdditionalSchemes() { + return additionalSchemes; + } + + + public void setAdditionalSchemes(List additionalSchemes) { + this.additionalSchemes = additionalSchemes; + } + + public PaymentMethodTokenized expirationDate(String expirationDate) { this.expirationDate = expirationDate; @@ -671,11 +813,11 @@ public PaymentMethodTokenized lastReplacedAt(String lastReplacedAt) { } /** - * The date and time when this card was last replaced. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`. + * The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`. * @return lastReplacedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this card was last replaced. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`.") + @ApiModelProperty(example = "2023-07-26T19:23Z", value = "The date and time when this card was last replaced. When the Account Updater determines that new card details are available, existing details are not changed immediately. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is updated. For non-card payment methods, the value of this field is always set to `null`.") public String getLastReplacedAt() { return lastReplacedAt; @@ -694,11 +836,11 @@ public PaymentMethodTokenized hasReplacement(Boolean hasReplacement) { } /** - * Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately, but this field is set to `true`. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`. + * Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available, existing details are not changed immediately, but this field is set to `true`. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`. * @return hasReplacement **/ @javax.annotation.Nullable - @ApiModelProperty(example = "false", value = "Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available (e.g. when it's about to expire), existing details are not changed immediately, but this field is set to `true`. The actual replacement occurs when a transaction using this payment method is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`.") + @ApiModelProperty(example = "false", value = "Whether this card has a pending replacement that hasn't been applied yet. When the Account Updater determines that new card details are available, existing details are not changed immediately, but this field is set to `true`. There are three scenarios in which the actual replacement occurs: 1. When this card has expired. 2. When only the expiration date changed. 3. When a transaction using this card is declined with any of the following codes: * `canceled_payment_method` * `expired_payment_method` * `unavailable_payment_method` * `unknown_payment_method` When the replacement is applied, this field is set to `false`. For non-card payment methods, the value of this field is always set to `false`.") public Boolean getHasReplacement() { return hasReplacement; @@ -725,6 +867,7 @@ public boolean equals(Object o) { Objects.equals(this.method, paymentMethodTokenized.method) && Objects.equals(this.label, paymentMethodTokenized.label) && Objects.equals(this.scheme, paymentMethodTokenized.scheme) && + Objects.equals(this.additionalSchemes, paymentMethodTokenized.additionalSchemes) && Objects.equals(this.expirationDate, paymentMethodTokenized.expirationDate) && Objects.equals(this.approvalTarget, paymentMethodTokenized.approvalTarget) && Objects.equals(this.approvalUrl, paymentMethodTokenized.approvalUrl) && @@ -736,7 +879,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(type, id, merchantAccountId, method, label, scheme, expirationDate, approvalTarget, approvalUrl, currency, country, lastReplacedAt, hasReplacement); + return Objects.hash(type, id, merchantAccountId, method, label, scheme, additionalSchemes, expirationDate, approvalTarget, approvalUrl, currency, country, lastReplacedAt, hasReplacement); } @Override @@ -749,6 +892,7 @@ public String toString() { sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" label: ").append(toIndentedString(label)).append("\n"); sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n"); + sb.append(" additionalSchemes: ").append(toIndentedString(additionalSchemes)).append("\n"); sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" approvalTarget: ").append(toIndentedString(approvalTarget)).append("\n"); sb.append(" approvalUrl: ").append(toIndentedString(approvalUrl)).append("\n"); diff --git a/src/main/java/com/gr4vy/api/model/PaymentService.java b/src/main/java/com/gr4vy/api/model/PaymentService.java index 8bf66db..ae6c060 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentService.java +++ b/src/main/java/com/gr4vy/api/model/PaymentService.java @@ -89,13 +89,37 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; + public static final String SERIALIZED_NAME_ACCEPTED_COUNTRIES = "accepted_countries"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_COUNTRIES) + private List acceptedCountries = null; + + public static final String SERIALIZED_NAME_ACCEPTED_CURRENCIES = "accepted_currencies"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_CURRENCIES) + private List acceptedCurrencies = null; + + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + private Boolean active = true; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + private List fields = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) private String merchantAccountId; - public static final String SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID = "payment_service_definition_id"; - @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID) - private String paymentServiceDefinitionId; + public static final String SERIALIZED_NAME_MERCHANT_PROFILE = "merchant_profile"; + @SerializedName(SERIALIZED_NAME_MERCHANT_PROFILE) + private MerchantProfile merchantProfile; /** * The payment method that this service handles. @@ -266,9 +290,21 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_NETWORK_TOKENS_ENABLED = "network_tokens_enabled"; + @SerializedName(SERIALIZED_NAME_NETWORK_TOKENS_ENABLED) + private Boolean networkTokensEnabled; + + public static final String SERIALIZED_NAME_OPEN_LOOP = "open_loop"; + @SerializedName(SERIALIZED_NAME_OPEN_LOOP) + private Boolean openLoop; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD_TOKENIZATION_ENABLED = "payment_method_tokenization_enabled"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_TOKENIZATION_ENABLED) + private Boolean paymentMethodTokenizationEnabled = false; + + public static final String SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID = "payment_service_definition_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID) + private String paymentServiceDefinitionId; /** * The current status of this service. This will start off as pending, move to created, and might eventually move to an error status if and when the credentials are no longer valid. @@ -323,42 +359,10 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_STATUS) private StatusEnum status; - public static final String SERIALIZED_NAME_ACCEPTED_CURRENCIES = "accepted_currencies"; - @SerializedName(SERIALIZED_NAME_ACCEPTED_CURRENCIES) - private List acceptedCurrencies = null; - - public static final String SERIALIZED_NAME_ACCEPTED_COUNTRIES = "accepted_countries"; - @SerializedName(SERIALIZED_NAME_ACCEPTED_COUNTRIES) - private List acceptedCountries = null; - - public static final String SERIALIZED_NAME_OPEN_LOOP = "open_loop"; - @SerializedName(SERIALIZED_NAME_OPEN_LOOP) - private Boolean openLoop; - - public static final String SERIALIZED_NAME_PAYMENT_METHOD_TOKENIZATION_ENABLED = "payment_method_tokenization_enabled"; - @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_TOKENIZATION_ENABLED) - private Boolean paymentMethodTokenizationEnabled = false; - - public static final String SERIALIZED_NAME_NETWORK_TOKENS_ENABLED = "network_tokens_enabled"; - @SerializedName(SERIALIZED_NAME_NETWORK_TOKENS_ENABLED) - private Boolean networkTokensEnabled; - public static final String SERIALIZED_NAME_THREE_D_SECURE_ENABLED = "three_d_secure_enabled"; @SerializedName(SERIALIZED_NAME_THREE_D_SECURE_ENABLED) private Boolean threeDSecureEnabled = false; - public static final String SERIALIZED_NAME_MERCHANT_PROFILE = "merchant_profile"; - @SerializedName(SERIALIZED_NAME_MERCHANT_PROFILE) - private MerchantProfile merchantProfile; - - public static final String SERIALIZED_NAME_ACTIVE = "active"; - @SerializedName(SERIALIZED_NAME_ACTIVE) - private Boolean active = true; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; @SerializedName(SERIALIZED_NAME_UPDATED_AT) private String updatedAt; @@ -367,10 +371,6 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_WEBHOOK_URL) private String webhookUrl; - public static final String SERIALIZED_NAME_FIELDS = "fields"; - @SerializedName(SERIALIZED_NAME_FIELDS) - private List fields = null; - public PaymentService type(TypeEnum type) { @@ -418,226 +418,234 @@ public void setId(UUID id) { } - public PaymentService merchantAccountId(String merchantAccountId) { + public PaymentService acceptedCountries(List acceptedCountries) { - this.merchantAccountId = merchantAccountId; + this.acceptedCountries = acceptedCountries; + return this; + } + + public PaymentService addAcceptedCountriesItem(String acceptedCountriesItem) { + if (this.acceptedCountries == null) { + this.acceptedCountries = new ArrayList(); + } + this.acceptedCountries.add(acceptedCountriesItem); return this; } /** - * The unique ID for a merchant account. - * @return merchantAccountId + * A list of countries for which this service is enabled, in ISO two-letter code format. + * @return acceptedCountries **/ @javax.annotation.Nullable - @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") + @ApiModelProperty(example = "[\"DE\"]", value = "A list of countries for which this service is enabled, in ISO two-letter code format.") - public String getMerchantAccountId() { - return merchantAccountId; + public List getAcceptedCountries() { + return acceptedCountries; } - public void setMerchantAccountId(String merchantAccountId) { - this.merchantAccountId = merchantAccountId; + public void setAcceptedCountries(List acceptedCountries) { + this.acceptedCountries = acceptedCountries; } - public PaymentService paymentServiceDefinitionId(String paymentServiceDefinitionId) { + public PaymentService acceptedCurrencies(List acceptedCurrencies) { - this.paymentServiceDefinitionId = paymentServiceDefinitionId; + this.acceptedCurrencies = acceptedCurrencies; + return this; + } + + public PaymentService addAcceptedCurrenciesItem(String acceptedCurrenciesItem) { + if (this.acceptedCurrencies == null) { + this.acceptedCurrencies = new ArrayList(); + } + this.acceptedCurrencies.add(acceptedCurrenciesItem); return this; } /** - * The ID of the payment service definition used to create this service. - * @return paymentServiceDefinitionId + * A list of currencies for which this service is enabled, in ISO 4217 three-letter code format. + * @return acceptedCurrencies **/ @javax.annotation.Nullable - @ApiModelProperty(example = "stripe-card", value = "The ID of the payment service definition used to create this service. ") + @ApiModelProperty(example = "[\"EUR\"]", value = "A list of currencies for which this service is enabled, in ISO 4217 three-letter code format.") - public String getPaymentServiceDefinitionId() { - return paymentServiceDefinitionId; + public List getAcceptedCurrencies() { + return acceptedCurrencies; } - public void setPaymentServiceDefinitionId(String paymentServiceDefinitionId) { - this.paymentServiceDefinitionId = paymentServiceDefinitionId; + public void setAcceptedCurrencies(List acceptedCurrencies) { + this.acceptedCurrencies = acceptedCurrencies; } - public PaymentService method(MethodEnum method) { + public PaymentService active(Boolean active) { - this.method = method; + this.active = active; return this; } /** - * The payment method that this service handles. - * @return method + * Defines if this service is currently active or not. + * @return active **/ @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "The payment method that this service handles.") + @ApiModelProperty(example = "true", value = "Defines if this service is currently active or not.") - public MethodEnum getMethod() { - return method; + public Boolean getActive() { + return active; } - public void setMethod(MethodEnum method) { - this.method = method; + public void setActive(Boolean active) { + this.active = active; } - public PaymentService displayName(String displayName) { + public PaymentService createdAt(String createdAt) { - this.displayName = displayName; + this.createdAt = createdAt; return this; } /** - * The custom name set for this service. - * @return displayName + * The date and time when this service was created. + * @return createdAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "Stripe (Main)", value = "The custom name set for this service.") + @ApiModelProperty(example = "2012-12-12T10:53:43Z", value = "The date and time when this service was created.") - public String getDisplayName() { - return displayName; + public String getCreatedAt() { + return createdAt; } - public void setDisplayName(String displayName) { - this.displayName = displayName; + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; } - public PaymentService status(StatusEnum status) { + public PaymentService displayName(String displayName) { - this.status = status; + this.displayName = displayName; return this; } /** - * The current status of this service. This will start off as pending, move to created, and might eventually move to an error status if and when the credentials are no longer valid. - * @return status + * The custom name set for this service. + * @return displayName **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The current status of this service. This will start off as pending, move to created, and might eventually move to an error status if and when the credentials are no longer valid. ") + @ApiModelProperty(example = "Stripe (Main)", value = "The custom name set for this service.") - public StatusEnum getStatus() { - return status; + public String getDisplayName() { + return displayName; } - public void setStatus(StatusEnum status) { - this.status = status; + public void setDisplayName(String displayName) { + this.displayName = displayName; } - public PaymentService acceptedCurrencies(List acceptedCurrencies) { + public PaymentService fields(List fields) { - this.acceptedCurrencies = acceptedCurrencies; + this.fields = fields; return this; } - public PaymentService addAcceptedCurrenciesItem(String acceptedCurrenciesItem) { - if (this.acceptedCurrencies == null) { - this.acceptedCurrencies = new ArrayList(); + public PaymentService addFieldsItem(GiftCardServiceFields fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList(); } - this.acceptedCurrencies.add(acceptedCurrenciesItem); + this.fields.add(fieldsItem); return this; } /** - * A list of currencies for which this service is enabled, in ISO 4217 three-letter code format. - * @return acceptedCurrencies + * A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. + * @return fields **/ @javax.annotation.Nullable - @ApiModelProperty(example = "[\"EUR\"]", value = "A list of currencies for which this service is enabled, in ISO 4217 three-letter code format.") + @ApiModelProperty(value = "A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned.") - public List getAcceptedCurrencies() { - return acceptedCurrencies; + public List getFields() { + return fields; } - public void setAcceptedCurrencies(List acceptedCurrencies) { - this.acceptedCurrencies = acceptedCurrencies; + public void setFields(List fields) { + this.fields = fields; } - public PaymentService acceptedCountries(List acceptedCountries) { + public PaymentService merchantAccountId(String merchantAccountId) { - this.acceptedCountries = acceptedCountries; - return this; - } - - public PaymentService addAcceptedCountriesItem(String acceptedCountriesItem) { - if (this.acceptedCountries == null) { - this.acceptedCountries = new ArrayList(); - } - this.acceptedCountries.add(acceptedCountriesItem); + this.merchantAccountId = merchantAccountId; return this; } /** - * A list of countries for which this service is enabled, in ISO two-letter code format. - * @return acceptedCountries + * The unique ID for a merchant account. + * @return merchantAccountId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "[\"DE\"]", value = "A list of countries for which this service is enabled, in ISO two-letter code format.") + @ApiModelProperty(example = "default", value = "The unique ID for a merchant account.") - public List getAcceptedCountries() { - return acceptedCountries; + public String getMerchantAccountId() { + return merchantAccountId; } - public void setAcceptedCountries(List acceptedCountries) { - this.acceptedCountries = acceptedCountries; + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; } - public PaymentService openLoop(Boolean openLoop) { + public PaymentService merchantProfile(MerchantProfile merchantProfile) { - this.openLoop = openLoop; + this.merchantProfile = merchantProfile; return this; } /** - * Defines if the service works as an open-loop service. This feature can only be enabled if the PSP is set up to accept previous scheme transaction IDs. - * @return openLoop + * An object containing a key for each supported card scheme (Amex, Discover, Mastercard and Visa), and for each key an object with the merchant profile for this service and the corresponding scheme. + * @return merchantProfile **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Defines if the service works as an open-loop service. This feature can only be enabled if the PSP is set up to accept previous scheme transaction IDs.") + @ApiModelProperty(value = "An object containing a key for each supported card scheme (Amex, Discover, Mastercard and Visa), and for each key an object with the merchant profile for this service and the corresponding scheme.") - public Boolean getOpenLoop() { - return openLoop; + public MerchantProfile getMerchantProfile() { + return merchantProfile; } - public void setOpenLoop(Boolean openLoop) { - this.openLoop = openLoop; + public void setMerchantProfile(MerchantProfile merchantProfile) { + this.merchantProfile = merchantProfile; } - public PaymentService paymentMethodTokenizationEnabled(Boolean paymentMethodTokenizationEnabled) { + public PaymentService method(MethodEnum method) { - this.paymentMethodTokenizationEnabled = paymentMethodTokenizationEnabled; + this.method = method; return this; } /** - * Defines if tokenization is enabled for the service. This feature can only be enabled if the payment service is NOT set as `open_loop` and the PSP is set up to tokenize. - * @return paymentMethodTokenizationEnabled + * The payment method that this service handles. + * @return method **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Defines if tokenization is enabled for the service. This feature can only be enabled if the payment service is NOT set as `open_loop` and the PSP is set up to tokenize.") + @ApiModelProperty(example = "card", value = "The payment method that this service handles.") - public Boolean getPaymentMethodTokenizationEnabled() { - return paymentMethodTokenizationEnabled; + public MethodEnum getMethod() { + return method; } - public void setPaymentMethodTokenizationEnabled(Boolean paymentMethodTokenizationEnabled) { - this.paymentMethodTokenizationEnabled = paymentMethodTokenizationEnabled; + public void setMethod(MethodEnum method) { + this.method = method; } @@ -664,95 +672,118 @@ public void setNetworkTokensEnabled(Boolean networkTokensEnabled) { } - public PaymentService threeDSecureEnabled(Boolean threeDSecureEnabled) { + public PaymentService openLoop(Boolean openLoop) { - this.threeDSecureEnabled = threeDSecureEnabled; + this.openLoop = openLoop; return this; } /** - * Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data. - * @return threeDSecureEnabled + * Defines if the service works as an open-loop service. This feature can only be enabled if the PSP is set up to accept previous scheme transaction IDs. + * @return openLoop **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data.") + @ApiModelProperty(example = "true", value = "Defines if the service works as an open-loop service. This feature can only be enabled if the PSP is set up to accept previous scheme transaction IDs.") - public Boolean getThreeDSecureEnabled() { - return threeDSecureEnabled; + public Boolean getOpenLoop() { + return openLoop; } - public void setThreeDSecureEnabled(Boolean threeDSecureEnabled) { - this.threeDSecureEnabled = threeDSecureEnabled; + public void setOpenLoop(Boolean openLoop) { + this.openLoop = openLoop; } - public PaymentService merchantProfile(MerchantProfile merchantProfile) { + public PaymentService paymentMethodTokenizationEnabled(Boolean paymentMethodTokenizationEnabled) { - this.merchantProfile = merchantProfile; + this.paymentMethodTokenizationEnabled = paymentMethodTokenizationEnabled; return this; } /** - * An object containing a key for each supported card scheme (Amex, Discover, Mastercard and Visa), and for each key an object with the merchant profile for this service and the corresponding scheme. - * @return merchantProfile + * Defines if tokenization is enabled for the service. This feature can only be enabled if the payment service is NOT set as `open_loop` and the PSP is set up to tokenize. + * @return paymentMethodTokenizationEnabled **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An object containing a key for each supported card scheme (Amex, Discover, Mastercard and Visa), and for each key an object with the merchant profile for this service and the corresponding scheme.") + @ApiModelProperty(example = "true", value = "Defines if tokenization is enabled for the service. This feature can only be enabled if the payment service is NOT set as `open_loop` and the PSP is set up to tokenize.") - public MerchantProfile getMerchantProfile() { - return merchantProfile; + public Boolean getPaymentMethodTokenizationEnabled() { + return paymentMethodTokenizationEnabled; } - public void setMerchantProfile(MerchantProfile merchantProfile) { - this.merchantProfile = merchantProfile; + public void setPaymentMethodTokenizationEnabled(Boolean paymentMethodTokenizationEnabled) { + this.paymentMethodTokenizationEnabled = paymentMethodTokenizationEnabled; } - public PaymentService active(Boolean active) { + public PaymentService paymentServiceDefinitionId(String paymentServiceDefinitionId) { - this.active = active; + this.paymentServiceDefinitionId = paymentServiceDefinitionId; return this; } /** - * Defines if this service is currently active or not. - * @return active + * The ID of the payment service definition used to create this service. + * @return paymentServiceDefinitionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Defines if this service is currently active or not.") + @ApiModelProperty(example = "stripe-card", value = "The ID of the payment service definition used to create this service. ") - public Boolean getActive() { - return active; + public String getPaymentServiceDefinitionId() { + return paymentServiceDefinitionId; } - public void setActive(Boolean active) { - this.active = active; + public void setPaymentServiceDefinitionId(String paymentServiceDefinitionId) { + this.paymentServiceDefinitionId = paymentServiceDefinitionId; } - public PaymentService createdAt(String createdAt) { + public PaymentService status(StatusEnum status) { - this.createdAt = createdAt; + this.status = status; return this; } /** - * The date and time when this service was created. - * @return createdAt + * The current status of this service. This will start off as pending, move to created, and might eventually move to an error status if and when the credentials are no longer valid. + * @return status **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2012-12-12T10:53:43Z", value = "The date and time when this service was created.") + @ApiModelProperty(value = "The current status of this service. This will start off as pending, move to created, and might eventually move to an error status if and when the credentials are no longer valid. ") - public String getCreatedAt() { - return createdAt; + public StatusEnum getStatus() { + return status; } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public PaymentService threeDSecureEnabled(Boolean threeDSecureEnabled) { + + this.threeDSecureEnabled = threeDSecureEnabled; + return this; + } + + /** + * Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data. + * @return threeDSecureEnabled + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Defines if 3-D Secure is enabled for the service (can only be enabled if the payment service definition supports the `three_d_secure_hosted` feature). This does not affect pass through 3-D Secure data.") + + public Boolean getThreeDSecureEnabled() { + return threeDSecureEnabled; + } + + + public void setThreeDSecureEnabled(Boolean threeDSecureEnabled) { + this.threeDSecureEnabled = threeDSecureEnabled; } @@ -802,37 +833,6 @@ public void setWebhookUrl(String webhookUrl) { } - public PaymentService fields(List fields) { - - this.fields = fields; - return this; - } - - public PaymentService addFieldsItem(GiftCardServiceFields fieldsItem) { - if (this.fields == null) { - this.fields = new ArrayList(); - } - this.fields.add(fieldsItem); - return this; - } - - /** - * A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned. - * @return fields - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A list of fields, each containing a key-value pair for each field configured for this payment service. Fields marked as `secret` (see Payment Service Definition) are not returned.") - - public List getFields() { - return fields; - } - - - public void setFields(List fields) { - this.fields = fields; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -844,28 +844,28 @@ public boolean equals(Object o) { PaymentService paymentService = (PaymentService) o; return Objects.equals(this.type, paymentService.type) && Objects.equals(this.id, paymentService.id) && + Objects.equals(this.acceptedCountries, paymentService.acceptedCountries) && + Objects.equals(this.acceptedCurrencies, paymentService.acceptedCurrencies) && + Objects.equals(this.active, paymentService.active) && + Objects.equals(this.createdAt, paymentService.createdAt) && + Objects.equals(this.displayName, paymentService.displayName) && + Objects.equals(this.fields, paymentService.fields) && Objects.equals(this.merchantAccountId, paymentService.merchantAccountId) && - Objects.equals(this.paymentServiceDefinitionId, paymentService.paymentServiceDefinitionId) && + Objects.equals(this.merchantProfile, paymentService.merchantProfile) && Objects.equals(this.method, paymentService.method) && - Objects.equals(this.displayName, paymentService.displayName) && - Objects.equals(this.status, paymentService.status) && - Objects.equals(this.acceptedCurrencies, paymentService.acceptedCurrencies) && - Objects.equals(this.acceptedCountries, paymentService.acceptedCountries) && + Objects.equals(this.networkTokensEnabled, paymentService.networkTokensEnabled) && Objects.equals(this.openLoop, paymentService.openLoop) && Objects.equals(this.paymentMethodTokenizationEnabled, paymentService.paymentMethodTokenizationEnabled) && - Objects.equals(this.networkTokensEnabled, paymentService.networkTokensEnabled) && + Objects.equals(this.paymentServiceDefinitionId, paymentService.paymentServiceDefinitionId) && + Objects.equals(this.status, paymentService.status) && Objects.equals(this.threeDSecureEnabled, paymentService.threeDSecureEnabled) && - Objects.equals(this.merchantProfile, paymentService.merchantProfile) && - Objects.equals(this.active, paymentService.active) && - Objects.equals(this.createdAt, paymentService.createdAt) && Objects.equals(this.updatedAt, paymentService.updatedAt) && - Objects.equals(this.webhookUrl, paymentService.webhookUrl) && - Objects.equals(this.fields, paymentService.fields); + Objects.equals(this.webhookUrl, paymentService.webhookUrl); } @Override public int hashCode() { - return Objects.hash(type, id, merchantAccountId, paymentServiceDefinitionId, method, displayName, status, acceptedCurrencies, acceptedCountries, openLoop, paymentMethodTokenizationEnabled, networkTokensEnabled, threeDSecureEnabled, merchantProfile, active, createdAt, updatedAt, webhookUrl, fields); + return Objects.hash(type, id, acceptedCountries, acceptedCurrencies, active, createdAt, displayName, fields, merchantAccountId, merchantProfile, method, networkTokensEnabled, openLoop, paymentMethodTokenizationEnabled, paymentServiceDefinitionId, status, threeDSecureEnabled, updatedAt, webhookUrl); } @Override @@ -874,23 +874,23 @@ public String toString() { sb.append("class PaymentService {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" acceptedCountries: ").append(toIndentedString(acceptedCountries)).append("\n"); + sb.append(" acceptedCurrencies: ").append(toIndentedString(acceptedCurrencies)).append("\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); - sb.append(" paymentServiceDefinitionId: ").append(toIndentedString(paymentServiceDefinitionId)).append("\n"); + sb.append(" merchantProfile: ").append(toIndentedString(merchantProfile)).append("\n"); sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" acceptedCurrencies: ").append(toIndentedString(acceptedCurrencies)).append("\n"); - sb.append(" acceptedCountries: ").append(toIndentedString(acceptedCountries)).append("\n"); + sb.append(" networkTokensEnabled: ").append(toIndentedString(networkTokensEnabled)).append("\n"); sb.append(" openLoop: ").append(toIndentedString(openLoop)).append("\n"); sb.append(" paymentMethodTokenizationEnabled: ").append(toIndentedString(paymentMethodTokenizationEnabled)).append("\n"); - sb.append(" networkTokensEnabled: ").append(toIndentedString(networkTokensEnabled)).append("\n"); + sb.append(" paymentServiceDefinitionId: ").append(toIndentedString(paymentServiceDefinitionId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" threeDSecureEnabled: ").append(toIndentedString(threeDSecureEnabled)).append("\n"); - sb.append(" merchantProfile: ").append(toIndentedString(merchantProfile)).append("\n"); - sb.append(" active: ").append(toIndentedString(active)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" webhookUrl: ").append(toIndentedString(webhookUrl)).append("\n"); - sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/PaymentServiceDefinitionSupportedFeatures.java b/src/main/java/com/gr4vy/api/model/PaymentServiceDefinitionSupportedFeatures.java index ea5329e..852bef0 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentServiceDefinitionSupportedFeatures.java +++ b/src/main/java/com/gr4vy/api/model/PaymentServiceDefinitionSupportedFeatures.java @@ -34,9 +34,9 @@ public class PaymentServiceDefinitionSupportedFeatures { @SerializedName(SERIALIZED_NAME_DELAYED_CAPTURE) private Boolean delayedCapture; - public static final String SERIALIZED_NAME_NETWORK_TOKENS = "network_tokens"; - @SerializedName(SERIALIZED_NAME_NETWORK_TOKENS) - private Boolean networkTokens; + public static final String SERIALIZED_NAME_DIGITAL_WALLETS = "digital_wallets"; + @SerializedName(SERIALIZED_NAME_DIGITAL_WALLETS) + private Boolean digitalWallets; public static final String SERIALIZED_NAME_NETWORK_TOKENS_DEFAULT = "network_tokens_default"; @SerializedName(SERIALIZED_NAME_NETWORK_TOKENS_DEFAULT) @@ -114,26 +114,26 @@ public void setDelayedCapture(Boolean delayedCapture) { } - public PaymentServiceDefinitionSupportedFeatures networkTokens(Boolean networkTokens) { + public PaymentServiceDefinitionSupportedFeatures digitalWallets(Boolean digitalWallets) { - this.networkTokens = networkTokens; + this.digitalWallets = digitalWallets; return this; } /** * Supports passing decrypted digital wallet (e.g. Apple Pay) tokens to the underlying processor. - * @return networkTokens + * @return digitalWallets **/ @javax.annotation.Nullable @ApiModelProperty(example = "false", value = "Supports passing decrypted digital wallet (e.g. Apple Pay) tokens to the underlying processor.") - public Boolean getNetworkTokens() { - return networkTokens; + public Boolean getDigitalWallets() { + return digitalWallets; } - public void setNetworkTokens(Boolean networkTokens) { - this.networkTokens = networkTokens; + public void setDigitalWallets(Boolean digitalWallets) { + this.digitalWallets = digitalWallets; } @@ -446,7 +446,7 @@ public boolean equals(Object o) { } PaymentServiceDefinitionSupportedFeatures paymentServiceDefinitionSupportedFeatures = (PaymentServiceDefinitionSupportedFeatures) o; return Objects.equals(this.delayedCapture, paymentServiceDefinitionSupportedFeatures.delayedCapture) && - Objects.equals(this.networkTokens, paymentServiceDefinitionSupportedFeatures.networkTokens) && + Objects.equals(this.digitalWallets, paymentServiceDefinitionSupportedFeatures.digitalWallets) && Objects.equals(this.networkTokensDefault, paymentServiceDefinitionSupportedFeatures.networkTokensDefault) && Objects.equals(this.networkTokensToggle, paymentServiceDefinitionSupportedFeatures.networkTokensToggle) && Objects.equals(this.openLoop, paymentServiceDefinitionSupportedFeatures.openLoop) && @@ -464,7 +464,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(delayedCapture, networkTokens, networkTokensDefault, networkTokensToggle, openLoop, openLoopToggle, partialRefunds, paymentMethodTokenization, paymentMethodTokenizationToggle, refunds, requiresWebhookSetup, threeDSecureHosted, threeDSecurePassThrough, verifyCredentials, _void); + return Objects.hash(delayedCapture, digitalWallets, networkTokensDefault, networkTokensToggle, openLoop, openLoopToggle, partialRefunds, paymentMethodTokenization, paymentMethodTokenizationToggle, refunds, requiresWebhookSetup, threeDSecureHosted, threeDSecurePassThrough, verifyCredentials, _void); } @Override @@ -472,7 +472,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentServiceDefinitionSupportedFeatures {\n"); sb.append(" delayedCapture: ").append(toIndentedString(delayedCapture)).append("\n"); - sb.append(" networkTokens: ").append(toIndentedString(networkTokens)).append("\n"); + sb.append(" digitalWallets: ").append(toIndentedString(digitalWallets)).append("\n"); sb.append(" networkTokensDefault: ").append(toIndentedString(networkTokensDefault)).append("\n"); sb.append(" networkTokensToggle: ").append(toIndentedString(networkTokensToggle)).append("\n"); sb.append(" openLoop: ").append(toIndentedString(openLoop)).append("\n"); diff --git a/src/main/java/com/gr4vy/api/model/PaymentServiceSnapshot.java b/src/main/java/com/gr4vy/api/model/PaymentServiceSnapshot.java index 8769a0a..4b5a89e 100644 --- a/src/main/java/com/gr4vy/api/model/PaymentServiceSnapshot.java +++ b/src/main/java/com/gr4vy/api/model/PaymentServiceSnapshot.java @@ -83,9 +83,9 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private String id; - public static final String SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID = "payment_service_definition_id"; - @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID) - private String paymentServiceDefinitionId; + public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; /** * The payment method that this services handles. @@ -256,9 +256,9 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; - public static final String SERIALIZED_NAME_DISPLAY_NAME = "display_name"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; + public static final String SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID = "payment_service_definition_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE_DEFINITION_ID) + private String paymentServiceDefinitionId; public PaymentServiceSnapshot type(TypeEnum type) { @@ -307,26 +307,26 @@ public void setId(String id) { } - public PaymentServiceSnapshot paymentServiceDefinitionId(String paymentServiceDefinitionId) { + public PaymentServiceSnapshot displayName(String displayName) { - this.paymentServiceDefinitionId = paymentServiceDefinitionId; + this.displayName = displayName; return this; } /** - * The ID of the payment service definition used to create this service. - * @return paymentServiceDefinitionId + * The custom name set for this service. + * @return displayName **/ @javax.annotation.Nullable - @ApiModelProperty(example = "stripe-card", value = "The ID of the payment service definition used to create this service. ") + @ApiModelProperty(example = "Stripe (Main)", value = "The custom name set for this service.") - public String getPaymentServiceDefinitionId() { - return paymentServiceDefinitionId; + public String getDisplayName() { + return displayName; } - public void setPaymentServiceDefinitionId(String paymentServiceDefinitionId) { - this.paymentServiceDefinitionId = paymentServiceDefinitionId; + public void setDisplayName(String displayName) { + this.displayName = displayName; } @@ -353,26 +353,26 @@ public void setMethod(MethodEnum method) { } - public PaymentServiceSnapshot displayName(String displayName) { + public PaymentServiceSnapshot paymentServiceDefinitionId(String paymentServiceDefinitionId) { - this.displayName = displayName; + this.paymentServiceDefinitionId = paymentServiceDefinitionId; return this; } /** - * The custom name set for this service. - * @return displayName + * The ID of the payment service definition used to create this service. + * @return paymentServiceDefinitionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "Stripe (Main)", value = "The custom name set for this service.") + @ApiModelProperty(example = "stripe-card", value = "The ID of the payment service definition used to create this service. ") - public String getDisplayName() { - return displayName; + public String getPaymentServiceDefinitionId() { + return paymentServiceDefinitionId; } - public void setDisplayName(String displayName) { - this.displayName = displayName; + public void setPaymentServiceDefinitionId(String paymentServiceDefinitionId) { + this.paymentServiceDefinitionId = paymentServiceDefinitionId; } @@ -387,14 +387,14 @@ public boolean equals(Object o) { PaymentServiceSnapshot paymentServiceSnapshot = (PaymentServiceSnapshot) o; return Objects.equals(this.type, paymentServiceSnapshot.type) && Objects.equals(this.id, paymentServiceSnapshot.id) && - Objects.equals(this.paymentServiceDefinitionId, paymentServiceSnapshot.paymentServiceDefinitionId) && + Objects.equals(this.displayName, paymentServiceSnapshot.displayName) && Objects.equals(this.method, paymentServiceSnapshot.method) && - Objects.equals(this.displayName, paymentServiceSnapshot.displayName); + Objects.equals(this.paymentServiceDefinitionId, paymentServiceSnapshot.paymentServiceDefinitionId); } @Override public int hashCode() { - return Objects.hash(type, id, paymentServiceDefinitionId, method, displayName); + return Objects.hash(type, id, displayName, method, paymentServiceDefinitionId); } @Override @@ -403,9 +403,9 @@ public String toString() { sb.append("class PaymentServiceSnapshot {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" paymentServiceDefinitionId: ").append(toIndentedString(paymentServiceDefinitionId)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" paymentServiceDefinitionId: ").append(toIndentedString(paymentServiceDefinitionId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/Refund.java b/src/main/java/com/gr4vy/api/model/Refund.java index e9a3191..adf6140 100644 --- a/src/main/java/com/gr4vy/api/model/Refund.java +++ b/src/main/java/com/gr4vy/api/model/Refund.java @@ -166,6 +166,61 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private String updatedAt; + /** + * The type of the instrument that was refunded. + */ + @JsonAdapter(TargetTypeEnum.Adapter.class) + public enum TargetTypeEnum { + PAYMENT_METHOD("payment-method"), + + GIFT_CARD_REDEMPTION("gift-card-redemption"); + + private String value; + + TargetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TargetTypeEnum fromValue(String value) { + for (TargetTypeEnum b : TargetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TargetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TargetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TargetTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TARGET_TYPE = "target_type"; + @SerializedName(SERIALIZED_NAME_TARGET_TYPE) + private TargetTypeEnum targetType; + + public static final String SERIALIZED_NAME_TARGET_ID = "target_id"; + @SerializedName(SERIALIZED_NAME_TARGET_ID) + private String targetId; + public Refund type(TypeEnum type) { @@ -376,6 +431,52 @@ public void setUpdatedAt(String updatedAt) { } + public Refund targetType(TargetTypeEnum targetType) { + + this.targetType = targetType; + return this; + } + + /** + * The type of the instrument that was refunded. + * @return targetType + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "payment-method", value = "The type of the instrument that was refunded.") + + public TargetTypeEnum getTargetType() { + return targetType; + } + + + public void setTargetType(TargetTypeEnum targetType) { + this.targetType = targetType; + } + + + public Refund targetId(String targetId) { + + this.targetId = targetId; + return this; + } + + /** + * The optional ID of the instrument that was refunded. This may be `null` if the instrument was not stored. + * @return targetId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "c23ea83f-1b1c-4584-a0e8-78ef8c041949", value = "The optional ID of the instrument that was refunded. This may be `null` if the instrument was not stored.") + + public String getTargetId() { + return targetId; + } + + + public void setTargetId(String targetId) { + this.targetId = targetId; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -393,12 +494,14 @@ public boolean equals(Object o) { Objects.equals(this.currency, refund.currency) && Objects.equals(this.amount, refund.amount) && Objects.equals(this.createdAt, refund.createdAt) && - Objects.equals(this.updatedAt, refund.updatedAt); + Objects.equals(this.updatedAt, refund.updatedAt) && + Objects.equals(this.targetType, refund.targetType) && + Objects.equals(this.targetId, refund.targetId); } @Override public int hashCode() { - return Objects.hash(type, id, transactionId, paymentServiceRefundId, status, currency, amount, createdAt, updatedAt); + return Objects.hash(type, id, transactionId, paymentServiceRefundId, status, currency, amount, createdAt, updatedAt, targetType, targetId); } @Override @@ -414,6 +517,8 @@ public String toString() { sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" targetType: ").append(toIndentedString(targetType)).append("\n"); + sb.append(" targetId: ").append(toIndentedString(targetId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/ReportSpec.java b/src/main/java/com/gr4vy/api/model/ReportSpec.java index b3d004e..c8c20fa 100644 --- a/src/main/java/com/gr4vy/api/model/ReportSpec.java +++ b/src/main/java/com/gr4vy/api/model/ReportSpec.java @@ -84,7 +84,7 @@ public ModelEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_PARAMS = "params"; @SerializedName(SERIALIZED_NAME_PARAMS) - private Map params = new HashMap(); + private Map params; public ReportSpec model(ModelEnum model) { @@ -124,7 +124,7 @@ public ReportSpec putParamsItem(String key, Object paramsItem) { * Parameters used to configure the report. Acceptable values for this property depend on the value specified for `model`. * @return params **/ - @ApiModelProperty(example = "{\"fields\":[\"id\",\"status\"],\"filters\":{\"status\":[\"authorization_failed\"]},\"sort\":[{\"field\":\"captured_at\",\"order\":\"desc\"}]}", required = true, value = "Parameters used to configure the report. Acceptable values for this property depend on the value specified for `model`.") + @ApiModelProperty(required = true, value = "Parameters used to configure the report. Acceptable values for this property depend on the value specified for `model`.") public Map getParams() { return params; diff --git a/src/main/java/com/gr4vy/api/model/Transaction.java b/src/main/java/com/gr4vy/api/model/Transaction.java index d9bb4fb..385a4ee 100644 --- a/src/main/java/com/gr4vy/api/model/Transaction.java +++ b/src/main/java/com/gr4vy/api/model/Transaction.java @@ -22,6 +22,8 @@ import com.google.gson.stream.JsonWriter; import com.gr4vy.api.model.BuyerSnapshot; import com.gr4vy.api.model.CartItem; +import com.gr4vy.api.model.GiftCardRedemption; +import com.gr4vy.api.model.GiftCardServiceSnapshot; import com.gr4vy.api.model.PaymentMethodSnapshot; import com.gr4vy.api.model.PaymentServiceSnapshot; import com.gr4vy.api.model.ShippingDetail; @@ -96,40 +98,127 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; - public static final String SERIALIZED_NAME_RECONCILIATION_ID = "reconciliation_id"; - @SerializedName(SERIALIZED_NAME_RECONCILIATION_ID) - private String reconciliationId; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; - public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; - @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) - private String merchantAccountId; + public static final String SERIALIZED_NAME_AUTH_RESPONSE_CODE = "auth_response_code"; + @SerializedName(SERIALIZED_NAME_AUTH_RESPONSE_CODE) + private String authResponseCode; + + public static final String SERIALIZED_NAME_AUTHORIZED_AMOUNT = "authorized_amount"; + @SerializedName(SERIALIZED_NAME_AUTHORIZED_AMOUNT) + private Integer authorizedAmount; + + public static final String SERIALIZED_NAME_AUTHORIZED_AT = "authorized_at"; + @SerializedName(SERIALIZED_NAME_AUTHORIZED_AT) + private String authorizedAt; /** - * The status of the transaction. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status. + * The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response. */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PROCESSING("processing"), - - BUYER_APPROVAL_PENDING("buyer_approval_pending"), + @JsonAdapter(AvsResponseCodeEnum.Adapter.class) + public enum AvsResponseCodeEnum { + NO_MATCH("no_match"), - AUTHORIZATION_SUCCEEDED("authorization_succeeded"), + MATCH("match"), - AUTHORIZATION_FAILED("authorization_failed"), + PARTIAL_MATCH_ADDRESS("partial_match_address"), - AUTHORIZATION_DECLINED("authorization_declined"), + PARTIAL_MATCH_POSTCODE("partial_match_postcode"), - CAPTURE_PENDING("capture_pending"), + UNAVAILABLE("unavailable"); + + private String value; + + AvsResponseCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AvsResponseCodeEnum fromValue(String value) { + for (AvsResponseCodeEnum b : AvsResponseCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AvsResponseCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AvsResponseCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AvsResponseCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AVS_RESPONSE_CODE = "avs_response_code"; + @SerializedName(SERIALIZED_NAME_AVS_RESPONSE_CODE) + private AvsResponseCodeEnum avsResponseCode; + + public static final String SERIALIZED_NAME_BUYER = "buyer"; + @SerializedName(SERIALIZED_NAME_BUYER) + private BuyerSnapshot buyer; + + public static final String SERIALIZED_NAME_CAPTURED_AMOUNT = "captured_amount"; + @SerializedName(SERIALIZED_NAME_CAPTURED_AMOUNT) + private Integer capturedAmount; + + public static final String SERIALIZED_NAME_CAPTURED_AT = "captured_at"; + @SerializedName(SERIALIZED_NAME_CAPTURED_AT) + private String capturedAt; + + public static final String SERIALIZED_NAME_CART_ITEMS = "cart_items"; + @SerializedName(SERIALIZED_NAME_CART_ITEMS) + private List cartItems = null; + + public static final String SERIALIZED_NAME_CHECKOUT_SESSION_ID = "checkout_session_id"; + @SerializedName(SERIALIZED_NAME_CHECKOUT_SESSION_ID) + private UUID checkoutSessionId; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + /** + * The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response. + */ + @JsonAdapter(CvvResponseCodeEnum.Adapter.class) + public enum CvvResponseCodeEnum { + NO_MATCH("no_match"), - CAPTURE_SUCCEEDED("capture_succeeded"), + MATCH("match"), - AUTHORIZATION_VOID_PENDING("authorization_void_pending"), + UNAVAILABLE("unavailable"), - AUTHORIZATION_VOIDED("authorization_voided"); + NOT_PROVIDED("not_provided"); private String value; - StatusEnum(String value) { + CvvResponseCodeEnum(String value) { this.value = value; } @@ -142,32 +231,48 @@ public String toString() { return String.valueOf(value); } - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { + public static CvvResponseCodeEnum fromValue(String value) { + for (CvvResponseCodeEnum b : CvvResponseCodeEnum.values()) { if (b.value.equals(value)) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final CvvResponseCodeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { + public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); + return CvvResponseCodeEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_CVV_RESPONSE_CODE = "cvv_response_code"; + @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) + private CvvResponseCodeEnum cvvResponseCode; + + public static final String SERIALIZED_NAME_ERROR_CODE = "error_code"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; + + public static final String SERIALIZED_NAME_GIFT_CARD_SERVICE = "gift_card_service"; + @SerializedName(SERIALIZED_NAME_GIFT_CARD_SERVICE) + private GiftCardServiceSnapshot giftCardService; + + public static final String SERIALIZED_NAME_GIFT_CARDS_REDEMPTIONS = "gift_cards_redemptions"; + @SerializedName(SERIALIZED_NAME_GIFT_CARDS_REDEMPTIONS) + private List giftCardsRedemptions = null; /** * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). @@ -220,76 +325,20 @@ public IntentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_INTENT) private IntentEnum intent; - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private Integer amount; - - public static final String SERIALIZED_NAME_CAPTURED_AMOUNT = "captured_amount"; - @SerializedName(SERIALIZED_NAME_CAPTURED_AMOUNT) - private Integer capturedAmount; - - public static final String SERIALIZED_NAME_REFUNDED_AMOUNT = "refunded_amount"; - @SerializedName(SERIALIZED_NAME_REFUNDED_AMOUNT) - private Integer refundedAmount; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_COUNTRY = "country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private String country; - - public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; - @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) - private PaymentMethodSnapshot paymentMethod; - - public static final String SERIALIZED_NAME_BUYER = "buyer"; - @SerializedName(SERIALIZED_NAME_BUYER) - private BuyerSnapshot buyer; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_PAYMENT_SERVICE = "payment_service"; - @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE) - private PaymentServiceSnapshot paymentService; - - public static final String SERIALIZED_NAME_PENDING_REVIEW = "pending_review"; - @SerializedName(SERIALIZED_NAME_PENDING_REVIEW) - private Boolean pendingReview; - - public static final String SERIALIZED_NAME_MERCHANT_INITIATED = "merchant_initiated"; - @SerializedName(SERIALIZED_NAME_MERCHANT_INITIATED) - private Boolean merchantInitiated = false; - /** - * Gets or Sets paymentSource + * The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. `capture` or `authorize`) has been achieved when dealing with multiple payment instruments. If all payment instruments (`payment_method` and/or `gift_cards`) have succeeded to get an authorization or direct sale **at any point in time** then this will return a `succeeded` value. If any of the payment instruments fails or declines then this will return a `failed` value. If any payment instruments is still in a `pending` or `processing` state then the result will be `pending`. Please note that if any of the payment instruments are voided or refunded after the result reaches a `succeeded` state then the result will remain unchanged. */ - @JsonAdapter(PaymentSourceEnum.Adapter.class) - public enum PaymentSourceEnum { - ECOMMERCE("ecommerce"), + @JsonAdapter(IntentOutcomeEnum.Adapter.class) + public enum IntentOutcomeEnum { + PENDING("pending"), - MOTO("moto"), - - RECURRING("recurring"), - - INSTALLMENT("installment"), + SUCCEEDED("succeeded"), - CARD_ON_FILE("card_on_file"); + FAILED("failed"); private String value; - PaymentSourceEnum(String value) { + IntentOutcomeEnum(String value) { this.value = value; } @@ -302,8 +351,8 @@ public String toString() { return String.valueOf(value); } - public static PaymentSourceEnum fromValue(String value) { - for (PaymentSourceEnum b : PaymentSourceEnum.values()) { + public static IntentOutcomeEnum fromValue(String value) { + for (IntentOutcomeEnum b : IntentOutcomeEnum.values()) { if (b.value.equals(value)) { return b; } @@ -311,167 +360,39 @@ public static PaymentSourceEnum fromValue(String value) { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - public static class Adapter extends TypeAdapter { + public static class Adapter extends TypeAdapter { @Override - public void write(final JsonWriter jsonWriter, final PaymentSourceEnum enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final IntentOutcomeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public PaymentSourceEnum read(final JsonReader jsonReader) throws IOException { + public IntentOutcomeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); - return PaymentSourceEnum.fromValue(value); + return IntentOutcomeEnum.fromValue(value); } } } - public static final String SERIALIZED_NAME_PAYMENT_SOURCE = "payment_source"; - @SerializedName(SERIALIZED_NAME_PAYMENT_SOURCE) - private PaymentSourceEnum paymentSource; + public static final String SERIALIZED_NAME_INTENT_OUTCOME = "intent_outcome"; + @SerializedName(SERIALIZED_NAME_INTENT_OUTCOME) + private IntentOutcomeEnum intentOutcome; public static final String SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT = "is_subsequent_payment"; @SerializedName(SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT) private Boolean isSubsequentPayment = false; - public static final String SERIALIZED_NAME_STATEMENT_DESCRIPTOR = "statement_descriptor"; - @SerializedName(SERIALIZED_NAME_STATEMENT_DESCRIPTOR) - private StatementDescriptor statementDescriptor; - - public static final String SERIALIZED_NAME_CART_ITEMS = "cart_items"; - @SerializedName(SERIALIZED_NAME_CART_ITEMS) - private List cartItems = null; - - public static final String SERIALIZED_NAME_SCHEME_TRANSACTION_ID = "scheme_transaction_id"; - @SerializedName(SERIALIZED_NAME_SCHEME_TRANSACTION_ID) - private String schemeTransactionId = "null"; - - public static final String SERIALIZED_NAME_RAW_RESPONSE_CODE = "raw_response_code"; - @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_CODE) - private String rawResponseCode; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; - public static final String SERIALIZED_NAME_RAW_RESPONSE_DESCRIPTION = "raw_response_description"; - @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_DESCRIPTION) - private String rawResponseDescription; + public static final String SERIALIZED_NAME_MERCHANT_INITIATED = "merchant_initiated"; + @SerializedName(SERIALIZED_NAME_MERCHANT_INITIATED) + private Boolean merchantInitiated = false; - public static final String SERIALIZED_NAME_ERROR_CODE = "error_code"; - @SerializedName(SERIALIZED_NAME_ERROR_CODE) - private String errorCode; - - public static final String SERIALIZED_NAME_AUTH_RESPONSE_CODE = "auth_response_code"; - @SerializedName(SERIALIZED_NAME_AUTH_RESPONSE_CODE) - private String authResponseCode; - - /** - * The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response. - */ - @JsonAdapter(AvsResponseCodeEnum.Adapter.class) - public enum AvsResponseCodeEnum { - NO_MATCH("no_match"), - - MATCH("match"), - - PARTIAL_MATCH_ADDRESS("partial_match_address"), - - PARTIAL_MATCH_POSTCODE("partial_match_postcode"), - - UNAVAILABLE("unavailable"); - - private String value; - - AvsResponseCodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static AvsResponseCodeEnum fromValue(String value) { - for (AvsResponseCodeEnum b : AvsResponseCodeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final AvsResponseCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public AvsResponseCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return AvsResponseCodeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_AVS_RESPONSE_CODE = "avs_response_code"; - @SerializedName(SERIALIZED_NAME_AVS_RESPONSE_CODE) - private AvsResponseCodeEnum avsResponseCode; - - /** - * The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response. - */ - @JsonAdapter(CvvResponseCodeEnum.Adapter.class) - public enum CvvResponseCodeEnum { - NO_MATCH("no_match"), - - MATCH("match"), - - UNAVAILABLE("unavailable"), - - NOT_PROVIDED("not_provided"); - - private String value; - - CvvResponseCodeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static CvvResponseCodeEnum fromValue(String value) { - for (CvvResponseCodeEnum b : CvvResponseCodeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final CvvResponseCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public CvvResponseCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return CvvResponseCodeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_CVV_RESPONSE_CODE = "cvv_response_code"; - @SerializedName(SERIALIZED_NAME_CVV_RESPONSE_CODE) - private CvvResponseCodeEnum cvvResponseCode; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; /** * Gets or Sets method @@ -642,249 +563,522 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; + public static final String SERIALIZED_NAME_MULTI_TENDER = "multi_tender"; + @SerializedName(SERIALIZED_NAME_MULTI_TENDER) + private Boolean multiTender; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private PaymentMethodSnapshot paymentMethod; + + public static final String SERIALIZED_NAME_PAYMENT_SERVICE = "payment_service"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE) + private PaymentServiceSnapshot paymentService; + public static final String SERIALIZED_NAME_PAYMENT_SERVICE_TRANSACTION_ID = "payment_service_transaction_id"; @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE_TRANSACTION_ID) private String paymentServiceTransactionId; - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Map metadata = null; + /** + * The source of the transaction. Defaults to `ecommerce`. + */ + @JsonAdapter(PaymentSourceEnum.Adapter.class) + public enum PaymentSourceEnum { + ECOMMERCE("ecommerce"), + + MOTO("moto"), + + RECURRING("recurring"), + + INSTALLMENT("installment"), + + CARD_ON_FILE("card_on_file"); + + private String value; + + PaymentSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentSourceEnum fromValue(String value) { + for (PaymentSourceEnum b : PaymentSourceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentSourceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_SOURCE = "payment_source"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SOURCE) + private PaymentSourceEnum paymentSource; + + public static final String SERIALIZED_NAME_PENDING_REVIEW = "pending_review"; + @SerializedName(SERIALIZED_NAME_PENDING_REVIEW) + private Boolean pendingReview; + + public static final String SERIALIZED_NAME_RAW_RESPONSE_CODE = "raw_response_code"; + @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_CODE) + private String rawResponseCode; + + public static final String SERIALIZED_NAME_RAW_RESPONSE_DESCRIPTION = "raw_response_description"; + @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_DESCRIPTION) + private String rawResponseDescription; + + public static final String SERIALIZED_NAME_RECONCILIATION_ID = "reconciliation_id"; + @SerializedName(SERIALIZED_NAME_RECONCILIATION_ID) + private String reconciliationId; + + public static final String SERIALIZED_NAME_REFUNDED_AMOUNT = "refunded_amount"; + @SerializedName(SERIALIZED_NAME_REFUNDED_AMOUNT) + private Integer refundedAmount; + + public static final String SERIALIZED_NAME_SCHEME_TRANSACTION_ID = "scheme_transaction_id"; + @SerializedName(SERIALIZED_NAME_SCHEME_TRANSACTION_ID) + private String schemeTransactionId = "null"; public static final String SERIALIZED_NAME_SHIPPING_DETAILS = "shipping_details"; @SerializedName(SERIALIZED_NAME_SHIPPING_DETAILS) private ShippingDetail shippingDetails; + public static final String SERIALIZED_NAME_STATEMENT_DESCRIPTOR = "statement_descriptor"; + @SerializedName(SERIALIZED_NAME_STATEMENT_DESCRIPTOR) + private StatementDescriptor statementDescriptor; + + /** + * The status of the transaction for the `payment_method`. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PROCESSING("processing"), + + BUYER_APPROVAL_PENDING("buyer_approval_pending"), + + AUTHORIZATION_SUCCEEDED("authorization_succeeded"), + + AUTHORIZATION_FAILED("authorization_failed"), + + AUTHORIZATION_DECLINED("authorization_declined"), + + CAPTURE_PENDING("capture_pending"), + + CAPTURE_SUCCEEDED("capture_succeeded"), + + AUTHORIZATION_VOID_PENDING("authorization_void_pending"), + + AUTHORIZATION_VOIDED("authorization_voided"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + public static final String SERIALIZED_NAME_THREE_D_SECURE = "three_d_secure"; @SerializedName(SERIALIZED_NAME_THREE_D_SECURE) private ThreeDSecureSummary threeDSecure; - public static final String SERIALIZED_NAME_AUTHORIZED_AT = "authorized_at"; - @SerializedName(SERIALIZED_NAME_AUTHORIZED_AT) - private String authorizedAt; + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; + + public static final String SERIALIZED_NAME_VOIDED_AT = "voided_at"; + @SerializedName(SERIALIZED_NAME_VOIDED_AT) + private String voidedAt; + + + public Transaction type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of this resource. Is always `transaction`. + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "transaction", value = "The type of this resource. Is always `transaction`.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public Transaction id(UUID id) { + + this.id = id; + return this; + } + + /** + * The unique identifier for this transaction. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this transaction.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public Transaction amount(Integer amount) { + + this.amount = amount; + return this; + } + + /** + * The total amount for this transaction across all funding sources including gift cards. + * minimum: 0 + * maximum: 99999999 + * @return amount + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1299", value = "The total amount for this transaction across all funding sources including gift cards.") + + public Integer getAmount() { + return amount; + } + + + public void setAmount(Integer amount) { + this.amount = amount; + } + + + public Transaction authResponseCode(String authResponseCode) { + + this.authResponseCode = authResponseCode; + return this; + } + + /** + * This is the response description received from the processor. + * @return authResponseCode + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "00", value = "This is the response description received from the processor.") + + public String getAuthResponseCode() { + return authResponseCode; + } + + + public void setAuthResponseCode(String authResponseCode) { + this.authResponseCode = authResponseCode; + } + + + public Transaction authorizedAmount(Integer authorizedAmount) { + + this.authorizedAmount = authorizedAmount; + return this; + } + + /** + * The amount for this transaction that has been authorized for the `payment_method`. This can be less than the `amount` if gift cards were used. + * minimum: 0 + * maximum: 99999999 + * @return authorizedAmount + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1299", value = "The amount for this transaction that has been authorized for the `payment_method`. This can be less than the `amount` if gift cards were used.") - public static final String SERIALIZED_NAME_CAPTURED_AT = "captured_at"; - @SerializedName(SERIALIZED_NAME_CAPTURED_AT) - private String capturedAt; + public Integer getAuthorizedAmount() { + return authorizedAmount; + } - public static final String SERIALIZED_NAME_VOIDED_AT = "voided_at"; - @SerializedName(SERIALIZED_NAME_VOIDED_AT) - private String voidedAt; - public static final String SERIALIZED_NAME_CHECKOUT_SESSION_ID = "checkout_session_id"; - @SerializedName(SERIALIZED_NAME_CHECKOUT_SESSION_ID) - private UUID checkoutSessionId; + public void setAuthorizedAmount(Integer authorizedAmount) { + this.authorizedAmount = authorizedAmount; + } - public Transaction type(TypeEnum type) { + public Transaction authorizedAt(String authorizedAt) { - this.type = type; + this.authorizedAt = authorizedAt; return this; } /** - * The type of this resource. Is always `transaction`. - * @return type + * The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field. + * @return authorizedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "transaction", value = "The type of this resource. Is always `transaction`.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field.") - public TypeEnum getType() { - return type; + public String getAuthorizedAt() { + return authorizedAt; } - public void setType(TypeEnum type) { - this.type = type; + public void setAuthorizedAt(String authorizedAt) { + this.authorizedAt = authorizedAt; } - public Transaction id(UUID id) { + public Transaction avsResponseCode(AvsResponseCodeEnum avsResponseCode) { - this.id = id; + this.avsResponseCode = avsResponseCode; return this; } /** - * The unique identifier for this transaction. - * @return id + * The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response. + * @return avsResponseCode **/ @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The unique identifier for this transaction.") + @ApiModelProperty(example = "partial_match_address", value = "The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response.") - public UUID getId() { - return id; + public AvsResponseCodeEnum getAvsResponseCode() { + return avsResponseCode; } - public void setId(UUID id) { - this.id = id; + public void setAvsResponseCode(AvsResponseCodeEnum avsResponseCode) { + this.avsResponseCode = avsResponseCode; } - public Transaction reconciliationId(String reconciliationId) { + public Transaction buyer(BuyerSnapshot buyer) { - this.reconciliationId = reconciliationId; + this.buyer = buyer; return this; } /** - * The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers. - * @return reconciliationId + * The buyer used for this transaction. + * @return buyer **/ @javax.annotation.Nullable - @ApiModelProperty(example = "7jZXl4gBUNl0CnaLEnfXbt", value = "The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers.") + @ApiModelProperty(value = "The buyer used for this transaction.") - public String getReconciliationId() { - return reconciliationId; + public BuyerSnapshot getBuyer() { + return buyer; } - public void setReconciliationId(String reconciliationId) { - this.reconciliationId = reconciliationId; + public void setBuyer(BuyerSnapshot buyer) { + this.buyer = buyer; } - public Transaction merchantAccountId(String merchantAccountId) { + public Transaction capturedAmount(Integer capturedAmount) { - this.merchantAccountId = merchantAccountId; + this.capturedAmount = capturedAmount; return this; } /** - * The ID of the merchant account to which this transaction belongs to. - * @return merchantAccountId + * The captured amount for this transaction. This can be the full value of the `authorized_amount` or less. + * minimum: 0 + * maximum: 99999999 + * @return capturedAmount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "default", value = "The ID of the merchant account to which this transaction belongs to.") + @ApiModelProperty(example = "999", value = "The captured amount for this transaction. This can be the full value of the `authorized_amount` or less.") - public String getMerchantAccountId() { - return merchantAccountId; + public Integer getCapturedAmount() { + return capturedAmount; } - public void setMerchantAccountId(String merchantAccountId) { - this.merchantAccountId = merchantAccountId; + public void setCapturedAmount(Integer capturedAmount) { + this.capturedAmount = capturedAmount; } - public Transaction status(StatusEnum status) { + public Transaction capturedAt(String capturedAt) { - this.status = status; + this.capturedAt = capturedAt; return this; } /** - * The status of the transaction. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status. - * @return status + * The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field. + * @return capturedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "processing", value = "The status of the transaction. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field.") - public StatusEnum getStatus() { - return status; + public String getCapturedAt() { + return capturedAt; } - public void setStatus(StatusEnum status) { - this.status = status; + public void setCapturedAt(String capturedAt) { + this.capturedAt = capturedAt; } - public Transaction intent(IntentEnum intent) { + public Transaction cartItems(List cartItems) { - this.intent = intent; + this.cartItems = cartItems; + return this; + } + + public Transaction addCartItemsItem(CartItem cartItemsItem) { + if (this.cartItems == null) { + this.cartItems = new ArrayList(); + } + this.cartItems.add(cartItemsItem); return this; } /** - * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). - * @return intent + * An array of cart items that represents the line items of a transaction. + * @return cartItems **/ @javax.annotation.Nullable - @ApiModelProperty(example = "authorize", value = "The original `intent` used when the transaction was [created](#operation/authorize-new-transaction).") + @ApiModelProperty(value = "An array of cart items that represents the line items of a transaction.") - public IntentEnum getIntent() { - return intent; + public List getCartItems() { + return cartItems; } - public void setIntent(IntentEnum intent) { - this.intent = intent; + public void setCartItems(List cartItems) { + this.cartItems = cartItems; } - public Transaction amount(Integer amount) { + public Transaction checkoutSessionId(UUID checkoutSessionId) { - this.amount = amount; + this.checkoutSessionId = checkoutSessionId; return this; } /** - * The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded. - * minimum: 0 - * maximum: 99999999 - * @return amount + * The identifier for the checkout session this transaction is associated with. + * @return checkoutSessionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "1299", value = "The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded.") + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The identifier for the checkout session this transaction is associated with.") - public Integer getAmount() { - return amount; + public UUID getCheckoutSessionId() { + return checkoutSessionId; } - public void setAmount(Integer amount) { - this.amount = amount; + public void setCheckoutSessionId(UUID checkoutSessionId) { + this.checkoutSessionId = checkoutSessionId; } - public Transaction capturedAmount(Integer capturedAmount) { + public Transaction country(String country) { - this.capturedAmount = capturedAmount; + this.country = country; return this; } /** - * The captured amount for this transaction. This can be the total or a portion of the authorized amount. - * minimum: 0 - * maximum: 99999999 - * @return capturedAmount + * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. + * @return country **/ @javax.annotation.Nullable - @ApiModelProperty(example = "999", value = "The captured amount for this transaction. This can be the total or a portion of the authorized amount.") + @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. ") - public Integer getCapturedAmount() { - return capturedAmount; + public String getCountry() { + return country; } - public void setCapturedAmount(Integer capturedAmount) { - this.capturedAmount = capturedAmount; + public void setCountry(String country) { + this.country = country; } - public Transaction refundedAmount(Integer refundedAmount) { + public Transaction createdAt(String createdAt) { - this.refundedAmount = refundedAmount; + this.createdAt = createdAt; return this; } /** - * The refunded amount for this transaction. This can be the total or a portion of the captured amount. - * minimum: 0 - * maximum: 99999999 - * @return refundedAmount + * The date and time when this transaction was created in our system. + * @return createdAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "100", value = "The refunded amount for this transaction. This can be the total or a portion of the captured amount.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was created in our system.") - public Integer getRefundedAmount() { - return refundedAmount; + public String getCreatedAt() { + return createdAt; } - public void setRefundedAmount(Integer refundedAmount) { - this.refundedAmount = refundedAmount; + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; } @@ -911,187 +1105,218 @@ public void setCurrency(String currency) { } - public Transaction country(String country) { + public Transaction cvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { - this.country = country; + this.cvvResponseCode = cvvResponseCode; return this; } /** - * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. - * @return country + * The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response. + * @return cvvResponseCode **/ @javax.annotation.Nullable - @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. ") + @ApiModelProperty(example = "match", value = "The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response.") - public String getCountry() { - return country; + public CvvResponseCodeEnum getCvvResponseCode() { + return cvvResponseCode; } - public void setCountry(String country) { - this.country = country; + public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { + this.cvvResponseCode = cvvResponseCode; } - public Transaction paymentMethod(PaymentMethodSnapshot paymentMethod) { + public Transaction errorCode(String errorCode) { - this.paymentMethod = paymentMethod; + this.errorCode = errorCode; return this; } /** - * The payment method used for this transaction. - * @return paymentMethod + * This is an error code set by Gr4vy. + * @return errorCode **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The payment method used for this transaction.") + @ApiModelProperty(example = "missing_redirect_url", value = "This is an error code set by Gr4vy.") - public PaymentMethodSnapshot getPaymentMethod() { - return paymentMethod; + public String getErrorCode() { + return errorCode; } - public void setPaymentMethod(PaymentMethodSnapshot paymentMethod) { - this.paymentMethod = paymentMethod; + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; } - public Transaction buyer(BuyerSnapshot buyer) { + public Transaction externalIdentifier(String externalIdentifier) { - this.buyer = buyer; + this.externalIdentifier = externalIdentifier; return this; } /** - * The buyer used for this transaction. - * @return buyer + * An external identifier that can be used to match the transaction against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The buyer used for this transaction.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") - public BuyerSnapshot getBuyer() { - return buyer; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setBuyer(BuyerSnapshot buyer) { - this.buyer = buyer; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } - public Transaction createdAt(String createdAt) { + public Transaction giftCardService(GiftCardServiceSnapshot giftCardService) { - this.createdAt = createdAt; + this.giftCardService = giftCardService; return this; } /** - * The date and time when this transaction was created in our system. - * @return createdAt + * The gift card service used for this transaction. + * @return giftCardService + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The gift card service used for this transaction.") + + public GiftCardServiceSnapshot getGiftCardService() { + return giftCardService; + } + + + public void setGiftCardService(GiftCardServiceSnapshot giftCardService) { + this.giftCardService = giftCardService; + } + + + public Transaction giftCardsRedemptions(List giftCardsRedemptions) { + + this.giftCardsRedemptions = giftCardsRedemptions; + return this; + } + + public Transaction addGiftCardsRedemptionsItem(GiftCardRedemption giftCardsRedemptionsItem) { + if (this.giftCardsRedemptions == null) { + this.giftCardsRedemptions = new ArrayList(); + } + this.giftCardsRedemptions.add(giftCardsRedemptionsItem); + return this; + } + + /** + * The gift cards redeemed for this transaction. + * @return giftCardsRedemptions **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was created in our system.") + @ApiModelProperty(value = "The gift cards redeemed for this transaction.") - public String getCreatedAt() { - return createdAt; + public List getGiftCardsRedemptions() { + return giftCardsRedemptions; } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; + public void setGiftCardsRedemptions(List giftCardsRedemptions) { + this.giftCardsRedemptions = giftCardsRedemptions; } - public Transaction externalIdentifier(String externalIdentifier) { + public Transaction intent(IntentEnum intent) { - this.externalIdentifier = externalIdentifier; + this.intent = intent; return this; } /** - * An external identifier that can be used to match the transaction against your own records. - * @return externalIdentifier + * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). + * @return intent **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") + @ApiModelProperty(example = "authorize", value = "The original `intent` used when the transaction was [created](#operation/authorize-new-transaction).") - public String getExternalIdentifier() { - return externalIdentifier; + public IntentEnum getIntent() { + return intent; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setIntent(IntentEnum intent) { + this.intent = intent; } - public Transaction updatedAt(String updatedAt) { + public Transaction intentOutcome(IntentOutcomeEnum intentOutcome) { - this.updatedAt = updatedAt; + this.intentOutcome = intentOutcome; return this; } /** - * Defines when the transaction was last updated. - * @return updatedAt + * The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. `capture` or `authorize`) has been achieved when dealing with multiple payment instruments. If all payment instruments (`payment_method` and/or `gift_cards`) have succeeded to get an authorization or direct sale **at any point in time** then this will return a `succeeded` value. If any of the payment instruments fails or declines then this will return a `failed` value. If any payment instruments is still in a `pending` or `processing` state then the result will be `pending`. Please note that if any of the payment instruments are voided or refunded after the result reaches a `succeeded` state then the result will remain unchanged. + * @return intentOutcome **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Defines when the transaction was last updated.") + @ApiModelProperty(example = "pending", value = "The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. `capture` or `authorize`) has been achieved when dealing with multiple payment instruments. If all payment instruments (`payment_method` and/or `gift_cards`) have succeeded to get an authorization or direct sale **at any point in time** then this will return a `succeeded` value. If any of the payment instruments fails or declines then this will return a `failed` value. If any payment instruments is still in a `pending` or `processing` state then the result will be `pending`. Please note that if any of the payment instruments are voided or refunded after the result reaches a `succeeded` state then the result will remain unchanged.") - public String getUpdatedAt() { - return updatedAt; + public IntentOutcomeEnum getIntentOutcome() { + return intentOutcome; } - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; + public void setIntentOutcome(IntentOutcomeEnum intentOutcome) { + this.intentOutcome = intentOutcome; } - public Transaction paymentService(PaymentServiceSnapshot paymentService) { + public Transaction isSubsequentPayment(Boolean isSubsequentPayment) { - this.paymentService = paymentService; + this.isSubsequentPayment = isSubsequentPayment; return this; } /** - * The payment service used for this transaction. - * @return paymentService + * Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. + * @return isSubsequentPayment **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The payment service used for this transaction.") + @ApiModelProperty(example = "true", value = "Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.") - public PaymentServiceSnapshot getPaymentService() { - return paymentService; + public Boolean getIsSubsequentPayment() { + return isSubsequentPayment; } - public void setPaymentService(PaymentServiceSnapshot paymentService) { - this.paymentService = paymentService; + public void setIsSubsequentPayment(Boolean isSubsequentPayment) { + this.isSubsequentPayment = isSubsequentPayment; } - public Transaction pendingReview(Boolean pendingReview) { + public Transaction merchantAccountId(String merchantAccountId) { - this.pendingReview = pendingReview; + this.merchantAccountId = merchantAccountId; return this; } /** - * Whether a manual review is pending. - * @return pendingReview + * The ID of the merchant account to which this transaction belongs to. + * @return merchantAccountId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Whether a manual review is pending.") + @ApiModelProperty(example = "default", value = "The ID of the merchant account to which this transaction belongs to.") - public Boolean getPendingReview() { - return pendingReview; + public String getMerchantAccountId() { + return merchantAccountId; } - public void setPendingReview(Boolean pendingReview) { - this.pendingReview = pendingReview; + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; } @@ -1118,341 +1343,312 @@ public void setMerchantInitiated(Boolean merchantInitiated) { } - public Transaction paymentSource(PaymentSourceEnum paymentSource) { + public Transaction metadata(Map metadata) { - this.paymentSource = paymentSource; + this.metadata = metadata; return this; } - /** - * Get paymentSource - * @return paymentSource - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "recurring", value = "") - - public PaymentSourceEnum getPaymentSource() { - return paymentSource; - } - - - public void setPaymentSource(PaymentSourceEnum paymentSource) { - this.paymentSource = paymentSource; - } - - - public Transaction isSubsequentPayment(Boolean isSubsequentPayment) { - - this.isSubsequentPayment = isSubsequentPayment; + public Transaction putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap(); + } + this.metadata.put(key, metadataItem); return this; } /** - * Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. - * @return isSubsequentPayment + * Additional information about the transaction stored as key-value pairs. + * @return metadata **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.") + @ApiModelProperty(example = "{\"key\":\"value\"}", value = "Additional information about the transaction stored as key-value pairs.") - public Boolean getIsSubsequentPayment() { - return isSubsequentPayment; + public Map getMetadata() { + return metadata; } - public void setIsSubsequentPayment(Boolean isSubsequentPayment) { - this.isSubsequentPayment = isSubsequentPayment; + public void setMetadata(Map metadata) { + this.metadata = metadata; } - public Transaction statementDescriptor(StatementDescriptor statementDescriptor) { + public Transaction method(MethodEnum method) { - this.statementDescriptor = statementDescriptor; + this.method = method; return this; } /** - * Get statementDescriptor - * @return statementDescriptor + * Get method + * @return method **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "card", value = "") - public StatementDescriptor getStatementDescriptor() { - return statementDescriptor; + public MethodEnum getMethod() { + return method; } - public void setStatementDescriptor(StatementDescriptor statementDescriptor) { - this.statementDescriptor = statementDescriptor; + public void setMethod(MethodEnum method) { + this.method = method; } - public Transaction cartItems(List cartItems) { + public Transaction multiTender(Boolean multiTender) { - this.cartItems = cartItems; - return this; - } - - public Transaction addCartItemsItem(CartItem cartItemsItem) { - if (this.cartItems == null) { - this.cartItems = new ArrayList(); - } - this.cartItems.add(cartItemsItem); + this.multiTender = multiTender; return this; } /** - * An array of cart items that represents the line items of a transaction. - * @return cartItems + * Defines if this transaction has been split across multiple payment instruments such as a `payment_method` and one or more `gift_cards`, or multiple `gift_cards` without a `payment_method`. + * @return multiTender **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of cart items that represents the line items of a transaction.") + @ApiModelProperty(example = "true", value = "Defines if this transaction has been split across multiple payment instruments such as a `payment_method` and one or more `gift_cards`, or multiple `gift_cards` without a `payment_method`.") - public List getCartItems() { - return cartItems; + public Boolean getMultiTender() { + return multiTender; } - public void setCartItems(List cartItems) { - this.cartItems = cartItems; + public void setMultiTender(Boolean multiTender) { + this.multiTender = multiTender; } - public Transaction schemeTransactionId(String schemeTransactionId) { + public Transaction paymentMethod(PaymentMethodSnapshot paymentMethod) { - this.schemeTransactionId = schemeTransactionId; + this.paymentMethod = paymentMethod; return this; } /** - * An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. - * @return schemeTransactionId + * The payment method used for this transaction. + * @return paymentMethod **/ @javax.annotation.Nullable - @ApiModelProperty(example = "123456789012345", value = "An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID.") + @ApiModelProperty(value = "The payment method used for this transaction.") - public String getSchemeTransactionId() { - return schemeTransactionId; + public PaymentMethodSnapshot getPaymentMethod() { + return paymentMethod; } - public void setSchemeTransactionId(String schemeTransactionId) { - this.schemeTransactionId = schemeTransactionId; + public void setPaymentMethod(PaymentMethodSnapshot paymentMethod) { + this.paymentMethod = paymentMethod; } - public Transaction rawResponseCode(String rawResponseCode) { + public Transaction paymentService(PaymentServiceSnapshot paymentService) { - this.rawResponseCode = rawResponseCode; + this.paymentService = paymentService; return this; } /** - * This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services. - * @return rawResponseCode + * The payment service used for this transaction. + * @return paymentService **/ @javax.annotation.Nullable - @ApiModelProperty(example = "incorrect-zip", value = "This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services.") + @ApiModelProperty(value = "The payment service used for this transaction.") - public String getRawResponseCode() { - return rawResponseCode; + public PaymentServiceSnapshot getPaymentService() { + return paymentService; } - public void setRawResponseCode(String rawResponseCode) { - this.rawResponseCode = rawResponseCode; + public void setPaymentService(PaymentServiceSnapshot paymentService) { + this.paymentService = paymentService; } - public Transaction rawResponseDescription(String rawResponseDescription) { + public Transaction paymentServiceTransactionId(String paymentServiceTransactionId) { - this.rawResponseDescription = rawResponseDescription; + this.paymentServiceTransactionId = paymentServiceTransactionId; return this; } /** - * This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services. - * @return rawResponseDescription + * The payment service's unique ID for the transaction. + * @return paymentServiceTransactionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "The card's postal code is incorrect. Check the card's postal code or use a different card.", value = "This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services.") + @ApiModelProperty(example = "charge_xYqd43gySMtori", value = "The payment service's unique ID for the transaction.") - public String getRawResponseDescription() { - return rawResponseDescription; + public String getPaymentServiceTransactionId() { + return paymentServiceTransactionId; } - public void setRawResponseDescription(String rawResponseDescription) { - this.rawResponseDescription = rawResponseDescription; + public void setPaymentServiceTransactionId(String paymentServiceTransactionId) { + this.paymentServiceTransactionId = paymentServiceTransactionId; } - public Transaction errorCode(String errorCode) { + public Transaction paymentSource(PaymentSourceEnum paymentSource) { - this.errorCode = errorCode; + this.paymentSource = paymentSource; return this; } /** - * This is an error code set by Gr4vy. - * @return errorCode + * The source of the transaction. Defaults to `ecommerce`. + * @return paymentSource **/ @javax.annotation.Nullable - @ApiModelProperty(example = "missing_redirect_url", value = "This is an error code set by Gr4vy.") + @ApiModelProperty(example = "recurring", value = "The source of the transaction. Defaults to `ecommerce`.") - public String getErrorCode() { - return errorCode; + public PaymentSourceEnum getPaymentSource() { + return paymentSource; } - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; + public void setPaymentSource(PaymentSourceEnum paymentSource) { + this.paymentSource = paymentSource; } - public Transaction authResponseCode(String authResponseCode) { + public Transaction pendingReview(Boolean pendingReview) { - this.authResponseCode = authResponseCode; + this.pendingReview = pendingReview; return this; } /** - * This is the response description received from the processor. - * @return authResponseCode + * Whether a manual review is pending. + * @return pendingReview **/ @javax.annotation.Nullable - @ApiModelProperty(example = "00", value = "This is the response description received from the processor.") + @ApiModelProperty(example = "true", value = "Whether a manual review is pending.") - public String getAuthResponseCode() { - return authResponseCode; + public Boolean getPendingReview() { + return pendingReview; } - public void setAuthResponseCode(String authResponseCode) { - this.authResponseCode = authResponseCode; + public void setPendingReview(Boolean pendingReview) { + this.pendingReview = pendingReview; } - public Transaction avsResponseCode(AvsResponseCodeEnum avsResponseCode) { + public Transaction rawResponseCode(String rawResponseCode) { - this.avsResponseCode = avsResponseCode; + this.rawResponseCode = rawResponseCode; return this; } /** - * The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response. - * @return avsResponseCode + * This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services. + * @return rawResponseCode **/ @javax.annotation.Nullable - @ApiModelProperty(example = "partial_match_address", value = "The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code. - `no_match` - neither address or postal code match - `match` - both address and postal code match - `partial_match_address` - address matches but postal code does not - `partial_match_postcode` - postal code matches but address does not - `unavailable ` - AVS is unavailable for card/country The value of this field can be `null` if the payment service did not provide a response.") + @ApiModelProperty(example = "incorrect-zip", value = "This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services.") - public AvsResponseCodeEnum getAvsResponseCode() { - return avsResponseCode; + public String getRawResponseCode() { + return rawResponseCode; } - public void setAvsResponseCode(AvsResponseCodeEnum avsResponseCode) { - this.avsResponseCode = avsResponseCode; + public void setRawResponseCode(String rawResponseCode) { + this.rawResponseCode = rawResponseCode; } - public Transaction cvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { + public Transaction rawResponseDescription(String rawResponseDescription) { - this.cvvResponseCode = cvvResponseCode; + this.rawResponseDescription = rawResponseDescription; return this; } /** - * The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response. - * @return cvvResponseCode + * This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services. + * @return rawResponseDescription **/ @javax.annotation.Nullable - @ApiModelProperty(example = "match", value = "The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code. - `no_match` - the CVV does not match the expected value - `match` - the CVV matches the expected value - `unavailable ` - CVV check unavailable for card our country - `not_provided ` - CVV not provided The value of this field can be `null` if the payment service did not provide a response.") + @ApiModelProperty(example = "The card's postal code is incorrect. Check the card's postal code or use a different card.", value = "This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services.") - public CvvResponseCodeEnum getCvvResponseCode() { - return cvvResponseCode; + public String getRawResponseDescription() { + return rawResponseDescription; } - public void setCvvResponseCode(CvvResponseCodeEnum cvvResponseCode) { - this.cvvResponseCode = cvvResponseCode; + public void setRawResponseDescription(String rawResponseDescription) { + this.rawResponseDescription = rawResponseDescription; } - public Transaction method(MethodEnum method) { + public Transaction reconciliationId(String reconciliationId) { - this.method = method; + this.reconciliationId = reconciliationId; return this; } /** - * Get method - * @return method + * The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers. + * @return reconciliationId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "") + @ApiModelProperty(example = "7jZXl4gBUNl0CnaLEnfXbt", value = "The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers.") - public MethodEnum getMethod() { - return method; + public String getReconciliationId() { + return reconciliationId; } - public void setMethod(MethodEnum method) { - this.method = method; + public void setReconciliationId(String reconciliationId) { + this.reconciliationId = reconciliationId; } - public Transaction paymentServiceTransactionId(String paymentServiceTransactionId) { + public Transaction refundedAmount(Integer refundedAmount) { - this.paymentServiceTransactionId = paymentServiceTransactionId; + this.refundedAmount = refundedAmount; return this; } /** - * The payment service's unique ID for the transaction. - * @return paymentServiceTransactionId + * The refunded amount for this transaction. This can be the full value of the `captured_amount` or less. + * minimum: 0 + * maximum: 99999999 + * @return refundedAmount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "charge_xYqd43gySMtori", value = "The payment service's unique ID for the transaction.") + @ApiModelProperty(example = "100", value = "The refunded amount for this transaction. This can be the full value of the `captured_amount` or less.") - public String getPaymentServiceTransactionId() { - return paymentServiceTransactionId; + public Integer getRefundedAmount() { + return refundedAmount; } - public void setPaymentServiceTransactionId(String paymentServiceTransactionId) { - this.paymentServiceTransactionId = paymentServiceTransactionId; + public void setRefundedAmount(Integer refundedAmount) { + this.refundedAmount = refundedAmount; } - public Transaction metadata(Map metadata) { + public Transaction schemeTransactionId(String schemeTransactionId) { - this.metadata = metadata; - return this; - } - - public Transaction putMetadataItem(String key, String metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap(); - } - this.metadata.put(key, metadataItem); + this.schemeTransactionId = schemeTransactionId; return this; } /** - * Additional information about the transaction stored as key-value pairs. - * @return metadata + * An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. + * @return schemeTransactionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "{\"key\":\"value\"}", value = "Additional information about the transaction stored as key-value pairs.") + @ApiModelProperty(example = "123456789012345", value = "An identifier for the transaction used by the scheme itself, when available. e.g. the Visa Transaction Identifier, or Mastercard Trace ID.") - public Map getMetadata() { - return metadata; + public String getSchemeTransactionId() { + return schemeTransactionId; } - public void setMetadata(Map metadata) { - this.metadata = metadata; + public void setSchemeTransactionId(String schemeTransactionId) { + this.schemeTransactionId = schemeTransactionId; } @@ -1479,118 +1675,118 @@ public void setShippingDetails(ShippingDetail shippingDetails) { } - public Transaction threeDSecure(ThreeDSecureSummary threeDSecure) { + public Transaction statementDescriptor(StatementDescriptor statementDescriptor) { - this.threeDSecure = threeDSecure; + this.statementDescriptor = statementDescriptor; return this; } /** - * Get threeDSecure - * @return threeDSecure + * Get statementDescriptor + * @return statementDescriptor **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public ThreeDSecureSummary getThreeDSecure() { - return threeDSecure; + public StatementDescriptor getStatementDescriptor() { + return statementDescriptor; } - public void setThreeDSecure(ThreeDSecureSummary threeDSecure) { - this.threeDSecure = threeDSecure; + public void setStatementDescriptor(StatementDescriptor statementDescriptor) { + this.statementDescriptor = statementDescriptor; } - public Transaction authorizedAt(String authorizedAt) { + public Transaction status(StatusEnum status) { - this.authorizedAt = authorizedAt; + this.status = status; return this; } /** - * The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field. - * @return authorizedAt + * The status of the transaction for the `payment_method`. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status. + * @return status **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was authorized in the payment service. Don't use this field to determine whether the transaction was authorized. A `null` value doesn't necessarily imply that the transaction wasn't authorized, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was authorized or that the transaction was authorized before the introduction of this field.") + @ApiModelProperty(example = "processing", value = "The status of the transaction for the `payment_method`. The status may change over time as asynchronous processing events occur. Please note that the possible statuses returned will depend on the operation performed. For example, a captured transaction will never move to a `authorization_voided` status.") - public String getAuthorizedAt() { - return authorizedAt; + public StatusEnum getStatus() { + return status; } - public void setAuthorizedAt(String authorizedAt) { - this.authorizedAt = authorizedAt; + public void setStatus(StatusEnum status) { + this.status = status; } - public Transaction capturedAt(String capturedAt) { + public Transaction threeDSecure(ThreeDSecureSummary threeDSecure) { - this.capturedAt = capturedAt; + this.threeDSecure = threeDSecure; return this; } /** - * The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field. - * @return capturedAt + * Get threeDSecure + * @return threeDSecure **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was captured in the payment service. Don't use this field to determine whether the transaction was captured. A `null` value doesn't necessarily imply that the transaction wasn't captured, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was captured or that the transaction was captured before the introduction of this field.") + @ApiModelProperty(value = "") - public String getCapturedAt() { - return capturedAt; + public ThreeDSecureSummary getThreeDSecure() { + return threeDSecure; } - public void setCapturedAt(String capturedAt) { - this.capturedAt = capturedAt; + public void setThreeDSecure(ThreeDSecureSummary threeDSecure) { + this.threeDSecure = threeDSecure; } - public Transaction voidedAt(String voidedAt) { + public Transaction updatedAt(String updatedAt) { - this.voidedAt = voidedAt; + this.updatedAt = updatedAt; return this; } /** - * The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field. - * @return voidedAt + * Defines when the transaction was last updated. + * @return updatedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "Defines when the transaction was last updated.") - public String getVoidedAt() { - return voidedAt; + public String getUpdatedAt() { + return updatedAt; } - public void setVoidedAt(String voidedAt) { - this.voidedAt = voidedAt; + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; } - public Transaction checkoutSessionId(UUID checkoutSessionId) { + public Transaction voidedAt(String voidedAt) { - this.checkoutSessionId = checkoutSessionId; + this.voidedAt = voidedAt; return this; } /** - * The identifier for the checkout session this transaction is associated with. - * @return checkoutSessionId + * The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field. + * @return voidedAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The identifier for the checkout session this transaction is associated with.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was voided in the payment service. Don't use this field to determine whether the transaction was voided. A `null` value doesn't necessarily imply that the transaction wasn't voided, it can mean that the payment service doesn't provide this value, that it didn't provide it at the time the transaction was voided or that the transaction was voided before the introduction of this field.") - public UUID getCheckoutSessionId() { - return checkoutSessionId; + public String getVoidedAt() { + return voidedAt; } - public void setCheckoutSessionId(UUID checkoutSessionId) { - this.checkoutSessionId = checkoutSessionId; + public void setVoidedAt(String voidedAt) { + this.voidedAt = voidedAt; } @@ -1605,48 +1801,53 @@ public boolean equals(Object o) { Transaction transaction = (Transaction) o; return Objects.equals(this.type, transaction.type) && Objects.equals(this.id, transaction.id) && - Objects.equals(this.reconciliationId, transaction.reconciliationId) && - Objects.equals(this.merchantAccountId, transaction.merchantAccountId) && - Objects.equals(this.status, transaction.status) && - Objects.equals(this.intent, transaction.intent) && Objects.equals(this.amount, transaction.amount) && + Objects.equals(this.authResponseCode, transaction.authResponseCode) && + Objects.equals(this.authorizedAmount, transaction.authorizedAmount) && + Objects.equals(this.authorizedAt, transaction.authorizedAt) && + Objects.equals(this.avsResponseCode, transaction.avsResponseCode) && + Objects.equals(this.buyer, transaction.buyer) && Objects.equals(this.capturedAmount, transaction.capturedAmount) && - Objects.equals(this.refundedAmount, transaction.refundedAmount) && - Objects.equals(this.currency, transaction.currency) && + Objects.equals(this.capturedAt, transaction.capturedAt) && + Objects.equals(this.cartItems, transaction.cartItems) && + Objects.equals(this.checkoutSessionId, transaction.checkoutSessionId) && Objects.equals(this.country, transaction.country) && - Objects.equals(this.paymentMethod, transaction.paymentMethod) && - Objects.equals(this.buyer, transaction.buyer) && Objects.equals(this.createdAt, transaction.createdAt) && + Objects.equals(this.currency, transaction.currency) && + Objects.equals(this.cvvResponseCode, transaction.cvvResponseCode) && + Objects.equals(this.errorCode, transaction.errorCode) && Objects.equals(this.externalIdentifier, transaction.externalIdentifier) && - Objects.equals(this.updatedAt, transaction.updatedAt) && - Objects.equals(this.paymentService, transaction.paymentService) && - Objects.equals(this.pendingReview, transaction.pendingReview) && + Objects.equals(this.giftCardService, transaction.giftCardService) && + Objects.equals(this.giftCardsRedemptions, transaction.giftCardsRedemptions) && + Objects.equals(this.intent, transaction.intent) && + Objects.equals(this.intentOutcome, transaction.intentOutcome) && + Objects.equals(this.isSubsequentPayment, transaction.isSubsequentPayment) && + Objects.equals(this.merchantAccountId, transaction.merchantAccountId) && Objects.equals(this.merchantInitiated, transaction.merchantInitiated) && + Objects.equals(this.metadata, transaction.metadata) && + Objects.equals(this.method, transaction.method) && + Objects.equals(this.multiTender, transaction.multiTender) && + Objects.equals(this.paymentMethod, transaction.paymentMethod) && + Objects.equals(this.paymentService, transaction.paymentService) && + Objects.equals(this.paymentServiceTransactionId, transaction.paymentServiceTransactionId) && Objects.equals(this.paymentSource, transaction.paymentSource) && - Objects.equals(this.isSubsequentPayment, transaction.isSubsequentPayment) && - Objects.equals(this.statementDescriptor, transaction.statementDescriptor) && - Objects.equals(this.cartItems, transaction.cartItems) && - Objects.equals(this.schemeTransactionId, transaction.schemeTransactionId) && + Objects.equals(this.pendingReview, transaction.pendingReview) && Objects.equals(this.rawResponseCode, transaction.rawResponseCode) && Objects.equals(this.rawResponseDescription, transaction.rawResponseDescription) && - Objects.equals(this.errorCode, transaction.errorCode) && - Objects.equals(this.authResponseCode, transaction.authResponseCode) && - Objects.equals(this.avsResponseCode, transaction.avsResponseCode) && - Objects.equals(this.cvvResponseCode, transaction.cvvResponseCode) && - Objects.equals(this.method, transaction.method) && - Objects.equals(this.paymentServiceTransactionId, transaction.paymentServiceTransactionId) && - Objects.equals(this.metadata, transaction.metadata) && + Objects.equals(this.reconciliationId, transaction.reconciliationId) && + Objects.equals(this.refundedAmount, transaction.refundedAmount) && + Objects.equals(this.schemeTransactionId, transaction.schemeTransactionId) && Objects.equals(this.shippingDetails, transaction.shippingDetails) && + Objects.equals(this.statementDescriptor, transaction.statementDescriptor) && + Objects.equals(this.status, transaction.status) && Objects.equals(this.threeDSecure, transaction.threeDSecure) && - Objects.equals(this.authorizedAt, transaction.authorizedAt) && - Objects.equals(this.capturedAt, transaction.capturedAt) && - Objects.equals(this.voidedAt, transaction.voidedAt) && - Objects.equals(this.checkoutSessionId, transaction.checkoutSessionId); + Objects.equals(this.updatedAt, transaction.updatedAt) && + Objects.equals(this.voidedAt, transaction.voidedAt); } @Override public int hashCode() { - return Objects.hash(type, id, reconciliationId, merchantAccountId, status, intent, amount, capturedAmount, refundedAmount, currency, country, paymentMethod, buyer, createdAt, externalIdentifier, updatedAt, paymentService, pendingReview, merchantInitiated, paymentSource, isSubsequentPayment, statementDescriptor, cartItems, schemeTransactionId, rawResponseCode, rawResponseDescription, errorCode, authResponseCode, avsResponseCode, cvvResponseCode, method, paymentServiceTransactionId, metadata, shippingDetails, threeDSecure, authorizedAt, capturedAt, voidedAt, checkoutSessionId); + return Objects.hash(type, id, amount, authResponseCode, authorizedAmount, authorizedAt, avsResponseCode, buyer, capturedAmount, capturedAt, cartItems, checkoutSessionId, country, createdAt, currency, cvvResponseCode, errorCode, externalIdentifier, giftCardService, giftCardsRedemptions, intent, intentOutcome, isSubsequentPayment, merchantAccountId, merchantInitiated, metadata, method, multiTender, paymentMethod, paymentService, paymentServiceTransactionId, paymentSource, pendingReview, rawResponseCode, rawResponseDescription, reconciliationId, refundedAmount, schemeTransactionId, shippingDetails, statementDescriptor, status, threeDSecure, updatedAt, voidedAt); } @Override @@ -1655,43 +1856,48 @@ public String toString() { sb.append("class Transaction {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" reconciliationId: ").append(toIndentedString(reconciliationId)).append("\n"); - sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" authResponseCode: ").append(toIndentedString(authResponseCode)).append("\n"); + sb.append(" authorizedAmount: ").append(toIndentedString(authorizedAmount)).append("\n"); + sb.append(" authorizedAt: ").append(toIndentedString(authorizedAt)).append("\n"); + sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); sb.append(" capturedAmount: ").append(toIndentedString(capturedAmount)).append("\n"); - sb.append(" refundedAmount: ").append(toIndentedString(refundedAmount)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" capturedAt: ").append(toIndentedString(capturedAt)).append("\n"); + sb.append(" cartItems: ").append(toIndentedString(cartItems)).append("\n"); + sb.append(" checkoutSessionId: ").append(toIndentedString(checkoutSessionId)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" paymentService: ").append(toIndentedString(paymentService)).append("\n"); - sb.append(" pendingReview: ").append(toIndentedString(pendingReview)).append("\n"); + sb.append(" giftCardService: ").append(toIndentedString(giftCardService)).append("\n"); + sb.append(" giftCardsRedemptions: ").append(toIndentedString(giftCardsRedemptions)).append("\n"); + sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); + sb.append(" intentOutcome: ").append(toIndentedString(intentOutcome)).append("\n"); + sb.append(" isSubsequentPayment: ").append(toIndentedString(isSubsequentPayment)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); sb.append(" merchantInitiated: ").append(toIndentedString(merchantInitiated)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" multiTender: ").append(toIndentedString(multiTender)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" paymentService: ").append(toIndentedString(paymentService)).append("\n"); + sb.append(" paymentServiceTransactionId: ").append(toIndentedString(paymentServiceTransactionId)).append("\n"); sb.append(" paymentSource: ").append(toIndentedString(paymentSource)).append("\n"); - sb.append(" isSubsequentPayment: ").append(toIndentedString(isSubsequentPayment)).append("\n"); - sb.append(" statementDescriptor: ").append(toIndentedString(statementDescriptor)).append("\n"); - sb.append(" cartItems: ").append(toIndentedString(cartItems)).append("\n"); - sb.append(" schemeTransactionId: ").append(toIndentedString(schemeTransactionId)).append("\n"); + sb.append(" pendingReview: ").append(toIndentedString(pendingReview)).append("\n"); sb.append(" rawResponseCode: ").append(toIndentedString(rawResponseCode)).append("\n"); sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); - sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); - sb.append(" authResponseCode: ").append(toIndentedString(authResponseCode)).append("\n"); - sb.append(" avsResponseCode: ").append(toIndentedString(avsResponseCode)).append("\n"); - sb.append(" cvvResponseCode: ").append(toIndentedString(cvvResponseCode)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); - sb.append(" paymentServiceTransactionId: ").append(toIndentedString(paymentServiceTransactionId)).append("\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" reconciliationId: ").append(toIndentedString(reconciliationId)).append("\n"); + sb.append(" refundedAmount: ").append(toIndentedString(refundedAmount)).append("\n"); + sb.append(" schemeTransactionId: ").append(toIndentedString(schemeTransactionId)).append("\n"); sb.append(" shippingDetails: ").append(toIndentedString(shippingDetails)).append("\n"); + sb.append(" statementDescriptor: ").append(toIndentedString(statementDescriptor)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" threeDSecure: ").append(toIndentedString(threeDSecure)).append("\n"); - sb.append(" authorizedAt: ").append(toIndentedString(authorizedAt)).append("\n"); - sb.append(" capturedAt: ").append(toIndentedString(capturedAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" voidedAt: ").append(toIndentedString(voidedAt)).append("\n"); - sb.append(" checkoutSessionId: ").append(toIndentedString(checkoutSessionId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/TransactionCardRequest.java b/src/main/java/com/gr4vy/api/model/TransactionCardRequest.java index 3cfa31d..8894ea0 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionCardRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionCardRequest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; /** * Card payment method details to use in a transaction. @@ -96,14 +95,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) private String externalIdentifier; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; @SerializedName(SERIALIZED_NAME_REDIRECT_URL) private String redirectUrl; @@ -220,52 +211,6 @@ public void setExternalIdentifier(String externalIdentifier) { } - public TransactionCardRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public TransactionCardRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - public TransactionCardRequest redirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; @@ -303,14 +248,12 @@ public boolean equals(Object o) { Objects.equals(this.expirationDate, transactionCardRequest.expirationDate) && Objects.equals(this.securityCode, transactionCardRequest.securityCode) && Objects.equals(this.externalIdentifier, transactionCardRequest.externalIdentifier) && - Objects.equals(this.buyerId, transactionCardRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, transactionCardRequest.buyerExternalIdentifier) && Objects.equals(this.redirectUrl, transactionCardRequest.redirectUrl); } @Override public int hashCode() { - return Objects.hash(method, number, expirationDate, securityCode, externalIdentifier, buyerId, buyerExternalIdentifier, redirectUrl); + return Objects.hash(method, number, expirationDate, securityCode, externalIdentifier, redirectUrl); } @Override @@ -322,8 +265,6 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" securityCode: ").append(toIndentedString(securityCode)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/gr4vy/api/model/TransactionCheckoutSessionRequest.java b/src/main/java/com/gr4vy/api/model/TransactionCheckoutSessionRequest.java index 4d871be..6d5f370 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionCheckoutSessionRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionCheckoutSessionRequest.java @@ -88,14 +88,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) private String externalIdentifier; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; @SerializedName(SERIALIZED_NAME_REDIRECT_URL) private String redirectUrl; @@ -168,52 +160,6 @@ public void setExternalIdentifier(String externalIdentifier) { } - public TransactionCheckoutSessionRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public TransactionCheckoutSessionRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - public TransactionCheckoutSessionRequest redirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; @@ -249,14 +195,12 @@ public boolean equals(Object o) { return Objects.equals(this.method, transactionCheckoutSessionRequest.method) && Objects.equals(this.id, transactionCheckoutSessionRequest.id) && Objects.equals(this.externalIdentifier, transactionCheckoutSessionRequest.externalIdentifier) && - Objects.equals(this.buyerId, transactionCheckoutSessionRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, transactionCheckoutSessionRequest.buyerExternalIdentifier) && Objects.equals(this.redirectUrl, transactionCheckoutSessionRequest.redirectUrl); } @Override public int hashCode() { - return Objects.hash(method, id, externalIdentifier, buyerId, buyerExternalIdentifier, redirectUrl); + return Objects.hash(method, id, externalIdentifier, redirectUrl); } @Override @@ -266,8 +210,6 @@ public String toString() { sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/src/main/java/com/gr4vy/api/model/TransactionGiftCardNewRequest.java b/src/main/java/com/gr4vy/api/model/TransactionGiftCardNewRequest.java new file mode 100644 index 0000000..2856853 --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/TransactionGiftCardNewRequest.java @@ -0,0 +1,156 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Create a transaction with this gift card. + */ +@ApiModel(description = "Create a transaction with this gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionGiftCardNewRequest { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private String pin; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; + + + public TransactionGiftCardNewRequest number(String number) { + + this.number = number; + return this; + } + + /** + * The 16-19 digit number for this gift card. + * @return number + **/ + @ApiModelProperty(example = "4123455541234561234", required = true, value = "The 16-19 digit number for this gift card.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public TransactionGiftCardNewRequest pin(String pin) { + + this.pin = pin; + return this; + } + + /** + * The PIN for this gift card. + * @return pin + **/ + @ApiModelProperty(example = "1234", required = true, value = "The PIN for this gift card.") + + public String getPin() { + return pin; + } + + + public void setPin(String pin) { + this.pin = pin; + } + + + public TransactionGiftCardNewRequest amount(Integer amount) { + + this.amount = amount; + return this; + } + + /** + * The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`. + * minimum: 1 + * maximum: 99999999 + * @return amount + **/ + @ApiModelProperty(example = "1299", required = true, value = "The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`.") + + public Integer getAmount() { + return amount; + } + + + public void setAmount(Integer amount) { + this.amount = amount; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionGiftCardNewRequest transactionGiftCardNewRequest = (TransactionGiftCardNewRequest) o; + return Objects.equals(this.number, transactionGiftCardNewRequest.number) && + Objects.equals(this.pin, transactionGiftCardNewRequest.pin) && + Objects.equals(this.amount, transactionGiftCardNewRequest.amount); + } + + @Override + public int hashCode() { + return Objects.hash(number, pin, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionGiftCardNewRequest {\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/TransactionGiftCardRequest.java b/src/main/java/com/gr4vy/api/model/TransactionGiftCardRequest.java new file mode 100644 index 0000000..ebf81ce --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/TransactionGiftCardRequest.java @@ -0,0 +1,188 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * Create a transaction with this gift card. + */ +@ApiModel(description = "Create a transaction with this gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionGiftCardRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private String pin; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; + + + public TransactionGiftCardRequest id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of the gift card to check a balance for. Required if `number` is not set. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", value = "The ID of the gift card to check a balance for. Required if `number` is not set.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public TransactionGiftCardRequest number(String number) { + + this.number = number; + return this; + } + + /** + * The 16-19 digit number for this gift card. Required if `id` is not set. + * @return number + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "4123455541234561234", value = "The 16-19 digit number for this gift card. Required if `id` is not set.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public TransactionGiftCardRequest pin(String pin) { + + this.pin = pin; + return this; + } + + /** + * The PIN for this gift card. Required if `number` is set. + * @return pin + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1234", value = "The PIN for this gift card. Required if `number` is set.") + + public String getPin() { + return pin; + } + + + public void setPin(String pin) { + this.pin = pin; + } + + + public TransactionGiftCardRequest amount(Integer amount) { + + this.amount = amount; + return this; + } + + /** + * The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`. + * minimum: 1 + * maximum: 99999999 + * @return amount + **/ + @ApiModelProperty(example = "1299", required = true, value = "The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`.") + + public Integer getAmount() { + return amount; + } + + + public void setAmount(Integer amount) { + this.amount = amount; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionGiftCardRequest transactionGiftCardRequest = (TransactionGiftCardRequest) o; + return Objects.equals(this.id, transactionGiftCardRequest.id) && + Objects.equals(this.number, transactionGiftCardRequest.number) && + Objects.equals(this.pin, transactionGiftCardRequest.pin) && + Objects.equals(this.amount, transactionGiftCardRequest.amount); + } + + @Override + public int hashCode() { + return Objects.hash(id, number, pin, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionGiftCardRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/TransactionGiftCardStoredRequest.java b/src/main/java/com/gr4vy/api/model/TransactionGiftCardStoredRequest.java new file mode 100644 index 0000000..41b5b4c --- /dev/null +++ b/src/main/java/com/gr4vy/api/model/TransactionGiftCardStoredRequest.java @@ -0,0 +1,129 @@ +/* + * Gr4vy API + * Welcome to the Gr4vy API reference documentation. Our API is still very much a work in product and subject to change. + * + * The version of the OpenAPI document: 1.1.0-beta + * Contact: code@gr4vy.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.gr4vy.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.UUID; + +/** + * Create a transaction with a stored gift card. + */ +@ApiModel(description = "Create a transaction with a stored gift card.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TransactionGiftCardStoredRequest { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private UUID id; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; + + + public TransactionGiftCardStoredRequest id(UUID id) { + + this.id = id; + return this; + } + + /** + * The ID of the gift card to check a balance for. + * @return id + **/ + @ApiModelProperty(example = "e6cdf979-87e2-4796-8ff6-9784d5aed893", required = true, value = "The ID of the gift card to check a balance for.") + + public UUID getId() { + return id; + } + + + public void setId(UUID id) { + this.id = id; + } + + + public TransactionGiftCardStoredRequest amount(Integer amount) { + + this.amount = amount; + return this; + } + + /** + * The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`. + * minimum: 1 + * maximum: 99999999 + * @return amount + **/ + @ApiModelProperty(example = "1299", required = true, value = "The monetary amount to charge for this gift card, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. All gift card amounts are subtracted from the total transaction amount. The remainder is charged to the provided `payment_method`.") + + public Integer getAmount() { + return amount; + } + + + public void setAmount(Integer amount) { + this.amount = amount; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionGiftCardStoredRequest transactionGiftCardStoredRequest = (TransactionGiftCardStoredRequest) o; + return Objects.equals(this.id, transactionGiftCardStoredRequest.id) && + Objects.equals(this.amount, transactionGiftCardStoredRequest.amount); + } + + @Override + public int hashCode() { + return Objects.hash(id, amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionGiftCardStoredRequest {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/gr4vy/api/model/TransactionHistoryEvent.java b/src/main/java/com/gr4vy/api/model/TransactionHistoryEvent.java index f4bb179..fa3803b 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionHistoryEvent.java +++ b/src/main/java/com/gr4vy/api/model/TransactionHistoryEvent.java @@ -113,6 +113,14 @@ public enum NameEnum { DIGITAL_WALLET_CLICK_TO_PAY_TOKEN_DECRYPTED("digital-wallet-click-to-pay-token-decrypted"), + GIFT_CARD_REDEMPTION_FAILED("gift-card-redemption-failed"), + + GIFT_CARD_REDEMPTION_SUCCEEDED("gift-card-redemption-succeeded"), + + GIFT_CARD_REFUND_FAILED("gift-card-refund-failed"), + + GIFT_CARD_REFUND_SUCCEEDED("gift-card-refund-succeeded"), + PAYMENT_CONNECTOR_RESPONSE_TRANSACTION_AUTHORIZATION_FAILED("payment-connector-response-transaction-authorization-failed"), PAYMENT_CONNECTOR_RESPONSE_TRANSACTION_AUTHORIZATION_SUCCEEDED("payment-connector-response-transaction-authorization-succeeded"), diff --git a/src/main/java/com/gr4vy/api/model/TransactionPaymentMethodRequest.java b/src/main/java/com/gr4vy/api/model/TransactionPaymentMethodRequest.java index 48cdcb1..102a3d0 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionPaymentMethodRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionPaymentMethodRequest.java @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; /** * Payment method details to use in a transaction or to register a new payment method. @@ -217,14 +216,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) private String externalIdentifier; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public static final String SERIALIZED_NAME_REDIRECT_URL = "redirect_url"; @SerializedName(SERIALIZED_NAME_REDIRECT_URL) private String redirectUrl; @@ -368,52 +359,6 @@ public void setExternalIdentifier(String externalIdentifier) { } - public TransactionPaymentMethodRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public TransactionPaymentMethodRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - public TransactionPaymentMethodRequest redirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; @@ -589,8 +534,6 @@ public boolean equals(Object o) { Objects.equals(this.expirationDate, transactionPaymentMethodRequest.expirationDate) && Objects.equals(this.securityCode, transactionPaymentMethodRequest.securityCode) && Objects.equals(this.externalIdentifier, transactionPaymentMethodRequest.externalIdentifier) && - Objects.equals(this.buyerId, transactionPaymentMethodRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, transactionPaymentMethodRequest.buyerExternalIdentifier) && Objects.equals(this.redirectUrl, transactionPaymentMethodRequest.redirectUrl) && Objects.equals(this.id, transactionPaymentMethodRequest.id) && Objects.equals(this.currency, transactionPaymentMethodRequest.currency) && @@ -602,7 +545,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(method, number, expirationDate, securityCode, externalIdentifier, buyerId, buyerExternalIdentifier, redirectUrl, id, currency, country, token, assuranceDetails, cardHolderName); + return Objects.hash(method, number, expirationDate, securityCode, externalIdentifier, redirectUrl, id, currency, country, token, assuranceDetails, cardHolderName); } @Override @@ -614,8 +557,6 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" securityCode: ").append(toIndentedString(securityCode)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append(" redirectUrl: ").append(toIndentedString(redirectUrl)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); diff --git a/src/main/java/com/gr4vy/api/model/TransactionRedirectRequest.java b/src/main/java/com/gr4vy/api/model/TransactionRedirectRequest.java index df7ff5d..1ecf525 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionRedirectRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionRedirectRequest.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.UUID; /** * Redirect payment method details to use in a transaction. @@ -104,14 +103,6 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) private String externalIdentifier; - public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; - @SerializedName(SERIALIZED_NAME_BUYER_ID) - private UUID buyerId; - - public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; - @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) - private String buyerExternalIdentifier; - public TransactionRedirectRequest method(MethodEnum method) { @@ -224,52 +215,6 @@ public void setExternalIdentifier(String externalIdentifier) { } - public TransactionRedirectRequest buyerId(UUID buyerId) { - - this.buyerId = buyerId; - return this; - } - - /** - * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. - * @return buyerId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset.") - - public UUID getBuyerId() { - return buyerId; - } - - - public void setBuyerId(UUID buyerId) { - this.buyerId = buyerId; - } - - - public TransactionRedirectRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - - this.buyerExternalIdentifier = buyerExternalIdentifier; - return this; - } - - /** - * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. - * @return buyerExternalIdentifier - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset.") - - public String getBuyerExternalIdentifier() { - return buyerExternalIdentifier; - } - - - public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { - this.buyerExternalIdentifier = buyerExternalIdentifier; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -283,14 +228,12 @@ public boolean equals(Object o) { Objects.equals(this.redirectUrl, transactionRedirectRequest.redirectUrl) && Objects.equals(this.currency, transactionRedirectRequest.currency) && Objects.equals(this.country, transactionRedirectRequest.country) && - Objects.equals(this.externalIdentifier, transactionRedirectRequest.externalIdentifier) && - Objects.equals(this.buyerId, transactionRedirectRequest.buyerId) && - Objects.equals(this.buyerExternalIdentifier, transactionRedirectRequest.buyerExternalIdentifier); + Objects.equals(this.externalIdentifier, transactionRedirectRequest.externalIdentifier); } @Override public int hashCode() { - return Objects.hash(method, redirectUrl, currency, country, externalIdentifier, buyerId, buyerExternalIdentifier); + return Objects.hash(method, redirectUrl, currency, country, externalIdentifier); } @Override @@ -302,8 +245,6 @@ public String toString() { sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); - sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/TransactionRefundRequest.java b/src/main/java/com/gr4vy/api/model/TransactionRefundRequest.java index 6fb7db7..d8554fc 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionRefundRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionRefundRequest.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.UUID; /** * A request to refund a transaction. @@ -34,6 +35,61 @@ public class TransactionRefundRequest { @SerializedName(SERIALIZED_NAME_AMOUNT) private Integer amount; + /** + * The target type to refund for. This can be used to target a gift card to refund to instead of the main payment method. + */ + @JsonAdapter(TargetTypeEnum.Adapter.class) + public enum TargetTypeEnum { + PAYMENT_METHOD("payment-method"), + + GIFT_CARD_REDEMPTION("gift-card-redemption"); + + private String value; + + TargetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TargetTypeEnum fromValue(String value) { + for (TargetTypeEnum b : TargetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TargetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TargetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TargetTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TARGET_TYPE = "target_type"; + @SerializedName(SERIALIZED_NAME_TARGET_TYPE) + private TargetTypeEnum targetType = TargetTypeEnum.PAYMENT_METHOD; + + public static final String SERIALIZED_NAME_TARGET_ID = "target_id"; + @SerializedName(SERIALIZED_NAME_TARGET_ID) + private UUID targetId; + public TransactionRefundRequest amount(Integer amount) { @@ -42,13 +98,13 @@ public TransactionRefundRequest amount(Integer amount) { } /** - * The amount requested to refund. If omitted, a full refund will be requested. Otherwise, the amount must be lower than or equal to the remaining balance in the associated transaction. Negative and zero-amount refunds are not supported. + * The amount requested to refund. If omitted, a full refund will be requested for the main payment method. When set, the amount must be lower than or equal to the remaining balance in the associated transaction. Negative and zero-amount refunds are not supported. * minimum: 1 * maximum: 99999999 * @return amount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "1299", value = "The amount requested to refund. If omitted, a full refund will be requested. Otherwise, the amount must be lower than or equal to the remaining balance in the associated transaction. Negative and zero-amount refunds are not supported.") + @ApiModelProperty(example = "1299", value = "The amount requested to refund. If omitted, a full refund will be requested for the main payment method. When set, the amount must be lower than or equal to the remaining balance in the associated transaction. Negative and zero-amount refunds are not supported.") public Integer getAmount() { return amount; @@ -60,6 +116,52 @@ public void setAmount(Integer amount) { } + public TransactionRefundRequest targetType(TargetTypeEnum targetType) { + + this.targetType = targetType; + return this; + } + + /** + * The target type to refund for. This can be used to target a gift card to refund to instead of the main payment method. + * @return targetType + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "gift-card-redemption", value = "The target type to refund for. This can be used to target a gift card to refund to instead of the main payment method.") + + public TargetTypeEnum getTargetType() { + return targetType; + } + + + public void setTargetType(TargetTypeEnum targetType) { + this.targetType = targetType; + } + + + public TransactionRefundRequest targetId(UUID targetId) { + + this.targetId = targetId; + return this; + } + + /** + * The optional ID of the instrument to refund for. This is only required when the `target_type` is set to `gift-card-redemption`. + * @return targetId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "c23ea83f-1b1c-4584-a0e8-78ef8c041949", value = "The optional ID of the instrument to refund for. This is only required when the `target_type` is set to `gift-card-redemption`.") + + public UUID getTargetId() { + return targetId; + } + + + public void setTargetId(UUID targetId) { + this.targetId = targetId; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -69,12 +171,14 @@ public boolean equals(Object o) { return false; } TransactionRefundRequest transactionRefundRequest = (TransactionRefundRequest) o; - return Objects.equals(this.amount, transactionRefundRequest.amount); + return Objects.equals(this.amount, transactionRefundRequest.amount) && + Objects.equals(this.targetType, transactionRefundRequest.targetType) && + Objects.equals(this.targetId, transactionRefundRequest.targetId); } @Override public int hashCode() { - return Objects.hash(amount); + return Objects.hash(amount, targetType, targetId); } @Override @@ -82,6 +186,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TransactionRefundRequest {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" targetType: ").append(toIndentedString(targetType)).append("\n"); + sb.append(" targetId: ").append(toIndentedString(targetId)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/TransactionRequest.java b/src/main/java/com/gr4vy/api/model/TransactionRequest.java index 86c4f6b..00abaed 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionRequest.java +++ b/src/main/java/com/gr4vy/api/model/TransactionRequest.java @@ -25,6 +25,7 @@ import com.gr4vy.api.model.ConnectionOptions; import com.gr4vy.api.model.StatementDescriptor; import com.gr4vy.api.model.ThreeDSecureDataV1V2; +import com.gr4vy.api.model.TransactionGiftCardRequest; import com.gr4vy.api.model.TransactionPaymentMethodRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -49,17 +50,49 @@ public class TransactionRequest { @SerializedName(SERIALIZED_NAME_CURRENCY) private String currency; + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private TransactionPaymentMethodRequest paymentMethod; + + public static final String SERIALIZED_NAME_ANTI_FRAUD_FINGERPRINT = "anti_fraud_fingerprint"; + @SerializedName(SERIALIZED_NAME_ANTI_FRAUD_FINGERPRINT) + private String antiFraudFingerprint = "null"; + + public static final String SERIALIZED_NAME_ASYNC_CAPTURE = "async_capture"; + @SerializedName(SERIALIZED_NAME_ASYNC_CAPTURE) + private Boolean asyncCapture = false; + + public static final String SERIALIZED_NAME_BROWSER_INFO = "browser_info"; + @SerializedName(SERIALIZED_NAME_BROWSER_INFO) + private BrowserInfo browserInfo; + + public static final String SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER = "buyer_external_identifier"; + @SerializedName(SERIALIZED_NAME_BUYER_EXTERNAL_IDENTIFIER) + private String buyerExternalIdentifier; + + public static final String SERIALIZED_NAME_BUYER_ID = "buyer_id"; + @SerializedName(SERIALIZED_NAME_BUYER_ID) + private UUID buyerId; + + public static final String SERIALIZED_NAME_CART_ITEMS = "cart_items"; + @SerializedName(SERIALIZED_NAME_CART_ITEMS) + private List cartItems = null; + + public static final String SERIALIZED_NAME_CONNECTION_OPTIONS = "connection_options"; + @SerializedName(SERIALIZED_NAME_CONNECTION_OPTIONS) + private ConnectionOptions connectionOptions; + public static final String SERIALIZED_NAME_COUNTRY = "country"; @SerializedName(SERIALIZED_NAME_COUNTRY) private String country; - public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; - @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) - private TransactionPaymentMethodRequest paymentMethod; + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; - public static final String SERIALIZED_NAME_STORE = "store"; - @SerializedName(SERIALIZED_NAME_STORE) - private Boolean store = false; + public static final String SERIALIZED_NAME_GIFT_CARDS = "gift_cards"; + @SerializedName(SERIALIZED_NAME_GIFT_CARDS) + private List giftCards = null; /** * Defines the intent of this API call. This determines the desired initial state of the transaction. * `authorize` - (Default) Optionally approves and then authorizes a transaction but does not capture the funds. * `capture` - Optionally approves and then authorizes and captures the funds of the transaction. @@ -112,20 +145,20 @@ public IntentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_INTENT) private IntentEnum intent = IntentEnum.AUTHORIZE; - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; - - public static final String SERIALIZED_NAME_THREE_D_SECURE_DATA = "three_d_secure_data"; - @SerializedName(SERIALIZED_NAME_THREE_D_SECURE_DATA) - private ThreeDSecureDataV1V2 threeDSecureData; + public static final String SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT = "is_subsequent_payment"; + @SerializedName(SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT) + private Boolean isSubsequentPayment = false; public static final String SERIALIZED_NAME_MERCHANT_INITIATED = "merchant_initiated"; @SerializedName(SERIALIZED_NAME_MERCHANT_INITIATED) private Boolean merchantInitiated = false; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + /** - * Gets or Sets paymentSource + * The source of the transaction. Defaults to `ecommerce`. */ @JsonAdapter(PaymentSourceEnum.Adapter.class) public enum PaymentSourceEnum { @@ -181,45 +214,25 @@ public PaymentSourceEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_PAYMENT_SOURCE) private PaymentSourceEnum paymentSource; - public static final String SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT = "is_subsequent_payment"; - @SerializedName(SERIALIZED_NAME_IS_SUBSEQUENT_PAYMENT) - private Boolean isSubsequentPayment = false; - - public static final String SERIALIZED_NAME_METADATA = "metadata"; - @SerializedName(SERIALIZED_NAME_METADATA) - private Map metadata = null; - - public static final String SERIALIZED_NAME_STATEMENT_DESCRIPTOR = "statement_descriptor"; - @SerializedName(SERIALIZED_NAME_STATEMENT_DESCRIPTOR) - private StatementDescriptor statementDescriptor; - - public static final String SERIALIZED_NAME_CART_ITEMS = "cart_items"; - @SerializedName(SERIALIZED_NAME_CART_ITEMS) - private List cartItems = null; - public static final String SERIALIZED_NAME_PREVIOUS_SCHEME_TRANSACTION_ID = "previous_scheme_transaction_id"; @SerializedName(SERIALIZED_NAME_PREVIOUS_SCHEME_TRANSACTION_ID) private String previousSchemeTransactionId = null; - public static final String SERIALIZED_NAME_BROWSER_INFO = "browser_info"; - @SerializedName(SERIALIZED_NAME_BROWSER_INFO) - private BrowserInfo browserInfo; - public static final String SERIALIZED_NAME_SHIPPING_DETAILS_ID = "shipping_details_id"; @SerializedName(SERIALIZED_NAME_SHIPPING_DETAILS_ID) private UUID shippingDetailsId; - public static final String SERIALIZED_NAME_CONNECTION_OPTIONS = "connection_options"; - @SerializedName(SERIALIZED_NAME_CONNECTION_OPTIONS) - private ConnectionOptions connectionOptions; + public static final String SERIALIZED_NAME_STATEMENT_DESCRIPTOR = "statement_descriptor"; + @SerializedName(SERIALIZED_NAME_STATEMENT_DESCRIPTOR) + private StatementDescriptor statementDescriptor; - public static final String SERIALIZED_NAME_ASYNC_CAPTURE = "async_capture"; - @SerializedName(SERIALIZED_NAME_ASYNC_CAPTURE) - private Boolean asyncCapture = false; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private Boolean store = false; - public static final String SERIALIZED_NAME_ANTI_FRAUD_FINGERPRINT = "anti_fraud_fingerprint"; - @SerializedName(SERIALIZED_NAME_ANTI_FRAUD_FINGERPRINT) - private String antiFraudFingerprint = "null"; + public static final String SERIALIZED_NAME_THREE_D_SECURE_DATA = "three_d_secure_data"; + @SerializedName(SERIALIZED_NAME_THREE_D_SECURE_DATA) + private ThreeDSecureDataV1V2 threeDSecureData; public TransactionRequest amount(Integer amount) { @@ -229,12 +242,12 @@ public TransactionRequest amount(Integer amount) { } /** - * The monetary amount to create an authorization for, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. If the `intent` is set to `capture`, an amount greater than zero must be supplied. + * The monetary amount for this transaction, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. If the `intent` is set to `capture`, an amount greater than zero must be supplied. All gift card amounts are subtracted from this amount before the remainder is charged to the provided `payment_method`. * minimum: 0 * maximum: 99999999 * @return amount **/ - @ApiModelProperty(example = "1299", required = true, value = "The monetary amount to create an authorization for, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. If the `intent` is set to `capture`, an amount greater than zero must be supplied.") + @ApiModelProperty(example = "1299", required = true, value = "The monetary amount for this transaction, in the smallest currency unit for the given currency, for example `1299` cents to create an authorization for `$12.99`. If the `intent` is set to `capture`, an amount greater than zero must be supplied. All gift card amounts are subtracted from this amount before the remainder is charged to the provided `payment_method`.") public Integer getAmount() { return amount; @@ -268,340 +281,418 @@ public void setCurrency(String currency) { } - public TransactionRequest country(String country) { + public TransactionRequest paymentMethod(TransactionPaymentMethodRequest paymentMethod) { - this.country = country; + this.paymentMethod = paymentMethod; return this; } /** - * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly. - * @return country + * Get paymentMethod + * @return paymentMethod **/ @javax.annotation.Nullable - @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly. ") + @ApiModelProperty(value = "") - public String getCountry() { - return country; + public TransactionPaymentMethodRequest getPaymentMethod() { + return paymentMethod; } - public void setCountry(String country) { - this.country = country; + public void setPaymentMethod(TransactionPaymentMethodRequest paymentMethod) { + this.paymentMethod = paymentMethod; } - public TransactionRequest paymentMethod(TransactionPaymentMethodRequest paymentMethod) { + public TransactionRequest antiFraudFingerprint(String antiFraudFingerprint) { - this.paymentMethod = paymentMethod; + this.antiFraudFingerprint = antiFraudFingerprint; return this; } /** - * Get paymentMethod - * @return paymentMethod + * This field represents the fingerprint data to be passed to the active anti-fraud service. + * @return antiFraudFingerprint **/ - @ApiModelProperty(required = true, value = "") + @javax.annotation.Nullable + @ApiModelProperty(example = "yGeBAFYgFmM=", value = "This field represents the fingerprint data to be passed to the active anti-fraud service.") - public TransactionPaymentMethodRequest getPaymentMethod() { - return paymentMethod; + public String getAntiFraudFingerprint() { + return antiFraudFingerprint; } - public void setPaymentMethod(TransactionPaymentMethodRequest paymentMethod) { - this.paymentMethod = paymentMethod; + public void setAntiFraudFingerprint(String antiFraudFingerprint) { + this.antiFraudFingerprint = antiFraudFingerprint; } - public TransactionRequest store(Boolean store) { + public TransactionRequest asyncCapture(Boolean asyncCapture) { - this.store = store; + this.asyncCapture = asyncCapture; return this; } /** - * Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method. - * @return store + * Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`. + * @return asyncCapture **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.") + @ApiModelProperty(example = "true", value = "Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.") - public Boolean getStore() { - return store; + public Boolean getAsyncCapture() { + return asyncCapture; } - public void setStore(Boolean store) { - this.store = store; + public void setAsyncCapture(Boolean asyncCapture) { + this.asyncCapture = asyncCapture; } - public TransactionRequest intent(IntentEnum intent) { + public TransactionRequest browserInfo(BrowserInfo browserInfo) { - this.intent = intent; + this.browserInfo = browserInfo; return this; } /** - * Defines the intent of this API call. This determines the desired initial state of the transaction. * `authorize` - (Default) Optionally approves and then authorizes a transaction but does not capture the funds. * `capture` - Optionally approves and then authorizes and captures the funds of the transaction. - * @return intent + * Information about the browser used by the buyer. + * @return browserInfo **/ @javax.annotation.Nullable - @ApiModelProperty(example = "capture", value = "Defines the intent of this API call. This determines the desired initial state of the transaction. * `authorize` - (Default) Optionally approves and then authorizes a transaction but does not capture the funds. * `capture` - Optionally approves and then authorizes and captures the funds of the transaction.") + @ApiModelProperty(value = "Information about the browser used by the buyer.") - public IntentEnum getIntent() { - return intent; + public BrowserInfo getBrowserInfo() { + return browserInfo; } - public void setIntent(IntentEnum intent) { - this.intent = intent; + public void setBrowserInfo(BrowserInfo browserInfo) { + this.browserInfo = browserInfo; } - public TransactionRequest externalIdentifier(String externalIdentifier) { + public TransactionRequest buyerExternalIdentifier(String buyerExternalIdentifier) { - this.externalIdentifier = externalIdentifier; + this.buyerExternalIdentifier = buyerExternalIdentifier; return this; } /** - * An external identifier that can be used to match the transaction against your own records. - * @return externalIdentifier + * The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field. + * @return buyerExternalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") + @ApiModelProperty(example = "user-789123", value = "The `external_identifier` of the buyer to associate this payment method to. If this field is provided then the `buyer_id` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field.") - public String getExternalIdentifier() { - return externalIdentifier; + public String getBuyerExternalIdentifier() { + return buyerExternalIdentifier; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setBuyerExternalIdentifier(String buyerExternalIdentifier) { + this.buyerExternalIdentifier = buyerExternalIdentifier; } - public TransactionRequest threeDSecureData(ThreeDSecureDataV1V2 threeDSecureData) { + public TransactionRequest buyerId(UUID buyerId) { - this.threeDSecureData = threeDSecureData; + this.buyerId = buyerId; return this; } /** - * Get threeDSecureData - * @return threeDSecureData + * The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field. + * @return buyerId **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The ID of the buyer to associate this payment method to. If this field is provided then the `buyer_external_identifier` field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field.") - public ThreeDSecureDataV1V2 getThreeDSecureData() { - return threeDSecureData; + public UUID getBuyerId() { + return buyerId; } - public void setThreeDSecureData(ThreeDSecureDataV1V2 threeDSecureData) { - this.threeDSecureData = threeDSecureData; + public void setBuyerId(UUID buyerId) { + this.buyerId = buyerId; } - public TransactionRequest merchantInitiated(Boolean merchantInitiated) { + public TransactionRequest cartItems(List cartItems) { - this.merchantInitiated = merchantInitiated; + this.cartItems = cartItems; + return this; + } + + public TransactionRequest addCartItemsItem(CartItem cartItemsItem) { + if (this.cartItems == null) { + this.cartItems = new ArrayList(); + } + this.cartItems.add(cartItemsItem); return this; } /** - * Indicates whether the transaction was initiated by the merchant (true) or customer (false). - * @return merchantInitiated + * An array of cart items that represents the line items of a transaction. + * @return cartItems **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Indicates whether the transaction was initiated by the merchant (true) or customer (false).") + @ApiModelProperty(value = "An array of cart items that represents the line items of a transaction.") - public Boolean getMerchantInitiated() { - return merchantInitiated; + public List getCartItems() { + return cartItems; } - public void setMerchantInitiated(Boolean merchantInitiated) { - this.merchantInitiated = merchantInitiated; + public void setCartItems(List cartItems) { + this.cartItems = cartItems; } - public TransactionRequest paymentSource(PaymentSourceEnum paymentSource) { + public TransactionRequest connectionOptions(ConnectionOptions connectionOptions) { - this.paymentSource = paymentSource; + this.connectionOptions = connectionOptions; return this; } /** - * Get paymentSource - * @return paymentSource + * Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake-case, for example `merchant_defined_data`. + * @return connectionOptions **/ @javax.annotation.Nullable - @ApiModelProperty(example = "recurring", value = "") + @ApiModelProperty(value = "Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake-case, for example `merchant_defined_data`.") - public PaymentSourceEnum getPaymentSource() { - return paymentSource; + public ConnectionOptions getConnectionOptions() { + return connectionOptions; } - public void setPaymentSource(PaymentSourceEnum paymentSource) { - this.paymentSource = paymentSource; + public void setConnectionOptions(ConnectionOptions connectionOptions) { + this.connectionOptions = connectionOptions; } - public TransactionRequest isSubsequentPayment(Boolean isSubsequentPayment) { + public TransactionRequest country(String country) { - this.isSubsequentPayment = isSubsequentPayment; + this.country = country; return this; } /** - * Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. - * @return isSubsequentPayment + * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly. + * @return country **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.") + @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. If this value is provided for redirect requests and it's not `null`, it must match the one specified for `country` in `payment_method`. Otherwise, the value specified for `country` in `payment_method` will be assumed implicitly. ") - public Boolean getIsSubsequentPayment() { - return isSubsequentPayment; + public String getCountry() { + return country; } - public void setIsSubsequentPayment(Boolean isSubsequentPayment) { - this.isSubsequentPayment = isSubsequentPayment; + public void setCountry(String country) { + this.country = country; } - public TransactionRequest metadata(Map metadata) { + public TransactionRequest externalIdentifier(String externalIdentifier) { - this.metadata = metadata; + this.externalIdentifier = externalIdentifier; return this; } - public TransactionRequest putMetadataItem(String key, String metadataItem) { - if (this.metadata == null) { - this.metadata = new HashMap(); + /** + * An external identifier that can be used to match the transaction against your own records. + * @return externalIdentifier + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") + + public String getExternalIdentifier() { + return externalIdentifier; + } + + + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; + } + + + public TransactionRequest giftCards(List giftCards) { + + this.giftCards = giftCards; + return this; + } + + public TransactionRequest addGiftCardsItem(TransactionGiftCardRequest giftCardsItem) { + if (this.giftCards == null) { + this.giftCards = new ArrayList(); } - this.metadata.put(key, metadataItem); + this.giftCards.add(giftCardsItem); return this; } /** - * Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it. - * @return metadata + * The optional gift-card to use for this transaction. At least one gift card is required if no other `payment_method` has been added. + * @return giftCards **/ @javax.annotation.Nullable - @ApiModelProperty(example = "{\"key\":\"value\"}", value = "Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.") + @ApiModelProperty(value = "The optional gift-card to use for this transaction. At least one gift card is required if no other `payment_method` has been added.") - public Map getMetadata() { - return metadata; + public List getGiftCards() { + return giftCards; } - public void setMetadata(Map metadata) { - this.metadata = metadata; + public void setGiftCards(List giftCards) { + this.giftCards = giftCards; } - public TransactionRequest statementDescriptor(StatementDescriptor statementDescriptor) { + public TransactionRequest intent(IntentEnum intent) { - this.statementDescriptor = statementDescriptor; + this.intent = intent; return this; } /** - * Get statementDescriptor - * @return statementDescriptor + * Defines the intent of this API call. This determines the desired initial state of the transaction. * `authorize` - (Default) Optionally approves and then authorizes a transaction but does not capture the funds. * `capture` - Optionally approves and then authorizes and captures the funds of the transaction. + * @return intent **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "capture", value = "Defines the intent of this API call. This determines the desired initial state of the transaction. * `authorize` - (Default) Optionally approves and then authorizes a transaction but does not capture the funds. * `capture` - Optionally approves and then authorizes and captures the funds of the transaction.") - public StatementDescriptor getStatementDescriptor() { - return statementDescriptor; + public IntentEnum getIntent() { + return intent; } - public void setStatementDescriptor(StatementDescriptor statementDescriptor) { - this.statementDescriptor = statementDescriptor; + public void setIntent(IntentEnum intent) { + this.intent = intent; } - public TransactionRequest cartItems(List cartItems) { + public TransactionRequest isSubsequentPayment(Boolean isSubsequentPayment) { - this.cartItems = cartItems; + this.isSubsequentPayment = isSubsequentPayment; return this; } - public TransactionRequest addCartItemsItem(CartItem cartItemsItem) { - if (this.cartItems == null) { - this.cartItems = new ArrayList(); + /** + * Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`. + * @return isSubsequentPayment + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used. The flag can only be `false` (or not set) when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `card_on_file`. The flag can only be set to `true` when the transaction meets one of the following criteria: * It is not `merchant_initiated`. * `payment_source` is set to `recurring` or `installment` and `merchant_initiated` is set to `true`. * `payment_source` is set to `card_on_file`.") + + public Boolean getIsSubsequentPayment() { + return isSubsequentPayment; + } + + + public void setIsSubsequentPayment(Boolean isSubsequentPayment) { + this.isSubsequentPayment = isSubsequentPayment; + } + + + public TransactionRequest merchantInitiated(Boolean merchantInitiated) { + + this.merchantInitiated = merchantInitiated; + return this; + } + + /** + * Indicates whether the transaction was initiated by the merchant (true) or customer (false). + * @return merchantInitiated + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "Indicates whether the transaction was initiated by the merchant (true) or customer (false).") + + public Boolean getMerchantInitiated() { + return merchantInitiated; + } + + + public void setMerchantInitiated(Boolean merchantInitiated) { + this.merchantInitiated = merchantInitiated; + } + + + public TransactionRequest metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public TransactionRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap(); } - this.cartItems.add(cartItemsItem); + this.metadata.put(key, metadataItem); return this; } /** - * An array of cart items that represents the line items of a transaction. - * @return cartItems + * Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it. + * @return metadata **/ @javax.annotation.Nullable - @ApiModelProperty(value = "An array of cart items that represents the line items of a transaction.") + @ApiModelProperty(example = "{\"key\":\"value\"}", value = "Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.") - public List getCartItems() { - return cartItems; + public Map getMetadata() { + return metadata; } - public void setCartItems(List cartItems) { - this.cartItems = cartItems; + public void setMetadata(Map metadata) { + this.metadata = metadata; } - public TransactionRequest previousSchemeTransactionId(String previousSchemeTransactionId) { + public TransactionRequest paymentSource(PaymentSourceEnum paymentSource) { - this.previousSchemeTransactionId = previousSchemeTransactionId; + this.paymentSource = paymentSource; return this; } /** - * A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. - * @return previousSchemeTransactionId + * The source of the transaction. Defaults to `ecommerce`. + * @return paymentSource **/ @javax.annotation.Nullable - @ApiModelProperty(example = "123456789012345", value = "A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID.") + @ApiModelProperty(example = "recurring", value = "The source of the transaction. Defaults to `ecommerce`.") - public String getPreviousSchemeTransactionId() { - return previousSchemeTransactionId; + public PaymentSourceEnum getPaymentSource() { + return paymentSource; } - public void setPreviousSchemeTransactionId(String previousSchemeTransactionId) { - this.previousSchemeTransactionId = previousSchemeTransactionId; + public void setPaymentSource(PaymentSourceEnum paymentSource) { + this.paymentSource = paymentSource; } - public TransactionRequest browserInfo(BrowserInfo browserInfo) { + public TransactionRequest previousSchemeTransactionId(String previousSchemeTransactionId) { - this.browserInfo = browserInfo; + this.previousSchemeTransactionId = previousSchemeTransactionId; return this; } /** - * Information about the browser used by the buyer. - * @return browserInfo + * A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID. + * @return previousSchemeTransactionId **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Information about the browser used by the buyer.") + @ApiModelProperty(example = "123456789012345", value = "A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made, then Gr4vy will populate this value with the identifier returned for that transaction. e.g. the Visa Transaction Identifier, or Mastercard Trace ID.") - public BrowserInfo getBrowserInfo() { - return browserInfo; + public String getPreviousSchemeTransactionId() { + return previousSchemeTransactionId; } - public void setBrowserInfo(BrowserInfo browserInfo) { - this.browserInfo = browserInfo; + public void setPreviousSchemeTransactionId(String previousSchemeTransactionId) { + this.previousSchemeTransactionId = previousSchemeTransactionId; } @@ -628,72 +719,72 @@ public void setShippingDetailsId(UUID shippingDetailsId) { } - public TransactionRequest connectionOptions(ConnectionOptions connectionOptions) { + public TransactionRequest statementDescriptor(StatementDescriptor statementDescriptor) { - this.connectionOptions = connectionOptions; + this.statementDescriptor = statementDescriptor; return this; } /** - * Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake-case, for example `merchant_defined_data`. - * @return connectionOptions + * Get statementDescriptor + * @return statementDescriptor **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Allows for passing optional configuration per connection to take advantage of connection specific features. When provided, the data is only passed to the target connection type to prevent sharing configuration across connections. Please note that each of the keys this object are in kebab-case, for example `cybersource-anti-fraud` as they represent the ID of the connector. All the other keys will be snake-case, for example `merchant_defined_data`.") + @ApiModelProperty(value = "") - public ConnectionOptions getConnectionOptions() { - return connectionOptions; + public StatementDescriptor getStatementDescriptor() { + return statementDescriptor; } - public void setConnectionOptions(ConnectionOptions connectionOptions) { - this.connectionOptions = connectionOptions; + public void setStatementDescriptor(StatementDescriptor statementDescriptor) { + this.statementDescriptor = statementDescriptor; } - public TransactionRequest asyncCapture(Boolean asyncCapture) { + public TransactionRequest store(Boolean store) { - this.asyncCapture = asyncCapture; + this.store = store; return this; } /** - * Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`. - * @return asyncCapture + * Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method. + * @return store **/ @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Whether to capture the transaction asynchronously. - When `async_capture` is `false` (default), the transaction is captured in the same request. - When `async_capture` is `true`, the transaction is automatically captured at a later time. Redirect transactions are not affected by this flag. This flag can only be set to `true` when `intent` is set to `capture`.") + @ApiModelProperty(example = "true", value = "Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set: * The flag has to be set to `true` when the `payment_source` is set to `recurring` or `installment`, and `merchant_initiated` is set to `false`. * The flag has to be set to `false` (or not set) when using a previously vaulted payment method.") - public Boolean getAsyncCapture() { - return asyncCapture; + public Boolean getStore() { + return store; } - public void setAsyncCapture(Boolean asyncCapture) { - this.asyncCapture = asyncCapture; + public void setStore(Boolean store) { + this.store = store; } - public TransactionRequest antiFraudFingerprint(String antiFraudFingerprint) { + public TransactionRequest threeDSecureData(ThreeDSecureDataV1V2 threeDSecureData) { - this.antiFraudFingerprint = antiFraudFingerprint; + this.threeDSecureData = threeDSecureData; return this; } /** - * This field represents the fingerprint data to be passed to the active anti-fraud service. - * @return antiFraudFingerprint + * Get threeDSecureData + * @return threeDSecureData **/ @javax.annotation.Nullable - @ApiModelProperty(example = "yGeBAFYgFmM=", value = "This field represents the fingerprint data to be passed to the active anti-fraud service.") + @ApiModelProperty(value = "") - public String getAntiFraudFingerprint() { - return antiFraudFingerprint; + public ThreeDSecureDataV1V2 getThreeDSecureData() { + return threeDSecureData; } - public void setAntiFraudFingerprint(String antiFraudFingerprint) { - this.antiFraudFingerprint = antiFraudFingerprint; + public void setThreeDSecureData(ThreeDSecureDataV1V2 threeDSecureData) { + this.threeDSecureData = threeDSecureData; } @@ -708,29 +799,32 @@ public boolean equals(Object o) { TransactionRequest transactionRequest = (TransactionRequest) o; return Objects.equals(this.amount, transactionRequest.amount) && Objects.equals(this.currency, transactionRequest.currency) && - Objects.equals(this.country, transactionRequest.country) && Objects.equals(this.paymentMethod, transactionRequest.paymentMethod) && - Objects.equals(this.store, transactionRequest.store) && - Objects.equals(this.intent, transactionRequest.intent) && + Objects.equals(this.antiFraudFingerprint, transactionRequest.antiFraudFingerprint) && + Objects.equals(this.asyncCapture, transactionRequest.asyncCapture) && + Objects.equals(this.browserInfo, transactionRequest.browserInfo) && + Objects.equals(this.buyerExternalIdentifier, transactionRequest.buyerExternalIdentifier) && + Objects.equals(this.buyerId, transactionRequest.buyerId) && + Objects.equals(this.cartItems, transactionRequest.cartItems) && + Objects.equals(this.connectionOptions, transactionRequest.connectionOptions) && + Objects.equals(this.country, transactionRequest.country) && Objects.equals(this.externalIdentifier, transactionRequest.externalIdentifier) && - Objects.equals(this.threeDSecureData, transactionRequest.threeDSecureData) && - Objects.equals(this.merchantInitiated, transactionRequest.merchantInitiated) && - Objects.equals(this.paymentSource, transactionRequest.paymentSource) && + Objects.equals(this.giftCards, transactionRequest.giftCards) && + Objects.equals(this.intent, transactionRequest.intent) && Objects.equals(this.isSubsequentPayment, transactionRequest.isSubsequentPayment) && + Objects.equals(this.merchantInitiated, transactionRequest.merchantInitiated) && Objects.equals(this.metadata, transactionRequest.metadata) && - Objects.equals(this.statementDescriptor, transactionRequest.statementDescriptor) && - Objects.equals(this.cartItems, transactionRequest.cartItems) && + Objects.equals(this.paymentSource, transactionRequest.paymentSource) && Objects.equals(this.previousSchemeTransactionId, transactionRequest.previousSchemeTransactionId) && - Objects.equals(this.browserInfo, transactionRequest.browserInfo) && Objects.equals(this.shippingDetailsId, transactionRequest.shippingDetailsId) && - Objects.equals(this.connectionOptions, transactionRequest.connectionOptions) && - Objects.equals(this.asyncCapture, transactionRequest.asyncCapture) && - Objects.equals(this.antiFraudFingerprint, transactionRequest.antiFraudFingerprint); + Objects.equals(this.statementDescriptor, transactionRequest.statementDescriptor) && + Objects.equals(this.store, transactionRequest.store) && + Objects.equals(this.threeDSecureData, transactionRequest.threeDSecureData); } @Override public int hashCode() { - return Objects.hash(amount, currency, country, paymentMethod, store, intent, externalIdentifier, threeDSecureData, merchantInitiated, paymentSource, isSubsequentPayment, metadata, statementDescriptor, cartItems, previousSchemeTransactionId, browserInfo, shippingDetailsId, connectionOptions, asyncCapture, antiFraudFingerprint); + return Objects.hash(amount, currency, paymentMethod, antiFraudFingerprint, asyncCapture, browserInfo, buyerExternalIdentifier, buyerId, cartItems, connectionOptions, country, externalIdentifier, giftCards, intent, isSubsequentPayment, merchantInitiated, metadata, paymentSource, previousSchemeTransactionId, shippingDetailsId, statementDescriptor, store, threeDSecureData); } @Override @@ -739,24 +833,27 @@ public String toString() { sb.append("class TransactionRequest {\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); + sb.append(" antiFraudFingerprint: ").append(toIndentedString(antiFraudFingerprint)).append("\n"); + sb.append(" asyncCapture: ").append(toIndentedString(asyncCapture)).append("\n"); + sb.append(" browserInfo: ").append(toIndentedString(browserInfo)).append("\n"); + sb.append(" buyerExternalIdentifier: ").append(toIndentedString(buyerExternalIdentifier)).append("\n"); + sb.append(" buyerId: ").append(toIndentedString(buyerId)).append("\n"); + sb.append(" cartItems: ").append(toIndentedString(cartItems)).append("\n"); + sb.append(" connectionOptions: ").append(toIndentedString(connectionOptions)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" threeDSecureData: ").append(toIndentedString(threeDSecureData)).append("\n"); - sb.append(" merchantInitiated: ").append(toIndentedString(merchantInitiated)).append("\n"); - sb.append(" paymentSource: ").append(toIndentedString(paymentSource)).append("\n"); + sb.append(" giftCards: ").append(toIndentedString(giftCards)).append("\n"); + sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); sb.append(" isSubsequentPayment: ").append(toIndentedString(isSubsequentPayment)).append("\n"); + sb.append(" merchantInitiated: ").append(toIndentedString(merchantInitiated)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" statementDescriptor: ").append(toIndentedString(statementDescriptor)).append("\n"); - sb.append(" cartItems: ").append(toIndentedString(cartItems)).append("\n"); + sb.append(" paymentSource: ").append(toIndentedString(paymentSource)).append("\n"); sb.append(" previousSchemeTransactionId: ").append(toIndentedString(previousSchemeTransactionId)).append("\n"); - sb.append(" browserInfo: ").append(toIndentedString(browserInfo)).append("\n"); sb.append(" shippingDetailsId: ").append(toIndentedString(shippingDetailsId)).append("\n"); - sb.append(" connectionOptions: ").append(toIndentedString(connectionOptions)).append("\n"); - sb.append(" asyncCapture: ").append(toIndentedString(asyncCapture)).append("\n"); - sb.append(" antiFraudFingerprint: ").append(toIndentedString(antiFraudFingerprint)).append("\n"); + sb.append(" statementDescriptor: ").append(toIndentedString(statementDescriptor)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" threeDSecureData: ").append(toIndentedString(threeDSecureData)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/gr4vy/api/model/TransactionSummary.java b/src/main/java/com/gr4vy/api/model/TransactionSummary.java index e85852f..559b0b6 100644 --- a/src/main/java/com/gr4vy/api/model/TransactionSummary.java +++ b/src/main/java/com/gr4vy/api/model/TransactionSummary.java @@ -88,78 +88,41 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private UUID id; - public static final String SERIALIZED_NAME_RECONCILIATION_ID = "reconciliation_id"; - @SerializedName(SERIALIZED_NAME_RECONCILIATION_ID) - private String reconciliationId; - - public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; - @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) - private String merchantAccountId; - - /** - * The status of the transaction. The status may change over time as asynchronous processing events occur. - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - PROCESSING("processing"), - - BUYER_APPROVAL_PENDING("buyer_approval_pending"), - - AUTHORIZATION_SUCCEEDED("authorization_succeeded"), - - AUTHORIZATION_FAILED("authorization_failed"), - - AUTHORIZATION_DECLINED("authorization_declined"), - - CAPTURE_PENDING("capture_pending"), - - CAPTURE_SUCCEEDED("capture_succeeded"), - - AUTHORIZATION_VOID_PENDING("authorization_void_pending"), - - AUTHORIZATION_VOIDED("authorization_voided"); + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Integer amount; - private String value; + public static final String SERIALIZED_NAME_AUTHORIZED_AMOUNT = "authorized_amount"; + @SerializedName(SERIALIZED_NAME_AUTHORIZED_AMOUNT) + private Integer authorizedAmount; - StatusEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_BUYER = "buyer"; + @SerializedName(SERIALIZED_NAME_BUYER) + private BuyerSnapshot buyer; - public String getValue() { - return value; - } + public static final String SERIALIZED_NAME_CAPTURED_AMOUNT = "captured_amount"; + @SerializedName(SERIALIZED_NAME_CAPTURED_AMOUNT) + private Integer capturedAmount; - @Override - public String toString() { - return String.valueOf(value); - } + public static final String SERIALIZED_NAME_CHECKOUT_SESSION_ID = "checkout_session_id"; + @SerializedName(SERIALIZED_NAME_CHECKOUT_SESSION_ID) + private UUID checkoutSessionId; - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private String createdAt; - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(value); - } - } - } + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private StatusEnum status; + public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) + private String externalIdentifier; /** * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). @@ -212,53 +175,9 @@ public IntentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_INTENT) private IntentEnum intent; - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - @SerializedName(SERIALIZED_NAME_AMOUNT) - private Integer amount; - - public static final String SERIALIZED_NAME_CAPTURED_AMOUNT = "captured_amount"; - @SerializedName(SERIALIZED_NAME_CAPTURED_AMOUNT) - private Integer capturedAmount; - - public static final String SERIALIZED_NAME_REFUNDED_AMOUNT = "refunded_amount"; - @SerializedName(SERIALIZED_NAME_REFUNDED_AMOUNT) - private Integer refundedAmount; - - public static final String SERIALIZED_NAME_CURRENCY = "currency"; - @SerializedName(SERIALIZED_NAME_CURRENCY) - private String currency; - - public static final String SERIALIZED_NAME_COUNTRY = "country"; - @SerializedName(SERIALIZED_NAME_COUNTRY) - private String country; - - public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; - @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) - private PaymentMethodSnapshot paymentMethod; - - public static final String SERIALIZED_NAME_BUYER = "buyer"; - @SerializedName(SERIALIZED_NAME_BUYER) - private BuyerSnapshot buyer; - - public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private String createdAt; - - public static final String SERIALIZED_NAME_EXTERNAL_IDENTIFIER = "external_identifier"; - @SerializedName(SERIALIZED_NAME_EXTERNAL_IDENTIFIER) - private String externalIdentifier; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private String updatedAt; - - public static final String SERIALIZED_NAME_PAYMENT_SERVICE = "payment_service"; - @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE) - private PaymentServiceSnapshot paymentService; - - public static final String SERIALIZED_NAME_PENDING_REVIEW = "pending_review"; - @SerializedName(SERIALIZED_NAME_PENDING_REVIEW) - private Boolean pendingReview; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_ID = "merchant_account_id"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_ID) + private String merchantAccountId; /** * Gets or Sets method @@ -429,6 +348,18 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_METHOD) private MethodEnum method; + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private PaymentMethodSnapshot paymentMethod; + + public static final String SERIALIZED_NAME_PAYMENT_SERVICE = "payment_service"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SERVICE) + private PaymentServiceSnapshot paymentService; + + public static final String SERIALIZED_NAME_PENDING_REVIEW = "pending_review"; + @SerializedName(SERIALIZED_NAME_PENDING_REVIEW) + private Boolean pendingReview; + public static final String SERIALIZED_NAME_RAW_RESPONSE_CODE = "raw_response_code"; @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_CODE) private String rawResponseCode; @@ -437,9 +368,82 @@ public MethodEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_RAW_RESPONSE_DESCRIPTION) private String rawResponseDescription; - public static final String SERIALIZED_NAME_CHECKOUT_SESSION_ID = "checkout_session_id"; - @SerializedName(SERIALIZED_NAME_CHECKOUT_SESSION_ID) - private UUID checkoutSessionId; + public static final String SERIALIZED_NAME_RECONCILIATION_ID = "reconciliation_id"; + @SerializedName(SERIALIZED_NAME_RECONCILIATION_ID) + private String reconciliationId; + + public static final String SERIALIZED_NAME_REFUNDED_AMOUNT = "refunded_amount"; + @SerializedName(SERIALIZED_NAME_REFUNDED_AMOUNT) + private Integer refundedAmount; + + /** + * The status of the transaction. The status may change over time as asynchronous processing events occur. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PROCESSING("processing"), + + BUYER_APPROVAL_PENDING("buyer_approval_pending"), + + AUTHORIZATION_SUCCEEDED("authorization_succeeded"), + + AUTHORIZATION_FAILED("authorization_failed"), + + AUTHORIZATION_DECLINED("authorization_declined"), + + CAPTURE_PENDING("capture_pending"), + + CAPTURE_SUCCEEDED("capture_succeeded"), + + AUTHORIZATION_VOID_PENDING("authorization_void_pending"), + + AUTHORIZATION_VOIDED("authorization_voided"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private String updatedAt; public TransactionSummary type(TypeEnum type) { @@ -488,170 +492,170 @@ public void setId(UUID id) { } - public TransactionSummary reconciliationId(String reconciliationId) { + public TransactionSummary amount(Integer amount) { - this.reconciliationId = reconciliationId; + this.amount = amount; return this; } /** - * The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers. - * @return reconciliationId + * The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded. + * minimum: 0 + * maximum: 99999999 + * @return amount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "7jZXl4gBUNl0CnaLEnfXbt", value = "The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers.") + @ApiModelProperty(example = "1299", value = "The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded.") - public String getReconciliationId() { - return reconciliationId; + public Integer getAmount() { + return amount; } - public void setReconciliationId(String reconciliationId) { - this.reconciliationId = reconciliationId; + public void setAmount(Integer amount) { + this.amount = amount; } - public TransactionSummary merchantAccountId(String merchantAccountId) { + public TransactionSummary authorizedAmount(Integer authorizedAmount) { - this.merchantAccountId = merchantAccountId; + this.authorizedAmount = authorizedAmount; return this; } /** - * The ID of the merchant account to which this transaction belongs to. - * @return merchantAccountId + * The amount for this transaction that has been authorized for the `payment_method`. This can be less than the `amount` if gift cards were used. + * minimum: 0 + * maximum: 99999999 + * @return authorizedAmount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "default", value = "The ID of the merchant account to which this transaction belongs to.") + @ApiModelProperty(example = "1299", value = "The amount for this transaction that has been authorized for the `payment_method`. This can be less than the `amount` if gift cards were used.") - public String getMerchantAccountId() { - return merchantAccountId; + public Integer getAuthorizedAmount() { + return authorizedAmount; } - public void setMerchantAccountId(String merchantAccountId) { - this.merchantAccountId = merchantAccountId; + public void setAuthorizedAmount(Integer authorizedAmount) { + this.authorizedAmount = authorizedAmount; } - public TransactionSummary status(StatusEnum status) { + public TransactionSummary buyer(BuyerSnapshot buyer) { - this.status = status; + this.buyer = buyer; return this; } /** - * The status of the transaction. The status may change over time as asynchronous processing events occur. - * @return status + * The buyer used for this transaction. + * @return buyer **/ @javax.annotation.Nullable - @ApiModelProperty(example = "processing", value = "The status of the transaction. The status may change over time as asynchronous processing events occur.") + @ApiModelProperty(value = "The buyer used for this transaction.") - public StatusEnum getStatus() { - return status; + public BuyerSnapshot getBuyer() { + return buyer; } - public void setStatus(StatusEnum status) { - this.status = status; + public void setBuyer(BuyerSnapshot buyer) { + this.buyer = buyer; } - public TransactionSummary intent(IntentEnum intent) { + public TransactionSummary capturedAmount(Integer capturedAmount) { - this.intent = intent; + this.capturedAmount = capturedAmount; return this; } /** - * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). - * @return intent + * The captured amount for this transaction. This can be the full value of the `authorized_amount` or less. + * minimum: 0 + * maximum: 99999999 + * @return capturedAmount **/ @javax.annotation.Nullable - @ApiModelProperty(example = "authorize", value = "The original `intent` used when the transaction was [created](#operation/authorize-new-transaction).") + @ApiModelProperty(example = "999", value = "The captured amount for this transaction. This can be the full value of the `authorized_amount` or less.") - public IntentEnum getIntent() { - return intent; + public Integer getCapturedAmount() { + return capturedAmount; } - public void setIntent(IntentEnum intent) { - this.intent = intent; + public void setCapturedAmount(Integer capturedAmount) { + this.capturedAmount = capturedAmount; } - public TransactionSummary amount(Integer amount) { + public TransactionSummary checkoutSessionId(UUID checkoutSessionId) { - this.amount = amount; + this.checkoutSessionId = checkoutSessionId; return this; } /** - * The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded. - * minimum: 0 - * maximum: 99999999 - * @return amount + * The identifier for the checkout session this transaction is associated with. + * @return checkoutSessionId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "1299", value = "The authorized amount for this transaction. This can be more than the actual captured amount and part of this amount may be refunded.") + @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The identifier for the checkout session this transaction is associated with.") - public Integer getAmount() { - return amount; + public UUID getCheckoutSessionId() { + return checkoutSessionId; } - public void setAmount(Integer amount) { - this.amount = amount; + public void setCheckoutSessionId(UUID checkoutSessionId) { + this.checkoutSessionId = checkoutSessionId; } - public TransactionSummary capturedAmount(Integer capturedAmount) { + public TransactionSummary country(String country) { - this.capturedAmount = capturedAmount; + this.country = country; return this; } /** - * The captured amount for this transaction. This can be the total or a portion of the authorized amount. - * minimum: 0 - * maximum: 99999999 - * @return capturedAmount + * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. + * @return country **/ @javax.annotation.Nullable - @ApiModelProperty(example = "999", value = "The captured amount for this transaction. This can be the total or a portion of the authorized amount.") + @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. ") - public Integer getCapturedAmount() { - return capturedAmount; + public String getCountry() { + return country; } - public void setCapturedAmount(Integer capturedAmount) { - this.capturedAmount = capturedAmount; + public void setCountry(String country) { + this.country = country; } - public TransactionSummary refundedAmount(Integer refundedAmount) { + public TransactionSummary createdAt(String createdAt) { - this.refundedAmount = refundedAmount; + this.createdAt = createdAt; return this; } /** - * The refunded amount for this transaction. This can be the total or a portion of the captured amount. - * minimum: 0 - * maximum: 99999999 - * @return refundedAmount + * The date and time when this transaction was created in our system. + * @return createdAt **/ @javax.annotation.Nullable - @ApiModelProperty(example = "100", value = "The refunded amount for this transaction. This can be the total or a portion of the captured amount.") + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was created in our system.") - public Integer getRefundedAmount() { - return refundedAmount; + public String getCreatedAt() { + return createdAt; } - public void setRefundedAmount(Integer refundedAmount) { - this.refundedAmount = refundedAmount; + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; } @@ -678,141 +682,118 @@ public void setCurrency(String currency) { } - public TransactionSummary country(String country) { - - this.country = country; - return this; - } - - /** - * The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. - * @return country - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "US", value = "The 2-letter ISO code of the country of the transaction. This is used to filter the payment services that is used to process the transaction. ") - - public String getCountry() { - return country; - } - - - public void setCountry(String country) { - this.country = country; - } - - - public TransactionSummary paymentMethod(PaymentMethodSnapshot paymentMethod) { + public TransactionSummary externalIdentifier(String externalIdentifier) { - this.paymentMethod = paymentMethod; + this.externalIdentifier = externalIdentifier; return this; } /** - * The payment method used for this transaction. - * @return paymentMethod + * An external identifier that can be used to match the transaction against your own records. + * @return externalIdentifier **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The payment method used for this transaction.") + @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") - public PaymentMethodSnapshot getPaymentMethod() { - return paymentMethod; + public String getExternalIdentifier() { + return externalIdentifier; } - public void setPaymentMethod(PaymentMethodSnapshot paymentMethod) { - this.paymentMethod = paymentMethod; + public void setExternalIdentifier(String externalIdentifier) { + this.externalIdentifier = externalIdentifier; } - public TransactionSummary buyer(BuyerSnapshot buyer) { + public TransactionSummary intent(IntentEnum intent) { - this.buyer = buyer; + this.intent = intent; return this; } /** - * The buyer used for this transaction. - * @return buyer + * The original `intent` used when the transaction was [created](#operation/authorize-new-transaction). + * @return intent **/ @javax.annotation.Nullable - @ApiModelProperty(value = "The buyer used for this transaction.") + @ApiModelProperty(example = "authorize", value = "The original `intent` used when the transaction was [created](#operation/authorize-new-transaction).") - public BuyerSnapshot getBuyer() { - return buyer; + public IntentEnum getIntent() { + return intent; } - public void setBuyer(BuyerSnapshot buyer) { - this.buyer = buyer; + public void setIntent(IntentEnum intent) { + this.intent = intent; } - public TransactionSummary createdAt(String createdAt) { + public TransactionSummary merchantAccountId(String merchantAccountId) { - this.createdAt = createdAt; + this.merchantAccountId = merchantAccountId; return this; } /** - * The date and time when this transaction was created in our system. - * @return createdAt + * The ID of the merchant account to which this transaction belongs to. + * @return merchantAccountId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "2013-07-16T19:23Z", value = "The date and time when this transaction was created in our system.") + @ApiModelProperty(example = "default", value = "The ID of the merchant account to which this transaction belongs to.") - public String getCreatedAt() { - return createdAt; + public String getMerchantAccountId() { + return merchantAccountId; } - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; + public void setMerchantAccountId(String merchantAccountId) { + this.merchantAccountId = merchantAccountId; } - public TransactionSummary externalIdentifier(String externalIdentifier) { + public TransactionSummary method(MethodEnum method) { - this.externalIdentifier = externalIdentifier; + this.method = method; return this; } /** - * An external identifier that can be used to match the transaction against your own records. - * @return externalIdentifier + * Get method + * @return method **/ @javax.annotation.Nullable - @ApiModelProperty(example = "user-789123", value = "An external identifier that can be used to match the transaction against your own records.") + @ApiModelProperty(example = "card", value = "") - public String getExternalIdentifier() { - return externalIdentifier; + public MethodEnum getMethod() { + return method; } - public void setExternalIdentifier(String externalIdentifier) { - this.externalIdentifier = externalIdentifier; + public void setMethod(MethodEnum method) { + this.method = method; } - public TransactionSummary updatedAt(String updatedAt) { + public TransactionSummary paymentMethod(PaymentMethodSnapshot paymentMethod) { - this.updatedAt = updatedAt; + this.paymentMethod = paymentMethod; return this; } /** - * Defines when the transaction was last updated. - * @return updatedAt + * The payment method used for this transaction. + * @return paymentMethod **/ @javax.annotation.Nullable - @ApiModelProperty(value = "Defines when the transaction was last updated.") + @ApiModelProperty(value = "The payment method used for this transaction.") - public String getUpdatedAt() { - return updatedAt; + public PaymentMethodSnapshot getPaymentMethod() { + return paymentMethod; } - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; + public void setPaymentMethod(PaymentMethodSnapshot paymentMethod) { + this.paymentMethod = paymentMethod; } @@ -862,29 +843,6 @@ public void setPendingReview(Boolean pendingReview) { } - public TransactionSummary method(MethodEnum method) { - - this.method = method; - return this; - } - - /** - * Get method - * @return method - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "card", value = "") - - public MethodEnum getMethod() { - return method; - } - - - public void setMethod(MethodEnum method) { - this.method = method; - } - - public TransactionSummary rawResponseCode(String rawResponseCode) { this.rawResponseCode = rawResponseCode; @@ -931,26 +889,97 @@ public void setRawResponseDescription(String rawResponseDescription) { } - public TransactionSummary checkoutSessionId(UUID checkoutSessionId) { + public TransactionSummary reconciliationId(String reconciliationId) { - this.checkoutSessionId = checkoutSessionId; + this.reconciliationId = reconciliationId; return this; } /** - * The identifier for the checkout session this transaction is associated with. - * @return checkoutSessionId + * The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers. + * @return reconciliationId **/ @javax.annotation.Nullable - @ApiModelProperty(example = "fe26475d-ec3e-4884-9553-f7356683f7f9", value = "The identifier for the checkout session this transaction is associated with.") + @ApiModelProperty(example = "7jZXl4gBUNl0CnaLEnfXbt", value = "The base62 encoded transaction ID. This represents a shorter version of this transaction's `id` which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers.") - public UUID getCheckoutSessionId() { - return checkoutSessionId; + public String getReconciliationId() { + return reconciliationId; } - public void setCheckoutSessionId(UUID checkoutSessionId) { - this.checkoutSessionId = checkoutSessionId; + public void setReconciliationId(String reconciliationId) { + this.reconciliationId = reconciliationId; + } + + + public TransactionSummary refundedAmount(Integer refundedAmount) { + + this.refundedAmount = refundedAmount; + return this; + } + + /** + * The refunded amount for this transaction. This can be the full value of the `captured_amount` or less. + * minimum: 0 + * maximum: 99999999 + * @return refundedAmount + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "100", value = "The refunded amount for this transaction. This can be the full value of the `captured_amount` or less.") + + public Integer getRefundedAmount() { + return refundedAmount; + } + + + public void setRefundedAmount(Integer refundedAmount) { + this.refundedAmount = refundedAmount; + } + + + public TransactionSummary status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the transaction. The status may change over time as asynchronous processing events occur. + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "processing", value = "The status of the transaction. The status may change over time as asynchronous processing events occur.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public TransactionSummary updatedAt(String updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Defines when the transaction was last updated. + * @return updatedAt + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2013-07-16T19:23Z", value = "Defines when the transaction was last updated.") + + public String getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; } @@ -965,31 +994,32 @@ public boolean equals(Object o) { TransactionSummary transactionSummary = (TransactionSummary) o; return Objects.equals(this.type, transactionSummary.type) && Objects.equals(this.id, transactionSummary.id) && - Objects.equals(this.reconciliationId, transactionSummary.reconciliationId) && - Objects.equals(this.merchantAccountId, transactionSummary.merchantAccountId) && - Objects.equals(this.status, transactionSummary.status) && - Objects.equals(this.intent, transactionSummary.intent) && Objects.equals(this.amount, transactionSummary.amount) && + Objects.equals(this.authorizedAmount, transactionSummary.authorizedAmount) && + Objects.equals(this.buyer, transactionSummary.buyer) && Objects.equals(this.capturedAmount, transactionSummary.capturedAmount) && - Objects.equals(this.refundedAmount, transactionSummary.refundedAmount) && - Objects.equals(this.currency, transactionSummary.currency) && + Objects.equals(this.checkoutSessionId, transactionSummary.checkoutSessionId) && Objects.equals(this.country, transactionSummary.country) && - Objects.equals(this.paymentMethod, transactionSummary.paymentMethod) && - Objects.equals(this.buyer, transactionSummary.buyer) && Objects.equals(this.createdAt, transactionSummary.createdAt) && + Objects.equals(this.currency, transactionSummary.currency) && Objects.equals(this.externalIdentifier, transactionSummary.externalIdentifier) && - Objects.equals(this.updatedAt, transactionSummary.updatedAt) && + Objects.equals(this.intent, transactionSummary.intent) && + Objects.equals(this.merchantAccountId, transactionSummary.merchantAccountId) && + Objects.equals(this.method, transactionSummary.method) && + Objects.equals(this.paymentMethod, transactionSummary.paymentMethod) && Objects.equals(this.paymentService, transactionSummary.paymentService) && Objects.equals(this.pendingReview, transactionSummary.pendingReview) && - Objects.equals(this.method, transactionSummary.method) && Objects.equals(this.rawResponseCode, transactionSummary.rawResponseCode) && Objects.equals(this.rawResponseDescription, transactionSummary.rawResponseDescription) && - Objects.equals(this.checkoutSessionId, transactionSummary.checkoutSessionId); + Objects.equals(this.reconciliationId, transactionSummary.reconciliationId) && + Objects.equals(this.refundedAmount, transactionSummary.refundedAmount) && + Objects.equals(this.status, transactionSummary.status) && + Objects.equals(this.updatedAt, transactionSummary.updatedAt); } @Override public int hashCode() { - return Objects.hash(type, id, reconciliationId, merchantAccountId, status, intent, amount, capturedAmount, refundedAmount, currency, country, paymentMethod, buyer, createdAt, externalIdentifier, updatedAt, paymentService, pendingReview, method, rawResponseCode, rawResponseDescription, checkoutSessionId); + return Objects.hash(type, id, amount, authorizedAmount, buyer, capturedAmount, checkoutSessionId, country, createdAt, currency, externalIdentifier, intent, merchantAccountId, method, paymentMethod, paymentService, pendingReview, rawResponseCode, rawResponseDescription, reconciliationId, refundedAmount, status, updatedAt); } @Override @@ -998,26 +1028,27 @@ public String toString() { sb.append("class TransactionSummary {\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" reconciliationId: ").append(toIndentedString(reconciliationId)).append("\n"); - sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" authorizedAmount: ").append(toIndentedString(authorizedAmount)).append("\n"); + sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); sb.append(" capturedAmount: ").append(toIndentedString(capturedAmount)).append("\n"); - sb.append(" refundedAmount: ").append(toIndentedString(refundedAmount)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" checkoutSessionId: ").append(toIndentedString(checkoutSessionId)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" buyer: ").append(toIndentedString(buyer)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" externalIdentifier: ").append(toIndentedString(externalIdentifier)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" intent: ").append(toIndentedString(intent)).append("\n"); + sb.append(" merchantAccountId: ").append(toIndentedString(merchantAccountId)).append("\n"); + sb.append(" method: ").append(toIndentedString(method)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" paymentService: ").append(toIndentedString(paymentService)).append("\n"); sb.append(" pendingReview: ").append(toIndentedString(pendingReview)).append("\n"); - sb.append(" method: ").append(toIndentedString(method)).append("\n"); sb.append(" rawResponseCode: ").append(toIndentedString(rawResponseCode)).append("\n"); sb.append(" rawResponseDescription: ").append(toIndentedString(rawResponseDescription)).append("\n"); - sb.append(" checkoutSessionId: ").append(toIndentedString(checkoutSessionId)).append("\n"); + sb.append(" reconciliationId: ").append(toIndentedString(reconciliationId)).append("\n"); + sb.append(" refundedAmount: ").append(toIndentedString(refundedAmount)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); }