From 9e5a45125dfe41132383c3be4d1ad5cff2bca46e Mon Sep 17 00:00:00 2001 From: bitbucket-pipelines Date: Fri, 12 Jul 2024 09:20:01 +0000 Subject: [PATCH] Generating Java SDK. --- .openapi-generator/FILES | 129 +- README.md | 6 +- build.gradle | 4 +- build.sbt | 2 +- docs/AuthorizationDetails.md | 20 + docs/Card.md | 2 +- docs/CardlessEMI.md | 4 +- docs/CreateOrderSettlementRequestBody.md | 15 + ...reateOrderSettlementRequestBodyMetaData.md | 14 + docs/CreatePlanRequest.md | 23 + docs/CreateSubscriptionPaymentAuthResponse.md | 23 + ...iptionPaymentAuthResponseFailureDetails.md | 13 + ...CreateSubscriptionPaymentChargeResponse.md | 23 + docs/CreateSubscriptionPaymentRequest.md | 21 + docs/CreateSubscriptionRefundRequest.md | 20 + docs/CreateSubscriptionRequest.md | 23 + ...SubscriptionRequestAuthorizationDetails.md | 14 + docs/CreateSubscriptionRequestPlanDetails.md | 22 + ...eateSubscriptionRequestSubscriptionMeta.md | 14 + docs/CreateTerminalTransactionRequest.md | 1 + docs/CreateVendorRequest.md | 2 +- docs/CustomerDetails.md | 4 +- docs/CustomerDetailsResponse.md | 21 + docs/EligibilityMethodItem.md | 17 + docs/EligibilityMethodItemEntityDetails.md | 17 + ...dItemEntityDetailsAvailableHandlesInner.md | 14 + docs/EntitySimulationRequest.md | 27 + docs/EntitySimulationResponse.md | 15 + docs/LinkCustomerDetailsEntity.md | 50 + docs/ManageSubscriptionPaymentRequest.md | 17 + ...SubscriptionPaymentRequestActionDetails.md | 14 + docs/ManageSubscriptionRequest.md | 16 + .../ManageSubscriptionRequestActionDetails.md | 15 + docs/OrderEntity.md | 2 +- docs/OrderMeta.md | 2 +- docs/PlanEntity.md | 24 + docs/SettlementsApi.md | 78 + docs/SimulateRequest.md | 25 + docs/SimulationApi.md | 166 ++ docs/SimulationResponse.md | 17 + docs/SubsCreatePayment200Response.md | 22 + docs/SubscriptionApi.md | 1061 +++++++ docs/SubscriptionBankDetails.md | 16 + docs/SubscriptionCustomerDetails.md | 21 + docs/SubscriptionEligibilityRequest.md | 15 + docs/SubscriptionEligibilityRequestFilters.md | 14 + docs/SubscriptionEligibilityRequestQueries.md | 14 + docs/SubscriptionEligibilityResponse.md | 14 + docs/SubscriptionEntity.md | 25 + docs/SubscriptionEntitySubscriptionMeta.md | 14 + docs/SubscriptionPaymentEntity.md | 28 + docs/SubscriptionPaymentRefundEntity.md | 21 + docs/SubscriptionPaymentSplitItem.md | 15 + docs/TerminalDetails.md | 2 +- docs/TerminateOrderRequest.md | 2 +- docs/UpdateVendorRequest.md | 2 +- docs/UpdateVendorResponse.md | 2 +- docs/UpdateVendorResponseRelatedDocsInner.md | 17 + docs/UploadPnachImageResponse.md | 17 + docs/VendorDocumentsResponse.md | 2 +- docs/VendorEntity.md | 3 +- pom.xml | 2 +- src/main/java/com/cashfree/ApiException.java | 2 +- src/main/java/com/cashfree/Cashfree.java | 2549 +++++++++++++++-- src/main/java/com/cashfree/Configuration.java | 4 +- src/main/java/com/cashfree/JSON.java | 41 +- src/main/java/com/cashfree/Pair.java | 2 +- src/main/java/com/cashfree/StringUtil.java | 2 +- .../java/com/cashfree/auth/ApiKeyAuth.java | 2 +- .../com/cashfree/auth/HttpBearerAuth.java | 2 +- .../cashfree/model/AbstractOpenApiSchema.java | 2 +- .../model/AdjustVendorBalanceRequest.java | 2 +- .../model/AdjustVendorBalanceResponse.java | 2 +- .../java/com/cashfree/model/ApiError.java | 2 +- .../java/com/cashfree/model/ApiError404.java | 2 +- .../java/com/cashfree/model/ApiError409.java | 2 +- .../java/com/cashfree/model/ApiError502.java | 2 +- src/main/java/com/cashfree/model/App.java | 2 +- .../com/cashfree/model/AppPaymentMethod.java | 2 +- .../cashfree/model/AuthenticationError.java | 2 +- .../cashfree/model/AuthorizationDetails.java | 415 +++ .../model/AuthorizationInPaymentsEntity.java | 2 +- .../cashfree/model/AuthorizeOrderRequest.java | 2 +- .../com/cashfree/model/BadRequestError.java | 2 +- .../com/cashfree/model/BalanceDetails.java | 2 +- .../java/com/cashfree/model/BankDetails.java | 2 +- .../java/com/cashfree/model/Banktransfer.java | 2 +- .../model/BanktransferPaymentMethod.java | 2 +- src/main/java/com/cashfree/model/Card.java | 6 +- src/main/java/com/cashfree/model/CardEMI.java | 2 +- .../cashfree/model/CardEMIPaymentMethod.java | 2 +- .../java/com/cashfree/model/CardOffer.java | 2 +- .../com/cashfree/model/CardPaymentMethod.java | 2 +- .../java/com/cashfree/model/CardlessEMI.java | 12 +- .../com/cashfree/model/CardlessEMIEntity.java | 2 +- .../model/CardlessEMIPaymentMethod.java | 2 +- .../cashfree/model/CardlessEMIQueries.java | 2 +- .../com/cashfree/model/CashbackDetails.java | 2 +- .../com/cashfree/model/ChargesDetails.java | 2 +- .../cashfree/model/CreateCustomerRequest.java | 2 +- .../com/cashfree/model/CreateLinkRequest.java | 2 +- .../cashfree/model/CreateOfferRequest.java | 2 +- .../cashfree/model/CreateOrderRequest.java | 2 +- .../CreateOrderSettlementRequestBody.java | 266 ++ ...ateOrderSettlementRequestBodyMetaData.java | 245 ++ .../com/cashfree/model/CreatePlanRequest.java | 526 ++++ ...CreateSubscriptionPaymentAuthResponse.java | 530 ++++ ...tionPaymentAuthResponseFailureDetails.java | 215 ++ ...eateSubscriptionPaymentChargeResponse.java | 530 ++++ .../CreateSubscriptionPaymentRequest.java | 467 +++ .../CreateSubscriptionRefundRequest.java | 438 +++ .../model/CreateSubscriptionRequest.java | 581 ++++ ...bscriptionRequestAuthorizationDetails.java | 239 ++ .../CreateSubscriptionRequestPlanDetails.java | 507 ++++ ...teSubscriptionRequestSubscriptionMeta.java | 262 ++ .../cashfree/model/CreateTerminalRequest.java | 2 +- .../CreateTerminalRequestTerminalMeta.java | 2 +- .../CreateTerminalTransactionRequest.java | 35 +- .../cashfree/model/CreateVendorRequest.java | 6 +- .../cashfree/model/CreateVendorResponse.java | 2 +- .../com/cashfree/model/CryptogramEntity.java | 2 +- .../com/cashfree/model/CustomerDetails.java | 15 +- .../model/CustomerDetailsCardlessEMI.java | 2 +- .../model/CustomerDetailsResponse.java | 456 +++ .../com/cashfree/model/CustomerEntity.java | 2 +- .../com/cashfree/model/DiscountDetails.java | 2 +- .../java/com/cashfree/model/EMIOffer.java | 2 +- .../com/cashfree/model/EMIPlansArray.java | 2 +- .../cashfree/model/ESOrderReconRequest.java | 2 +- .../model/ESOrderReconRequestFilters.java | 2 +- .../model/ESOrderReconRequestPagination.java | 2 +- .../cashfree/model/ESOrderReconResponse.java | 2 +- .../model/ESOrderReconResponseDataInner.java | 2 +- ...econResponseDataInnerOrderSplitsInner.java | 2 +- ...seDataInnerOrderSplitsInnerSplitInner.java | 2 +- .../model/EligibilityCardlessEMIEntity.java | 2 +- .../EligibilityFetchCardlessEMIRequest.java | 2 +- .../model/EligibilityFetchOffersRequest.java | 2 +- .../EligibilityFetchPaylaterRequest.java | 2 +- ...EligibilityFetchPaymentMethodsRequest.java | 2 +- .../cashfree/model/EligibilityMethodItem.java | 319 +++ .../EligibilityMethodItemEntityDetails.java | 469 +++ ...temEntityDetailsAvailableHandlesInner.java | 250 ++ .../model/EligibilityOfferEntity.java | 2 +- .../model/EligibilityPaylaterEntity.java | 2 +- .../EligibilityPaymentMethodsEntity.java | 2 +- ...lityPaymentMethodsEntityEntityDetails.java | 2 +- .../model/EntitySimulationRequest.java | 319 +++ .../model/EntitySimulationResponse.java | 266 ++ .../model/ErrorDetailsInPaymentsEntity.java | 2 +- .../com/cashfree/model/FetchReconRequest.java | 2 +- .../model/FetchReconRequestFilters.java | 2 +- .../model/FetchReconRequestPagination.java | 2 +- .../model/FetchSettlementsRequest.java | 2 +- .../model/FetchSettlementsRequestFilters.java | 2 +- .../FetchSettlementsRequestPagination.java | 2 +- .../model/FetchTerminalQRCodesEntity.java | 2 +- .../com/cashfree/model/IdempotencyError.java | 2 +- .../com/cashfree/model/InstrumentEntity.java | 2 +- .../com/cashfree/model/InstrumentWebhook.java | 2 +- .../cashfree/model/InstrumentWebhookData.java | 2 +- .../model/InstrumentWebhookDataEntity.java | 2 +- .../java/com/cashfree/model/KycDetails.java | 2 +- .../model/LinkCustomerDetailsEntity.java | 228 +- .../java/com/cashfree/model/LinkEntity.java | 2 +- .../model/LinkMetaResponseEntity.java | 2 +- .../com/cashfree/model/LinkNotifyEntity.java | 2 +- .../ManageSubscriptionPaymentRequest.java | 342 +++ ...bscriptionPaymentRequestActionDetails.java | 216 ++ .../model/ManageSubscriptionRequest.java | 306 ++ ...anageSubscriptionRequestActionDetails.java | 251 ++ .../model/NetBankingPaymentMethod.java | 2 +- .../java/com/cashfree/model/Netbanking.java | 2 +- .../java/com/cashfree/model/OfferAll.java | 2 +- .../java/com/cashfree/model/OfferCard.java | 2 +- .../java/com/cashfree/model/OfferDetails.java | 2 +- .../java/com/cashfree/model/OfferEMI.java | 2 +- .../java/com/cashfree/model/OfferEntity.java | 2 +- .../java/com/cashfree/model/OfferFilters.java | 2 +- .../java/com/cashfree/model/OfferMeta.java | 2 +- src/main/java/com/cashfree/model/OfferNB.java | 2 +- .../com/cashfree/model/OfferNBNetbanking.java | 2 +- .../com/cashfree/model/OfferPaylater.java | 2 +- .../java/com/cashfree/model/OfferQueries.java | 2 +- .../java/com/cashfree/model/OfferTnc.java | 2 +- .../java/com/cashfree/model/OfferUPI.java | 2 +- .../com/cashfree/model/OfferValidations.java | 2 +- .../model/OfferValidationsPaymentMethod.java | 2 +- .../java/com/cashfree/model/OfferWallet.java | 2 +- .../model/OrderAuthenticateEntity.java | 2 +- .../OrderAuthenticatePaymentRequest.java | 2 +- .../model/OrderCreateRefundRequest.java | 2 +- .../java/com/cashfree/model/OrderEntity.java | 16 +- .../java/com/cashfree/model/OrderMeta.java | 6 +- .../java/com/cashfree/model/OrderPayData.java | 2 +- .../com/cashfree/model/PayOrderEntity.java | 2 +- .../com/cashfree/model/PayOrderRequest.java | 2 +- .../model/PayOrderRequestPaymentMethod.java | 2 +- .../java/com/cashfree/model/Paylater.java | 2 +- .../com/cashfree/model/PaylaterEntity.java | 2 +- .../com/cashfree/model/PaylaterOffer.java | 2 +- .../cashfree/model/PaylaterPaymentMethod.java | 2 +- .../com/cashfree/model/PaymentEntity.java | 2 +- .../model/PaymentEntityPaymentMethod.java | 2 +- .../model/PaymentLinkCustomerDetails.java | 2 +- .../model/PaymentLinkOrderEntity.java | 2 +- .../PaymentMethodAppInPaymentsEntity.java | 2 +- .../PaymentMethodAppInPaymentsEntityApp.java | 2 +- ...entMethodBankTransferInPaymentsEntity.java | 2 +- ...kTransferInPaymentsEntityBanktransfer.java | 2 +- .../PaymentMethodCardEMIInPaymentsEntity.java | 2 +- ...ymentMethodCardEMIInPaymentsEntityEmi.java | 2 +- ...dCardEMIInPaymentsEntityEmiEmiDetails.java | 2 +- .../PaymentMethodCardInPaymentsEntity.java | 2 +- ...PaymentMethodCardInPaymentsEntityCard.java | 2 +- ...mentMethodCardlessEMIInPaymentsEntity.java | 2 +- ...ymentMethodNetBankingInPaymentsEntity.java | 2 +- ...dNetBankingInPaymentsEntityNetbanking.java | 2 +- ...PaymentMethodPaylaterInPaymentsEntity.java | 2 +- .../PaymentMethodUPIInPaymentsEntity.java | 2 +- .../PaymentMethodUPIInPaymentsEntityUpi.java | 2 +- .../cashfree/model/PaymentMethodsFilters.java | 2 +- .../cashfree/model/PaymentMethodsQueries.java | 2 +- .../cashfree/model/PaymentModeDetails.java | 2 +- .../com/cashfree/model/PaymentWebhook.java | 2 +- .../model/PaymentWebhookCustomerEntity.java | 2 +- .../model/PaymentWebhookDataEntity.java | 2 +- .../model/PaymentWebhookErrorEntity.java | 2 +- .../PaymentWebhookGatewayDetailsEntity.java | 2 +- .../model/PaymentWebhookOrderEntity.java | 2 +- .../java/com/cashfree/model/PlanEntity.java | 543 ++++ .../com/cashfree/model/RateLimitError.java | 2 +- .../java/com/cashfree/model/ReconEntity.java | 2 +- .../cashfree/model/ReconEntityDataInner.java | 2 +- .../java/com/cashfree/model/RefundEntity.java | 2 +- .../java/com/cashfree/model/RefundSpeed.java | 2 +- .../com/cashfree/model/RefundWebhook.java | 2 +- .../model/RefundWebhookDataEntity.java | 2 +- .../cashfree/model/SavedInstrumentMeta.java | 2 +- .../com/cashfree/model/ScheduleOption.java | 2 +- .../com/cashfree/model/SettlementEntity.java | 2 +- .../model/SettlementFetchReconRequest.java | 2 +- .../cashfree/model/SettlementReconEntity.java | 2 +- .../model/SettlementReconEntityDataInner.java | 2 +- .../com/cashfree/model/SettlementWebhook.java | 2 +- .../model/SettlementWebhookDataEntity.java | 2 +- .../com/cashfree/model/SimulateRequest.java | 349 +++ .../cashfree/model/SimulationResponse.java | 325 +++ .../model/SplitAfterPaymentRequest.java | 2 +- .../SplitAfterPaymentRequestSplitInner.java | 2 +- .../model/SplitAfterPaymentResponse.java | 2 +- .../cashfree/model/StaticSplitRequest.java | 2 +- .../model/StaticSplitRequestSchemeInner.java | 2 +- .../cashfree/model/StaticSplitResponse.java | 2 +- .../model/StaticSplitResponseSchemeInner.java | 2 +- .../model/SubsCreatePayment200Response.java | 283 ++ .../model/SubscriptionBankDetails.java | 298 ++ .../model/SubscriptionCustomerDetails.java | 477 +++ .../model/SubscriptionEligibilityRequest.java | 269 ++ ...SubscriptionEligibilityRequestFilters.java | 228 ++ ...SubscriptionEligibilityRequestQueries.java | 231 ++ .../SubscriptionEligibilityResponse.java | 249 ++ .../cashfree/model/SubscriptionEntity.java | 644 +++++ .../SubscriptionEntitySubscriptionMeta.java | 216 ++ .../model/SubscriptionPaymentEntity.java | 703 +++++ .../SubscriptionPaymentRefundEntity.java | 456 +++ .../model/SubscriptionPaymentSplitItem.java | 246 ++ .../com/cashfree/model/TerminalDetails.java | 11 +- .../com/cashfree/model/TerminalEntity.java | 2 +- .../cashfree/model/TerminalPaymentEntity.java | 2 +- .../model/TerminalTransactionEntity.java | 2 +- .../cashfree/model/TerminateOrderRequest.java | 6 +- .../com/cashfree/model/TransferDetails.java | 2 +- .../model/TransferDetailsTagsInner.java | 2 +- .../cashfree/model/UPIAuthorizeDetails.java | 2 +- .../com/cashfree/model/UPIPaymentMethod.java | 2 +- .../cashfree/model/UpdateTerminalEntity.java | 2 +- .../cashfree/model/UpdateTerminalRequest.java | 2 +- .../UpdateTerminalRequestTerminalMeta.java | 2 +- .../model/UpdateTerminalStatusRequest.java | 2 +- .../cashfree/model/UpdateVendorRequest.java | 6 +- .../cashfree/model/UpdateVendorResponse.java | 18 +- .../UpdateVendorResponseRelatedDocsInner.java | 355 +++ src/main/java/com/cashfree/model/Upi.java | 2 +- .../java/com/cashfree/model/UpiDetails.java | 2 +- .../model/UploadPnachImageResponse.java | 321 +++ .../cashfree/model/UploadTerminalDocs.java | 2 +- .../model/UploadTerminalDocsEntity.java | 2 +- .../model/UploadVendorDocumentsResponse.java | 2 +- .../com/cashfree/model/VendorBalance.java | 2 +- .../model/VendorBalanceTransferCharges.java | 2 +- .../model/VendorDocumentDownloadResponse.java | 2 +- .../model/VendorDocumentsResponse.java | 18 +- .../java/com/cashfree/model/VendorEntity.java | 55 +- .../java/com/cashfree/model/VendorSplit.java | 2 +- .../java/com/cashfree/model/WalletOffer.java | 2 +- 296 files changed, 19737 insertions(+), 522 deletions(-) create mode 100644 docs/AuthorizationDetails.md create mode 100644 docs/CreateOrderSettlementRequestBody.md create mode 100644 docs/CreateOrderSettlementRequestBodyMetaData.md create mode 100644 docs/CreatePlanRequest.md create mode 100644 docs/CreateSubscriptionPaymentAuthResponse.md create mode 100644 docs/CreateSubscriptionPaymentAuthResponseFailureDetails.md create mode 100644 docs/CreateSubscriptionPaymentChargeResponse.md create mode 100644 docs/CreateSubscriptionPaymentRequest.md create mode 100644 docs/CreateSubscriptionRefundRequest.md create mode 100644 docs/CreateSubscriptionRequest.md create mode 100644 docs/CreateSubscriptionRequestAuthorizationDetails.md create mode 100644 docs/CreateSubscriptionRequestPlanDetails.md create mode 100644 docs/CreateSubscriptionRequestSubscriptionMeta.md create mode 100644 docs/CustomerDetailsResponse.md create mode 100644 docs/EligibilityMethodItem.md create mode 100644 docs/EligibilityMethodItemEntityDetails.md create mode 100644 docs/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md create mode 100644 docs/EntitySimulationRequest.md create mode 100644 docs/EntitySimulationResponse.md create mode 100644 docs/ManageSubscriptionPaymentRequest.md create mode 100644 docs/ManageSubscriptionPaymentRequestActionDetails.md create mode 100644 docs/ManageSubscriptionRequest.md create mode 100644 docs/ManageSubscriptionRequestActionDetails.md create mode 100644 docs/PlanEntity.md create mode 100644 docs/SimulateRequest.md create mode 100644 docs/SimulationApi.md create mode 100644 docs/SimulationResponse.md create mode 100644 docs/SubsCreatePayment200Response.md create mode 100644 docs/SubscriptionApi.md create mode 100644 docs/SubscriptionBankDetails.md create mode 100644 docs/SubscriptionCustomerDetails.md create mode 100644 docs/SubscriptionEligibilityRequest.md create mode 100644 docs/SubscriptionEligibilityRequestFilters.md create mode 100644 docs/SubscriptionEligibilityRequestQueries.md create mode 100644 docs/SubscriptionEligibilityResponse.md create mode 100644 docs/SubscriptionEntity.md create mode 100644 docs/SubscriptionEntitySubscriptionMeta.md create mode 100644 docs/SubscriptionPaymentEntity.md create mode 100644 docs/SubscriptionPaymentRefundEntity.md create mode 100644 docs/SubscriptionPaymentSplitItem.md create mode 100644 docs/UpdateVendorResponseRelatedDocsInner.md create mode 100644 docs/UploadPnachImageResponse.md create mode 100644 src/main/java/com/cashfree/model/AuthorizationDetails.java create mode 100644 src/main/java/com/cashfree/model/CreateOrderSettlementRequestBody.java create mode 100644 src/main/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaData.java create mode 100644 src/main/java/com/cashfree/model/CreatePlanRequest.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponse.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetails.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponse.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionPaymentRequest.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionRefundRequest.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionRequest.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetails.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionRequestPlanDetails.java create mode 100644 src/main/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMeta.java create mode 100644 src/main/java/com/cashfree/model/CustomerDetailsResponse.java create mode 100644 src/main/java/com/cashfree/model/EligibilityMethodItem.java create mode 100644 src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetails.java create mode 100644 src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.java create mode 100644 src/main/java/com/cashfree/model/EntitySimulationRequest.java create mode 100644 src/main/java/com/cashfree/model/EntitySimulationResponse.java create mode 100644 src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequest.java create mode 100644 src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetails.java create mode 100644 src/main/java/com/cashfree/model/ManageSubscriptionRequest.java create mode 100644 src/main/java/com/cashfree/model/ManageSubscriptionRequestActionDetails.java create mode 100644 src/main/java/com/cashfree/model/PlanEntity.java create mode 100644 src/main/java/com/cashfree/model/SimulateRequest.java create mode 100644 src/main/java/com/cashfree/model/SimulationResponse.java create mode 100644 src/main/java/com/cashfree/model/SubsCreatePayment200Response.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionBankDetails.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionCustomerDetails.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEligibilityRequest.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEligibilityRequestFilters.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEligibilityRequestQueries.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEligibilityResponse.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEntity.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionEntitySubscriptionMeta.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionPaymentEntity.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionPaymentRefundEntity.java create mode 100644 src/main/java/com/cashfree/model/SubscriptionPaymentSplitItem.java create mode 100644 src/main/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInner.java create mode 100644 src/main/java/com/cashfree/model/UploadPnachImageResponse.java diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4c08dda4..004b89f7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -15,6 +15,7 @@ docs/ApiError502.md docs/App.md docs/AppPaymentMethod.md docs/AuthenticationError.md +docs/AuthorizationDetails.md docs/AuthorizationInPaymentsEntity.md docs/AuthorizeOrderRequest.md docs/BadRequestError.md @@ -37,6 +38,18 @@ docs/CreateCustomerRequest.md docs/CreateLinkRequest.md docs/CreateOfferRequest.md docs/CreateOrderRequest.md +docs/CreateOrderSettlementRequestBody.md +docs/CreateOrderSettlementRequestBodyMetaData.md +docs/CreatePlanRequest.md +docs/CreateSubscriptionPaymentAuthResponse.md +docs/CreateSubscriptionPaymentAuthResponseFailureDetails.md +docs/CreateSubscriptionPaymentChargeResponse.md +docs/CreateSubscriptionPaymentRequest.md +docs/CreateSubscriptionRefundRequest.md +docs/CreateSubscriptionRequest.md +docs/CreateSubscriptionRequestAuthorizationDetails.md +docs/CreateSubscriptionRequestPlanDetails.md +docs/CreateSubscriptionRequestSubscriptionMeta.md docs/CreateTerminalRequest.md docs/CreateTerminalRequestTerminalMeta.md docs/CreateTerminalTransactionRequest.md @@ -45,6 +58,7 @@ docs/CreateVendorResponse.md docs/CryptogramEntity.md docs/CustomerDetails.md docs/CustomerDetailsCardlessEMI.md +docs/CustomerDetailsResponse.md docs/CustomerEntity.md docs/CustomersApi.md docs/DiscountDetails.md @@ -64,10 +78,15 @@ docs/EligibilityFetchCardlessEMIRequest.md docs/EligibilityFetchOffersRequest.md docs/EligibilityFetchPaylaterRequest.md docs/EligibilityFetchPaymentMethodsRequest.md +docs/EligibilityMethodItem.md +docs/EligibilityMethodItemEntityDetails.md +docs/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md docs/EligibilityOfferEntity.md docs/EligibilityPaylaterEntity.md docs/EligibilityPaymentMethodsEntity.md docs/EligibilityPaymentMethodsEntityEntityDetails.md +docs/EntitySimulationRequest.md +docs/EntitySimulationResponse.md docs/ErrorDetailsInPaymentsEntity.md docs/FetchReconRequest.md docs/FetchReconRequestFilters.md @@ -86,6 +105,10 @@ docs/LinkCustomerDetailsEntity.md docs/LinkEntity.md docs/LinkMetaResponseEntity.md docs/LinkNotifyEntity.md +docs/ManageSubscriptionPaymentRequest.md +docs/ManageSubscriptionPaymentRequestActionDetails.md +docs/ManageSubscriptionRequest.md +docs/ManageSubscriptionRequestActionDetails.md docs/NetBankingPaymentMethod.md docs/Netbanking.md docs/OfferAll.md @@ -151,6 +174,7 @@ docs/PaymentWebhookGatewayDetailsEntity.md docs/PaymentWebhookOrderEntity.md docs/PaymentsApi.md docs/PgReconciliationApi.md +docs/PlanEntity.md docs/RateLimitError.md docs/ReconEntity.md docs/ReconEntityDataInner.md @@ -169,6 +193,9 @@ docs/SettlementReconciliationApi.md docs/SettlementWebhook.md docs/SettlementWebhookDataEntity.md docs/SettlementsApi.md +docs/SimulateRequest.md +docs/SimulationApi.md +docs/SimulationResponse.md docs/SoftPosApi.md docs/SplitAfterPaymentRequest.md docs/SplitAfterPaymentRequestSplitInner.md @@ -177,6 +204,19 @@ docs/StaticSplitRequest.md docs/StaticSplitRequestSchemeInner.md docs/StaticSplitResponse.md docs/StaticSplitResponseSchemeInner.md +docs/SubsCreatePayment200Response.md +docs/SubscriptionApi.md +docs/SubscriptionBankDetails.md +docs/SubscriptionCustomerDetails.md +docs/SubscriptionEligibilityRequest.md +docs/SubscriptionEligibilityRequestFilters.md +docs/SubscriptionEligibilityRequestQueries.md +docs/SubscriptionEligibilityResponse.md +docs/SubscriptionEntity.md +docs/SubscriptionEntitySubscriptionMeta.md +docs/SubscriptionPaymentEntity.md +docs/SubscriptionPaymentRefundEntity.md +docs/SubscriptionPaymentSplitItem.md docs/TerminalDetails.md docs/TerminalEntity.md docs/TerminalPaymentEntity.md @@ -193,8 +233,10 @@ docs/UpdateTerminalRequestTerminalMeta.md docs/UpdateTerminalStatusRequest.md docs/UpdateVendorRequest.md docs/UpdateVendorResponse.md +docs/UpdateVendorResponseRelatedDocsInner.md docs/Upi.md docs/UpiDetails.md +docs/UploadPnachImageResponse.md docs/UploadTerminalDocs.md docs/UploadTerminalDocsEntity.md docs/UploadVendorDocumentsResponse.md @@ -203,7 +245,6 @@ docs/VendorBalanceTransferCharges.md docs/VendorDocumentDownloadResponse.md docs/VendorDocumentsResponse.md docs/VendorEntity.md -docs/VendorEntityRelatedDocsInner.md docs/VendorSplit.md docs/WalletOffer.md git_push.sh @@ -243,7 +284,9 @@ src/main/java/com/cashfree/client/PgReconciliationApi.java src/main/java/com/cashfree/client/RefundsApi.java src/main/java/com/cashfree/client/SettlementReconciliationApi.java src/main/java/com/cashfree/client/SettlementsApi.java +src/main/java/com/cashfree/client/SimulationApi.java src/main/java/com/cashfree/client/SoftPosApi.java +src/main/java/com/cashfree/client/SubscriptionApi.java src/main/java/com/cashfree/client/TokenVaultApi.java src/main/java/com/cashfree/model/AbstractOpenApiSchema.java src/main/java/com/cashfree/model/AdjustVendorBalanceRequest.java @@ -255,6 +298,7 @@ src/main/java/com/cashfree/model/ApiError502.java src/main/java/com/cashfree/model/App.java src/main/java/com/cashfree/model/AppPaymentMethod.java src/main/java/com/cashfree/model/AuthenticationError.java +src/main/java/com/cashfree/model/AuthorizationDetails.java src/main/java/com/cashfree/model/AuthorizationInPaymentsEntity.java src/main/java/com/cashfree/model/AuthorizeOrderRequest.java src/main/java/com/cashfree/model/BadRequestError.java @@ -277,6 +321,18 @@ src/main/java/com/cashfree/model/CreateCustomerRequest.java src/main/java/com/cashfree/model/CreateLinkRequest.java src/main/java/com/cashfree/model/CreateOfferRequest.java src/main/java/com/cashfree/model/CreateOrderRequest.java +src/main/java/com/cashfree/model/CreateOrderSettlementRequestBody.java +src/main/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaData.java +src/main/java/com/cashfree/model/CreatePlanRequest.java +src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponse.java +src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetails.java +src/main/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponse.java +src/main/java/com/cashfree/model/CreateSubscriptionPaymentRequest.java +src/main/java/com/cashfree/model/CreateSubscriptionRefundRequest.java +src/main/java/com/cashfree/model/CreateSubscriptionRequest.java +src/main/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetails.java +src/main/java/com/cashfree/model/CreateSubscriptionRequestPlanDetails.java +src/main/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMeta.java src/main/java/com/cashfree/model/CreateTerminalRequest.java src/main/java/com/cashfree/model/CreateTerminalRequestTerminalMeta.java src/main/java/com/cashfree/model/CreateTerminalTransactionRequest.java @@ -285,6 +341,7 @@ src/main/java/com/cashfree/model/CreateVendorResponse.java src/main/java/com/cashfree/model/CryptogramEntity.java src/main/java/com/cashfree/model/CustomerDetails.java src/main/java/com/cashfree/model/CustomerDetailsCardlessEMI.java +src/main/java/com/cashfree/model/CustomerDetailsResponse.java src/main/java/com/cashfree/model/CustomerEntity.java src/main/java/com/cashfree/model/DiscountDetails.java src/main/java/com/cashfree/model/EMIOffer.java @@ -301,10 +358,15 @@ src/main/java/com/cashfree/model/EligibilityFetchCardlessEMIRequest.java src/main/java/com/cashfree/model/EligibilityFetchOffersRequest.java src/main/java/com/cashfree/model/EligibilityFetchPaylaterRequest.java src/main/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequest.java +src/main/java/com/cashfree/model/EligibilityMethodItem.java +src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetails.java +src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.java src/main/java/com/cashfree/model/EligibilityOfferEntity.java src/main/java/com/cashfree/model/EligibilityPaylaterEntity.java src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntity.java src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetails.java +src/main/java/com/cashfree/model/EntitySimulationRequest.java +src/main/java/com/cashfree/model/EntitySimulationResponse.java src/main/java/com/cashfree/model/ErrorDetailsInPaymentsEntity.java src/main/java/com/cashfree/model/FetchReconRequest.java src/main/java/com/cashfree/model/FetchReconRequestFilters.java @@ -323,6 +385,10 @@ src/main/java/com/cashfree/model/LinkCustomerDetailsEntity.java src/main/java/com/cashfree/model/LinkEntity.java src/main/java/com/cashfree/model/LinkMetaResponseEntity.java src/main/java/com/cashfree/model/LinkNotifyEntity.java +src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequest.java +src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetails.java +src/main/java/com/cashfree/model/ManageSubscriptionRequest.java +src/main/java/com/cashfree/model/ManageSubscriptionRequestActionDetails.java src/main/java/com/cashfree/model/NetBankingPaymentMethod.java src/main/java/com/cashfree/model/Netbanking.java src/main/java/com/cashfree/model/OfferAll.java @@ -383,6 +449,7 @@ src/main/java/com/cashfree/model/PaymentWebhookDataEntity.java src/main/java/com/cashfree/model/PaymentWebhookErrorEntity.java src/main/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntity.java src/main/java/com/cashfree/model/PaymentWebhookOrderEntity.java +src/main/java/com/cashfree/model/PlanEntity.java src/main/java/com/cashfree/model/RateLimitError.java src/main/java/com/cashfree/model/ReconEntity.java src/main/java/com/cashfree/model/ReconEntityDataInner.java @@ -398,6 +465,8 @@ src/main/java/com/cashfree/model/SettlementReconEntity.java src/main/java/com/cashfree/model/SettlementReconEntityDataInner.java src/main/java/com/cashfree/model/SettlementWebhook.java src/main/java/com/cashfree/model/SettlementWebhookDataEntity.java +src/main/java/com/cashfree/model/SimulateRequest.java +src/main/java/com/cashfree/model/SimulationResponse.java src/main/java/com/cashfree/model/SplitAfterPaymentRequest.java src/main/java/com/cashfree/model/SplitAfterPaymentRequestSplitInner.java src/main/java/com/cashfree/model/SplitAfterPaymentResponse.java @@ -405,6 +474,18 @@ src/main/java/com/cashfree/model/StaticSplitRequest.java src/main/java/com/cashfree/model/StaticSplitRequestSchemeInner.java src/main/java/com/cashfree/model/StaticSplitResponse.java src/main/java/com/cashfree/model/StaticSplitResponseSchemeInner.java +src/main/java/com/cashfree/model/SubsCreatePayment200Response.java +src/main/java/com/cashfree/model/SubscriptionBankDetails.java +src/main/java/com/cashfree/model/SubscriptionCustomerDetails.java +src/main/java/com/cashfree/model/SubscriptionEligibilityRequest.java +src/main/java/com/cashfree/model/SubscriptionEligibilityRequestFilters.java +src/main/java/com/cashfree/model/SubscriptionEligibilityRequestQueries.java +src/main/java/com/cashfree/model/SubscriptionEligibilityResponse.java +src/main/java/com/cashfree/model/SubscriptionEntity.java +src/main/java/com/cashfree/model/SubscriptionEntitySubscriptionMeta.java +src/main/java/com/cashfree/model/SubscriptionPaymentEntity.java +src/main/java/com/cashfree/model/SubscriptionPaymentRefundEntity.java +src/main/java/com/cashfree/model/SubscriptionPaymentSplitItem.java src/main/java/com/cashfree/model/TerminalDetails.java src/main/java/com/cashfree/model/TerminalEntity.java src/main/java/com/cashfree/model/TerminalPaymentEntity.java @@ -420,8 +501,10 @@ src/main/java/com/cashfree/model/UpdateTerminalRequestTerminalMeta.java src/main/java/com/cashfree/model/UpdateTerminalStatusRequest.java src/main/java/com/cashfree/model/UpdateVendorRequest.java src/main/java/com/cashfree/model/UpdateVendorResponse.java +src/main/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInner.java src/main/java/com/cashfree/model/Upi.java src/main/java/com/cashfree/model/UpiDetails.java +src/main/java/com/cashfree/model/UploadPnachImageResponse.java src/main/java/com/cashfree/model/UploadTerminalDocs.java src/main/java/com/cashfree/model/UploadTerminalDocsEntity.java src/main/java/com/cashfree/model/UploadVendorDocumentsResponse.java @@ -430,7 +513,6 @@ src/main/java/com/cashfree/model/VendorBalanceTransferCharges.java src/main/java/com/cashfree/model/VendorDocumentDownloadResponse.java src/main/java/com/cashfree/model/VendorDocumentsResponse.java src/main/java/com/cashfree/model/VendorEntity.java -src/main/java/com/cashfree/model/VendorEntityRelatedDocsInner.java src/main/java/com/cashfree/model/VendorSplit.java src/main/java/com/cashfree/model/WalletOffer.java src/test/java/com/cashfree/client/CustomersApiTest.java @@ -444,7 +526,9 @@ src/test/java/com/cashfree/client/PgReconciliationApiTest.java src/test/java/com/cashfree/client/RefundsApiTest.java src/test/java/com/cashfree/client/SettlementReconciliationApiTest.java src/test/java/com/cashfree/client/SettlementsApiTest.java +src/test/java/com/cashfree/client/SimulationApiTest.java src/test/java/com/cashfree/client/SoftPosApiTest.java +src/test/java/com/cashfree/client/SubscriptionApiTest.java src/test/java/com/cashfree/client/TokenVaultApiTest.java src/test/java/com/cashfree/model/AdjustVendorBalanceRequestTest.java src/test/java/com/cashfree/model/AdjustVendorBalanceResponseTest.java @@ -455,6 +539,7 @@ src/test/java/com/cashfree/model/ApiErrorTest.java src/test/java/com/cashfree/model/AppPaymentMethodTest.java src/test/java/com/cashfree/model/AppTest.java src/test/java/com/cashfree/model/AuthenticationErrorTest.java +src/test/java/com/cashfree/model/AuthorizationDetailsTest.java src/test/java/com/cashfree/model/AuthorizationInPaymentsEntityTest.java src/test/java/com/cashfree/model/AuthorizeOrderRequestTest.java src/test/java/com/cashfree/model/BadRequestErrorTest.java @@ -477,6 +562,18 @@ src/test/java/com/cashfree/model/CreateCustomerRequestTest.java src/test/java/com/cashfree/model/CreateLinkRequestTest.java src/test/java/com/cashfree/model/CreateOfferRequestTest.java src/test/java/com/cashfree/model/CreateOrderRequestTest.java +src/test/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaDataTest.java +src/test/java/com/cashfree/model/CreateOrderSettlementRequestBodyTest.java +src/test/java/com/cashfree/model/CreatePlanRequestTest.java +src/test/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetailsTest.java +src/test/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseTest.java +src/test/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponseTest.java +src/test/java/com/cashfree/model/CreateSubscriptionPaymentRequestTest.java +src/test/java/com/cashfree/model/CreateSubscriptionRefundRequestTest.java +src/test/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetailsTest.java +src/test/java/com/cashfree/model/CreateSubscriptionRequestPlanDetailsTest.java +src/test/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMetaTest.java +src/test/java/com/cashfree/model/CreateSubscriptionRequestTest.java src/test/java/com/cashfree/model/CreateTerminalRequestTerminalMetaTest.java src/test/java/com/cashfree/model/CreateTerminalRequestTest.java src/test/java/com/cashfree/model/CreateTerminalTransactionRequestTest.java @@ -484,6 +581,7 @@ src/test/java/com/cashfree/model/CreateVendorRequestTest.java src/test/java/com/cashfree/model/CreateVendorResponseTest.java src/test/java/com/cashfree/model/CryptogramEntityTest.java src/test/java/com/cashfree/model/CustomerDetailsCardlessEMITest.java +src/test/java/com/cashfree/model/CustomerDetailsResponseTest.java src/test/java/com/cashfree/model/CustomerDetailsTest.java src/test/java/com/cashfree/model/CustomerEntityTest.java src/test/java/com/cashfree/model/DiscountDetailsTest.java @@ -501,10 +599,15 @@ src/test/java/com/cashfree/model/EligibilityFetchCardlessEMIRequestTest.java src/test/java/com/cashfree/model/EligibilityFetchOffersRequestTest.java src/test/java/com/cashfree/model/EligibilityFetchPaylaterRequestTest.java src/test/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequestTest.java +src/test/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInnerTest.java +src/test/java/com/cashfree/model/EligibilityMethodItemEntityDetailsTest.java +src/test/java/com/cashfree/model/EligibilityMethodItemTest.java src/test/java/com/cashfree/model/EligibilityOfferEntityTest.java src/test/java/com/cashfree/model/EligibilityPaylaterEntityTest.java src/test/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetailsTest.java src/test/java/com/cashfree/model/EligibilityPaymentMethodsEntityTest.java +src/test/java/com/cashfree/model/EntitySimulationRequestTest.java +src/test/java/com/cashfree/model/EntitySimulationResponseTest.java src/test/java/com/cashfree/model/ErrorDetailsInPaymentsEntityTest.java src/test/java/com/cashfree/model/FetchReconRequestFiltersTest.java src/test/java/com/cashfree/model/FetchReconRequestPaginationTest.java @@ -523,6 +626,10 @@ src/test/java/com/cashfree/model/LinkCustomerDetailsEntityTest.java src/test/java/com/cashfree/model/LinkEntityTest.java src/test/java/com/cashfree/model/LinkMetaResponseEntityTest.java src/test/java/com/cashfree/model/LinkNotifyEntityTest.java +src/test/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetailsTest.java +src/test/java/com/cashfree/model/ManageSubscriptionPaymentRequestTest.java +src/test/java/com/cashfree/model/ManageSubscriptionRequestActionDetailsTest.java +src/test/java/com/cashfree/model/ManageSubscriptionRequestTest.java src/test/java/com/cashfree/model/NetBankingPaymentMethodTest.java src/test/java/com/cashfree/model/NetbankingTest.java src/test/java/com/cashfree/model/OfferAllTest.java @@ -583,6 +690,7 @@ src/test/java/com/cashfree/model/PaymentWebhookErrorEntityTest.java src/test/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntityTest.java src/test/java/com/cashfree/model/PaymentWebhookOrderEntityTest.java src/test/java/com/cashfree/model/PaymentWebhookTest.java +src/test/java/com/cashfree/model/PlanEntityTest.java src/test/java/com/cashfree/model/RateLimitErrorTest.java src/test/java/com/cashfree/model/ReconEntityDataInnerTest.java src/test/java/com/cashfree/model/ReconEntityTest.java @@ -598,6 +706,8 @@ src/test/java/com/cashfree/model/SettlementReconEntityDataInnerTest.java src/test/java/com/cashfree/model/SettlementReconEntityTest.java src/test/java/com/cashfree/model/SettlementWebhookDataEntityTest.java src/test/java/com/cashfree/model/SettlementWebhookTest.java +src/test/java/com/cashfree/model/SimulateRequestTest.java +src/test/java/com/cashfree/model/SimulationResponseTest.java src/test/java/com/cashfree/model/SplitAfterPaymentRequestSplitInnerTest.java src/test/java/com/cashfree/model/SplitAfterPaymentRequestTest.java src/test/java/com/cashfree/model/SplitAfterPaymentResponseTest.java @@ -605,6 +715,18 @@ src/test/java/com/cashfree/model/StaticSplitRequestSchemeInnerTest.java src/test/java/com/cashfree/model/StaticSplitRequestTest.java src/test/java/com/cashfree/model/StaticSplitResponseSchemeInnerTest.java src/test/java/com/cashfree/model/StaticSplitResponseTest.java +src/test/java/com/cashfree/model/SubsCreatePayment200ResponseTest.java +src/test/java/com/cashfree/model/SubscriptionBankDetailsTest.java +src/test/java/com/cashfree/model/SubscriptionCustomerDetailsTest.java +src/test/java/com/cashfree/model/SubscriptionEligibilityRequestFiltersTest.java +src/test/java/com/cashfree/model/SubscriptionEligibilityRequestQueriesTest.java +src/test/java/com/cashfree/model/SubscriptionEligibilityRequestTest.java +src/test/java/com/cashfree/model/SubscriptionEligibilityResponseTest.java +src/test/java/com/cashfree/model/SubscriptionEntitySubscriptionMetaTest.java +src/test/java/com/cashfree/model/SubscriptionEntityTest.java +src/test/java/com/cashfree/model/SubscriptionPaymentEntityTest.java +src/test/java/com/cashfree/model/SubscriptionPaymentRefundEntityTest.java +src/test/java/com/cashfree/model/SubscriptionPaymentSplitItemTest.java src/test/java/com/cashfree/model/TerminalDetailsTest.java src/test/java/com/cashfree/model/TerminalEntityTest.java src/test/java/com/cashfree/model/TerminalPaymentEntityTest.java @@ -619,9 +741,11 @@ src/test/java/com/cashfree/model/UpdateTerminalRequestTerminalMetaTest.java src/test/java/com/cashfree/model/UpdateTerminalRequestTest.java src/test/java/com/cashfree/model/UpdateTerminalStatusRequestTest.java src/test/java/com/cashfree/model/UpdateVendorRequestTest.java +src/test/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInnerTest.java src/test/java/com/cashfree/model/UpdateVendorResponseTest.java src/test/java/com/cashfree/model/UpiDetailsTest.java src/test/java/com/cashfree/model/UpiTest.java +src/test/java/com/cashfree/model/UploadPnachImageResponseTest.java src/test/java/com/cashfree/model/UploadTerminalDocsEntityTest.java src/test/java/com/cashfree/model/UploadTerminalDocsTest.java src/test/java/com/cashfree/model/UploadVendorDocumentsResponseTest.java @@ -629,7 +753,6 @@ src/test/java/com/cashfree/model/VendorBalanceTest.java src/test/java/com/cashfree/model/VendorBalanceTransferChargesTest.java src/test/java/com/cashfree/model/VendorDocumentDownloadResponseTest.java src/test/java/com/cashfree/model/VendorDocumentsResponseTest.java -src/test/java/com/cashfree/model/VendorEntityRelatedDocsInnerTest.java src/test/java/com/cashfree/model/VendorEntityTest.java src/test/java/com/cashfree/model/VendorSplitTest.java src/test/java/com/cashfree/model/WalletOfferTest.java diff --git a/README.md b/README.md index 737ac960..d4023458 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,14 @@ Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com ### Installation * Gradle Project ```bash -implementation `com.cashfree.pg.java:cashfree_pg:4.1.4` +implementation `com.cashfree.pg.java:cashfree_pg:4.2.0` ``` * Maven Project ```bash com.cashfree.pg.java cashfree_pg - 4.1.4 + 4.2.0 compile @@ -80,4 +80,4 @@ try { ## Licence -Apache Licensed. See [LICENSE.md](LICENSE.md) for more details. +Apache Licensed. See [LICENSE.md](LICENSE.md) for more details diff --git a/build.gradle b/build.gradle index 2b213ecb..adfd7e78 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'maven-publish' apply plugin: 'signing' group = 'com.cashfree.pg.java' -version = '4.1.4' +version = '4.2.0' buildscript { repositories { @@ -116,7 +116,7 @@ if(hasProperty('target') && target == 'android') { groupId 'com.cashfree.pg.java' artifactId 'cashfree_pg' - version '4.1.4' + version '4.2.0' from components.java diff --git a/build.sbt b/build.sbt index d386553d..aa31ab62 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.cashfree.pg.java", name := "cashfree_pg", - version := "4.1.4", + version := "4.2.0", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/docs/AuthorizationDetails.md b/docs/AuthorizationDetails.md new file mode 100644 index 00000000..1f137252 --- /dev/null +++ b/docs/AuthorizationDetails.md @@ -0,0 +1,20 @@ + + +# AuthorizationDetails + +Details of the authorization done for the subscription. Returned in Get subscription and auth payments. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authorizationAmount** | **BigDecimal** | Authorization amount for the auth payment. | [optional] | +|**authorizationAmountRefund** | **Boolean** | Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription. | [optional] | +|**authorizationReference** | **String** | Authorization reference. UMN for UPI, UMRN for EMandate/Physical Mandate and Enrollment ID for cards. | [optional] | +|**authorizationTime** | **String** | Authorization time. | [optional] | +|**authorizationStatus** | **String** | Status of the authorization. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**paymentMethod** | **String** | Payment method used for the authorization. | [optional] | + + + diff --git a/docs/Card.md b/docs/Card.md index 2789738c..5abd7ad3 100644 --- a/docs/Card.md +++ b/docs/Card.md @@ -17,7 +17,7 @@ Card Payment method |**instrumentId** | **String** | instrument id of saved card. Required only to make payment using saved instrument. | [optional] | |**cryptogram** | **String** | cryptogram received from card network. Required only for tokenized card transactions. | [optional] | |**tokenRequestorId** | **String** | TRID issued by card networks. Required only for tokenized card transactions. | [optional] | -|**tokenReferenceId** | **String** | Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards. | [optional] | +|**tokenReferenceId** | **String** | Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards. | [optional] | |**tokenType** | [**TokenTypeEnum**](#TokenTypeEnum) | | [optional] | |**cardDisplay** | **String** | last 4 digits of original card number. Required only for tokenized card transactions. | [optional] | |**cardAlias** | **String** | Card alias as returned by Cashfree Vault API. | [optional] | diff --git a/docs/CardlessEMI.md b/docs/CardlessEMI.md index 6f3cc4db..5339bc98 100644 --- a/docs/CardlessEMI.md +++ b/docs/CardlessEMI.md @@ -9,7 +9,7 @@ Request body for cardless emi payment method | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**channel** | **String** | The channel for cardless EMI is always `link` | [optional] | -|**provider** | [**ProviderEnum**](#ProviderEnum) | One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`] | [optional] | +|**provider** | [**ProviderEnum**](#ProviderEnum) | One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`] | [optional] | |**phone** | **String** | Customers phone number for this payment instrument. If the customer is not eligible you will receive a 400 error with type as 'invalid_request_error' and code as 'invalid_request_error' | [optional] | |**emiTenure** | **Integer** | EMI tenure for the selected provider. This is mandatory when provider is one of [`hdfc`, `icici`, `cashe`, `idfc`, `kotak`] | [optional] | @@ -26,6 +26,8 @@ Request body for cardless emi payment method | CASHE | "cashe" | | IDFC | "idfc" | | KOTAK | "kotak" | +| SNAPMINT | "snapmint" | +| BHARATX | "bharatx" | | UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | diff --git a/docs/CreateOrderSettlementRequestBody.md b/docs/CreateOrderSettlementRequestBody.md new file mode 100644 index 00000000..f10e6afd --- /dev/null +++ b/docs/CreateOrderSettlementRequestBody.md @@ -0,0 +1,15 @@ + + +# CreateOrderSettlementRequestBody + +Create Order Settlement Object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**orderId** | **String** | OrderId of the order. | | +|**metaData** | [**CreateOrderSettlementRequestBodyMetaData**](CreateOrderSettlementRequestBodyMetaData.md) | | | + + + diff --git a/docs/CreateOrderSettlementRequestBodyMetaData.md b/docs/CreateOrderSettlementRequestBodyMetaData.md new file mode 100644 index 00000000..0cfd23b0 --- /dev/null +++ b/docs/CreateOrderSettlementRequestBodyMetaData.md @@ -0,0 +1,14 @@ + + +# CreateOrderSettlementRequestBodyMetaData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cbriksId** | **String** | Meta data cbricks ID to be used for reporting purpose. | [optional] | +|**settlementDate** | **LocalDate** | Requested Settlement Date. | [optional] | + + + diff --git a/docs/CreatePlanRequest.md b/docs/CreatePlanRequest.md new file mode 100644 index 00000000..a1dae3bd --- /dev/null +++ b/docs/CreatePlanRequest.md @@ -0,0 +1,23 @@ + + +# CreatePlanRequest + +Request body to create a plan. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**planId** | **String** | Unique ID to identify the plan. Only alpha-numerics, dot, hyphen and underscore allowed. | | +|**planName** | **String** | Name of the plan. | | +|**planType** | **String** | Type of the plan. Possible values - PERIODIC, ON_DEMAND. | | +|**planCurrency** | **String** | Currency of the plan. | [optional] | +|**planRecurringAmount** | **BigDecimal** | Recurring amount for the plan. Required for PERIODIC plan_type. | [optional] | +|**planMaxAmount** | **BigDecimal** | Maximum amount for the plan. | | +|**planMaxCycles** | **Integer** | Maximum number of payment cycles for the plan. | [optional] | +|**planIntervals** | **Integer** | Number of billing cycles between charges. For instance, if set to 2 and the interval type is 'week', the service will be billed every 2 weeks. Similarly, if set to 3 and the interval type is 'month', the service will be billed every 3 months. Required for PERIODIC plan_type. | [optional] | +|**planIntervalType** | **String** | Interval type for the plan. Possible values - DAY, WEEK, MONTH, YEAR. | [optional] | +|**planNote** | **String** | Note for the plan. | [optional] | + + + diff --git a/docs/CreateSubscriptionPaymentAuthResponse.md b/docs/CreateSubscriptionPaymentAuthResponse.md new file mode 100644 index 00000000..45da2e3d --- /dev/null +++ b/docs/CreateSubscriptionPaymentAuthResponse.md @@ -0,0 +1,23 @@ + + +# CreateSubscriptionPaymentAuthResponse + +The response returned in Get, Create or Manage Subscription Payment APIs. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cfPaymentId** | **String** | Cashfree subscription payment reference number | [optional] | +|**cfSubscriptionId** | **String** | Cashfree subscription reference number | [optional] | +|**failureDetails** | [**CreateSubscriptionPaymentAuthResponseFailureDetails**](CreateSubscriptionPaymentAuthResponseFailureDetails.md) | | [optional] | +|**paymentAmount** | **BigDecimal** | The charge amount of the payment. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**paymentInitiatedDate** | **String** | The date on which the payment was initiated. | [optional] | +|**paymentStatus** | **String** | Status of the payment. | [optional] | +|**paymentType** | **String** | Payment type. Can be AUTH or CHARGE. | [optional] | +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | [optional] | +|**paymentMethod** | **String** | Payment method used for the authorization. | [optional] | + + + diff --git a/docs/CreateSubscriptionPaymentAuthResponseFailureDetails.md b/docs/CreateSubscriptionPaymentAuthResponseFailureDetails.md new file mode 100644 index 00000000..ec42af25 --- /dev/null +++ b/docs/CreateSubscriptionPaymentAuthResponseFailureDetails.md @@ -0,0 +1,13 @@ + + +# CreateSubscriptionPaymentAuthResponseFailureDetails + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**failureReason** | **String** | Failure reason of the payment if the payment_status is failed. | [optional] | + + + diff --git a/docs/CreateSubscriptionPaymentChargeResponse.md b/docs/CreateSubscriptionPaymentChargeResponse.md new file mode 100644 index 00000000..93a226af --- /dev/null +++ b/docs/CreateSubscriptionPaymentChargeResponse.md @@ -0,0 +1,23 @@ + + +# CreateSubscriptionPaymentChargeResponse + +The response returned in Get, Create or Manage Subscription Payment APIs. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cfPaymentId** | **String** | Cashfree subscription payment reference number | [optional] | +|**cfSubscriptionId** | **String** | Cashfree subscription reference number | [optional] | +|**failureDetails** | [**CreateSubscriptionPaymentAuthResponseFailureDetails**](CreateSubscriptionPaymentAuthResponseFailureDetails.md) | | [optional] | +|**paymentAmount** | **BigDecimal** | The charge amount of the payment. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**paymentInitiatedDate** | **String** | The date on which the payment was initiated. | [optional] | +|**paymentStatus** | **String** | Status of the payment. | [optional] | +|**paymentType** | **String** | Payment type. Can be AUTH or CHARGE. | [optional] | +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | [optional] | +|**paymentMethod** | **String** | Payment method used for the authorization. | [optional] | + + + diff --git a/docs/CreateSubscriptionPaymentRequest.md b/docs/CreateSubscriptionPaymentRequest.md new file mode 100644 index 00000000..8a4780ae --- /dev/null +++ b/docs/CreateSubscriptionPaymentRequest.md @@ -0,0 +1,21 @@ + + +# CreateSubscriptionPaymentRequest + +The request to be passed for the create subscription payment API. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | | +|**subscriptionSessionId** | **String** | Session ID for the subscription. Required only for Auth. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the subscription payment. | | +|**paymentAmount** | **BigDecimal** | The charge amount of the payment. Required in case of charge. | [optional] | +|**paymentScheduleDate** | **String** | The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes. | [optional] | +|**paymentRemarks** | **String** | Payment remarks. | [optional] | +|**paymentType** | **String** | Payment type. Can be AUTH or CHARGE. | | +|**paymentMethod** | **Object** | Payment method. Can be one of [\"upi\", \"enach\", \"pnach\", \"card\"] | [optional] | + + + diff --git a/docs/CreateSubscriptionRefundRequest.md b/docs/CreateSubscriptionRefundRequest.md new file mode 100644 index 00000000..0a492190 --- /dev/null +++ b/docs/CreateSubscriptionRefundRequest.md @@ -0,0 +1,20 @@ + + +# CreateSubscriptionRefundRequest + +Request body to create a subscription refund. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**cfPaymentId** | **String** | Cashfree subscription payment reference number. | [optional] | +|**refundId** | **String** | A unique ID passed by merchant for identifying the refund. | | +|**refundAmount** | **BigDecimal** | The amount to be refunded. Can be partial or full amount of the payment. | | +|**refundNote** | **String** | Refund note. | [optional] | +|**refundSpeed** | **String** | Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds. | [optional] | + + + diff --git a/docs/CreateSubscriptionRequest.md b/docs/CreateSubscriptionRequest.md new file mode 100644 index 00000000..ee78a1a1 --- /dev/null +++ b/docs/CreateSubscriptionRequest.md @@ -0,0 +1,23 @@ + + +# CreateSubscriptionRequest + +Request body to create a new subscription. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | A unique ID for the subscription. It can include alphanumeric characters, underscore, dot, hyphen, and space. Maximum characters allowed is 250. | | +|**customerDetails** | [**SubscriptionCustomerDetails**](SubscriptionCustomerDetails.md) | | | +|**planDetails** | [**CreateSubscriptionRequestPlanDetails**](CreateSubscriptionRequestPlanDetails.md) | | | +|**authorizationDetails** | [**CreateSubscriptionRequestAuthorizationDetails**](CreateSubscriptionRequestAuthorizationDetails.md) | | [optional] | +|**subscriptionMeta** | [**CreateSubscriptionRequestSubscriptionMeta**](CreateSubscriptionRequestSubscriptionMeta.md) | | [optional] | +|**subscriptionExpiryTime** | **String** | Expiry date for the subscription. | [optional] | +|**subscriptionFirstChargeTime** | **String** | Time at which the first charge will be made for the subscription after authorization. Applicable only for PERIODIC plans. | [optional] | +|**subscriptionNote** | **String** | Note for the subscription. | [optional] | +|**subscriptionTags** | **Object** | Tags for the subscription. | [optional] | +|**subscriptionPaymentSplits** | [**List<SubscriptionPaymentSplitItem>**](SubscriptionPaymentSplitItem.md) | Payment splits for the subscription. | [optional] | + + + diff --git a/docs/CreateSubscriptionRequestAuthorizationDetails.md b/docs/CreateSubscriptionRequestAuthorizationDetails.md new file mode 100644 index 00000000..37752db3 --- /dev/null +++ b/docs/CreateSubscriptionRequestAuthorizationDetails.md @@ -0,0 +1,14 @@ + + +# CreateSubscriptionRequestAuthorizationDetails + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authorizationAmount** | **BigDecimal** | Authorization amount for the auth payment. | [optional] | +|**authorizationAmountRefund** | **Boolean** | Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription. | [optional] | + + + diff --git a/docs/CreateSubscriptionRequestPlanDetails.md b/docs/CreateSubscriptionRequestPlanDetails.md new file mode 100644 index 00000000..4afd5374 --- /dev/null +++ b/docs/CreateSubscriptionRequestPlanDetails.md @@ -0,0 +1,22 @@ + + +# CreateSubscriptionRequestPlanDetails + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**planId** | **String** | The unique identifier used to create plan. You only need to pass this field if you had already created plan. Otherwise use the other fields here to define the plan. | [optional] | +|**planName** | **String** | Specify plan name for easy reference. | [optional] | +|**planType** | **String** | Possible values ON_DEMAND or PERIODIC. PERIODIC - Payments are triggered automatically at fixed intervals defined by the merchant. ON_DEMAND - Merchant needs to trigger/charge the customer explicitly with the required amount. | [optional] | +|**planCurrency** | **String** | INR by default. | [optional] | +|**planAmount** | **BigDecimal** | The amount to be charged for PERIODIC plan. This is a conditional parameter, only required for PERIODIC plans. | [optional] | +|**planMaxAmount** | **BigDecimal** | This is the maximum amount that can be charged on a subscription. | [optional] | +|**planMaxCycles** | **Integer** | Maximum number of debits set for the plan. The subscription will automatically change to COMPLETED status once this limit is reached. | [optional] | +|**planIntervals** | **Integer** | Number of intervals of intervalType between every subscription payment. For example, to charge a customer bi-weekly use intervalType as “week” and intervals as 2. Required for PERIODIC plan. The default value is 1. | [optional] | +|**planIntervalType** | **String** | The type of interval for a PERIODIC plan like DAY, WEEK, MONTH, or YEAR. This is a conditional parameter only applicable for PERIODIC plans. | [optional] | +|**planNote** | **String** | Note for the plan. | [optional] | + + + diff --git a/docs/CreateSubscriptionRequestSubscriptionMeta.md b/docs/CreateSubscriptionRequestSubscriptionMeta.md new file mode 100644 index 00000000..db2521a1 --- /dev/null +++ b/docs/CreateSubscriptionRequestSubscriptionMeta.md @@ -0,0 +1,14 @@ + + +# CreateSubscriptionRequestSubscriptionMeta + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**returnUrl** | **String** | The url to redirect after checkout. | [optional] | +|**notificationChannel** | **List<String>** | Notification channel for the subscription. SMS, EMAIL are possible values. | [optional] | + + + diff --git a/docs/CreateTerminalTransactionRequest.md b/docs/CreateTerminalTransactionRequest.md index 65fefbdf..7966eef0 100644 --- a/docs/CreateTerminalTransactionRequest.md +++ b/docs/CreateTerminalTransactionRequest.md @@ -12,6 +12,7 @@ Request body to create a terminal transaction |**cfTerminalId** | **String** | cashfree terminal id. this is a required parameter when you do not provide the terminal phone number. | [optional] | |**paymentMethod** | **String** | mention the payment method used for the transaction. possible values - QR_CODE, LINK. | | |**terminalPhoneNo** | **String** | agent mobile number assigned to the terminal. this is a required parameter when you do not provide the cf_terminal_id. | [optional] | +|**addInvoice** | **Boolean** | make it true to have request be sent to create a Dynamic GST QR Code. | [optional] | diff --git a/docs/CreateVendorRequest.md b/docs/CreateVendorRequest.md index 17cca76b..c2271c36 100644 --- a/docs/CreateVendorRequest.md +++ b/docs/CreateVendorRequest.md @@ -15,7 +15,7 @@ Create Vendor Request |**phone** | **String** | Specify the beneficiaries phone number to be updated. Phone number registered in India (only digits, 8 - 12 characters after excluding +91). | | |**verifyAccount** | **Boolean** | Specify if the vendor bank account details should be verified. Possible values: true or false | [optional] | |**dashboardAccess** | **Boolean** | Update if the vendor will have dashboard access or not. Possible values are: true or false | [optional] | -|**scheduleOption** | **BigDecimal** | Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. | [optional] | +|**scheduleOption** | **BigDecimal** | Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. | [optional] | |**bank** | [**List<BankDetails>**](BankDetails.md) | Specify the vendor bank account details to be updated. | [optional] | |**upi** | [**List<UpiDetails>**](UpiDetails.md) | Updated beneficiary upi vpa. Alphanumeric, dot (.), hyphen (-), at sign (@), and underscore allowed (100 character limit). Note: underscore and dot (.) gets accepted before and after @, but hyphen (-) is only accepted before @ sign. | [optional] | |**kycDetails** | [**List<KycDetails>**](KycDetails.md) | Specify the kyc details that should be updated. | | diff --git a/docs/CustomerDetails.md b/docs/CustomerDetails.md index 245393a6..f71bb843 100644 --- a/docs/CustomerDetails.md +++ b/docs/CustomerDetails.md @@ -2,13 +2,13 @@ # CustomerDetails -The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. +The customer details that are necessary. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**customerId** | **String** | A unique identifier for the customer. Use alphanumeric values only. | [optional] | +|**customerId** | **String** | A unique identifier for the customer. Use alphanumeric values only. | | |**customerEmail** | **String** | Customer email address. | [optional] | |**customerPhone** | **String** | Customer phone number. | | |**customerName** | **String** | Name of the customer. | [optional] | diff --git a/docs/CustomerDetailsResponse.md b/docs/CustomerDetailsResponse.md new file mode 100644 index 00000000..a9667e20 --- /dev/null +++ b/docs/CustomerDetailsResponse.md @@ -0,0 +1,21 @@ + + +# CustomerDetailsResponse + +The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**customerId** | **String** | A unique identifier for the customer. Use alphanumeric values only. | [optional] | +|**customerEmail** | **String** | Customer email address. | [optional] | +|**customerPhone** | **String** | Customer phone number. | [optional] | +|**customerName** | **String** | Name of the customer. | [optional] | +|**customerBankAccountNumber** | **String** | Customer bank account. Required if you want to do a bank account check (TPV) | [optional] | +|**customerBankIfsc** | **String** | Customer bank IFSC. Required if you want to do a bank account check (TPV) | [optional] | +|**customerBankCode** | **BigDecimal** | Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV) | [optional] | +|**customerUid** | **String** | Customer identifier at Cashfree. You will get this when you create/get customer | [optional] | + + + diff --git a/docs/EligibilityMethodItem.md b/docs/EligibilityMethodItem.md new file mode 100644 index 00000000..5ed6d006 --- /dev/null +++ b/docs/EligibilityMethodItem.md @@ -0,0 +1,17 @@ + + +# EligibilityMethodItem + +Eligibile payment method object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eligibility** | **Boolean** | Indicates whether the payment method is eligible. | [optional] | +|**entityType** | **String** | Type of entity (e.g., \"payment_methods\"). | [optional] | +|**entityValue** | **String** | Payment method (e.g., enach, pnach, upi, card). | [optional] | +|**entityDetails** | [**EligibilityMethodItemEntityDetails**](EligibilityMethodItemEntityDetails.md) | | [optional] | + + + diff --git a/docs/EligibilityMethodItemEntityDetails.md b/docs/EligibilityMethodItemEntityDetails.md new file mode 100644 index 00000000..9e085ed6 --- /dev/null +++ b/docs/EligibilityMethodItemEntityDetails.md @@ -0,0 +1,17 @@ + + +# EligibilityMethodItemEntityDetails + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**accountTypes** | **List<String>** | List of account types associated with the payment method. (e.g. SAVINGS or CURRENT) | [optional] | +|**frequentBankDetails** | [**List<SubscriptionBankDetails>**](SubscriptionBankDetails.md) | List of the most frequently used banks. | [optional] | +|**allBankDetails** | [**List<SubscriptionBankDetails>**](SubscriptionBankDetails.md) | Details about all banks associated with the payment method. | [optional] | +|**availableHandles** | [**List<EligibilityMethodItemEntityDetailsAvailableHandlesInner>**](EligibilityMethodItemEntityDetailsAvailableHandlesInner.md) | List of supported VPA handles. | [optional] | +|**allowedCardTypes** | **List<String>** | List of allowed card types. (e.g. DEBIT_CARD, CREDIT_CARD) | [optional] | + + + diff --git a/docs/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md b/docs/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md new file mode 100644 index 00000000..39bcdbf7 --- /dev/null +++ b/docs/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md @@ -0,0 +1,14 @@ + + +# EligibilityMethodItemEntityDetailsAvailableHandlesInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**handle** | **String** | VPA handle | [optional] | +|**application** | **String** | Application or service related to the VPA handle. | [optional] | + + + diff --git a/docs/EntitySimulationRequest.md b/docs/EntitySimulationRequest.md new file mode 100644 index 00000000..063dc0ba --- /dev/null +++ b/docs/EntitySimulationRequest.md @@ -0,0 +1,27 @@ + + +# EntitySimulationRequest + +Entity Simulation it contains payment_status and payment_error_code + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paymentStatus** | [**PaymentStatusEnum**](#PaymentStatusEnum) | Payment Status | | +|**paymentErrorCode** | **String** | Payment Error Code | [optional] | + + + +## Enum: PaymentStatusEnum + +| Name | Value | +|---- | -----| +| SUCCESS | "SUCCESS" | +| FAILED | "FAILED" | +| PENDING | "PENDING" | +| USER_DROPPED | "USER_DROPPED" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/EntitySimulationResponse.md b/docs/EntitySimulationResponse.md new file mode 100644 index 00000000..6b9b3c30 --- /dev/null +++ b/docs/EntitySimulationResponse.md @@ -0,0 +1,15 @@ + + +# EntitySimulationResponse + +Entity Simulation it contains payment_status and payment_error_code + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paymentStatus** | **String** | Payment Status | | +|**paymentErrorCode** | **String** | Payment Error Code | [optional] | + + + diff --git a/docs/LinkCustomerDetailsEntity.md b/docs/LinkCustomerDetailsEntity.md index b4c91d3c..92edbb07 100644 --- a/docs/LinkCustomerDetailsEntity.md +++ b/docs/LinkCustomerDetailsEntity.md @@ -11,6 +11,56 @@ Payment link customer entity |**customerPhone** | **String** | Customer phone number | | |**customerEmail** | **String** | Customer email address | [optional] | |**customerName** | **String** | Customer name | [optional] | +|**customerBankAccountNumber** | **String** | Customer Bank Account Number | [optional] | +|**customerBankIfsc** | **String** | Customer Bank Ifsc | [optional] | +|**customerBankCode** | [**CustomerBankCodeEnum**](#CustomerBankCodeEnum) | Customer Bank Code | [optional] | + + + +## Enum: CustomerBankCodeEnum + +| Name | Value | +|---- | -----| +| NUMBER_3003 | 3003 | +| NUMBER_3005 | 3005 | +| NUMBER_3006 | 3006 | +| NUMBER_3010 | 3010 | +| NUMBER_3012 | 3012 | +| NUMBER_3016 | 3016 | +| NUMBER_3019 | 3019 | +| NUMBER_3020 | 3020 | +| NUMBER_3021 | 3021 | +| NUMBER_3022 | 3022 | +| NUMBER_3023 | 3023 | +| NUMBER_3024 | 3024 | +| NUMBER_3026 | 3026 | +| NUMBER_3027 | 3027 | +| NUMBER_3028 | 3028 | +| NUMBER_3029 | 3029 | +| NUMBER_3030 | 3030 | +| NUMBER_3031 | 3031 | +| NUMBER_3032 | 3032 | +| NUMBER_3033 | 3033 | +| NUMBER_3038 | 3038 | +| NUMBER_3039 | 3039 | +| NUMBER_3040 | 3040 | +| NUMBER_3042 | 3042 | +| NUMBER_3044 | 3044 | +| NUMBER_3054 | 3054 | +| NUMBER_3055 | 3055 | +| NUMBER_3058 | 3058 | +| NUMBER_3086 | 3086 | +| NUMBER_3087 | 3087 | +| NUMBER_3088 | 3088 | +| NUMBER_3089 | 3089 | +| NUMBER_3090 | 3090 | +| NUMBER_3091 | 3091 | +| NUMBER_3092 | 3092 | +| NUMBER_3098 | 3098 | +| NUMBER_3115 | 3115 | +| NUMBER_3117 | 3117 | +| NUMBER_7001 | 7001 | +| NUMBER_unknown_default_open_api | 11184809 | diff --git a/docs/ManageSubscriptionPaymentRequest.md b/docs/ManageSubscriptionPaymentRequest.md new file mode 100644 index 00000000..b35f8c7a --- /dev/null +++ b/docs/ManageSubscriptionPaymentRequest.md @@ -0,0 +1,17 @@ + + +# ManageSubscriptionPaymentRequest + +Request body to manage a subscription payment. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | The unique ID which was used to create subscription. | | +|**paymentId** | **String** | The unique ID which was used to create payment. | | +|**action** | **String** | Action to be performed on the payment. Possible values - CANCEL, RETRY. | | +|**actionDetails** | [**ManageSubscriptionPaymentRequestActionDetails**](ManageSubscriptionPaymentRequestActionDetails.md) | | [optional] | + + + diff --git a/docs/ManageSubscriptionPaymentRequestActionDetails.md b/docs/ManageSubscriptionPaymentRequestActionDetails.md new file mode 100644 index 00000000..6d9be7fb --- /dev/null +++ b/docs/ManageSubscriptionPaymentRequestActionDetails.md @@ -0,0 +1,14 @@ + + +# ManageSubscriptionPaymentRequestActionDetails + +Details of the action to be performed. Needed for retry action. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nextScheduledTime** | **String** | Next scheduled time for the retry of the FAILED payment. Required for retry action. | [optional] | + + + diff --git a/docs/ManageSubscriptionRequest.md b/docs/ManageSubscriptionRequest.md new file mode 100644 index 00000000..a06a9937 --- /dev/null +++ b/docs/ManageSubscriptionRequest.md @@ -0,0 +1,16 @@ + + +# ManageSubscriptionRequest + +Request body to manage a subscription. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | The unique ID which was used to create subscription. | | +|**action** | **String** | Action to be performed on the subscription. Possible values - CANCEL, PAUSE, ACTIVATE, CHANGE_PLAN. | | +|**actionDetails** | [**ManageSubscriptionRequestActionDetails**](ManageSubscriptionRequestActionDetails.md) | | [optional] | + + + diff --git a/docs/ManageSubscriptionRequestActionDetails.md b/docs/ManageSubscriptionRequestActionDetails.md new file mode 100644 index 00000000..de2085ce --- /dev/null +++ b/docs/ManageSubscriptionRequestActionDetails.md @@ -0,0 +1,15 @@ + + +# ManageSubscriptionRequestActionDetails + +Details of the action to be performed. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nextScheduledTime** | **String** | Next scheduled time for the action. Required for ACTIVATE action. | [optional] | +|**planId** | **String** | Plan ID to update. Required for CHANGE_PLAN action. | [optional] | + + + diff --git a/docs/OrderEntity.md b/docs/OrderEntity.md index cef95793..36849dfa 100644 --- a/docs/OrderEntity.md +++ b/docs/OrderEntity.md @@ -19,7 +19,7 @@ The complete order entity |**orderNote** | **String** | Additional note for order | [optional] | |**createdAt** | **OffsetDateTime** | When the order was created at cashfree's server | [optional] | |**orderSplits** | [**List<VendorSplit>**](VendorSplit.md) | | [optional] | -|**customerDetails** | [**CustomerDetails**](CustomerDetails.md) | | [optional] | +|**customerDetails** | [**CustomerDetailsResponse**](CustomerDetailsResponse.md) | | [optional] | |**orderMeta** | [**OrderMeta**](OrderMeta.md) | | [optional] | |**orderTags** | **Map<String, String>** | Custom Tags in thr form of {\"key\":\"value\"} which can be passed for an order. A maximum of 10 tags can be added | [optional] | diff --git a/docs/OrderMeta.md b/docs/OrderMeta.md index c2094200..6ef39d84 100644 --- a/docs/OrderMeta.md +++ b/docs/OrderMeta.md @@ -8,7 +8,7 @@ Optional meta details to control how the customer pays and how payment journey c | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**returnUrl** | **String** | The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://example.com/return?order_id=myOrderId | [optional] | +|**returnUrl** | **String** | The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://www.cashfree.com/devstudio/thankyou | [optional] | |**notifyUrl** | **String** | Notification URL for server-server communication. Useful when user's connection drops while re-directing. NotifyUrl should be an https URL. Maximum length: 250. | [optional] | |**paymentMethods** | **Object** | Allowed payment modes for this order. Pass comma-separated values among following options - \"cc\", \"dc\", \"ccc\", \"ppc\",\"nb\",\"upi\",\"paypal\",\"app\",\"paylater\",\"cardlessemi\",\"dcemi\",\"ccemi\",\"banktransfer\". Leave it blank to show all available payment methods | [optional] | diff --git a/docs/PlanEntity.md b/docs/PlanEntity.md new file mode 100644 index 00000000..7ff25e69 --- /dev/null +++ b/docs/PlanEntity.md @@ -0,0 +1,24 @@ + + +# PlanEntity + +The response returned for Get, Create and Manage Plan APIs + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**planCurrency** | **String** | Currency for the plan. | [optional] | +|**planId** | **String** | Plan ID provided by merchant. | [optional] | +|**planIntervalType** | **String** | Interval type for the plan. | [optional] | +|**planIntervals** | **Integer** | Number of intervals for the plan. | [optional] | +|**planMaxAmount** | **BigDecimal** | Maximum amount for the plan. | [optional] | +|**planMaxCycles** | **Integer** | Maximum number of payment cycles for the plan. | [optional] | +|**planName** | **String** | Name of the plan. | [optional] | +|**planNote** | **String** | Note for the plan. | [optional] | +|**planRecurringAmount** | **BigDecimal** | Recurring amount for the plan. | [optional] | +|**planStatus** | **String** | Status of the plan. | [optional] | +|**planType** | **String** | Type of the plan. | [optional] | + + + diff --git a/docs/SettlementsApi.md b/docs/SettlementsApi.md index 77dd1779..b00fd306 100644 --- a/docs/SettlementsApi.md +++ b/docs/SettlementsApi.md @@ -4,10 +4,88 @@ All URIs are relative to *https://sandbox.cashfree.com/pg* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**MarkForSettlement**](SettlementsApi.md#MarkForSettlement) | **POST** /orders/settlements | Mark Order For Settlement | | [**PGOrderFetchSettlement**](SettlementsApi.md#PGOrderFetchSettlement) | **GET** /orders/{order_id}/settlements | Get Settlements by Order ID | +## MarkForSettlement + +> Object MarkForSettlement(xApiVersion, xRequestId, xIdempotencyKey, createOrderSettlementRequestBody) + +Mark Order For Settlement + +Use this API to pass the CBRICS ID to Cashfree and mark an order for settlement. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + CreateOrderSettlementRequestBody createOrderSettlementRequestBody = new CreateOrderSettlementRequestBody(); // CreateOrderSettlementRequestBody | Create Order Settlement Request Body. + try { + Object result = cashfree.MarkForSettlement(xApiVersion, xRequestId, xIdempotencyKey, createOrderSettlementRequestBodyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SettlementsApi#MarkForSettlement"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | +| **createOrderSettlementRequestBody** | [**CreateOrderSettlementRequestBody**](CreateOrderSettlementRequestBody.md)| Create Order Settlement Request Body. | [optional] | + +### Return type + +**Object** + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | OK | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Create Settlement Failure Response. | - | +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Create Settlement Failure Response. | - | +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + ## PGOrderFetchSettlement > SettlementEntity PGOrderFetchSettlement(xApiVersion, orderId, xRequestId, xIdempotencyKey) diff --git a/docs/SimulateRequest.md b/docs/SimulateRequest.md new file mode 100644 index 00000000..e56555f4 --- /dev/null +++ b/docs/SimulateRequest.md @@ -0,0 +1,25 @@ + + +# SimulateRequest + +simulate payment request object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**entity** | [**EntityEnum**](#EntityEnum) | Entity type should be PAYMENTS only. | | +|**entityId** | **String** | In case of Entity type is PAYMENTS, entity_id will be transactionId | | +|**entitySimulation** | [**EntitySimulationRequest**](EntitySimulationRequest.md) | | | + + + +## Enum: EntityEnum + +| Name | Value | +|---- | -----| +| PAYMENTS | "PAYMENTS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/SimulationApi.md b/docs/SimulationApi.md new file mode 100644 index 00000000..240ef4d3 --- /dev/null +++ b/docs/SimulationApi.md @@ -0,0 +1,166 @@ +# SimulationApi + +All URIs are relative to *https://sandbox.cashfree.com/pg* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**PGFetchSimulation**](SimulationApi.md#PGFetchSimulation) | **GET** /simulate/{simulation_id} | Fetch Simulation | +| [**PGSimulatePayment**](SimulationApi.md#PGSimulatePayment) | **POST** /simulate | Simulate Payment | + + + +## PGFetchSimulation + +> SimulationResponse PGFetchSimulation(xApiVersion, simulationId, xRequestId, xIdempotencyKey) + +Fetch Simulation + +Use this API to fetch simulated payment details. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String simulationId = "sim_2900842gV18Lhh7owswLj5XF0uHHUn1CX"; // String | Provide the SimulationId for which the details have to be fetched. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SimulationResponse result = cashfree.PGFetchSimulation(xApiVersion, simulationId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SimulationApi#PGFetchSimulation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **simulationId** | **String**| Provide the SimulationId for which the details have to be fetched. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SimulationResponse**](SimulationResponse.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Simulated Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## PGSimulatePayment + +> SimulationResponse PGSimulatePayment(xApiVersion, simulateRequest, xRequestId, xIdempotencyKey) + +Simulate Payment + +Use this API to simulate payment. To use this API you should first create an order using the Create Order API. Also, you need to create a payment with the same order. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + SimulateRequest simulateRequest = new SimulateRequest(); // SimulateRequest | Request Body to Make Simulation + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SimulationResponse result = cashfree.PGSimulatePayment(xApiVersion, simulateRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SimulationApi#PGSimulatePayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **simulateRequest** | [**SimulateRequest**](SimulateRequest.md)| Request Body to Make Simulation | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SimulationResponse**](SimulationResponse.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Payment Simulated Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + diff --git a/docs/SimulationResponse.md b/docs/SimulationResponse.md new file mode 100644 index 00000000..93e7e15c --- /dev/null +++ b/docs/SimulationResponse.md @@ -0,0 +1,17 @@ + + +# SimulationResponse + +Simulation response object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**simulationId** | **String** | | [optional] | +|**entity** | **String** | | [optional] | +|**entityId** | **String** | | [optional] | +|**entitySimulation** | [**EntitySimulationResponse**](EntitySimulationResponse.md) | | [optional] | + + + diff --git a/docs/SubsCreatePayment200Response.md b/docs/SubsCreatePayment200Response.md new file mode 100644 index 00000000..a88dbc37 --- /dev/null +++ b/docs/SubsCreatePayment200Response.md @@ -0,0 +1,22 @@ + + +# SubsCreatePayment200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cfPaymentId** | **String** | Cashfree subscription payment reference number | [optional] | +|**cfSubscriptionId** | **String** | Cashfree subscription reference number | [optional] | +|**failureDetails** | [**CreateSubscriptionPaymentAuthResponseFailureDetails**](CreateSubscriptionPaymentAuthResponseFailureDetails.md) | | [optional] | +|**paymentAmount** | **BigDecimal** | The charge amount of the payment. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**paymentInitiatedDate** | **String** | The date on which the payment was initiated. | [optional] | +|**paymentStatus** | **String** | Status of the payment. | [optional] | +|**paymentType** | **String** | Payment type. Can be AUTH or CHARGE. | [optional] | +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | [optional] | +|**paymentMethod** | **String** | Payment method used for the authorization. | [optional] | + + + diff --git a/docs/SubscriptionApi.md b/docs/SubscriptionApi.md new file mode 100644 index 00000000..538be247 --- /dev/null +++ b/docs/SubscriptionApi.md @@ -0,0 +1,1061 @@ +# SubscriptionApi + +All URIs are relative to *https://sandbox.cashfree.com/pg* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**SubsCreatePayment**](SubscriptionApi.md#SubsCreatePayment) | **POST** /subscriptions/pay | Raise a charge or create an auth. | +| [**SubsCreatePlan**](SubscriptionApi.md#SubsCreatePlan) | **POST** /plans | Create a plan. | +| [**SubsCreateRefund**](SubscriptionApi.md#SubsCreateRefund) | **POST** /subscriptions/{subscription_id}/refunds | Create a refund. | +| [**SubsCreateSubscription**](SubscriptionApi.md#SubsCreateSubscription) | **POST** /subscriptions | Create Subscription | +| [**SubsFetchPlan**](SubscriptionApi.md#SubsFetchPlan) | **GET** /pg/plans/{plan_id} | Fetch Plan | +| [**SubsFetchSubscription**](SubscriptionApi.md#SubsFetchSubscription) | **GET** /subscriptions/{subscription_id} | Fetch Subscription | +| [**SubsFetchSubscriptionPayment**](SubscriptionApi.md#SubsFetchSubscriptionPayment) | **GET** /subscriptions/{subscription_id}/payments/{payment_id} | Fetch details of a single payment. | +| [**SubsFetchSubscriptionPayments**](SubscriptionApi.md#SubsFetchSubscriptionPayments) | **GET** /subscriptions/{subscription_id}/payments | Fetch details of all payments of a subscription. | +| [**SubsFetchSubscriptionRefund**](SubscriptionApi.md#SubsFetchSubscriptionRefund) | **GET** /subscriptions/{subscription_id}/refunds/{refund_id} | Fetch details of a refund. | +| [**SubsManageSubscription**](SubscriptionApi.md#SubsManageSubscription) | **POST** /subscriptions/{subscription_id}/manage | Manage a subscription. | +| [**SubsManageSubscriptionPayment**](SubscriptionApi.md#SubsManageSubscriptionPayment) | **POST** /subscriptions/{subscription_id}/payments/{payment_id}/manage | Manage a single payment. | +| [**SubscriptionDocumentUpload**](SubscriptionApi.md#SubscriptionDocumentUpload) | **POST** /subscriptions/pay/documents/{payment_id} | Upload Physical Nach for Physical Nach Authorization. | +| [**SubscriptionEligibility**](SubscriptionApi.md#SubscriptionEligibility) | **POST** /subscriptions/eligibility/payment_methods | Get Eligible payment methods available for a subscription | + + + +## SubsCreatePayment + +> SubsCreatePayment200Response SubsCreatePayment(xApiVersion, createSubscriptionPaymentRequest, xRequestId, xIdempotencyKey) + +Raise a charge or create an auth. + +Use this API to create an auth or to raise a charge . + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + CreateSubscriptionPaymentRequest createSubscriptionPaymentRequest = new CreateSubscriptionPaymentRequest(); // CreateSubscriptionPaymentRequest | Request body to create a subscription payment. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubsCreatePayment200Response result = cashfree.SubsCreatePayment(xApiVersion, createSubscriptionPaymentRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsCreatePayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **createSubscriptionPaymentRequest** | [**CreateSubscriptionPaymentRequest**](CreateSubscriptionPaymentRequest.md)| Request body to create a subscription payment. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubsCreatePayment200Response**](SubsCreatePayment200Response.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response of created payment. | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsCreatePlan + +> PlanEntity SubsCreatePlan(xApiVersion, createPlanRequest, xRequestId, xIdempotencyKey) + +Create a plan. + +A plan allows your customer to identify the features you offer along with your pricing. You can create plans as per the pricing you support for your services. For each plan, you can set a pre-decided frequency and amount with which they’ll be charged. Example: Netflix Plans - Premium, Basic, Standard, Mobile. Each plan differs and caters for a particular set of audiences. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + CreatePlanRequest createPlanRequest = new CreatePlanRequest(); // CreatePlanRequest | Request body to create a plan. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + PlanEntity result = cashfree.SubsCreatePlan(xApiVersion, createPlanRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsCreatePlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **createPlanRequest** | [**CreatePlanRequest**](CreatePlanRequest.md)| Request body to create a plan. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**PlanEntity**](PlanEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Plan Created | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsCreateRefund + +> SubscriptionPaymentRefundEntity SubsCreateRefund(xApiVersion, subscriptionId, createSubscriptionRefundRequest, xRequestId, xIdempotencyKey) + +Create a refund. + +This API allows you to create refund on a successful payment. Refund amount can be partial or the full amount of the payment. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + CreateSubscriptionRefundRequest createSubscriptionRefundRequest = new CreateSubscriptionRefundRequest(); // CreateSubscriptionRefundRequest | Request body to create a subscription refund. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionPaymentRefundEntity result = cashfree.SubsCreateRefund(xApiVersion, subscriptionId, createSubscriptionRefundRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsCreateRefund"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **createSubscriptionRefundRequest** | [**CreateSubscriptionRefundRequest**](CreateSubscriptionRefundRequest.md)| Request body to create a subscription refund. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionPaymentRefundEntity**](SubscriptionPaymentRefundEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Refund Initiated | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsCreateSubscription + +> SubscriptionEntity SubsCreateSubscription(xApiVersion, createSubscriptionRequest, xRequestId, xIdempotencyKey) + +Create Subscription + +Use this API to create a new subscription. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + CreateSubscriptionRequest createSubscriptionRequest = new CreateSubscriptionRequest(); // CreateSubscriptionRequest | Request body to create a subscription. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionEntity result = cashfree.SubsCreateSubscription(xApiVersion, createSubscriptionRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsCreateSubscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **createSubscriptionRequest** | [**CreateSubscriptionRequest**](CreateSubscriptionRequest.md)| Request body to create a subscription. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionEntity**](SubscriptionEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscription Created | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsFetchPlan + +> PlanEntity SubsFetchPlan(xApiVersion, planId, xRequestId, xIdempotencyKey) + +Fetch Plan + +Use this API to fetch plan details. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String planId = "plan-id-123"; // String | Provide the PlanId for which the details have to be fetched. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + PlanEntity result = cashfree.SubsFetchPlan(xApiVersion, planId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsFetchPlan"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **planId** | **String**| Provide the PlanId for which the details have to be fetched. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**PlanEntity**](PlanEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Plan Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsFetchSubscription + +> SubscriptionEntity SubsFetchSubscription(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey) + +Fetch Subscription + +Use this API to fetch subscription details. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionEntity result = cashfree.SubsFetchSubscription(xApiVersion, subscriptionId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsFetchSubscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionEntity**](SubscriptionEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Subscription Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsFetchSubscriptionPayment + +> SubscriptionPaymentEntity SubsFetchSubscriptionPayment(xApiVersion, subscriptionId, paymentId, xRequestId, xIdempotencyKey) + +Fetch details of a single payment. + +Use this API to fetch details of a single payment of a subscription. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + String paymentId = "payment-id-123"; // String | Provide the PaymentId using which the payment was created. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionPaymentEntity result = cashfree.SubsFetchSubscriptionPayment(xApiVersion, subscriptionId, paymentId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsFetchSubscriptionPayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **paymentId** | **String**| Provide the PaymentId using which the payment was created. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionPaymentEntity**](SubscriptionPaymentEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Payment Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsFetchSubscriptionPayments + +> List<SubscriptionPaymentEntity> SubsFetchSubscriptionPayments(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey) + +Fetch details of all payments of a subscription. + +Use this API to fetch all payments of a subscription. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + List result = cashfree.SubsFetchSubscriptionPayments(xApiVersion, subscriptionId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsFetchSubscriptionPayments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**List<SubscriptionPaymentEntity>**](SubscriptionPaymentEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched all payments of subscription | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsFetchSubscriptionRefund + +> SubscriptionPaymentRefundEntity SubsFetchSubscriptionRefund(xApiVersion, subscriptionId, refundId, xRequestId, xIdempotencyKey) + +Fetch details of a refund. + +Use this API to fetch details of a refund of a subscription payment. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + String refundId = "refund-id-123"; // String | Provide the PaymentId for which the details have to be fetched. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionPaymentRefundEntity result = cashfree.SubsFetchSubscriptionRefund(xApiVersion, subscriptionId, refundId, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsFetchSubscriptionRefund"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **refundId** | **String**| Provide the PaymentId for which the details have to be fetched. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionPaymentRefundEntity**](SubscriptionPaymentRefundEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Refund Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsManageSubscription + +> SubscriptionEntity SubsManageSubscription(xApiVersion, subscriptionId, manageSubscriptionRequest, xRequestId, xIdempotencyKey) + +Manage a subscription. + +Use this API to manage a subscription. You can cancel, pause, activate or change the plan of a subscription. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + ManageSubscriptionRequest manageSubscriptionRequest = new ManageSubscriptionRequest(); // ManageSubscriptionRequest | Request body to manage a subscription. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionEntity result = cashfree.SubsManageSubscription(xApiVersion, subscriptionId, manageSubscriptionRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsManageSubscription"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **manageSubscriptionRequest** | [**ManageSubscriptionRequest**](ManageSubscriptionRequest.md)| Request body to manage a subscription. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionEntity**](SubscriptionEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscription Updated | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubsManageSubscriptionPayment + +> SubscriptionPaymentEntity SubsManageSubscriptionPayment(xApiVersion, subscriptionId, paymentId, manageSubscriptionPaymentRequest, xRequestId, xIdempotencyKey) + +Manage a single payment. + +Use this API to manage a payment of a subscription. A payment can be cancelled or retried with this API. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String subscriptionId = "subscription-id-123"; // String | Provide the SubscriptionId using which the subscription was created. + String paymentId = "payment-id-123"; // String | Provide the PaymentId using which the payment was created. + ManageSubscriptionPaymentRequest manageSubscriptionPaymentRequest = new ManageSubscriptionPaymentRequest(); // ManageSubscriptionPaymentRequest | Request body to manage a subscription payment. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionPaymentEntity result = cashfree.SubsManageSubscriptionPayment(xApiVersion, subscriptionId, paymentId, manageSubscriptionPaymentRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubsManageSubscriptionPayment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionId** | **String**| Provide the SubscriptionId using which the subscription was created. | | +| **paymentId** | **String**| Provide the PaymentId using which the payment was created. | | +| **manageSubscriptionPaymentRequest** | [**ManageSubscriptionPaymentRequest**](ManageSubscriptionPaymentRequest.md)| Request body to manage a subscription payment. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionPaymentEntity**](SubscriptionPaymentEntity.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Fetched Manage Payment Response | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
| +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubscriptionDocumentUpload + +> UploadPnachImageResponse SubscriptionDocumentUpload(xApiVersion, paymentId, _file, paymentId2, action, xRequestId, xIdempotencyKey) + +Upload Physical Nach for Physical Nach Authorization. + +Use this API to upload Physical Nach for Physical Nach Authorization. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + String paymentId = "payment-id-123"; // String | Provide the PaymentId using which the payment was created. + File _file = new File("/path/to/file"); // File | Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. + String paymentId2 = "paymentId_example"; // String | Authorization Payment Id for physical nach authorization + String action = "action_example"; // String | Action to be performed on the file. Can be SUBMIT_DOCUMENT + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + UploadPnachImageResponse result = cashfree.SubscriptionDocumentUpload(xApiVersion, paymentId, _file, paymentId2, action, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubscriptionDocumentUpload"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **paymentId** | **String**| Provide the PaymentId using which the payment was created. | | +| **_file** | **File**| Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. | | +| **paymentId2** | **String**| Authorization Payment Id for physical nach authorization | | +| **action** | **String**| Action to be performed on the file. Can be SUBMIT_DOCUMENT | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**UploadPnachImageResponse**](UploadPnachImageResponse.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Upload Pnach Image 200 response. | - | +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + + +## SubscriptionEligibility + +> SubscriptionEligibilityResponse SubscriptionEligibility(xApiVersion, subscriptionEligibilityRequest, xRequestId, xIdempotencyKey) + +Get Eligible payment methods available for a subscription + +Use this API to check if a payment method is enabled for your account. + +### Example + +```java +// Import classes: +import com.cashfree.*; +import com.cashfree.models.*; + + +public class Example { + public static void main(String[] args) { + + Cashfree.XClientId = "TEST32461bf279b7ab306cdae3b423"; + Cashfree.XClientSecret = "TEST4a3236fe94e6b1e0e60b875639e2008695b977b2"; + Cashfree.XEnvironment = Cashfree.SANDBOX; + + Cashfree cashfree = new Cashfree(); + + String xApiVersion = "2023-08-01"; // String | API version to be used. Format is in YYYY-MM-DD + SubscriptionEligibilityRequest subscriptionEligibilityRequest = new SubscriptionEligibilityRequest(); // SubscriptionEligibilityRequest | Request body to fetch subscription eligibile payment method details. + String xRequestId = "4dfb9780-46fe-11ee-be56-0242ac120002"; // String | Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree + UUID xIdempotencyKey = UUID.fromString("47bf8872-46fe-11ee-be56-0242ac120002"); // UUID | An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. + try { + SubscriptionEligibilityResponse result = cashfree.SubscriptionEligibility(xApiVersion, subscriptionEligibilityRequest, xRequestId, xIdempotencyKeyOkHttpClient httpClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SubscriptionApi#SubscriptionEligibility"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xApiVersion** | **String**| API version to be used. Format is in YYYY-MM-DD | [default to 2023-08-01] | +| **subscriptionEligibilityRequest** | [**SubscriptionEligibilityRequest**](SubscriptionEligibilityRequest.md)| Request body to fetch subscription eligibile payment method details. | | +| **xRequestId** | **String**| Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree | [optional] | +| **xIdempotencyKey** | **UUID**| An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. | [optional] | + +### Return type + +[**SubscriptionEligibilityResponse**](SubscriptionEligibilityResponse.md) + +### Authorization + +[XPartnerAPIKey](../README.md#XPartnerAPIKey), [XClientSecret](../README.md#XClientSecret), [XPartnerMerchantID](../README.md#XPartnerMerchantID), [XClientID](../README.md#XClientID), [XClientSignatureHeader](../README.md#XClientSignatureHeader) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Subscrition eligibility API 200 response | - | +| **400** | Bad request error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **401** | Authentication Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **404** | Resource Not found | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **422** | Idempotency error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **429** | Rate Limit Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| +| **500** | API related Error | * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
| + diff --git a/docs/SubscriptionBankDetails.md b/docs/SubscriptionBankDetails.md new file mode 100644 index 00000000..177f9ad3 --- /dev/null +++ b/docs/SubscriptionBankDetails.md @@ -0,0 +1,16 @@ + + +# SubscriptionBankDetails + +Bank details object + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bankId** | **String** | ID of the bank. | [optional] | +|**bankName** | **String** | Name of the bank. | [optional] | +|**accountAuthModes** | **List<String>** | List of account authentication modes supported by the bank. (e.g. DEBIT_CARD, NET_BANKING, AADHAAR) | [optional] | + + + diff --git a/docs/SubscriptionCustomerDetails.md b/docs/SubscriptionCustomerDetails.md new file mode 100644 index 00000000..e56090d4 --- /dev/null +++ b/docs/SubscriptionCustomerDetails.md @@ -0,0 +1,21 @@ + + +# SubscriptionCustomerDetails + +Subscription customer details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**customerName** | **String** | Name of the customer. | [optional] | +|**customerEmail** | **String** | Email of the customer. | | +|**customerPhone** | **String** | Phone number of the customer. | | +|**customerBankAccountHolderName** | **String** | Bank holder name of the customer. | [optional] | +|**customerBankAccountNumber** | **String** | Bank account number of the customer. | [optional] | +|**customerBankIfsc** | **String** | IFSC code of the customer. | [optional] | +|**customerBankCode** | **String** | Bank code of the customer. | [optional] | +|**customerBankAccountType** | **String** | Bank account type of the customer. | [optional] | + + + diff --git a/docs/SubscriptionEligibilityRequest.md b/docs/SubscriptionEligibilityRequest.md new file mode 100644 index 00000000..b44316ae --- /dev/null +++ b/docs/SubscriptionEligibilityRequest.md @@ -0,0 +1,15 @@ + + +# SubscriptionEligibilityRequest + +Request body to fetch subscription eligibile payment method details. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**queries** | [**SubscriptionEligibilityRequestQueries**](SubscriptionEligibilityRequestQueries.md) | | | +|**filters** | [**SubscriptionEligibilityRequestFilters**](SubscriptionEligibilityRequestFilters.md) | | [optional] | + + + diff --git a/docs/SubscriptionEligibilityRequestFilters.md b/docs/SubscriptionEligibilityRequestFilters.md new file mode 100644 index 00000000..1433b68c --- /dev/null +++ b/docs/SubscriptionEligibilityRequestFilters.md @@ -0,0 +1,14 @@ + + +# SubscriptionEligibilityRequestFilters + +Filters to refine eligible payment method selection. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paymentMethods** | **List<String>** | Possbile values in array - enach, pnach, upi, card. | [optional] | + + + diff --git a/docs/SubscriptionEligibilityRequestQueries.md b/docs/SubscriptionEligibilityRequestQueries.md new file mode 100644 index 00000000..276620c7 --- /dev/null +++ b/docs/SubscriptionEligibilityRequestQueries.md @@ -0,0 +1,14 @@ + + +# SubscriptionEligibilityRequestQueries + +Necessary parameters to fetch eligible payment methods. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription | | + + + diff --git a/docs/SubscriptionEligibilityResponse.md b/docs/SubscriptionEligibilityResponse.md new file mode 100644 index 00000000..bf024cec --- /dev/null +++ b/docs/SubscriptionEligibilityResponse.md @@ -0,0 +1,14 @@ + + +# SubscriptionEligibilityResponse + +Subscrition eligibility API response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**List<EligibilityMethodItem>**](EligibilityMethodItem.md) | List of eligibile payment methods for the subscription. | [optional] | + + + diff --git a/docs/SubscriptionEntity.md b/docs/SubscriptionEntity.md new file mode 100644 index 00000000..76a04e9e --- /dev/null +++ b/docs/SubscriptionEntity.md @@ -0,0 +1,25 @@ + + +# SubscriptionEntity + +The response returned for Get, Create or Manage Subscription APIs. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authorisationDetails** | [**AuthorizationDetails**](AuthorizationDetails.md) | | [optional] | +|**cfSubscriptionId** | **String** | Cashfree subscription reference number | [optional] | +|**customerDetails** | [**SubscriptionCustomerDetails**](SubscriptionCustomerDetails.md) | | [optional] | +|**planDetails** | [**PlanEntity**](PlanEntity.md) | | [optional] | +|**subscriptionExpiryTime** | **String** | Time at which the subscription will expire. | [optional] | +|**subscriptionFirstChargeTime** | **String** | Time at which the first charge will be made for the subscription. Applicable only for PERIODIC plans. | [optional] | +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | [optional] | +|**subscriptionMeta** | [**SubscriptionEntitySubscriptionMeta**](SubscriptionEntitySubscriptionMeta.md) | | [optional] | +|**subscriptionNote** | **String** | Note for the subscription. | [optional] | +|**subscriptionPaymentSplits** | [**List<SubscriptionPaymentSplitItem>**](SubscriptionPaymentSplitItem.md) | Payment splits for the subscription. | [optional] | +|**subscriptionStatus** | **String** | Status of the subscription. | [optional] | +|**subscriptionTags** | **Object** | Tags for the subscription. | [optional] | + + + diff --git a/docs/SubscriptionEntitySubscriptionMeta.md b/docs/SubscriptionEntitySubscriptionMeta.md new file mode 100644 index 00000000..4b780179 --- /dev/null +++ b/docs/SubscriptionEntitySubscriptionMeta.md @@ -0,0 +1,14 @@ + + +# SubscriptionEntitySubscriptionMeta + +Subscription metadata. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**returnUrl** | **String** | Return URL for the subscription. | [optional] | + + + diff --git a/docs/SubscriptionPaymentEntity.md b/docs/SubscriptionPaymentEntity.md new file mode 100644 index 00000000..3e3d859a --- /dev/null +++ b/docs/SubscriptionPaymentEntity.md @@ -0,0 +1,28 @@ + + +# SubscriptionPaymentEntity + +The response returned in Get, Create or Manage Subscription Payment APIs. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**authorizationDetails** | [**AuthorizationDetails**](AuthorizationDetails.md) | | [optional] | +|**cfPaymentId** | **String** | Cashfree subscription payment reference number | [optional] | +|**cfSubscriptionId** | **String** | Cashfree subscription reference number | [optional] | +|**cfTxnId** | **String** | Cashfree subscription payment transaction ID | [optional] | +|**cfOrderId** | **String** | Cashfree subscription payment order ID | [optional] | +|**failureDetails** | [**CreateSubscriptionPaymentAuthResponseFailureDetails**](CreateSubscriptionPaymentAuthResponseFailureDetails.md) | | [optional] | +|**paymentAmount** | **BigDecimal** | The charge amount of the payment. | [optional] | +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**paymentInitiatedDate** | **String** | The date on which the payment was initiated. | [optional] | +|**paymentRemarks** | **String** | Payment remarks. | [optional] | +|**paymentScheduleDate** | **String** | The date on which the payment is scheduled to be processed. | [optional] | +|**paymentStatus** | **String** | Status of the payment. | [optional] | +|**paymentType** | **String** | Payment type. Can be AUTH or CHARGE. | [optional] | +|**retryAttempts** | **Integer** | Retry attempts. | [optional] | +|**subscriptionId** | **String** | A unique ID passed by merchant for identifying the subscription. | [optional] | + + + diff --git a/docs/SubscriptionPaymentRefundEntity.md b/docs/SubscriptionPaymentRefundEntity.md new file mode 100644 index 00000000..76414d6a --- /dev/null +++ b/docs/SubscriptionPaymentRefundEntity.md @@ -0,0 +1,21 @@ + + +# SubscriptionPaymentRefundEntity + +Get/Create Subscription Payment Refund Response + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paymentId** | **String** | A unique ID passed by merchant for identifying the transaction. | [optional] | +|**cfPaymentId** | **String** | Cashfree subscription payment reference number. | [optional] | +|**refundId** | **String** | A unique ID passed by merchant for identifying the refund. | [optional] | +|**cfRefundId** | **String** | Cashfree subscription payment refund reference number. | [optional] | +|**refundAmount** | **BigDecimal** | The refund amount. | [optional] | +|**refundNote** | **String** | Refund note. | [optional] | +|**refundSpeed** | **String** | Refund speed. Can be INSTANT or NORMAL. | [optional] | +|**refundStatus** | **String** | Status of the refund. | [optional] | + + + diff --git a/docs/SubscriptionPaymentSplitItem.md b/docs/SubscriptionPaymentSplitItem.md new file mode 100644 index 00000000..1983f07b --- /dev/null +++ b/docs/SubscriptionPaymentSplitItem.md @@ -0,0 +1,15 @@ + + +# SubscriptionPaymentSplitItem + +Subscription Payment Split Item + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vendorId** | **String** | Vendor ID | [optional] | +|**percentage** | **BigDecimal** | Percentage of the payment to be split to vendor | [optional] | + + + diff --git a/docs/TerminalDetails.md b/docs/TerminalDetails.md index 1e0bad6c..17cf9d71 100644 --- a/docs/TerminalDetails.md +++ b/docs/TerminalDetails.md @@ -12,7 +12,7 @@ Use this if you are creating an order for cashfree's softPOS |**cfTerminalId** | **String** | cashfree terminal id | [optional] | |**lastUpdatedOn** | **String** | last instant when this terminal was updated | [optional] | |**terminalAddress** | **String** | location of terminal | [optional] | -|**terminalId** | **String** | terminal id for merchant reference | | +|**terminalId** | **String** | terminal id for merchant reference | [optional] | |**terminalName** | **String** | name of terminal/agent/storefront | [optional] | |**terminalNote** | **String** | note given by merchant while creating the terminal | [optional] | |**terminalPhoneNo** | **String** | mobile num of the terminal/agent/storefront | | diff --git a/docs/TerminateOrderRequest.md b/docs/TerminateOrderRequest.md index a18c17fe..e0a3254d 100644 --- a/docs/TerminateOrderRequest.md +++ b/docs/TerminateOrderRequest.md @@ -8,7 +8,7 @@ Request to terminate an active order at Cashfree | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**orderStatus** | **String** | To terminate an order, pass order_status as \"TERMINATE\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated. | | +|**orderStatus** | **String** | To terminate an order, pass order_status as \"TERMINATED\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated. | | diff --git a/docs/UpdateVendorRequest.md b/docs/UpdateVendorRequest.md index ca6b6110..6963732d 100644 --- a/docs/UpdateVendorRequest.md +++ b/docs/UpdateVendorRequest.md @@ -14,7 +14,7 @@ Update Vendor Request |**phone** | **String** | Specify the beneficiaries phone number to be updated. Phone number registered in India (only digits, 8 - 12 characters after excluding +91). | | |**verifyAccount** | **Boolean** | Specify if the vendor bank account details should be verified. Possible values: true or false | [optional] | |**dashboardAccess** | **Boolean** | Update if the vendor will have dashboard access or not. Possible values are: true or false | [optional] | -|**scheduleOption** | **BigDecimal** | Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. | | +|**scheduleOption** | **BigDecimal** | Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. | | |**bank** | [**List<BankDetails>**](BankDetails.md) | Specify the vendor bank account details to be updated. | [optional] | |**upi** | [**List<UpiDetails>**](UpiDetails.md) | Updated beneficiary upi vpa. Alphanumeric, dot (.), hyphen (-), at sign (@), and underscore allowed (100 character limit). Note: underscore and dot (.) gets accepted before and after @, but hyphen (-) is only accepted before @ sign. | [optional] | |**kycDetails** | [**List<KycDetails>**](KycDetails.md) | Specify the kyc details that should be updated. | | diff --git a/docs/UpdateVendorResponse.md b/docs/UpdateVendorResponse.md index 2895dae7..ec1e1c3f 100644 --- a/docs/UpdateVendorResponse.md +++ b/docs/UpdateVendorResponse.md @@ -24,7 +24,7 @@ Update Vendor Response |**kycDetails** | [**List<KycDetails>**](KycDetails.md) | | [optional] | |**dashboardAccess** | **Boolean** | | [optional] | |**bankDetails** | **String** | | [optional] | -|**relatedDocs** | [**List<VendorEntityRelatedDocsInner>**](VendorEntityRelatedDocsInner.md) | | [optional] | +|**relatedDocs** | [**List<UpdateVendorResponseRelatedDocsInner>**](UpdateVendorResponseRelatedDocsInner.md) | | [optional] | diff --git a/docs/UpdateVendorResponseRelatedDocsInner.md b/docs/UpdateVendorResponseRelatedDocsInner.md new file mode 100644 index 00000000..a5b9a9cb --- /dev/null +++ b/docs/UpdateVendorResponseRelatedDocsInner.md @@ -0,0 +1,17 @@ + + +# UpdateVendorResponseRelatedDocsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**vendorId** | **String** | | [optional] | +|**docType** | **String** | | [optional] | +|**docValue** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**remarks** | **String** | | [optional] | + + + diff --git a/docs/UploadPnachImageResponse.md b/docs/UploadPnachImageResponse.md new file mode 100644 index 00000000..6ab0871d --- /dev/null +++ b/docs/UploadPnachImageResponse.md @@ -0,0 +1,17 @@ + + +# UploadPnachImageResponse + +Response of pnach image upload API. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**paymentId** | **String** | The payment_id against which the pnach image is uploaded. | [optional] | +|**authorizationStatus** | **String** | Authorization status of the subscription. | [optional] | +|**action** | **String** | Action performed on the file. | [optional] | +|**paymentMessage** | **String** | Message of the API. | [optional] | + + + diff --git a/docs/VendorDocumentsResponse.md b/docs/VendorDocumentsResponse.md index 6e679d7e..999eddf3 100644 --- a/docs/VendorDocumentsResponse.md +++ b/docs/VendorDocumentsResponse.md @@ -8,7 +8,7 @@ Get Vendor Documents | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**documents** | [**List<VendorEntityRelatedDocsInner>**](VendorEntityRelatedDocsInner.md) | | [optional] | +|**documents** | [**List<UpdateVendorResponseRelatedDocsInner>**](UpdateVendorResponseRelatedDocsInner.md) | | [optional] | diff --git a/docs/VendorEntity.md b/docs/VendorEntity.md index 6b393c83..245acc24 100644 --- a/docs/VendorEntity.md +++ b/docs/VendorEntity.md @@ -21,7 +21,8 @@ Vendor entity object |**vendorType** | **String** | | [optional] | |**accountType** | **String** | | [optional] | |**businessType** | **String** | | [optional] | -|**relatedDocs** | [**List<VendorEntityRelatedDocsInner>**](VendorEntityRelatedDocsInner.md) | | [optional] | +|**remarks** | **String** | | [optional] | +|**relatedDocs** | [**List<UpdateVendorResponseRelatedDocsInner>**](UpdateVendorResponseRelatedDocsInner.md) | | [optional] | diff --git a/pom.xml b/pom.xml index 3a519d2f..7e34a085 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ cashfree_pg jar cashfree_pg - 4.1.4 + 4.2.0 https://github.com/cashfree/cashfree-pg-sdk-java Java Framework for Cashfree Payment Gateway. diff --git a/src/main/java/com/cashfree/ApiException.java b/src/main/java/com/cashfree/ApiException.java index bf6b6509..2bbb67ca 100644 --- a/src/main/java/com/cashfree/ApiException.java +++ b/src/main/java/com/cashfree/ApiException.java @@ -21,7 +21,7 @@ *

ApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; diff --git a/src/main/java/com/cashfree/Cashfree.java b/src/main/java/com/cashfree/Cashfree.java index 8d4f9dbe..a3695933 100644 --- a/src/main/java/com/cashfree/Cashfree.java +++ b/src/main/java/com/cashfree/Cashfree.java @@ -199,7 +199,7 @@ public okhttp3.Call pGCreateCustomerCall(String xApiVersion, CreateCustomerReque localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -321,7 +321,7 @@ public okhttp3.Call pGESCreateOnDemandTransferCall(String xApiVersion, String ve localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -441,7 +441,7 @@ public okhttp3.Call pGESCreateVendorsCall(String xApiVersion, String xRequestId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -557,7 +557,7 @@ public okhttp3.Call pGESDownloadVendorsDocsCall(String xApiVersion, String docTy localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -682,7 +682,7 @@ public okhttp3.Call pGESFetchVendorsCall(String xApiVersion, String vendorId, St localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -802,7 +802,7 @@ public okhttp3.Call pGESGetVendorBalanceCall(String xApiVersion, String vendorId localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -927,7 +927,7 @@ public okhttp3.Call pGESGetVendorBalanceTransferChargesCall(String xApiVersion, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1052,7 +1052,7 @@ public okhttp3.Call pGESGetVendorsDocsCall(String xApiVersion, String vendorId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1174,7 +1174,7 @@ public okhttp3.Call pGESOrderReconCall(String xApiVersion, String xRequestId, UU localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1291,7 +1291,7 @@ public okhttp3.Call pGESUpdateVendorsCall(String xApiVersion, String vendorId, S localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1427,7 +1427,7 @@ public okhttp3.Call pGESUploadVendorsDocsCall(String xApiVersion, String vendorI localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1551,7 +1551,7 @@ public okhttp3.Call pGOrderSplitAfterPaymentCall(String xApiVersion, String orde localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1671,7 +1671,7 @@ public okhttp3.Call pGOrderStaticSplitCall(String xApiVersion, String xRequestId localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1793,7 +1793,7 @@ public okhttp3.Call pGEligibilityFetchCardlessEMICall(String xApiVersion, Eligib localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -1919,7 +1919,7 @@ public okhttp3.Call pGEligibilityFetchOffersCall(String xApiVersion, Eligibility localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2046,7 +2046,7 @@ public okhttp3.Call pGEligibilityFetchPaylaterCall(String xApiVersion, Eligibili localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2173,7 +2173,7 @@ public okhttp3.Call pGEligibilityFetchPaymentMethodsCall(String xApiVersion, Eli localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2299,7 +2299,7 @@ public okhttp3.Call pGCreateOfferCall(String xApiVersion, CreateOfferRequest cre localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2425,7 +2425,7 @@ public okhttp3.Call pGFetchOfferCall(String xApiVersion, String offerId, String localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2551,7 +2551,7 @@ public okhttp3.Call pGCreateOrderCall(String xApiVersion, CreateOrderRequest cre localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2677,7 +2677,7 @@ public okhttp3.Call pGFetchOrderCall(String xApiVersion, String orderId, String localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2805,7 +2805,7 @@ public okhttp3.Call pGTerminateOrderCall(String xApiVersion, String orderId, Ter localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -2936,7 +2936,7 @@ public okhttp3.Call pGCancelLinkCall(String xApiVersion, String linkId, String x localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3062,7 +3062,7 @@ public okhttp3.Call pGCreateLinkCall(String xApiVersion, CreateLinkRequest creat localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3189,7 +3189,7 @@ public okhttp3.Call pGFetchLinkCall(String xApiVersion, String linkId, String xR localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3315,7 +3315,7 @@ public okhttp3.Call pGLinkFetchOrdersCall(String xApiVersion, String linkId, Str localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3444,7 +3444,7 @@ public okhttp3.Call pGAuthorizeOrderCall(String xApiVersion, String orderId, Aut localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3578,7 +3578,7 @@ public okhttp3.Call pGOrderAuthenticatePaymentCall(String xApiVersion, String cf localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3712,7 +3712,7 @@ public okhttp3.Call pGOrderFetchPaymentCall(String xApiVersion, String orderId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3844,7 +3844,7 @@ public okhttp3.Call pGOrderFetchPaymentsCall(String xApiVersion, String orderId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -3971,7 +3971,7 @@ public okhttp3.Call pGPayOrderCall(String xApiVersion, PayOrderRequest payOrderR localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4107,7 +4107,7 @@ public okhttp3.Call pGFetchReconCall(String xApiVersion, FetchReconRequest fetch localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4236,7 +4236,7 @@ public okhttp3.Call pGOrderCreateRefundCall(String xApiVersion, String orderId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4370,7 +4370,7 @@ public okhttp3.Call pGOrderFetchRefundCall(String xApiVersion, String orderId, S localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4501,7 +4501,7 @@ public okhttp3.Call pGOrderFetchRefundsCall(String xApiVersion, String orderId, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4637,7 +4637,7 @@ public okhttp3.Call pGFetchSettlementsCall(String xApiVersion, FetchSettlementsR localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4773,7 +4773,7 @@ public okhttp3.Call pGSettlementFetchReconCall(String xApiVersion, SettlementFet localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -4805,10 +4805,2062 @@ public ApiResponse PGSettlementFetchRecon(String xApiVers } + /** + * Build call for markForSettlement + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param createOrderSettlementRequestBody Create Order Settlement Request Body. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 OK * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Create Settlement Failure Response. -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Create Settlement Failure Response. -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call markForSettlementCall(String xApiVersion, String xRequestId, UUID xIdempotencyKey, CreateOrderSettlementRequestBody createOrderSettlementRequestBody, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createOrderSettlementRequestBody; + + // create path and map variables + String localVarPath = "/orders/settlements"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call markForSettlementValidateBeforeCall(String xApiVersion, String xRequestId, UUID xIdempotencyKey, CreateOrderSettlementRequestBody createOrderSettlementRequestBody, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling MarkForSettlement(Async)"); + } + + return markForSettlementCall(xApiVersion, xRequestId, xIdempotencyKey, createOrderSettlementRequestBody, _callback); + + } + + public ApiResponse MarkForSettlement(String xApiVersion, String xRequestId, UUID xIdempotencyKey, CreateOrderSettlementRequestBody createOrderSettlementRequestBody, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = markForSettlementValidateBeforeCall(xApiVersion, xRequestId, xIdempotencyKey, createOrderSettlementRequestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** * Build call for pGOrderFetchSettlement * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param orderId The id which uniquely identifies your order (required) + * @param orderId The id which uniquely identifies your order (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + + +
Status Code Description Response Headers
200 OK * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
502 Bank related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call pGOrderFetchSettlementCall(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/orders/{order_id}/settlements" + .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pGOrderFetchSettlementValidateBeforeCall(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling PGOrderFetchSettlement(Async)"); + } + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException("Missing the required parameter 'orderId' when calling PGOrderFetchSettlement(Async)"); + } + + return pGOrderFetchSettlementCall(xApiVersion, orderId, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse PGOrderFetchSettlement(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = pGOrderFetchSettlementValidateBeforeCall(xApiVersion, orderId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for pGFetchSimulation + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param simulationId Provide the SimulationId for which the details have to be fetched. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Fetched Simulated Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call pGFetchSimulationCall(String xApiVersion, String simulationId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/simulate/{simulation_id}" + .replace("{" + "simulation_id" + "}", localVarApiClient.escapeString(simulationId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pGFetchSimulationValidateBeforeCall(String xApiVersion, String simulationId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling PGFetchSimulation(Async)"); + } + + // verify the required parameter 'simulationId' is set + if (simulationId == null) { + throw new ApiException("Missing the required parameter 'simulationId' when calling PGFetchSimulation(Async)"); + } + + return pGFetchSimulationCall(xApiVersion, simulationId, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse PGFetchSimulation(String xApiVersion, String simulationId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = pGFetchSimulationValidateBeforeCall(xApiVersion, simulationId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for pGSimulatePayment + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param simulateRequest Request Body to Make Simulation (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 Payment Simulated Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call pGSimulatePaymentCall(String xApiVersion, SimulateRequest simulateRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = simulateRequest; + + // create path and map variables + String localVarPath = "/simulate"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pGSimulatePaymentValidateBeforeCall(String xApiVersion, SimulateRequest simulateRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling PGSimulatePayment(Async)"); + } + + // verify the required parameter 'simulateRequest' is set + if (simulateRequest == null) { + throw new ApiException("Missing the required parameter 'simulateRequest' when calling PGSimulatePayment(Async)"); + } + + return pGSimulatePaymentCall(xApiVersion, simulateRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse PGSimulatePayment(String xApiVersion, SimulateRequest simulateRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = pGSimulatePaymentValidateBeforeCall(xApiVersion, simulateRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposCreateTerminal + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param createTerminalRequest Request Body to Create Terminal for SPOS (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Terminal created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposCreateTerminalCall(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createTerminalRequest; + + // create path and map variables + String localVarPath = "/terminal"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposCreateTerminalValidateBeforeCall(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposCreateTerminal(Async)"); + } + + // verify the required parameter 'createTerminalRequest' is set + if (createTerminalRequest == null) { + throw new ApiException("Missing the required parameter 'createTerminalRequest' when calling SposCreateTerminal(Async)"); + } + + return sposCreateTerminalCall(xApiVersion, createTerminalRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SposCreateTerminal(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposCreateTerminalValidateBeforeCall(xApiVersion, createTerminalRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposCreateTerminalTransaction + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param createTerminalTransactionRequest Request body to create a terminal transaction (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Terminal Transaction created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposCreateTerminalTransactionCall(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createTerminalTransactionRequest; + + // create path and map variables + String localVarPath = "/terminal/transactions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposCreateTerminalTransactionValidateBeforeCall(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposCreateTerminalTransaction(Async)"); + } + + // verify the required parameter 'createTerminalTransactionRequest' is set + if (createTerminalTransactionRequest == null) { + throw new ApiException("Missing the required parameter 'createTerminalTransactionRequest' when calling SposCreateTerminalTransaction(Async)"); + } + + return sposCreateTerminalTransactionCall(xApiVersion, createTerminalTransactionRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SposCreateTerminalTransaction(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposCreateTerminalTransactionValidateBeforeCall(xApiVersion, createTerminalTransactionRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposFetchTerminal + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param terminalPhoneNo The terminal for which you want to view the order details. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 OK * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposFetchTerminalCall(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/terminal/{terminal_phone_no}" + .replace("{" + "terminal_phone_no" + "}", localVarApiClient.escapeString(terminalPhoneNo.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposFetchTerminalValidateBeforeCall(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminal(Async)"); + } + + // verify the required parameter 'terminalPhoneNo' is set + if (terminalPhoneNo == null) { + throw new ApiException("Missing the required parameter 'terminalPhoneNo' when calling SposFetchTerminal(Async)"); + } + + return sposFetchTerminalCall(xApiVersion, terminalPhoneNo, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SposFetchTerminal(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposFetchTerminalValidateBeforeCall(xApiVersion, terminalPhoneNo, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposFetchTerminalQRCodes + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param terminalPhoneNo Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. (required) + * @param cfTerminalId Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Fetched Terminal QR Codes * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposFetchTerminalQRCodesCall(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/terminal/qrcodes"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (terminalPhoneNo != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("terminal_phone_no", terminalPhoneNo)); + } + + if (cfTerminalId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("cf_terminal_id", cfTerminalId)); + } + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposFetchTerminalQRCodesValidateBeforeCall(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminalQRCodes(Async)"); + } + + // verify the required parameter 'terminalPhoneNo' is set + if (terminalPhoneNo == null) { + throw new ApiException("Missing the required parameter 'terminalPhoneNo' when calling SposFetchTerminalQRCodes(Async)"); + } + + // verify the required parameter 'cfTerminalId' is set + if (cfTerminalId == null) { + throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposFetchTerminalQRCodes(Async)"); + } + + return sposFetchTerminalQRCodesCall(xApiVersion, terminalPhoneNo, cfTerminalId, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse> SposFetchTerminalQRCodes(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposFetchTerminalQRCodesValidateBeforeCall(xApiVersion, terminalPhoneNo, cfTerminalId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposFetchTerminalTransaction + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param utr Utr of the transaction. (required) + * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Fetch Terminal Transaction * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposFetchTerminalTransactionCall(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/terminal/{cf_terminal_id}/payments" + .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (utr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("utr", utr)); + } + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposFetchTerminalTransactionValidateBeforeCall(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminalTransaction(Async)"); + } + + // verify the required parameter 'utr' is set + if (utr == null) { + throw new ApiException("Missing the required parameter 'utr' when calling SposFetchTerminalTransaction(Async)"); + } + + // verify the required parameter 'cfTerminalId' is set + if (cfTerminalId == null) { + throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposFetchTerminalTransaction(Async)"); + } + + return sposFetchTerminalTransactionCall(xApiVersion, utr, cfTerminalId, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SposFetchTerminalTransaction(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposFetchTerminalTransactionValidateBeforeCall(xApiVersion, utr, cfTerminalId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposUpdateTerminal + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) + * @param updateTerminalRequest Request Body to update terminal for SPOS. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Updated Terminal * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposUpdateTerminalCall(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = updateTerminalRequest; + + // create path and map variables + String localVarPath = "/terminal/{cf_terminal_id}" + .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposUpdateTerminalValidateBeforeCall(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUpdateTerminal(Async)"); + } + + // verify the required parameter 'cfTerminalId' is set + if (cfTerminalId == null) { + throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUpdateTerminal(Async)"); + } + + // verify the required parameter 'updateTerminalRequest' is set + if (updateTerminalRequest == null) { + throw new ApiException("Missing the required parameter 'updateTerminalRequest' when calling SposUpdateTerminal(Async)"); + } + + return sposUpdateTerminalCall(xApiVersion, cfTerminalId, updateTerminalRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse> SposUpdateTerminal(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposUpdateTerminalValidateBeforeCall(xApiVersion, cfTerminalId, updateTerminalRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposUpdateTerminalStatus + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) + * @param updateTerminalStatusRequest Request Body to update terminal status for SPOS. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Updated Terminal Status * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposUpdateTerminalStatusCall(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = updateTerminalStatusRequest; + + // create path and map variables + String localVarPath = "/terminal/{cf_terminal_id}/status" + .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposUpdateTerminalStatusValidateBeforeCall(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUpdateTerminalStatus(Async)"); + } + + // verify the required parameter 'cfTerminalId' is set + if (cfTerminalId == null) { + throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUpdateTerminalStatus(Async)"); + } + + // verify the required parameter 'updateTerminalStatusRequest' is set + if (updateTerminalStatusRequest == null) { + throw new ApiException("Missing the required parameter 'updateTerminalStatusRequest' when calling SposUpdateTerminalStatus(Async)"); + } + + return sposUpdateTerminalStatusCall(xApiVersion, cfTerminalId, updateTerminalStatusRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse> SposUpdateTerminalStatus(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposUpdateTerminalStatusValidateBeforeCall(xApiVersion, cfTerminalId, updateTerminalStatusRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for sposUploadTerminalDocs + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) + * @param uploadTerminalDocs Request Body to update terminal documents for SPOS. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + + +
Status Code Description Response Headers
200 Upload Terminal Docs * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call sposUploadTerminalDocsCall(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = uploadTerminalDocs; + + // create path and map variables + String localVarPath = "/terminal/{cf_terminal_id}/docs" + .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sposUploadTerminalDocsValidateBeforeCall(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUploadTerminalDocs(Async)"); + } + + // verify the required parameter 'cfTerminalId' is set + if (cfTerminalId == null) { + throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUploadTerminalDocs(Async)"); + } + + // verify the required parameter 'uploadTerminalDocs' is set + if (uploadTerminalDocs == null) { + throw new ApiException("Missing the required parameter 'uploadTerminalDocs' when calling SposUploadTerminalDocs(Async)"); + } + + return sposUploadTerminalDocsCall(xApiVersion, cfTerminalId, uploadTerminalDocs, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse> SposUploadTerminalDocs(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = sposUploadTerminalDocsValidateBeforeCall(xApiVersion, cfTerminalId, uploadTerminalDocs, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for subsCreatePayment + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param createSubscriptionPaymentRequest Request body to create a subscription payment. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 response of created payment. * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call subsCreatePaymentCall(String xApiVersion, CreateSubscriptionPaymentRequest createSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createSubscriptionPaymentRequest; + + // create path and map variables + String localVarPath = "/subscriptions/pay"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subsCreatePaymentValidateBeforeCall(String xApiVersion, CreateSubscriptionPaymentRequest createSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsCreatePayment(Async)"); + } + + // verify the required parameter 'createSubscriptionPaymentRequest' is set + if (createSubscriptionPaymentRequest == null) { + throw new ApiException("Missing the required parameter 'createSubscriptionPaymentRequest' when calling SubsCreatePayment(Async)"); + } + + return subsCreatePaymentCall(xApiVersion, createSubscriptionPaymentRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SubsCreatePayment(String xApiVersion, CreateSubscriptionPaymentRequest createSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = subsCreatePaymentValidateBeforeCall(xApiVersion, createSubscriptionPaymentRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for subsCreatePlan + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param createPlanRequest Request body to create a plan. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Plan Created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call subsCreatePlanCall(String xApiVersion, CreatePlanRequest createPlanRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createPlanRequest; + + // create path and map variables + String localVarPath = "/plans"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subsCreatePlanValidateBeforeCall(String xApiVersion, CreatePlanRequest createPlanRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsCreatePlan(Async)"); + } + + // verify the required parameter 'createPlanRequest' is set + if (createPlanRequest == null) { + throw new ApiException("Missing the required parameter 'createPlanRequest' when calling SubsCreatePlan(Async)"); + } + + return subsCreatePlanCall(xApiVersion, createPlanRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SubsCreatePlan(String xApiVersion, CreatePlanRequest createPlanRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = subsCreatePlanValidateBeforeCall(xApiVersion, createPlanRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for subsCreateRefund + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) + * @param createSubscriptionRefundRequest Request body to create a subscription refund. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Refund Initiated * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call subsCreateRefundCall(String xApiVersion, String subscriptionId, CreateSubscriptionRefundRequest createSubscriptionRefundRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createSubscriptionRefundRequest; + + // create path and map variables + String localVarPath = "/subscriptions/{subscription_id}/refunds" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subsCreateRefundValidateBeforeCall(String xApiVersion, String subscriptionId, CreateSubscriptionRefundRequest createSubscriptionRefundRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsCreateRefund(Async)"); + } + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsCreateRefund(Async)"); + } + + // verify the required parameter 'createSubscriptionRefundRequest' is set + if (createSubscriptionRefundRequest == null) { + throw new ApiException("Missing the required parameter 'createSubscriptionRefundRequest' when calling SubsCreateRefund(Async)"); + } + + return subsCreateRefundCall(xApiVersion, subscriptionId, createSubscriptionRefundRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SubsCreateRefund(String xApiVersion, String subscriptionId, CreateSubscriptionRefundRequest createSubscriptionRefundRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = subsCreateRefundValidateBeforeCall(xApiVersion, subscriptionId, createSubscriptionRefundRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for subsCreateSubscription + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param createSubscriptionRequest Request body to create a subscription. (required) + * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) + * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + + +
Status Code Description Response Headers
200 Subscription Created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
+ */ + public okhttp3.Call subsCreateSubscriptionCall(String xApiVersion, CreateSubscriptionRequest createSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + String basePath = "https://sandbox.cashfree.com/pg"; + + if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { + basePath = "https://api.cashfree.com/pg"; + } + + Object localVarPostBody = createSubscriptionRequest; + + // create path and map variables + String localVarPath = "/subscriptions"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (xApiVersion != null) { + localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); + } + + if (xRequestId != null) { + localVarHeaderParams.put("x-request-id", localVarApiClient.parameterToString(xRequestId)); + } + + if (xIdempotencyKey != null) { + localVarHeaderParams.put("x-idempotency-key", localVarApiClient.parameterToString(xIdempotencyKey)); + } + + + if(Cashfree.XClientSecret != null && !Cashfree.XClientSecret.isEmpty()) { + ApiKeyAuth XClientSecret = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSecret"); + XClientSecret.setApiKey(Cashfree.XClientSecret); + } + + if(Cashfree.XClientId != null && !Cashfree.XClientId.isEmpty()) { + ApiKeyAuth XClientID = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientID"); + XClientID.setApiKey(Cashfree.XClientId); + } + + if(Cashfree.XClientSignature != null && !Cashfree.XClientSignature.isEmpty()) { + ApiKeyAuth XClientSignature = (ApiKeyAuth) localVarApiClient.getAuthentication("XClientSignatureHeader"); + XClientSignature.setApiKey(Cashfree.XClientSignature); + } + + if(Cashfree.XPartnerAPIKey != null && !Cashfree.XPartnerAPIKey.isEmpty()) { + ApiKeyAuth XPartnerAPIKey = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerAPIKey"); + XPartnerAPIKey.setApiKey(Cashfree.XPartnerAPIKey); + } + + if(Cashfree.XPartnerMerchantID != null && !Cashfree.XPartnerMerchantID.isEmpty()) { + ApiKeyAuth XPartnerMerchantID = (ApiKeyAuth) localVarApiClient.getAuthentication("XPartnerMerchantID"); + XPartnerMerchantID.setApiKey(Cashfree.XPartnerMerchantID); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); + + String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call subsCreateSubscriptionValidateBeforeCall(String xApiVersion, CreateSubscriptionRequest createSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'xApiVersion' is set + if (xApiVersion == null) { + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsCreateSubscription(Async)"); + } + + // verify the required parameter 'createSubscriptionRequest' is set + if (createSubscriptionRequest == null) { + throw new ApiException("Missing the required parameter 'createSubscriptionRequest' when calling SubsCreateSubscription(Async)"); + } + + return subsCreateSubscriptionCall(xApiVersion, createSubscriptionRequest, xRequestId, xIdempotencyKey, _callback); + + } + + public ApiResponse SubsCreateSubscription(String xApiVersion, CreateSubscriptionRequest createSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + if(httpClient != null) { + localVarApiClient.httpClient = httpClient; + } + okhttp3.Call localVarCall = subsCreateSubscriptionValidateBeforeCall(xApiVersion, createSubscriptionRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + + /** + * Build call for subsFetchPlan + * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) + * @param planId Provide the PlanId for which the details have to be fetched. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -4817,18 +6869,15 @@ public ApiResponse PGSettlementFetchRecon(String xApiVers * @http.response.details - + - - -
Status Code Description Response Headers
200 OK * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched Plan Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
502 Bank related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call pGOrderFetchSettlementCall(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsFetchPlanCall(String xApiVersion, String planId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -4838,8 +6887,8 @@ public okhttp3.Call pGOrderFetchSettlementCall(String xApiVersion, String orderI Object localVarPostBody = null; // create path and map variables - String localVarPath = "/orders/{order_id}/settlements" - .replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString())); + String localVarPath = "/pg/plans/{plan_id}" + .replace("{" + "plan_id" + "}", localVarApiClient.escapeString(planId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -4900,42 +6949,42 @@ public okhttp3.Call pGOrderFetchSettlementCall(String xApiVersion, String orderI localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call pGOrderFetchSettlementValidateBeforeCall(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsFetchPlanValidateBeforeCall(String xApiVersion, String planId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling PGOrderFetchSettlement(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsFetchPlan(Async)"); } - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId' when calling PGOrderFetchSettlement(Async)"); + // verify the required parameter 'planId' is set + if (planId == null) { + throw new ApiException("Missing the required parameter 'planId' when calling SubsFetchPlan(Async)"); } - return pGOrderFetchSettlementCall(xApiVersion, orderId, xRequestId, xIdempotencyKey, _callback); + return subsFetchPlanCall(xApiVersion, planId, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse PGOrderFetchSettlement(String xApiVersion, String orderId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsFetchPlan(String xApiVersion, String planId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = pGOrderFetchSettlementValidateBeforeCall(xApiVersion, orderId, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = subsFetchPlanValidateBeforeCall(xApiVersion, planId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposCreateTerminal + * Build call for subsFetchSubscription * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param createTerminalRequest Request Body to Create Terminal for SPOS (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -4944,27 +6993,26 @@ public ApiResponse PGOrderFetchSettlement(String xApiVersion, * @http.response.details - + - -
Status Code Description Response Headers
200 Terminal created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched Subscription Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposCreateTerminalCall(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsFetchSubscriptionCall(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = createTerminalRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/terminal"; + String localVarPath = "/subscriptions/{subscription_id}" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5019,49 +7067,49 @@ public okhttp3.Call sposCreateTerminalCall(String xApiVersion, CreateTerminalReq } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposCreateTerminalValidateBeforeCall(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsFetchSubscriptionValidateBeforeCall(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposCreateTerminal(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsFetchSubscription(Async)"); } - // verify the required parameter 'createTerminalRequest' is set - if (createTerminalRequest == null) { - throw new ApiException("Missing the required parameter 'createTerminalRequest' when calling SposCreateTerminal(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsFetchSubscription(Async)"); } - return sposCreateTerminalCall(xApiVersion, createTerminalRequest, xRequestId, xIdempotencyKey, _callback); + return subsFetchSubscriptionCall(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse SposCreateTerminal(String xApiVersion, CreateTerminalRequest createTerminalRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsFetchSubscription(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposCreateTerminalValidateBeforeCall(xApiVersion, createTerminalRequest, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = subsFetchSubscriptionValidateBeforeCall(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposCreateTerminalTransaction + * Build call for subsFetchSubscriptionPayment * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param createTerminalTransactionRequest Request body to create a terminal transaction (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) + * @param paymentId Provide the PaymentId using which the payment was created. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5070,27 +7118,27 @@ public ApiResponse SposCreateTerminal(String xApiVersion, Create * @http.response.details - + - -
Status Code Description Response Headers
200 Terminal Transaction created * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched Payment Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposCreateTerminalTransactionCall(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsFetchSubscriptionPaymentCall(String xApiVersion, String subscriptionId, String paymentId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = createTerminalTransactionRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/terminal/transactions"; + String localVarPath = "/subscriptions/{subscription_id}/payments/{payment_id}" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())) + .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5145,49 +7193,53 @@ public okhttp3.Call sposCreateTerminalTransactionCall(String xApiVersion, Create } final String[] localVarContentTypes = { - "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; - return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposCreateTerminalTransactionValidateBeforeCall(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsFetchSubscriptionPaymentValidateBeforeCall(String xApiVersion, String subscriptionId, String paymentId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposCreateTerminalTransaction(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsFetchSubscriptionPayment(Async)"); } - // verify the required parameter 'createTerminalTransactionRequest' is set - if (createTerminalTransactionRequest == null) { - throw new ApiException("Missing the required parameter 'createTerminalTransactionRequest' when calling SposCreateTerminalTransaction(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsFetchSubscriptionPayment(Async)"); } - return sposCreateTerminalTransactionCall(xApiVersion, createTerminalTransactionRequest, xRequestId, xIdempotencyKey, _callback); + // verify the required parameter 'paymentId' is set + if (paymentId == null) { + throw new ApiException("Missing the required parameter 'paymentId' when calling SubsFetchSubscriptionPayment(Async)"); + } + + return subsFetchSubscriptionPaymentCall(xApiVersion, subscriptionId, paymentId, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse SposCreateTerminalTransaction(String xApiVersion, CreateTerminalTransactionRequest createTerminalTransactionRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsFetchSubscriptionPayment(String xApiVersion, String subscriptionId, String paymentId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposCreateTerminalTransactionValidateBeforeCall(xApiVersion, createTerminalTransactionRequest, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = subsFetchSubscriptionPaymentValidateBeforeCall(xApiVersion, subscriptionId, paymentId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposFetchTerminal + * Build call for subsFetchSubscriptionPayments * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param terminalPhoneNo The terminal for which you want to view the order details. (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5196,17 +7248,16 @@ public ApiResponse SposCreateTerminalTransaction(Stri * @http.response.details - + -
Status Code Description Response Headers
200 OK * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched all payments of subscription * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposFetchTerminalCall(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsFetchSubscriptionPaymentsCall(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -5216,8 +7267,8 @@ public okhttp3.Call sposFetchTerminalCall(String xApiVersion, String terminalPho Object localVarPostBody = null; // create path and map variables - String localVarPath = "/terminal/{terminal_phone_no}" - .replace("{" + "terminal_phone_no" + "}", localVarApiClient.escapeString(terminalPhoneNo.toString())); + String localVarPath = "/subscriptions/{subscription_id}/payments" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5278,43 +7329,43 @@ public okhttp3.Call sposFetchTerminalCall(String xApiVersion, String terminalPho localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposFetchTerminalValidateBeforeCall(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsFetchSubscriptionPaymentsValidateBeforeCall(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminal(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsFetchSubscriptionPayments(Async)"); } - // verify the required parameter 'terminalPhoneNo' is set - if (terminalPhoneNo == null) { - throw new ApiException("Missing the required parameter 'terminalPhoneNo' when calling SposFetchTerminal(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsFetchSubscriptionPayments(Async)"); } - return sposFetchTerminalCall(xApiVersion, terminalPhoneNo, xRequestId, xIdempotencyKey, _callback); + return subsFetchSubscriptionPaymentsCall(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse SposFetchTerminal(String xApiVersion, String terminalPhoneNo, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse> SubsFetchSubscriptionPayments(String xApiVersion, String subscriptionId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposFetchTerminalValidateBeforeCall(xApiVersion, terminalPhoneNo, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = subsFetchSubscriptionPaymentsValidateBeforeCall(xApiVersion, subscriptionId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposFetchTerminalQRCodes + * Build call for subsFetchSubscriptionRefund * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param terminalPhoneNo Phone number assigned to the terminal. Required if you are not providing the cf_terminal_id in the request. (required) - * @param cfTerminalId Cashfree terminal id for which you want to get staticQRs. Required if you are not providing the terminal_phone_number in the request. (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) + * @param refundId Provide the PaymentId for which the details have to be fetched. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5323,17 +7374,15 @@ public ApiResponse SposFetchTerminal(String xApiVersion, String * @http.response.details - + - -
Status Code Description Response Headers
200 Fetched Terminal QR Codes * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched Refund Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposFetchTerminalQRCodesCall(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsFetchSubscriptionRefundCall(String xApiVersion, String subscriptionId, String refundId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { @@ -5343,7 +7392,9 @@ public okhttp3.Call sposFetchTerminalQRCodesCall(String xApiVersion, String term Object localVarPostBody = null; // create path and map variables - String localVarPath = "/terminal/qrcodes"; + String localVarPath = "/subscriptions/{subscription_id}/refunds/{refund_id}" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())) + .replace("{" + "refund_id" + "}", localVarApiClient.escapeString(refundId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5351,14 +7402,6 @@ public okhttp3.Call sposFetchTerminalQRCodesCall(String xApiVersion, String term Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (terminalPhoneNo != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("terminal_phone_no", terminalPhoneNo)); - } - - if (cfTerminalId != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("cf_terminal_id", cfTerminalId)); - } - if (xApiVersion != null) { localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); } @@ -5412,48 +7455,48 @@ public okhttp3.Call sposFetchTerminalQRCodesCall(String xApiVersion, String term localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposFetchTerminalQRCodesValidateBeforeCall(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsFetchSubscriptionRefundValidateBeforeCall(String xApiVersion, String subscriptionId, String refundId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminalQRCodes(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsFetchSubscriptionRefund(Async)"); } - // verify the required parameter 'terminalPhoneNo' is set - if (terminalPhoneNo == null) { - throw new ApiException("Missing the required parameter 'terminalPhoneNo' when calling SposFetchTerminalQRCodes(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsFetchSubscriptionRefund(Async)"); } - // verify the required parameter 'cfTerminalId' is set - if (cfTerminalId == null) { - throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposFetchTerminalQRCodes(Async)"); + // verify the required parameter 'refundId' is set + if (refundId == null) { + throw new ApiException("Missing the required parameter 'refundId' when calling SubsFetchSubscriptionRefund(Async)"); } - return sposFetchTerminalQRCodesCall(xApiVersion, terminalPhoneNo, cfTerminalId, xRequestId, xIdempotencyKey, _callback); + return subsFetchSubscriptionRefundCall(xApiVersion, subscriptionId, refundId, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse> SposFetchTerminalQRCodes(String xApiVersion, String terminalPhoneNo, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsFetchSubscriptionRefund(String xApiVersion, String subscriptionId, String refundId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposFetchTerminalQRCodesValidateBeforeCall(xApiVersion, terminalPhoneNo, cfTerminalId, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + okhttp3.Call localVarCall = subsFetchSubscriptionRefundValidateBeforeCall(xApiVersion, subscriptionId, refundId, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposFetchTerminalTransaction + * Build call for subsManageSubscription * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param utr Utr of the transaction. (required) - * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) + * @param manageSubscriptionRequest Request body to manage a subscription. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5462,28 +7505,27 @@ public ApiResponse> SposFetchTerminalQRCodes(St * @http.response.details - + -
Status Code Description Response Headers
200 Fetch Terminal Transaction * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Subscription Updated * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposFetchTerminalTransactionCall(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsManageSubscriptionCall(String xApiVersion, String subscriptionId, ManageSubscriptionRequest manageSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = null; + Object localVarPostBody = manageSubscriptionRequest; // create path and map variables - String localVarPath = "/terminal/{cf_terminal_id}/payments" - .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + String localVarPath = "/subscriptions/{subscription_id}/manage" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5491,10 +7533,6 @@ public okhttp3.Call sposFetchTerminalTransactionCall(String xApiVersion, String Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (utr != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("utr", utr)); - } - if (xApiVersion != null) { localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); } @@ -5542,54 +7580,56 @@ public okhttp3.Call sposFetchTerminalTransactionCall(String xApiVersion, String } final String[] localVarContentTypes = { + "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposFetchTerminalTransactionValidateBeforeCall(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsManageSubscriptionValidateBeforeCall(String xApiVersion, String subscriptionId, ManageSubscriptionRequest manageSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposFetchTerminalTransaction(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsManageSubscription(Async)"); } - // verify the required parameter 'utr' is set - if (utr == null) { - throw new ApiException("Missing the required parameter 'utr' when calling SposFetchTerminalTransaction(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsManageSubscription(Async)"); } - // verify the required parameter 'cfTerminalId' is set - if (cfTerminalId == null) { - throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposFetchTerminalTransaction(Async)"); + // verify the required parameter 'manageSubscriptionRequest' is set + if (manageSubscriptionRequest == null) { + throw new ApiException("Missing the required parameter 'manageSubscriptionRequest' when calling SubsManageSubscription(Async)"); } - return sposFetchTerminalTransactionCall(xApiVersion, utr, cfTerminalId, xRequestId, xIdempotencyKey, _callback); + return subsManageSubscriptionCall(xApiVersion, subscriptionId, manageSubscriptionRequest, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse SposFetchTerminalTransaction(String xApiVersion, String utr, String cfTerminalId, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsManageSubscription(String xApiVersion, String subscriptionId, ManageSubscriptionRequest manageSubscriptionRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposFetchTerminalTransactionValidateBeforeCall(xApiVersion, utr, cfTerminalId, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = subsManageSubscriptionValidateBeforeCall(xApiVersion, subscriptionId, manageSubscriptionRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposUpdateTerminal + * Build call for subsManageSubscriptionPayment * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) - * @param updateTerminalRequest Request Body to update terminal for SPOS. (required) + * @param subscriptionId Provide the SubscriptionId using which the subscription was created. (required) + * @param paymentId Provide the PaymentId using which the payment was created. (required) + * @param manageSubscriptionPaymentRequest Request body to manage a subscription payment. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5598,28 +7638,27 @@ public ApiResponse SposFetchTerminalTransaction(String xA * @http.response.details - + - -
Status Code Description Response Headers
200 Updated Terminal * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Fetched Manage Payment Response * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposUpdateTerminalCall(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subsManageSubscriptionPaymentCall(String xApiVersion, String subscriptionId, String paymentId, ManageSubscriptionPaymentRequest manageSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = updateTerminalRequest; + Object localVarPostBody = manageSubscriptionPaymentRequest; // create path and map variables - String localVarPath = "/terminal/{cf_terminal_id}" - .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + String localVarPath = "/subscriptions/{subscription_id}/payments/{payment_id}/manage" + .replace("{" + "subscription_id" + "}", localVarApiClient.escapeString(subscriptionId.toString())) + .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5681,48 +7720,55 @@ public okhttp3.Call sposUpdateTerminalCall(String xApiVersion, String cfTerminal localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposUpdateTerminalValidateBeforeCall(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subsManageSubscriptionPaymentValidateBeforeCall(String xApiVersion, String subscriptionId, String paymentId, ManageSubscriptionPaymentRequest manageSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUpdateTerminal(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubsManageSubscriptionPayment(Async)"); } - // verify the required parameter 'cfTerminalId' is set - if (cfTerminalId == null) { - throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUpdateTerminal(Async)"); + // verify the required parameter 'subscriptionId' is set + if (subscriptionId == null) { + throw new ApiException("Missing the required parameter 'subscriptionId' when calling SubsManageSubscriptionPayment(Async)"); } - // verify the required parameter 'updateTerminalRequest' is set - if (updateTerminalRequest == null) { - throw new ApiException("Missing the required parameter 'updateTerminalRequest' when calling SposUpdateTerminal(Async)"); + // verify the required parameter 'paymentId' is set + if (paymentId == null) { + throw new ApiException("Missing the required parameter 'paymentId' when calling SubsManageSubscriptionPayment(Async)"); } - return sposUpdateTerminalCall(xApiVersion, cfTerminalId, updateTerminalRequest, xRequestId, xIdempotencyKey, _callback); + // verify the required parameter 'manageSubscriptionPaymentRequest' is set + if (manageSubscriptionPaymentRequest == null) { + throw new ApiException("Missing the required parameter 'manageSubscriptionPaymentRequest' when calling SubsManageSubscriptionPayment(Async)"); + } + + return subsManageSubscriptionPaymentCall(xApiVersion, subscriptionId, paymentId, manageSubscriptionPaymentRequest, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse> SposUpdateTerminal(String xApiVersion, String cfTerminalId, UpdateTerminalRequest updateTerminalRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubsManageSubscriptionPayment(String xApiVersion, String subscriptionId, String paymentId, ManageSubscriptionPaymentRequest manageSubscriptionPaymentRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposUpdateTerminalValidateBeforeCall(xApiVersion, cfTerminalId, updateTerminalRequest, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + okhttp3.Call localVarCall = subsManageSubscriptionPaymentValidateBeforeCall(xApiVersion, subscriptionId, paymentId, manageSubscriptionPaymentRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposUpdateTerminalStatus + * Build call for subscriptionDocumentUpload * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) - * @param updateTerminalStatusRequest Request Body to update terminal status for SPOS. (required) + * @param paymentId Provide the PaymentId using which the payment was created. (required) + * @param _file Select the .jpg file that should be uploaded or provide the path of that file. You cannot upload a file that is more than 1MB in size. (required) + * @param paymentId2 Authorization Payment Id for physical nach authorization (required) + * @param action Action to be performed on the file. Can be SUBMIT_DOCUMENT (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5731,28 +7777,27 @@ public ApiResponse> SposUpdateTerminal(String xApiVer * @http.response.details - + -
Status Code Description Response Headers
200 Updated Terminal Status * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Upload Pnach Image 200 response. -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposUpdateTerminalStatusCall(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subscriptionDocumentUploadCall(String xApiVersion, String paymentId, File _file, String paymentId2, String action, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = updateTerminalStatusRequest; + Object localVarPostBody = null; // create path and map variables - String localVarPath = "/terminal/{cf_terminal_id}/status" - .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + String localVarPath = "/subscriptions/pay/documents/{payment_id}" + .replace("{" + "payment_id" + "}", localVarApiClient.escapeString(paymentId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5760,6 +7805,18 @@ public okhttp3.Call sposUpdateTerminalStatusCall(String xApiVersion, String cfTe Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (_file != null) { + localVarFormParams.put("file", _file); + } + + if (paymentId2 != null) { + localVarFormParams.put("payment_id", paymentId2); + } + + if (action != null) { + localVarFormParams.put("action", action); + } + if (xApiVersion != null) { localVarHeaderParams.put("x-api-version", localVarApiClient.parameterToString(xApiVersion)); } @@ -5807,55 +7864,64 @@ public okhttp3.Call sposUpdateTerminalStatusCall(String xApiVersion, String cfTe } final String[] localVarContentTypes = { - "application/json" + "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; - return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposUpdateTerminalStatusValidateBeforeCall(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subscriptionDocumentUploadValidateBeforeCall(String xApiVersion, String paymentId, File _file, String paymentId2, String action, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUpdateTerminalStatus(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubscriptionDocumentUpload(Async)"); } - // verify the required parameter 'cfTerminalId' is set - if (cfTerminalId == null) { - throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUpdateTerminalStatus(Async)"); + // verify the required parameter 'paymentId' is set + if (paymentId == null) { + throw new ApiException("Missing the required parameter 'paymentId' when calling SubscriptionDocumentUpload(Async)"); } - // verify the required parameter 'updateTerminalStatusRequest' is set - if (updateTerminalStatusRequest == null) { - throw new ApiException("Missing the required parameter 'updateTerminalStatusRequest' when calling SposUpdateTerminalStatus(Async)"); + // verify the required parameter '_file' is set + if (_file == null) { + throw new ApiException("Missing the required parameter '_file' when calling SubscriptionDocumentUpload(Async)"); } - return sposUpdateTerminalStatusCall(xApiVersion, cfTerminalId, updateTerminalStatusRequest, xRequestId, xIdempotencyKey, _callback); + // verify the required parameter 'paymentId2' is set + if (paymentId2 == null) { + throw new ApiException("Missing the required parameter 'paymentId2' when calling SubscriptionDocumentUpload(Async)"); + } + + // verify the required parameter 'action' is set + if (action == null) { + throw new ApiException("Missing the required parameter 'action' when calling SubscriptionDocumentUpload(Async)"); + } + + return subscriptionDocumentUploadCall(xApiVersion, paymentId, _file, paymentId2, action, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse> SposUpdateTerminalStatus(String xApiVersion, String cfTerminalId, UpdateTerminalStatusRequest updateTerminalStatusRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubscriptionDocumentUpload(String xApiVersion, String paymentId, File _file, String paymentId2, String action, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposUpdateTerminalStatusValidateBeforeCall(xApiVersion, cfTerminalId, updateTerminalStatusRequest, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + okhttp3.Call localVarCall = subscriptionDocumentUploadValidateBeforeCall(xApiVersion, paymentId, _file, paymentId2, action, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Build call for sposUploadTerminalDocs + * Build call for subscriptionEligibility * @param xApiVersion API version to be used. Format is in YYYY-MM-DD (required) - * @param cfTerminalId Provide the Cashfree terminal ID for which the details have to be updated. (required) - * @param uploadTerminalDocs Request Body to update terminal documents for SPOS. (required) + * @param subscriptionEligibilityRequest Request body to fetch subscription eligibile payment method details. (required) * @param xRequestId Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree (optional) * @param xIdempotencyKey An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions. (optional) * @param _callback Callback for upload/download progress @@ -5864,28 +7930,26 @@ public ApiResponse> SposUpdateTerminalStatus(String x * @http.response.details - + -
Status Code Description Response Headers
200 Upload Terminal Docs * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
200 Subscrition eligibility API 200 response -
400 Bad request error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
401 Authentication Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
404 Resource Not found * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
409 Resource already present * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
422 Idempotency error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
429 Rate Limit Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
500 API related Error * x-api-version -
* x-ratelimit-limit -
* x-ratelimit-remaining -
* x-ratelimit-retry -
* x-ratelimit-type -
* x-request-id -
* x-idempotency-key -
* x-idempotency-replayed -
*/ - public okhttp3.Call sposUploadTerminalDocsCall(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + public okhttp3.Call subscriptionEligibilityCall(String xApiVersion, SubscriptionEligibilityRequest subscriptionEligibilityRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { String basePath = "https://sandbox.cashfree.com/pg"; if(Cashfree.XEnvironment == CFEnvironment.PRODUCTION) { basePath = "https://api.cashfree.com/pg"; } - Object localVarPostBody = uploadTerminalDocs; + Object localVarPostBody = subscriptionEligibilityRequest; // create path and map variables - String localVarPath = "/terminal/{cf_terminal_id}/docs" - .replace("{" + "cf_terminal_id" + "}", localVarApiClient.escapeString(cfTerminalId.toString())); + String localVarPath = "/subscriptions/eligibility/payment_methods"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -5947,39 +8011,34 @@ public okhttp3.Call sposUploadTerminalDocsCall(String xApiVersion, String cfTerm localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call sposUploadTerminalDocsValidateBeforeCall(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { + private okhttp3.Call subscriptionEligibilityValidateBeforeCall(String xApiVersion, SubscriptionEligibilityRequest subscriptionEligibilityRequest, String xRequestId, UUID xIdempotencyKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'xApiVersion' is set if (xApiVersion == null) { - throw new ApiException("Missing the required parameter 'xApiVersion' when calling SposUploadTerminalDocs(Async)"); - } - - // verify the required parameter 'cfTerminalId' is set - if (cfTerminalId == null) { - throw new ApiException("Missing the required parameter 'cfTerminalId' when calling SposUploadTerminalDocs(Async)"); + throw new ApiException("Missing the required parameter 'xApiVersion' when calling SubscriptionEligibility(Async)"); } - // verify the required parameter 'uploadTerminalDocs' is set - if (uploadTerminalDocs == null) { - throw new ApiException("Missing the required parameter 'uploadTerminalDocs' when calling SposUploadTerminalDocs(Async)"); + // verify the required parameter 'subscriptionEligibilityRequest' is set + if (subscriptionEligibilityRequest == null) { + throw new ApiException("Missing the required parameter 'subscriptionEligibilityRequest' when calling SubscriptionEligibility(Async)"); } - return sposUploadTerminalDocsCall(xApiVersion, cfTerminalId, uploadTerminalDocs, xRequestId, xIdempotencyKey, _callback); + return subscriptionEligibilityCall(xApiVersion, subscriptionEligibilityRequest, xRequestId, xIdempotencyKey, _callback); } - public ApiResponse> SposUploadTerminalDocs(String xApiVersion, String cfTerminalId, UploadTerminalDocs uploadTerminalDocs, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { + public ApiResponse SubscriptionEligibility(String xApiVersion, SubscriptionEligibilityRequest subscriptionEligibilityRequest, String xRequestId, UUID xIdempotencyKey, OkHttpClient httpClient) throws ApiException { if(httpClient != null) { localVarApiClient.httpClient = httpClient; } - okhttp3.Call localVarCall = sposUploadTerminalDocsValidateBeforeCall(xApiVersion, cfTerminalId, uploadTerminalDocs, xRequestId, xIdempotencyKey, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + okhttp3.Call localVarCall = subscriptionEligibilityValidateBeforeCall(xApiVersion, subscriptionEligibilityRequest, xRequestId, xIdempotencyKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -6081,7 +8140,7 @@ public okhttp3.Call pGCustomerDeleteInstrumentCall(String xApiVersion, String cu localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -6215,7 +8274,7 @@ public okhttp3.Call pGCustomerFetchInstrumentCall(String xApiVersion, String cus localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -6351,7 +8410,7 @@ public okhttp3.Call pGCustomerFetchInstrumentsCall(String xApiVersion, String cu localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -6485,7 +8544,7 @@ public okhttp3.Call pGCustomerInstrumentsFetchCryptogramCall(String xApiVersion, localVarHeaderParams.put("Content-Type", localVarContentType); } - localVarHeaderParams.put("x-sdk-platform", "javasdk-4.1.4"); + localVarHeaderParams.put("x-sdk-platform", "javasdk-4.2.0"); String[] localVarAuthNames = new String[] { "XPartnerAPIKey", "XClientSecret", "XPartnerMerchantID", "XClientID", "XClientSignatureHeader" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); @@ -6621,7 +8680,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/4.1.4/java"); + setUserAgent("OpenAPI-Generator/4.2.0/java"); authentications = new HashMap(); } diff --git a/src/main/java/com/cashfree/Configuration.java b/src/main/java/com/cashfree/Configuration.java index a28c29d4..dfe87469 100644 --- a/src/main/java/com/cashfree/Configuration.java +++ b/src/main/java/com/cashfree/Configuration.java @@ -13,9 +13,9 @@ package com.cashfree; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") class Configuration { - public static final String VERSION = "4.1.4"; + public static final String VERSION = "4.2.0"; private static Cashfree.ApiClient defaultApiClient = new Cashfree.ApiClient(); diff --git a/src/main/java/com/cashfree/JSON.java b/src/main/java/com/cashfree/JSON.java index 3d570917..b0477f73 100644 --- a/src/main/java/com/cashfree/JSON.java +++ b/src/main/java/com/cashfree/JSON.java @@ -102,6 +102,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.App.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AppPaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AuthenticationError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AuthorizationDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AuthorizationInPaymentsEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.AuthorizeOrderRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.BadRequestError.CustomTypeAdapterFactory()); @@ -124,6 +125,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateLinkRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateOfferRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateOrderRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateOrderSettlementRequestBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateOrderSettlementRequestBodyMetaData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreatePlanRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionPaymentAuthResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionPaymentAuthResponseFailureDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionPaymentChargeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionPaymentRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionRefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionRequestAuthorizationDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionRequestPlanDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateSubscriptionRequestSubscriptionMeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateTerminalRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateTerminalRequestTerminalMeta.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CreateTerminalTransactionRequest.CustomTypeAdapterFactory()); @@ -132,6 +145,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CryptogramEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CustomerDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CustomerDetailsCardlessEMI.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CustomerDetailsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.CustomerEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.DiscountDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EMIOffer.CustomTypeAdapterFactory()); @@ -148,10 +162,15 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityFetchOffersRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityFetchPaylaterRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityFetchPaymentMethodsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityMethodItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityMethodItemEntityDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityMethodItemEntityDetailsAvailableHandlesInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityOfferEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityPaylaterEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityPaymentMethodsEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EligibilityPaymentMethodsEntityEntityDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EntitySimulationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.EntitySimulationResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ErrorDetailsInPaymentsEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.FetchReconRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.FetchReconRequestFilters.CustomTypeAdapterFactory()); @@ -170,6 +189,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.LinkEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.LinkMetaResponseEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.LinkNotifyEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ManageSubscriptionPaymentRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ManageSubscriptionPaymentRequestActionDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ManageSubscriptionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ManageSubscriptionRequestActionDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.NetBankingPaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.Netbanking.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.OfferAll.CustomTypeAdapterFactory()); @@ -229,6 +252,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PaymentWebhookErrorEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PaymentWebhookGatewayDetailsEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PaymentWebhookOrderEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.PlanEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.RateLimitError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ReconEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.ReconEntityDataInner.CustomTypeAdapterFactory()); @@ -244,6 +268,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SettlementReconEntityDataInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SettlementWebhook.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SettlementWebhookDataEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SimulateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SimulationResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SplitAfterPaymentRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SplitAfterPaymentRequestSplitInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SplitAfterPaymentResponse.CustomTypeAdapterFactory()); @@ -251,6 +277,18 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.StaticSplitRequestSchemeInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.StaticSplitResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.StaticSplitResponseSchemeInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubsCreatePayment200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionBankDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionCustomerDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEligibilityRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEligibilityRequestFilters.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEligibilityRequestQueries.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEligibilityResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionEntitySubscriptionMeta.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionPaymentEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionPaymentRefundEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.SubscriptionPaymentSplitItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.TerminalDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.TerminalEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.TerminalPaymentEntity.CustomTypeAdapterFactory()); @@ -266,8 +304,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpdateTerminalStatusRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpdateVendorRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpdateVendorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpdateVendorResponseRelatedDocsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.Upi.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UpiDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UploadPnachImageResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UploadTerminalDocs.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UploadTerminalDocsEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.UploadVendorDocumentsResponse.CustomTypeAdapterFactory()); @@ -276,7 +316,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VendorDocumentDownloadResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VendorDocumentsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VendorEntity.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VendorEntityRelatedDocsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.VendorSplit.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.cashfree.model.WalletOffer.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); diff --git a/src/main/java/com/cashfree/Pair.java b/src/main/java/com/cashfree/Pair.java index 95b45a7b..9e1698bc 100644 --- a/src/main/java/com/cashfree/Pair.java +++ b/src/main/java/com/cashfree/Pair.java @@ -13,7 +13,7 @@ package com.cashfree; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/com/cashfree/StringUtil.java b/src/main/java/com/cashfree/StringUtil.java index f5797fdd..fdeaf08c 100644 --- a/src/main/java/com/cashfree/StringUtil.java +++ b/src/main/java/com/cashfree/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/com/cashfree/auth/ApiKeyAuth.java b/src/main/java/com/cashfree/auth/ApiKeyAuth.java index 00fdf3ef..19153400 100644 --- a/src/main/java/com/cashfree/auth/ApiKeyAuth.java +++ b/src/main/java/com/cashfree/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/com/cashfree/auth/HttpBearerAuth.java b/src/main/java/com/cashfree/auth/HttpBearerAuth.java index e51952fd..eaee2d3c 100644 --- a/src/main/java/com/cashfree/auth/HttpBearerAuth.java +++ b/src/main/java/com/cashfree/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java b/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java index ada9587c..2d81b1a7 100644 --- a/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java +++ b/src/main/java/com/cashfree/model/AbstractOpenApiSchema.java @@ -23,7 +23,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/com/cashfree/model/AdjustVendorBalanceRequest.java b/src/main/java/com/cashfree/model/AdjustVendorBalanceRequest.java index 9ec47449..c8352dca 100644 --- a/src/main/java/com/cashfree/model/AdjustVendorBalanceRequest.java +++ b/src/main/java/com/cashfree/model/AdjustVendorBalanceRequest.java @@ -53,7 +53,7 @@ * Adjust Vendor Balance Request */ @Schema(description = "Adjust Vendor Balance Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AdjustVendorBalanceRequest { public static final String SERIALIZED_NAME_TRANSFER_FROM = "transfer_from"; @SerializedName(SERIALIZED_NAME_TRANSFER_FROM) diff --git a/src/main/java/com/cashfree/model/AdjustVendorBalanceResponse.java b/src/main/java/com/cashfree/model/AdjustVendorBalanceResponse.java index d1e1db32..0a39d7ad 100644 --- a/src/main/java/com/cashfree/model/AdjustVendorBalanceResponse.java +++ b/src/main/java/com/cashfree/model/AdjustVendorBalanceResponse.java @@ -56,7 +56,7 @@ * Adjust Vendor Balance Response */ @Schema(description = "Adjust Vendor Balance Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AdjustVendorBalanceResponse { public static final String SERIALIZED_NAME_SETTLEMENT_ID = "settlement_id"; @SerializedName(SERIALIZED_NAME_SETTLEMENT_ID) diff --git a/src/main/java/com/cashfree/model/ApiError.java b/src/main/java/com/cashfree/model/ApiError.java index 29c5a844..10ebf459 100644 --- a/src/main/java/com/cashfree/model/ApiError.java +++ b/src/main/java/com/cashfree/model/ApiError.java @@ -52,7 +52,7 @@ * Error at cashfree's server */ @Schema(description = "Error at cashfree's server") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/ApiError404.java b/src/main/java/com/cashfree/model/ApiError404.java index 77595ada..c5fde9dc 100644 --- a/src/main/java/com/cashfree/model/ApiError404.java +++ b/src/main/java/com/cashfree/model/ApiError404.java @@ -52,7 +52,7 @@ * Error when resource requested is not found */ @Schema(description = "Error when resource requested is not found") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiError404 { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/ApiError409.java b/src/main/java/com/cashfree/model/ApiError409.java index e62f5ed8..075e0b4b 100644 --- a/src/main/java/com/cashfree/model/ApiError409.java +++ b/src/main/java/com/cashfree/model/ApiError409.java @@ -52,7 +52,7 @@ * duplicate request */ @Schema(description = "duplicate request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiError409 { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/ApiError502.java b/src/main/java/com/cashfree/model/ApiError502.java index d8209cd7..57e21f46 100644 --- a/src/main/java/com/cashfree/model/ApiError502.java +++ b/src/main/java/com/cashfree/model/ApiError502.java @@ -52,7 +52,7 @@ * Error when there is error at partner bank */ @Schema(description = "Error when there is error at partner bank") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ApiError502 { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/App.java b/src/main/java/com/cashfree/model/App.java index e8513ed3..3ecbe51b 100644 --- a/src/main/java/com/cashfree/model/App.java +++ b/src/main/java/com/cashfree/model/App.java @@ -52,7 +52,7 @@ * App payment method */ @Schema(description = "App payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class App { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/AppPaymentMethod.java b/src/main/java/com/cashfree/model/AppPaymentMethod.java index 088bc80e..ca318c88 100644 --- a/src/main/java/com/cashfree/model/AppPaymentMethod.java +++ b/src/main/java/com/cashfree/model/AppPaymentMethod.java @@ -53,7 +53,7 @@ * App payment method */ @Schema(description = "App payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AppPaymentMethod { public static final String SERIALIZED_NAME_APP = "app"; @SerializedName(SERIALIZED_NAME_APP) diff --git a/src/main/java/com/cashfree/model/AuthenticationError.java b/src/main/java/com/cashfree/model/AuthenticationError.java index fd0bb8b7..961c7640 100644 --- a/src/main/java/com/cashfree/model/AuthenticationError.java +++ b/src/main/java/com/cashfree/model/AuthenticationError.java @@ -52,7 +52,7 @@ * Error if api keys are wrong */ @Schema(description = "Error if api keys are wrong") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AuthenticationError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/AuthorizationDetails.java b/src/main/java/com/cashfree/model/AuthorizationDetails.java new file mode 100644 index 00000000..e8e595f3 --- /dev/null +++ b/src/main/java/com/cashfree/model/AuthorizationDetails.java @@ -0,0 +1,415 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Details of the authorization done for the subscription. Returned in Get subscription and auth payments. + */ +@Schema(description = "Details of the authorization done for the subscription. Returned in Get subscription and auth payments.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class AuthorizationDetails { + public static final String SERIALIZED_NAME_AUTHORIZATION_AMOUNT = "authorization_amount"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_AMOUNT) + private BigDecimal authorizationAmount; + + public static final String SERIALIZED_NAME_AUTHORIZATION_AMOUNT_REFUND = "authorization_amount_refund"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_AMOUNT_REFUND) + private Boolean authorizationAmountRefund; + + public static final String SERIALIZED_NAME_AUTHORIZATION_REFERENCE = "authorization_reference"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_REFERENCE) + private String authorizationReference; + + public static final String SERIALIZED_NAME_AUTHORIZATION_TIME = "authorization_time"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_TIME) + private String authorizationTime; + + public static final String SERIALIZED_NAME_AUTHORIZATION_STATUS = "authorization_status"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_STATUS) + private String authorizationStatus; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private String paymentMethod; + + public AuthorizationDetails() { + } + + public AuthorizationDetails authorizationAmount(BigDecimal authorizationAmount) { + + this.authorizationAmount = authorizationAmount; + return this; + } + + /** + * Authorization amount for the auth payment. + * @return authorizationAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Authorization amount for the auth payment.") + public BigDecimal getAuthorizationAmount() { + return authorizationAmount; + } + + + public void setAuthorizationAmount(BigDecimal authorizationAmount) { + this.authorizationAmount = authorizationAmount; + } + + + public AuthorizationDetails authorizationAmountRefund(Boolean authorizationAmountRefund) { + + this.authorizationAmountRefund = authorizationAmountRefund; + return this; + } + + /** + * Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription. + * @return authorizationAmountRefund + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription.") + public Boolean getAuthorizationAmountRefund() { + return authorizationAmountRefund; + } + + + public void setAuthorizationAmountRefund(Boolean authorizationAmountRefund) { + this.authorizationAmountRefund = authorizationAmountRefund; + } + + + public AuthorizationDetails authorizationReference(String authorizationReference) { + + this.authorizationReference = authorizationReference; + return this; + } + + /** + * Authorization reference. UMN for UPI, UMRN for EMandate/Physical Mandate and Enrollment ID for cards. + * @return authorizationReference + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Authorization reference. UMN for UPI, UMRN for EMandate/Physical Mandate and Enrollment ID for cards.") + public String getAuthorizationReference() { + return authorizationReference; + } + + + public void setAuthorizationReference(String authorizationReference) { + this.authorizationReference = authorizationReference; + } + + + public AuthorizationDetails authorizationTime(String authorizationTime) { + + this.authorizationTime = authorizationTime; + return this; + } + + /** + * Authorization time. + * @return authorizationTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Authorization time.") + public String getAuthorizationTime() { + return authorizationTime; + } + + + public void setAuthorizationTime(String authorizationTime) { + this.authorizationTime = authorizationTime; + } + + + public AuthorizationDetails authorizationStatus(String authorizationStatus) { + + this.authorizationStatus = authorizationStatus; + return this; + } + + /** + * Status of the authorization. + * @return authorizationStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the authorization.") + public String getAuthorizationStatus() { + return authorizationStatus; + } + + + public void setAuthorizationStatus(String authorizationStatus) { + this.authorizationStatus = authorizationStatus; + } + + + public AuthorizationDetails paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public AuthorizationDetails paymentMethod(String paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Payment method used for the authorization. + * @return paymentMethod + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment method used for the authorization.") + public String getPaymentMethod() { + return paymentMethod; + } + + + public void setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetails authorizationDetails = (AuthorizationDetails) o; + return Objects.equals(this.authorizationAmount, authorizationDetails.authorizationAmount) && + Objects.equals(this.authorizationAmountRefund, authorizationDetails.authorizationAmountRefund) && + Objects.equals(this.authorizationReference, authorizationDetails.authorizationReference) && + Objects.equals(this.authorizationTime, authorizationDetails.authorizationTime) && + Objects.equals(this.authorizationStatus, authorizationDetails.authorizationStatus) && + Objects.equals(this.paymentId, authorizationDetails.paymentId) && + Objects.equals(this.paymentMethod, authorizationDetails.paymentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(authorizationAmount, authorizationAmountRefund, authorizationReference, authorizationTime, authorizationStatus, paymentId, paymentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetails {\n"); + sb.append(" authorizationAmount: ").append(toIndentedString(authorizationAmount)).append("\n"); + sb.append(" authorizationAmountRefund: ").append(toIndentedString(authorizationAmountRefund)).append("\n"); + sb.append(" authorizationReference: ").append(toIndentedString(authorizationReference)).append("\n"); + sb.append(" authorizationTime: ").append(toIndentedString(authorizationTime)).append("\n"); + sb.append(" authorizationStatus: ").append(toIndentedString(authorizationStatus)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authorization_amount"); + openapiFields.add("authorization_amount_refund"); + openapiFields.add("authorization_reference"); + openapiFields.add("authorization_time"); + openapiFields.add("authorization_status"); + openapiFields.add("payment_id"); + openapiFields.add("payment_method"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthorizationDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("authorization_reference") != null && !jsonObj.get("authorization_reference").isJsonNull()) && !jsonObj.get("authorization_reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_reference").toString())); + } + if ((jsonObj.get("authorization_time") != null && !jsonObj.get("authorization_time").isJsonNull()) && !jsonObj.get("authorization_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_time").toString())); + } + if ((jsonObj.get("authorization_status") != null && !jsonObj.get("authorization_status").isJsonNull()) && !jsonObj.get("authorization_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_status").toString())); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AuthorizationDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("authorization_reference") != null && !jsonObj.get("authorization_reference").isJsonNull()) && !jsonObj.get("authorization_reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_reference").toString())); + } + if ((jsonObj.get("authorization_time") != null && !jsonObj.get("authorization_time").isJsonNull()) && !jsonObj.get("authorization_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_time").toString())); + } + if ((jsonObj.get("authorization_status") != null && !jsonObj.get("authorization_status").isJsonNull()) && !jsonObj.get("authorization_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_status").toString())); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AuthorizationDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthorizationDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthorizationDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AuthorizationDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AuthorizationDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthorizationDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthorizationDetails + * @throws IOException if the JSON string is invalid with respect to AuthorizationDetails + */ + public static AuthorizationDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthorizationDetails.class); + } + + /** + * Convert an instance of AuthorizationDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/AuthorizationInPaymentsEntity.java b/src/main/java/com/cashfree/model/AuthorizationInPaymentsEntity.java index f836184c..8200cac1 100644 --- a/src/main/java/com/cashfree/model/AuthorizationInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/AuthorizationInPaymentsEntity.java @@ -53,7 +53,7 @@ * If preauth enabled for account you will get this body */ @Schema(description = "If preauth enabled for account you will get this body") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AuthorizationInPaymentsEntity { /** * One of CAPTURE or VOID diff --git a/src/main/java/com/cashfree/model/AuthorizeOrderRequest.java b/src/main/java/com/cashfree/model/AuthorizeOrderRequest.java index ae835f1c..b604a256 100644 --- a/src/main/java/com/cashfree/model/AuthorizeOrderRequest.java +++ b/src/main/java/com/cashfree/model/AuthorizeOrderRequest.java @@ -53,7 +53,7 @@ * Request to capture or void transaction */ @Schema(description = "Request to capture or void transaction") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class AuthorizeOrderRequest { /** * Type of authorization to run. Can be one of 'CAPTURE' , 'VOID' diff --git a/src/main/java/com/cashfree/model/BadRequestError.java b/src/main/java/com/cashfree/model/BadRequestError.java index 82447b6c..1544f95d 100644 --- a/src/main/java/com/cashfree/model/BadRequestError.java +++ b/src/main/java/com/cashfree/model/BadRequestError.java @@ -52,7 +52,7 @@ * Invalid request received from client */ @Schema(description = "Invalid request received from client") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class BadRequestError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/BalanceDetails.java b/src/main/java/com/cashfree/model/BalanceDetails.java index a9593faf..b0187675 100644 --- a/src/main/java/com/cashfree/model/BalanceDetails.java +++ b/src/main/java/com/cashfree/model/BalanceDetails.java @@ -52,7 +52,7 @@ /** * BalanceDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class BalanceDetails { public static final String SERIALIZED_NAME_MERCHANT_ID = "merchant_id"; @SerializedName(SERIALIZED_NAME_MERCHANT_ID) diff --git a/src/main/java/com/cashfree/model/BankDetails.java b/src/main/java/com/cashfree/model/BankDetails.java index 309469c7..ea72c87a 100644 --- a/src/main/java/com/cashfree/model/BankDetails.java +++ b/src/main/java/com/cashfree/model/BankDetails.java @@ -51,7 +51,7 @@ /** * BankDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class BankDetails { public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "account_number"; @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) diff --git a/src/main/java/com/cashfree/model/Banktransfer.java b/src/main/java/com/cashfree/model/Banktransfer.java index b3817dcc..19a7973f 100644 --- a/src/main/java/com/cashfree/model/Banktransfer.java +++ b/src/main/java/com/cashfree/model/Banktransfer.java @@ -52,7 +52,7 @@ * Banktransfer payment method */ @Schema(description = "Banktransfer payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Banktransfer { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/BanktransferPaymentMethod.java b/src/main/java/com/cashfree/model/BanktransferPaymentMethod.java index 501baa73..b08c1252 100644 --- a/src/main/java/com/cashfree/model/BanktransferPaymentMethod.java +++ b/src/main/java/com/cashfree/model/BanktransferPaymentMethod.java @@ -53,7 +53,7 @@ * banktransfer payment method */ @Schema(description = "banktransfer payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class BanktransferPaymentMethod { public static final String SERIALIZED_NAME_BANKTRANSFER = "banktransfer"; @SerializedName(SERIALIZED_NAME_BANKTRANSFER) diff --git a/src/main/java/com/cashfree/model/Card.java b/src/main/java/com/cashfree/model/Card.java index c1fc0771..31285d47 100644 --- a/src/main/java/com/cashfree/model/Card.java +++ b/src/main/java/com/cashfree/model/Card.java @@ -52,7 +52,7 @@ * Card Payment method */ @Schema(description = "Card Payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Card { /** * The channel for card payments can be \"link\" or \"post\". Post is used for seamless OTP payments where merchant captures OTP on their own page. @@ -477,11 +477,11 @@ public Card tokenReferenceId(String tokenReferenceId) { } /** - * Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards. + * Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards. * @return tokenReferenceId **/ @javax.annotation.Nullable - @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards. ") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Token Reference Id provided by Diners for Guest Checkout Token. Required only for Diners cards.") public String getTokenReferenceId() { return tokenReferenceId; } diff --git a/src/main/java/com/cashfree/model/CardEMI.java b/src/main/java/com/cashfree/model/CardEMI.java index 69263e60..178b4535 100644 --- a/src/main/java/com/cashfree/model/CardEMI.java +++ b/src/main/java/com/cashfree/model/CardEMI.java @@ -52,7 +52,7 @@ * Payment method for card emi */ @Schema(description = "Payment method for card emi") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardEMI { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/CardEMIPaymentMethod.java b/src/main/java/com/cashfree/model/CardEMIPaymentMethod.java index aeea3f61..8bbe2869 100644 --- a/src/main/java/com/cashfree/model/CardEMIPaymentMethod.java +++ b/src/main/java/com/cashfree/model/CardEMIPaymentMethod.java @@ -53,7 +53,7 @@ * Complete card emi payment method */ @Schema(description = "Complete card emi payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardEMIPaymentMethod { public static final String SERIALIZED_NAME_EMI = "emi"; @SerializedName(SERIALIZED_NAME_EMI) diff --git a/src/main/java/com/cashfree/model/CardOffer.java b/src/main/java/com/cashfree/model/CardOffer.java index 92e1d098..671b95ec 100644 --- a/src/main/java/com/cashfree/model/CardOffer.java +++ b/src/main/java/com/cashfree/model/CardOffer.java @@ -53,7 +53,7 @@ /** * CardOffer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardOffer { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/cashfree/model/CardPaymentMethod.java b/src/main/java/com/cashfree/model/CardPaymentMethod.java index ee431618..772d04c7 100644 --- a/src/main/java/com/cashfree/model/CardPaymentMethod.java +++ b/src/main/java/com/cashfree/model/CardPaymentMethod.java @@ -53,7 +53,7 @@ * The card payment object is used to make payment using either plain card number, saved card instrument id or using cryptogram */ @Schema(description = "The card payment object is used to make payment using either plain card number, saved card instrument id or using cryptogram ") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardPaymentMethod { public static final String SERIALIZED_NAME_CARD = "card"; @SerializedName(SERIALIZED_NAME_CARD) diff --git a/src/main/java/com/cashfree/model/CardlessEMI.java b/src/main/java/com/cashfree/model/CardlessEMI.java index 592da67e..d92ac69e 100644 --- a/src/main/java/com/cashfree/model/CardlessEMI.java +++ b/src/main/java/com/cashfree/model/CardlessEMI.java @@ -52,14 +52,14 @@ * Request body for cardless emi payment method */ @Schema(description = "Request body for cardless emi payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardlessEMI { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) private String channel; /** - * One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`] + * One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`] */ @JsonAdapter(ProviderEnum.Adapter.class) public enum ProviderEnum { @@ -77,6 +77,10 @@ public enum ProviderEnum { KOTAK("kotak"), + SNAPMINT("snapmint"), + + BHARATX("bharatx"), + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); private String value; @@ -161,11 +165,11 @@ public CardlessEMI provider(ProviderEnum provider) { } /** - * One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`] + * One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`] * @return provider **/ @javax.annotation.Nullable - @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`]") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`]") public ProviderEnum getProvider() { return provider; } diff --git a/src/main/java/com/cashfree/model/CardlessEMIEntity.java b/src/main/java/com/cashfree/model/CardlessEMIEntity.java index 6d8af96b..3d63a4c2 100644 --- a/src/main/java/com/cashfree/model/CardlessEMIEntity.java +++ b/src/main/java/com/cashfree/model/CardlessEMIEntity.java @@ -55,7 +55,7 @@ * cardless EMI object */ @Schema(description = "cardless EMI object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardlessEMIEntity { public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) diff --git a/src/main/java/com/cashfree/model/CardlessEMIPaymentMethod.java b/src/main/java/com/cashfree/model/CardlessEMIPaymentMethod.java index 0da15414..2042bcc7 100644 --- a/src/main/java/com/cashfree/model/CardlessEMIPaymentMethod.java +++ b/src/main/java/com/cashfree/model/CardlessEMIPaymentMethod.java @@ -53,7 +53,7 @@ * cardless EMI payment method object */ @Schema(description = "cardless EMI payment method object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardlessEMIPaymentMethod { public static final String SERIALIZED_NAME_CARDLESS_EMI = "cardless_emi"; @SerializedName(SERIALIZED_NAME_CARDLESS_EMI) diff --git a/src/main/java/com/cashfree/model/CardlessEMIQueries.java b/src/main/java/com/cashfree/model/CardlessEMIQueries.java index e56fb8e1..337c2309 100644 --- a/src/main/java/com/cashfree/model/CardlessEMIQueries.java +++ b/src/main/java/com/cashfree/model/CardlessEMIQueries.java @@ -54,7 +54,7 @@ * cardless EMI query object */ @Schema(description = "cardless EMI query object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CardlessEMIQueries { public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; @SerializedName(SERIALIZED_NAME_ORDER_ID) diff --git a/src/main/java/com/cashfree/model/CashbackDetails.java b/src/main/java/com/cashfree/model/CashbackDetails.java index 24467201..0167f513 100644 --- a/src/main/java/com/cashfree/model/CashbackDetails.java +++ b/src/main/java/com/cashfree/model/CashbackDetails.java @@ -53,7 +53,7 @@ * Cashback detail boject */ @Schema(description = "Cashback detail boject") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CashbackDetails { /** * Type of discount diff --git a/src/main/java/com/cashfree/model/ChargesDetails.java b/src/main/java/com/cashfree/model/ChargesDetails.java index 7bbf0723..eb8a1883 100644 --- a/src/main/java/com/cashfree/model/ChargesDetails.java +++ b/src/main/java/com/cashfree/model/ChargesDetails.java @@ -52,7 +52,7 @@ /** * ChargesDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ChargesDetails { public static final String SERIALIZED_NAME_SERVICE_CHARGES = "service_charges"; @SerializedName(SERIALIZED_NAME_SERVICE_CHARGES) diff --git a/src/main/java/com/cashfree/model/CreateCustomerRequest.java b/src/main/java/com/cashfree/model/CreateCustomerRequest.java index 6cd8cf63..58f10ed2 100644 --- a/src/main/java/com/cashfree/model/CreateCustomerRequest.java +++ b/src/main/java/com/cashfree/model/CreateCustomerRequest.java @@ -52,7 +52,7 @@ * Request body to create a customer at cashfree */ @Schema(description = "Request body to create a customer at cashfree") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateCustomerRequest { public static final String SERIALIZED_NAME_CUSTOMER_PHONE = "customer_phone"; @SerializedName(SERIALIZED_NAME_CUSTOMER_PHONE) diff --git a/src/main/java/com/cashfree/model/CreateLinkRequest.java b/src/main/java/com/cashfree/model/CreateLinkRequest.java index 57bb7a2e..d16b86d5 100644 --- a/src/main/java/com/cashfree/model/CreateLinkRequest.java +++ b/src/main/java/com/cashfree/model/CreateLinkRequest.java @@ -60,7 +60,7 @@ * Request paramenters for link creation */ @Schema(description = "Request paramenters for link creation") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateLinkRequest { public static final String SERIALIZED_NAME_LINK_ID = "link_id"; @SerializedName(SERIALIZED_NAME_LINK_ID) diff --git a/src/main/java/com/cashfree/model/CreateOfferRequest.java b/src/main/java/com/cashfree/model/CreateOfferRequest.java index 30882594..7decb0bb 100644 --- a/src/main/java/com/cashfree/model/CreateOfferRequest.java +++ b/src/main/java/com/cashfree/model/CreateOfferRequest.java @@ -56,7 +56,7 @@ * create offer backend request object */ @Schema(description = "create offer backend request object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateOfferRequest { public static final String SERIALIZED_NAME_OFFER_META = "offer_meta"; @SerializedName(SERIALIZED_NAME_OFFER_META) diff --git a/src/main/java/com/cashfree/model/CreateOrderRequest.java b/src/main/java/com/cashfree/model/CreateOrderRequest.java index e706fb13..ee589b97 100644 --- a/src/main/java/com/cashfree/model/CreateOrderRequest.java +++ b/src/main/java/com/cashfree/model/CreateOrderRequest.java @@ -60,7 +60,7 @@ * Request body to create an order at cashfree */ @Schema(description = "Request body to create an order at cashfree") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateOrderRequest { public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; @SerializedName(SERIALIZED_NAME_ORDER_ID) diff --git a/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBody.java b/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBody.java new file mode 100644 index 00000000..0c5e4b04 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBody.java @@ -0,0 +1,266 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CreateOrderSettlementRequestBodyMetaData; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Create Order Settlement Object + */ +@Schema(description = "Create Order Settlement Object") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateOrderSettlementRequestBody { + public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; + @SerializedName(SERIALIZED_NAME_ORDER_ID) + private String orderId; + + public static final String SERIALIZED_NAME_META_DATA = "meta_data"; + @SerializedName(SERIALIZED_NAME_META_DATA) + private CreateOrderSettlementRequestBodyMetaData metaData; + + public CreateOrderSettlementRequestBody() { + } + + public CreateOrderSettlementRequestBody orderId(String orderId) { + + this.orderId = orderId; + return this; + } + + /** + * OrderId of the order. + * @return orderId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "OrderId of the order.") + public String getOrderId() { + return orderId; + } + + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + + public CreateOrderSettlementRequestBody metaData(CreateOrderSettlementRequestBodyMetaData metaData) { + + this.metaData = metaData; + return this; + } + + /** + * Get metaData + * @return metaData + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public CreateOrderSettlementRequestBodyMetaData getMetaData() { + return metaData; + } + + + public void setMetaData(CreateOrderSettlementRequestBodyMetaData metaData) { + this.metaData = metaData; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrderSettlementRequestBody createOrderSettlementRequestBody = (CreateOrderSettlementRequestBody) o; + return Objects.equals(this.orderId, createOrderSettlementRequestBody.orderId) && + Objects.equals(this.metaData, createOrderSettlementRequestBody.metaData); + } + + @Override + public int hashCode() { + return Objects.hash(orderId, metaData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrderSettlementRequestBody {\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" metaData: ").append(toIndentedString(metaData)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("order_id"); + openapiFields.add("meta_data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("order_id"); + openapiRequiredFields.add("meta_data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateOrderSettlementRequestBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOrderSettlementRequestBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("order_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `order_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_id").toString())); + } + // validate the required field `meta_data` + CreateOrderSettlementRequestBodyMetaData.validateJsonElement(jsonObj.get("meta_data")); + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateOrderSettlementRequestBody + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOrderSettlementRequestBody.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("order_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `order_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("order_id").toString())); + } + // validate the required field `meta_data` + CreateOrderSettlementRequestBodyMetaData.validateJsonElement(jsonObj.get("meta_data")); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateOrderSettlementRequestBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOrderSettlementRequestBody' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOrderSettlementRequestBody.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateOrderSettlementRequestBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateOrderSettlementRequestBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOrderSettlementRequestBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOrderSettlementRequestBody + * @throws IOException if the JSON string is invalid with respect to CreateOrderSettlementRequestBody + */ + public static CreateOrderSettlementRequestBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOrderSettlementRequestBody.class); + } + + /** + * Convert an instance of CreateOrderSettlementRequestBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaData.java b/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaData.java new file mode 100644 index 00000000..60661b1f --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateOrderSettlementRequestBodyMetaData.java @@ -0,0 +1,245 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.time.LocalDate; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * CreateOrderSettlementRequestBodyMetaData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateOrderSettlementRequestBodyMetaData { + public static final String SERIALIZED_NAME_CBRIKS_ID = "cbriks_id"; + @SerializedName(SERIALIZED_NAME_CBRIKS_ID) + private String cbriksId; + + public static final String SERIALIZED_NAME_SETTLEMENT_DATE = "settlement_date"; + @SerializedName(SERIALIZED_NAME_SETTLEMENT_DATE) + private LocalDate settlementDate; + + public CreateOrderSettlementRequestBodyMetaData() { + } + + public CreateOrderSettlementRequestBodyMetaData cbriksId(String cbriksId) { + + this.cbriksId = cbriksId; + return this; + } + + /** + * Meta data cbricks ID to be used for reporting purpose. + * @return cbriksId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Meta data cbricks ID to be used for reporting purpose.") + public String getCbriksId() { + return cbriksId; + } + + + public void setCbriksId(String cbriksId) { + this.cbriksId = cbriksId; + } + + + public CreateOrderSettlementRequestBodyMetaData settlementDate(LocalDate settlementDate) { + + this.settlementDate = settlementDate; + return this; + } + + /** + * Requested Settlement Date. + * @return settlementDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Requested Settlement Date.") + public LocalDate getSettlementDate() { + return settlementDate; + } + + + public void setSettlementDate(LocalDate settlementDate) { + this.settlementDate = settlementDate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrderSettlementRequestBodyMetaData createOrderSettlementRequestBodyMetaData = (CreateOrderSettlementRequestBodyMetaData) o; + return Objects.equals(this.cbriksId, createOrderSettlementRequestBodyMetaData.cbriksId) && + Objects.equals(this.settlementDate, createOrderSettlementRequestBodyMetaData.settlementDate); + } + + @Override + public int hashCode() { + return Objects.hash(cbriksId, settlementDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrderSettlementRequestBodyMetaData {\n"); + sb.append(" cbriksId: ").append(toIndentedString(cbriksId)).append("\n"); + sb.append(" settlementDate: ").append(toIndentedString(settlementDate)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cbriks_id"); + openapiFields.add("settlement_date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateOrderSettlementRequestBodyMetaData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cbriks_id") != null && !jsonObj.get("cbriks_id").isJsonNull()) && !jsonObj.get("cbriks_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cbriks_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cbriks_id").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateOrderSettlementRequestBodyMetaData + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cbriks_id") != null && !jsonObj.get("cbriks_id").isJsonNull()) && !jsonObj.get("cbriks_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cbriks_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cbriks_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateOrderSettlementRequestBodyMetaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOrderSettlementRequestBodyMetaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOrderSettlementRequestBodyMetaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateOrderSettlementRequestBodyMetaData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateOrderSettlementRequestBodyMetaData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOrderSettlementRequestBodyMetaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOrderSettlementRequestBodyMetaData + * @throws IOException if the JSON string is invalid with respect to CreateOrderSettlementRequestBodyMetaData + */ + public static CreateOrderSettlementRequestBodyMetaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOrderSettlementRequestBodyMetaData.class); + } + + /** + * Convert an instance of CreateOrderSettlementRequestBodyMetaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreatePlanRequest.java b/src/main/java/com/cashfree/model/CreatePlanRequest.java new file mode 100644 index 00000000..798d7413 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreatePlanRequest.java @@ -0,0 +1,526 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to create a plan. + */ +@Schema(description = "Request body to create a plan.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreatePlanRequest { + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private String planId; + + public static final String SERIALIZED_NAME_PLAN_NAME = "plan_name"; + @SerializedName(SERIALIZED_NAME_PLAN_NAME) + private String planName; + + public static final String SERIALIZED_NAME_PLAN_TYPE = "plan_type"; + @SerializedName(SERIALIZED_NAME_PLAN_TYPE) + private String planType; + + public static final String SERIALIZED_NAME_PLAN_CURRENCY = "plan_currency"; + @SerializedName(SERIALIZED_NAME_PLAN_CURRENCY) + private String planCurrency; + + public static final String SERIALIZED_NAME_PLAN_RECURRING_AMOUNT = "plan_recurring_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_RECURRING_AMOUNT) + private BigDecimal planRecurringAmount; + + public static final String SERIALIZED_NAME_PLAN_MAX_AMOUNT = "plan_max_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_AMOUNT) + private BigDecimal planMaxAmount; + + public static final String SERIALIZED_NAME_PLAN_MAX_CYCLES = "plan_max_cycles"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_CYCLES) + private Integer planMaxCycles; + + public static final String SERIALIZED_NAME_PLAN_INTERVALS = "plan_intervals"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVALS) + private Integer planIntervals; + + public static final String SERIALIZED_NAME_PLAN_INTERVAL_TYPE = "plan_interval_type"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVAL_TYPE) + private String planIntervalType; + + public static final String SERIALIZED_NAME_PLAN_NOTE = "plan_note"; + @SerializedName(SERIALIZED_NAME_PLAN_NOTE) + private String planNote; + + public CreatePlanRequest() { + } + + public CreatePlanRequest planId(String planId) { + + this.planId = planId; + return this; + } + + /** + * Unique ID to identify the plan. Only alpha-numerics, dot, hyphen and underscore allowed. + * @return planId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Unique ID to identify the plan. Only alpha-numerics, dot, hyphen and underscore allowed.") + public String getPlanId() { + return planId; + } + + + public void setPlanId(String planId) { + this.planId = planId; + } + + + public CreatePlanRequest planName(String planName) { + + this.planName = planName; + return this; + } + + /** + * Name of the plan. + * @return planName + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Name of the plan.") + public String getPlanName() { + return planName; + } + + + public void setPlanName(String planName) { + this.planName = planName; + } + + + public CreatePlanRequest planType(String planType) { + + this.planType = planType; + return this; + } + + /** + * Type of the plan. Possible values - PERIODIC, ON_DEMAND. + * @return planType + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Type of the plan. Possible values - PERIODIC, ON_DEMAND.") + public String getPlanType() { + return planType; + } + + + public void setPlanType(String planType) { + this.planType = planType; + } + + + public CreatePlanRequest planCurrency(String planCurrency) { + + this.planCurrency = planCurrency; + return this; + } + + /** + * Currency of the plan. + * @return planCurrency + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Currency of the plan.") + public String getPlanCurrency() { + return planCurrency; + } + + + public void setPlanCurrency(String planCurrency) { + this.planCurrency = planCurrency; + } + + + public CreatePlanRequest planRecurringAmount(BigDecimal planRecurringAmount) { + + this.planRecurringAmount = planRecurringAmount; + return this; + } + + /** + * Recurring amount for the plan. Required for PERIODIC plan_type. + * @return planRecurringAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Recurring amount for the plan. Required for PERIODIC plan_type.") + public BigDecimal getPlanRecurringAmount() { + return planRecurringAmount; + } + + + public void setPlanRecurringAmount(BigDecimal planRecurringAmount) { + this.planRecurringAmount = planRecurringAmount; + } + + + public CreatePlanRequest planMaxAmount(BigDecimal planMaxAmount) { + + this.planMaxAmount = planMaxAmount; + return this; + } + + /** + * Maximum amount for the plan. + * @return planMaxAmount + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Maximum amount for the plan.") + public BigDecimal getPlanMaxAmount() { + return planMaxAmount; + } + + + public void setPlanMaxAmount(BigDecimal planMaxAmount) { + this.planMaxAmount = planMaxAmount; + } + + + public CreatePlanRequest planMaxCycles(Integer planMaxCycles) { + + this.planMaxCycles = planMaxCycles; + return this; + } + + /** + * Maximum number of payment cycles for the plan. + * @return planMaxCycles + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Maximum number of payment cycles for the plan.") + public Integer getPlanMaxCycles() { + return planMaxCycles; + } + + + public void setPlanMaxCycles(Integer planMaxCycles) { + this.planMaxCycles = planMaxCycles; + } + + + public CreatePlanRequest planIntervals(Integer planIntervals) { + + this.planIntervals = planIntervals; + return this; + } + + /** + * Number of billing cycles between charges. For instance, if set to 2 and the interval type is 'week', the service will be billed every 2 weeks. Similarly, if set to 3 and the interval type is 'month', the service will be billed every 3 months. Required for PERIODIC plan_type. + * @return planIntervals + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Number of billing cycles between charges. For instance, if set to 2 and the interval type is 'week', the service will be billed every 2 weeks. Similarly, if set to 3 and the interval type is 'month', the service will be billed every 3 months. Required for PERIODIC plan_type.") + public Integer getPlanIntervals() { + return planIntervals; + } + + + public void setPlanIntervals(Integer planIntervals) { + this.planIntervals = planIntervals; + } + + + public CreatePlanRequest planIntervalType(String planIntervalType) { + + this.planIntervalType = planIntervalType; + return this; + } + + /** + * Interval type for the plan. Possible values - DAY, WEEK, MONTH, YEAR. + * @return planIntervalType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Interval type for the plan. Possible values - DAY, WEEK, MONTH, YEAR.") + public String getPlanIntervalType() { + return planIntervalType; + } + + + public void setPlanIntervalType(String planIntervalType) { + this.planIntervalType = planIntervalType; + } + + + public CreatePlanRequest planNote(String planNote) { + + this.planNote = planNote; + return this; + } + + /** + * Note for the plan. + * @return planNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Note for the plan.") + public String getPlanNote() { + return planNote; + } + + + public void setPlanNote(String planNote) { + this.planNote = planNote; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlanRequest createPlanRequest = (CreatePlanRequest) o; + return Objects.equals(this.planId, createPlanRequest.planId) && + Objects.equals(this.planName, createPlanRequest.planName) && + Objects.equals(this.planType, createPlanRequest.planType) && + Objects.equals(this.planCurrency, createPlanRequest.planCurrency) && + Objects.equals(this.planRecurringAmount, createPlanRequest.planRecurringAmount) && + Objects.equals(this.planMaxAmount, createPlanRequest.planMaxAmount) && + Objects.equals(this.planMaxCycles, createPlanRequest.planMaxCycles) && + Objects.equals(this.planIntervals, createPlanRequest.planIntervals) && + Objects.equals(this.planIntervalType, createPlanRequest.planIntervalType) && + Objects.equals(this.planNote, createPlanRequest.planNote); + } + + @Override + public int hashCode() { + return Objects.hash(planId, planName, planType, planCurrency, planRecurringAmount, planMaxAmount, planMaxCycles, planIntervals, planIntervalType, planNote); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePlanRequest {\n"); + sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); + sb.append(" planName: ").append(toIndentedString(planName)).append("\n"); + sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); + sb.append(" planCurrency: ").append(toIndentedString(planCurrency)).append("\n"); + sb.append(" planRecurringAmount: ").append(toIndentedString(planRecurringAmount)).append("\n"); + sb.append(" planMaxAmount: ").append(toIndentedString(planMaxAmount)).append("\n"); + sb.append(" planMaxCycles: ").append(toIndentedString(planMaxCycles)).append("\n"); + sb.append(" planIntervals: ").append(toIndentedString(planIntervals)).append("\n"); + sb.append(" planIntervalType: ").append(toIndentedString(planIntervalType)).append("\n"); + sb.append(" planNote: ").append(toIndentedString(planNote)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("plan_id"); + openapiFields.add("plan_name"); + openapiFields.add("plan_type"); + openapiFields.add("plan_currency"); + openapiFields.add("plan_recurring_amount"); + openapiFields.add("plan_max_amount"); + openapiFields.add("plan_max_cycles"); + openapiFields.add("plan_intervals"); + openapiFields.add("plan_interval_type"); + openapiFields.add("plan_note"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("plan_id"); + openapiRequiredFields.add("plan_name"); + openapiRequiredFields.add("plan_type"); + openapiRequiredFields.add("plan_max_amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreatePlanRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreatePlanRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if (!jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if (!jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreatePlanRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreatePlanRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if (!jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if (!jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreatePlanRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreatePlanRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreatePlanRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreatePlanRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreatePlanRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreatePlanRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreatePlanRequest + * @throws IOException if the JSON string is invalid with respect to CreatePlanRequest + */ + public static CreatePlanRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreatePlanRequest.class); + } + + /** + * Convert an instance of CreatePlanRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponse.java b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponse.java new file mode 100644 index 00000000..79601d6a --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponse.java @@ -0,0 +1,530 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CreateSubscriptionPaymentAuthResponseFailureDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The response returned in Get, Create or Manage Subscription Payment APIs. + */ +@Schema(description = "The response returned in Get, Create or Manage Subscription Payment APIs.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionPaymentAuthResponse { + public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; + @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) + private String cfPaymentId; + + public static final String SERIALIZED_NAME_CF_SUBSCRIPTION_ID = "cf_subscription_id"; + @SerializedName(SERIALIZED_NAME_CF_SUBSCRIPTION_ID) + private String cfSubscriptionId; + + public static final String SERIALIZED_NAME_FAILURE_DETAILS = "failure_details"; + @SerializedName(SERIALIZED_NAME_FAILURE_DETAILS) + private CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails; + + public static final String SERIALIZED_NAME_PAYMENT_AMOUNT = "payment_amount"; + @SerializedName(SERIALIZED_NAME_PAYMENT_AMOUNT) + private BigDecimal paymentAmount; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_PAYMENT_INITIATED_DATE = "payment_initiated_date"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INITIATED_DATE) + private String paymentInitiatedDate; + + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private String paymentStatus; + + public static final String SERIALIZED_NAME_PAYMENT_TYPE = "payment_type"; + @SerializedName(SERIALIZED_NAME_PAYMENT_TYPE) + private String paymentType; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private String paymentMethod; + + public CreateSubscriptionPaymentAuthResponse() { + } + + public CreateSubscriptionPaymentAuthResponse cfPaymentId(String cfPaymentId) { + + this.cfPaymentId = cfPaymentId; + return this; + } + + /** + * Cashfree subscription payment reference number + * @return cfPaymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment reference number") + public String getCfPaymentId() { + return cfPaymentId; + } + + + public void setCfPaymentId(String cfPaymentId) { + this.cfPaymentId = cfPaymentId; + } + + + public CreateSubscriptionPaymentAuthResponse cfSubscriptionId(String cfSubscriptionId) { + + this.cfSubscriptionId = cfSubscriptionId; + return this; + } + + /** + * Cashfree subscription reference number + * @return cfSubscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription reference number") + public String getCfSubscriptionId() { + return cfSubscriptionId; + } + + + public void setCfSubscriptionId(String cfSubscriptionId) { + this.cfSubscriptionId = cfSubscriptionId; + } + + + public CreateSubscriptionPaymentAuthResponse failureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + + this.failureDetails = failureDetails; + return this; + } + + /** + * Get failureDetails + * @return failureDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public CreateSubscriptionPaymentAuthResponseFailureDetails getFailureDetails() { + return failureDetails; + } + + + public void setFailureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + this.failureDetails = failureDetails; + } + + + public CreateSubscriptionPaymentAuthResponse paymentAmount(BigDecimal paymentAmount) { + + this.paymentAmount = paymentAmount; + return this; + } + + /** + * The charge amount of the payment. + * @return paymentAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The charge amount of the payment.") + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + + public CreateSubscriptionPaymentAuthResponse paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public CreateSubscriptionPaymentAuthResponse paymentInitiatedDate(String paymentInitiatedDate) { + + this.paymentInitiatedDate = paymentInitiatedDate; + return this; + } + + /** + * The date on which the payment was initiated. + * @return paymentInitiatedDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The date on which the payment was initiated.") + public String getPaymentInitiatedDate() { + return paymentInitiatedDate; + } + + + public void setPaymentInitiatedDate(String paymentInitiatedDate) { + this.paymentInitiatedDate = paymentInitiatedDate; + } + + + public CreateSubscriptionPaymentAuthResponse paymentStatus(String paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * Status of the payment. + * @return paymentStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the payment.") + public String getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(String paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public CreateSubscriptionPaymentAuthResponse paymentType(String paymentType) { + + this.paymentType = paymentType; + return this; + } + + /** + * Payment type. Can be AUTH or CHARGE. + * @return paymentType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment type. Can be AUTH or CHARGE.") + public String getPaymentType() { + return paymentType; + } + + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + + public CreateSubscriptionPaymentAuthResponse subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public CreateSubscriptionPaymentAuthResponse paymentMethod(String paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Payment method used for the authorization. + * @return paymentMethod + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment method used for the authorization.") + public String getPaymentMethod() { + return paymentMethod; + } + + + public void setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionPaymentAuthResponse createSubscriptionPaymentAuthResponse = (CreateSubscriptionPaymentAuthResponse) o; + return Objects.equals(this.cfPaymentId, createSubscriptionPaymentAuthResponse.cfPaymentId) && + Objects.equals(this.cfSubscriptionId, createSubscriptionPaymentAuthResponse.cfSubscriptionId) && + Objects.equals(this.failureDetails, createSubscriptionPaymentAuthResponse.failureDetails) && + Objects.equals(this.paymentAmount, createSubscriptionPaymentAuthResponse.paymentAmount) && + Objects.equals(this.paymentId, createSubscriptionPaymentAuthResponse.paymentId) && + Objects.equals(this.paymentInitiatedDate, createSubscriptionPaymentAuthResponse.paymentInitiatedDate) && + Objects.equals(this.paymentStatus, createSubscriptionPaymentAuthResponse.paymentStatus) && + Objects.equals(this.paymentType, createSubscriptionPaymentAuthResponse.paymentType) && + Objects.equals(this.subscriptionId, createSubscriptionPaymentAuthResponse.subscriptionId) && + Objects.equals(this.paymentMethod, createSubscriptionPaymentAuthResponse.paymentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(cfPaymentId, cfSubscriptionId, failureDetails, paymentAmount, paymentId, paymentInitiatedDate, paymentStatus, paymentType, subscriptionId, paymentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionPaymentAuthResponse {\n"); + sb.append(" cfPaymentId: ").append(toIndentedString(cfPaymentId)).append("\n"); + sb.append(" cfSubscriptionId: ").append(toIndentedString(cfSubscriptionId)).append("\n"); + sb.append(" failureDetails: ").append(toIndentedString(failureDetails)).append("\n"); + sb.append(" paymentAmount: ").append(toIndentedString(paymentAmount)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" paymentInitiatedDate: ").append(toIndentedString(paymentInitiatedDate)).append("\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cf_payment_id"); + openapiFields.add("cf_subscription_id"); + openapiFields.add("failure_details"); + openapiFields.add("payment_amount"); + openapiFields.add("payment_id"); + openapiFields.add("payment_initiated_date"); + openapiFields.add("payment_status"); + openapiFields.add("payment_type"); + openapiFields.add("subscription_id"); + openapiFields.add("payment_method"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentAuthResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentAuthResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + return true; + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionPaymentAuthResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionPaymentAuthResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentAuthResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionPaymentAuthResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionPaymentAuthResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionPaymentAuthResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionPaymentAuthResponse + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionPaymentAuthResponse + */ + public static CreateSubscriptionPaymentAuthResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionPaymentAuthResponse.class); + } + + /** + * Convert an instance of CreateSubscriptionPaymentAuthResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetails.java b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetails.java new file mode 100644 index 00000000..1973ce35 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentAuthResponseFailureDetails.java @@ -0,0 +1,215 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * CreateSubscriptionPaymentAuthResponseFailureDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionPaymentAuthResponseFailureDetails { + public static final String SERIALIZED_NAME_FAILURE_REASON = "failure_reason"; + @SerializedName(SERIALIZED_NAME_FAILURE_REASON) + private String failureReason; + + public CreateSubscriptionPaymentAuthResponseFailureDetails() { + } + + public CreateSubscriptionPaymentAuthResponseFailureDetails failureReason(String failureReason) { + + this.failureReason = failureReason; + return this; + } + + /** + * Failure reason of the payment if the payment_status is failed. + * @return failureReason + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Failure reason of the payment if the payment_status is failed.") + public String getFailureReason() { + return failureReason; + } + + + public void setFailureReason(String failureReason) { + this.failureReason = failureReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionPaymentAuthResponseFailureDetails createSubscriptionPaymentAuthResponseFailureDetails = (CreateSubscriptionPaymentAuthResponseFailureDetails) o; + return Objects.equals(this.failureReason, createSubscriptionPaymentAuthResponseFailureDetails.failureReason); + } + + @Override + public int hashCode() { + return Objects.hash(failureReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionPaymentAuthResponseFailureDetails {\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("failure_reason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentAuthResponseFailureDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("failure_reason") != null && !jsonObj.get("failure_reason").isJsonNull()) && !jsonObj.get("failure_reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `failure_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("failure_reason").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentAuthResponseFailureDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("failure_reason") != null && !jsonObj.get("failure_reason").isJsonNull()) && !jsonObj.get("failure_reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `failure_reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("failure_reason").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionPaymentAuthResponseFailureDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionPaymentAuthResponseFailureDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentAuthResponseFailureDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionPaymentAuthResponseFailureDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionPaymentAuthResponseFailureDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionPaymentAuthResponseFailureDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionPaymentAuthResponseFailureDetails + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionPaymentAuthResponseFailureDetails + */ + public static CreateSubscriptionPaymentAuthResponseFailureDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionPaymentAuthResponseFailureDetails.class); + } + + /** + * Convert an instance of CreateSubscriptionPaymentAuthResponseFailureDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponse.java b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponse.java new file mode 100644 index 00000000..8e6eb8bd --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentChargeResponse.java @@ -0,0 +1,530 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CreateSubscriptionPaymentAuthResponseFailureDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The response returned in Get, Create or Manage Subscription Payment APIs. + */ +@Schema(description = "The response returned in Get, Create or Manage Subscription Payment APIs.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionPaymentChargeResponse { + public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; + @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) + private String cfPaymentId; + + public static final String SERIALIZED_NAME_CF_SUBSCRIPTION_ID = "cf_subscription_id"; + @SerializedName(SERIALIZED_NAME_CF_SUBSCRIPTION_ID) + private String cfSubscriptionId; + + public static final String SERIALIZED_NAME_FAILURE_DETAILS = "failure_details"; + @SerializedName(SERIALIZED_NAME_FAILURE_DETAILS) + private CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails; + + public static final String SERIALIZED_NAME_PAYMENT_AMOUNT = "payment_amount"; + @SerializedName(SERIALIZED_NAME_PAYMENT_AMOUNT) + private BigDecimal paymentAmount; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_PAYMENT_INITIATED_DATE = "payment_initiated_date"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INITIATED_DATE) + private String paymentInitiatedDate; + + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private String paymentStatus; + + public static final String SERIALIZED_NAME_PAYMENT_TYPE = "payment_type"; + @SerializedName(SERIALIZED_NAME_PAYMENT_TYPE) + private String paymentType; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private String paymentMethod; + + public CreateSubscriptionPaymentChargeResponse() { + } + + public CreateSubscriptionPaymentChargeResponse cfPaymentId(String cfPaymentId) { + + this.cfPaymentId = cfPaymentId; + return this; + } + + /** + * Cashfree subscription payment reference number + * @return cfPaymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment reference number") + public String getCfPaymentId() { + return cfPaymentId; + } + + + public void setCfPaymentId(String cfPaymentId) { + this.cfPaymentId = cfPaymentId; + } + + + public CreateSubscriptionPaymentChargeResponse cfSubscriptionId(String cfSubscriptionId) { + + this.cfSubscriptionId = cfSubscriptionId; + return this; + } + + /** + * Cashfree subscription reference number + * @return cfSubscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription reference number") + public String getCfSubscriptionId() { + return cfSubscriptionId; + } + + + public void setCfSubscriptionId(String cfSubscriptionId) { + this.cfSubscriptionId = cfSubscriptionId; + } + + + public CreateSubscriptionPaymentChargeResponse failureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + + this.failureDetails = failureDetails; + return this; + } + + /** + * Get failureDetails + * @return failureDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public CreateSubscriptionPaymentAuthResponseFailureDetails getFailureDetails() { + return failureDetails; + } + + + public void setFailureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + this.failureDetails = failureDetails; + } + + + public CreateSubscriptionPaymentChargeResponse paymentAmount(BigDecimal paymentAmount) { + + this.paymentAmount = paymentAmount; + return this; + } + + /** + * The charge amount of the payment. + * @return paymentAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The charge amount of the payment.") + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + + public CreateSubscriptionPaymentChargeResponse paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public CreateSubscriptionPaymentChargeResponse paymentInitiatedDate(String paymentInitiatedDate) { + + this.paymentInitiatedDate = paymentInitiatedDate; + return this; + } + + /** + * The date on which the payment was initiated. + * @return paymentInitiatedDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The date on which the payment was initiated.") + public String getPaymentInitiatedDate() { + return paymentInitiatedDate; + } + + + public void setPaymentInitiatedDate(String paymentInitiatedDate) { + this.paymentInitiatedDate = paymentInitiatedDate; + } + + + public CreateSubscriptionPaymentChargeResponse paymentStatus(String paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * Status of the payment. + * @return paymentStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the payment.") + public String getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(String paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public CreateSubscriptionPaymentChargeResponse paymentType(String paymentType) { + + this.paymentType = paymentType; + return this; + } + + /** + * Payment type. Can be AUTH or CHARGE. + * @return paymentType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment type. Can be AUTH or CHARGE.") + public String getPaymentType() { + return paymentType; + } + + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + + public CreateSubscriptionPaymentChargeResponse subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public CreateSubscriptionPaymentChargeResponse paymentMethod(String paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Payment method used for the authorization. + * @return paymentMethod + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment method used for the authorization.") + public String getPaymentMethod() { + return paymentMethod; + } + + + public void setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionPaymentChargeResponse createSubscriptionPaymentChargeResponse = (CreateSubscriptionPaymentChargeResponse) o; + return Objects.equals(this.cfPaymentId, createSubscriptionPaymentChargeResponse.cfPaymentId) && + Objects.equals(this.cfSubscriptionId, createSubscriptionPaymentChargeResponse.cfSubscriptionId) && + Objects.equals(this.failureDetails, createSubscriptionPaymentChargeResponse.failureDetails) && + Objects.equals(this.paymentAmount, createSubscriptionPaymentChargeResponse.paymentAmount) && + Objects.equals(this.paymentId, createSubscriptionPaymentChargeResponse.paymentId) && + Objects.equals(this.paymentInitiatedDate, createSubscriptionPaymentChargeResponse.paymentInitiatedDate) && + Objects.equals(this.paymentStatus, createSubscriptionPaymentChargeResponse.paymentStatus) && + Objects.equals(this.paymentType, createSubscriptionPaymentChargeResponse.paymentType) && + Objects.equals(this.subscriptionId, createSubscriptionPaymentChargeResponse.subscriptionId) && + Objects.equals(this.paymentMethod, createSubscriptionPaymentChargeResponse.paymentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(cfPaymentId, cfSubscriptionId, failureDetails, paymentAmount, paymentId, paymentInitiatedDate, paymentStatus, paymentType, subscriptionId, paymentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionPaymentChargeResponse {\n"); + sb.append(" cfPaymentId: ").append(toIndentedString(cfPaymentId)).append("\n"); + sb.append(" cfSubscriptionId: ").append(toIndentedString(cfSubscriptionId)).append("\n"); + sb.append(" failureDetails: ").append(toIndentedString(failureDetails)).append("\n"); + sb.append(" paymentAmount: ").append(toIndentedString(paymentAmount)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" paymentInitiatedDate: ").append(toIndentedString(paymentInitiatedDate)).append("\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cf_payment_id"); + openapiFields.add("cf_subscription_id"); + openapiFields.add("failure_details"); + openapiFields.add("payment_amount"); + openapiFields.add("payment_id"); + openapiFields.add("payment_initiated_date"); + openapiFields.add("payment_status"); + openapiFields.add("payment_type"); + openapiFields.add("subscription_id"); + openapiFields.add("payment_method"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentChargeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentChargeResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + return true; + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_method") != null && !jsonObj.get("payment_method").isJsonNull()) && !jsonObj.get("payment_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_method").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionPaymentChargeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionPaymentChargeResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentChargeResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionPaymentChargeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionPaymentChargeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionPaymentChargeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionPaymentChargeResponse + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionPaymentChargeResponse + */ + public static CreateSubscriptionPaymentChargeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionPaymentChargeResponse.class); + } + + /** + * Convert an instance of CreateSubscriptionPaymentChargeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionPaymentRequest.java b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentRequest.java new file mode 100644 index 00000000..798f0603 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionPaymentRequest.java @@ -0,0 +1,467 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The request to be passed for the create subscription payment API. + */ +@Schema(description = "The request to be passed for the create subscription payment API.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionPaymentRequest { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_SESSION_ID = "subscription_session_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_SESSION_ID) + private String subscriptionSessionId; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_PAYMENT_AMOUNT = "payment_amount"; + @SerializedName(SERIALIZED_NAME_PAYMENT_AMOUNT) + private BigDecimal paymentAmount; + + public static final String SERIALIZED_NAME_PAYMENT_SCHEDULE_DATE = "payment_schedule_date"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SCHEDULE_DATE) + private String paymentScheduleDate; + + public static final String SERIALIZED_NAME_PAYMENT_REMARKS = "payment_remarks"; + @SerializedName(SERIALIZED_NAME_PAYMENT_REMARKS) + private String paymentRemarks; + + public static final String SERIALIZED_NAME_PAYMENT_TYPE = "payment_type"; + @SerializedName(SERIALIZED_NAME_PAYMENT_TYPE) + private String paymentType; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Object paymentMethod; + + public CreateSubscriptionPaymentRequest() { + } + + public CreateSubscriptionPaymentRequest subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public CreateSubscriptionPaymentRequest subscriptionSessionId(String subscriptionSessionId) { + + this.subscriptionSessionId = subscriptionSessionId; + return this; + } + + /** + * Session ID for the subscription. Required only for Auth. + * @return subscriptionSessionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Session ID for the subscription. Required only for Auth.") + public String getSubscriptionSessionId() { + return subscriptionSessionId; + } + + + public void setSubscriptionSessionId(String subscriptionSessionId) { + this.subscriptionSessionId = subscriptionSessionId; + } + + + public CreateSubscriptionPaymentRequest paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription payment. + * @return paymentId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID passed by merchant for identifying the subscription payment.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public CreateSubscriptionPaymentRequest paymentAmount(BigDecimal paymentAmount) { + + this.paymentAmount = paymentAmount; + return this; + } + + /** + * The charge amount of the payment. Required in case of charge. + * @return paymentAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The charge amount of the payment. Required in case of charge.") + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + + public CreateSubscriptionPaymentRequest paymentScheduleDate(String paymentScheduleDate) { + + this.paymentScheduleDate = paymentScheduleDate; + return this; + } + + /** + * The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes. + * @return paymentScheduleDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes.") + public String getPaymentScheduleDate() { + return paymentScheduleDate; + } + + + public void setPaymentScheduleDate(String paymentScheduleDate) { + this.paymentScheduleDate = paymentScheduleDate; + } + + + public CreateSubscriptionPaymentRequest paymentRemarks(String paymentRemarks) { + + this.paymentRemarks = paymentRemarks; + return this; + } + + /** + * Payment remarks. + * @return paymentRemarks + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment remarks.") + public String getPaymentRemarks() { + return paymentRemarks; + } + + + public void setPaymentRemarks(String paymentRemarks) { + this.paymentRemarks = paymentRemarks; + } + + + public CreateSubscriptionPaymentRequest paymentType(String paymentType) { + + this.paymentType = paymentType; + return this; + } + + /** + * Payment type. Can be AUTH or CHARGE. + * @return paymentType + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Payment type. Can be AUTH or CHARGE.") + public String getPaymentType() { + return paymentType; + } + + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + + public CreateSubscriptionPaymentRequest paymentMethod(Object paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Payment method. Can be one of [\"upi\", \"enach\", \"pnach\", \"card\"] + * @return paymentMethod + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment method. Can be one of [\"upi\", \"enach\", \"pnach\", \"card\"]") + public Object getPaymentMethod() { + return paymentMethod; + } + + + public void setPaymentMethod(Object paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionPaymentRequest createSubscriptionPaymentRequest = (CreateSubscriptionPaymentRequest) o; + return Objects.equals(this.subscriptionId, createSubscriptionPaymentRequest.subscriptionId) && + Objects.equals(this.subscriptionSessionId, createSubscriptionPaymentRequest.subscriptionSessionId) && + Objects.equals(this.paymentId, createSubscriptionPaymentRequest.paymentId) && + Objects.equals(this.paymentAmount, createSubscriptionPaymentRequest.paymentAmount) && + Objects.equals(this.paymentScheduleDate, createSubscriptionPaymentRequest.paymentScheduleDate) && + Objects.equals(this.paymentRemarks, createSubscriptionPaymentRequest.paymentRemarks) && + Objects.equals(this.paymentType, createSubscriptionPaymentRequest.paymentType) && + Objects.equals(this.paymentMethod, createSubscriptionPaymentRequest.paymentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId, subscriptionSessionId, paymentId, paymentAmount, paymentScheduleDate, paymentRemarks, paymentType, paymentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionPaymentRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" subscriptionSessionId: ").append(toIndentedString(subscriptionSessionId)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" paymentAmount: ").append(toIndentedString(paymentAmount)).append("\n"); + sb.append(" paymentScheduleDate: ").append(toIndentedString(paymentScheduleDate)).append("\n"); + sb.append(" paymentRemarks: ").append(toIndentedString(paymentRemarks)).append("\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + openapiFields.add("subscription_session_id"); + openapiFields.add("payment_id"); + openapiFields.add("payment_amount"); + openapiFields.add("payment_schedule_date"); + openapiFields.add("payment_remarks"); + openapiFields.add("payment_type"); + openapiFields.add("payment_method"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + openapiRequiredFields.add("payment_id"); + openapiRequiredFields.add("payment_type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionPaymentRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("subscription_session_id") != null && !jsonObj.get("subscription_session_id").isJsonNull()) && !jsonObj.get("subscription_session_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_session_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_session_id").toString())); + } + if (!jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_schedule_date") != null && !jsonObj.get("payment_schedule_date").isJsonNull()) && !jsonObj.get("payment_schedule_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_schedule_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_schedule_date").toString())); + } + if ((jsonObj.get("payment_remarks") != null && !jsonObj.get("payment_remarks").isJsonNull()) && !jsonObj.get("payment_remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_remarks").toString())); + } + if (!jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionPaymentRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionPaymentRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("subscription_session_id") != null && !jsonObj.get("subscription_session_id").isJsonNull()) && !jsonObj.get("subscription_session_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_session_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_session_id").toString())); + } + if (!jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_schedule_date") != null && !jsonObj.get("payment_schedule_date").isJsonNull()) && !jsonObj.get("payment_schedule_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_schedule_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_schedule_date").toString())); + } + if ((jsonObj.get("payment_remarks") != null && !jsonObj.get("payment_remarks").isJsonNull()) && !jsonObj.get("payment_remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_remarks").toString())); + } + if (!jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionPaymentRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionPaymentRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionPaymentRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionPaymentRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionPaymentRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionPaymentRequest + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionPaymentRequest + */ + public static CreateSubscriptionPaymentRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionPaymentRequest.class); + } + + /** + * Convert an instance of CreateSubscriptionPaymentRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionRefundRequest.java b/src/main/java/com/cashfree/model/CreateSubscriptionRefundRequest.java new file mode 100644 index 00000000..b787d978 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionRefundRequest.java @@ -0,0 +1,438 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to create a subscription refund. + */ +@Schema(description = "Request body to create a subscription refund.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionRefundRequest { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; + @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) + private String cfPaymentId; + + public static final String SERIALIZED_NAME_REFUND_ID = "refund_id"; + @SerializedName(SERIALIZED_NAME_REFUND_ID) + private String refundId; + + public static final String SERIALIZED_NAME_REFUND_AMOUNT = "refund_amount"; + @SerializedName(SERIALIZED_NAME_REFUND_AMOUNT) + private BigDecimal refundAmount; + + public static final String SERIALIZED_NAME_REFUND_NOTE = "refund_note"; + @SerializedName(SERIALIZED_NAME_REFUND_NOTE) + private String refundNote; + + public static final String SERIALIZED_NAME_REFUND_SPEED = "refund_speed"; + @SerializedName(SERIALIZED_NAME_REFUND_SPEED) + private String refundSpeed; + + public CreateSubscriptionRefundRequest() { + } + + public CreateSubscriptionRefundRequest subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public CreateSubscriptionRefundRequest paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public CreateSubscriptionRefundRequest cfPaymentId(String cfPaymentId) { + + this.cfPaymentId = cfPaymentId; + return this; + } + + /** + * Cashfree subscription payment reference number. + * @return cfPaymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment reference number.") + public String getCfPaymentId() { + return cfPaymentId; + } + + + public void setCfPaymentId(String cfPaymentId) { + this.cfPaymentId = cfPaymentId; + } + + + public CreateSubscriptionRefundRequest refundId(String refundId) { + + this.refundId = refundId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the refund. + * @return refundId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID passed by merchant for identifying the refund.") + public String getRefundId() { + return refundId; + } + + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + + public CreateSubscriptionRefundRequest refundAmount(BigDecimal refundAmount) { + + this.refundAmount = refundAmount; + return this; + } + + /** + * The amount to be refunded. Can be partial or full amount of the payment. + * @return refundAmount + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "The amount to be refunded. Can be partial or full amount of the payment.") + public BigDecimal getRefundAmount() { + return refundAmount; + } + + + public void setRefundAmount(BigDecimal refundAmount) { + this.refundAmount = refundAmount; + } + + + public CreateSubscriptionRefundRequest refundNote(String refundNote) { + + this.refundNote = refundNote; + return this; + } + + /** + * Refund note. + * @return refundNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Refund note.") + public String getRefundNote() { + return refundNote; + } + + + public void setRefundNote(String refundNote) { + this.refundNote = refundNote; + } + + + public CreateSubscriptionRefundRequest refundSpeed(String refundSpeed) { + + this.refundSpeed = refundSpeed; + return this; + } + + /** + * Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds. + * @return refundSpeed + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds.") + public String getRefundSpeed() { + return refundSpeed; + } + + + public void setRefundSpeed(String refundSpeed) { + this.refundSpeed = refundSpeed; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionRefundRequest createSubscriptionRefundRequest = (CreateSubscriptionRefundRequest) o; + return Objects.equals(this.subscriptionId, createSubscriptionRefundRequest.subscriptionId) && + Objects.equals(this.paymentId, createSubscriptionRefundRequest.paymentId) && + Objects.equals(this.cfPaymentId, createSubscriptionRefundRequest.cfPaymentId) && + Objects.equals(this.refundId, createSubscriptionRefundRequest.refundId) && + Objects.equals(this.refundAmount, createSubscriptionRefundRequest.refundAmount) && + Objects.equals(this.refundNote, createSubscriptionRefundRequest.refundNote) && + Objects.equals(this.refundSpeed, createSubscriptionRefundRequest.refundSpeed); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId, paymentId, cfPaymentId, refundId, refundAmount, refundNote, refundSpeed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionRefundRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" cfPaymentId: ").append(toIndentedString(cfPaymentId)).append("\n"); + sb.append(" refundId: ").append(toIndentedString(refundId)).append("\n"); + sb.append(" refundAmount: ").append(toIndentedString(refundAmount)).append("\n"); + sb.append(" refundNote: ").append(toIndentedString(refundNote)).append("\n"); + sb.append(" refundSpeed: ").append(toIndentedString(refundSpeed)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + openapiFields.add("payment_id"); + openapiFields.add("cf_payment_id"); + openapiFields.add("refund_id"); + openapiFields.add("refund_amount"); + openapiFields.add("refund_note"); + openapiFields.add("refund_speed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + openapiRequiredFields.add("refund_id"); + openapiRequiredFields.add("refund_amount"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRefundRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionRefundRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if (!jsonObj.get("refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_id").toString())); + } + if ((jsonObj.get("refund_note") != null && !jsonObj.get("refund_note").isJsonNull()) && !jsonObj.get("refund_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_note").toString())); + } + if ((jsonObj.get("refund_speed") != null && !jsonObj.get("refund_speed").isJsonNull()) && !jsonObj.get("refund_speed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_speed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_speed").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRefundRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionRefundRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if (!jsonObj.get("refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_id").toString())); + } + if ((jsonObj.get("refund_note") != null && !jsonObj.get("refund_note").isJsonNull()) && !jsonObj.get("refund_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_note").toString())); + } + if ((jsonObj.get("refund_speed") != null && !jsonObj.get("refund_speed").isJsonNull()) && !jsonObj.get("refund_speed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_speed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_speed").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionRefundRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionRefundRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionRefundRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionRefundRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionRefundRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionRefundRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionRefundRequest + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionRefundRequest + */ + public static CreateSubscriptionRefundRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionRefundRequest.class); + } + + /** + * Convert an instance of CreateSubscriptionRefundRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionRequest.java b/src/main/java/com/cashfree/model/CreateSubscriptionRequest.java new file mode 100644 index 00000000..b727314d --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionRequest.java @@ -0,0 +1,581 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CreateSubscriptionRequestAuthorizationDetails; +import com.cashfree.model.CreateSubscriptionRequestPlanDetails; +import com.cashfree.model.CreateSubscriptionRequestSubscriptionMeta; +import com.cashfree.model.SubscriptionCustomerDetails; +import com.cashfree.model.SubscriptionPaymentSplitItem; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to create a new subscription. + */ +@Schema(description = "Request body to create a new subscription.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionRequest { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_CUSTOMER_DETAILS = "customer_details"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_DETAILS) + private SubscriptionCustomerDetails customerDetails; + + public static final String SERIALIZED_NAME_PLAN_DETAILS = "plan_details"; + @SerializedName(SERIALIZED_NAME_PLAN_DETAILS) + private CreateSubscriptionRequestPlanDetails planDetails; + + public static final String SERIALIZED_NAME_AUTHORIZATION_DETAILS = "authorization_details"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_DETAILS) + private CreateSubscriptionRequestAuthorizationDetails authorizationDetails; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_META = "subscription_meta"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_META) + private CreateSubscriptionRequestSubscriptionMeta subscriptionMeta; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_EXPIRY_TIME = "subscription_expiry_time"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_EXPIRY_TIME) + private String subscriptionExpiryTime; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_FIRST_CHARGE_TIME = "subscription_first_charge_time"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_FIRST_CHARGE_TIME) + private String subscriptionFirstChargeTime; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_NOTE = "subscription_note"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_NOTE) + private String subscriptionNote; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_TAGS = "subscription_tags"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TAGS) + private Object subscriptionTags; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_PAYMENT_SPLITS = "subscription_payment_splits"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_PAYMENT_SPLITS) + private List subscriptionPaymentSplits; + + public CreateSubscriptionRequest() { + } + + public CreateSubscriptionRequest subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID for the subscription. It can include alphanumeric characters, underscore, dot, hyphen, and space. Maximum characters allowed is 250. + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID for the subscription. It can include alphanumeric characters, underscore, dot, hyphen, and space. Maximum characters allowed is 250.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public CreateSubscriptionRequest customerDetails(SubscriptionCustomerDetails customerDetails) { + + this.customerDetails = customerDetails; + return this; + } + + /** + * Get customerDetails + * @return customerDetails + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public SubscriptionCustomerDetails getCustomerDetails() { + return customerDetails; + } + + + public void setCustomerDetails(SubscriptionCustomerDetails customerDetails) { + this.customerDetails = customerDetails; + } + + + public CreateSubscriptionRequest planDetails(CreateSubscriptionRequestPlanDetails planDetails) { + + this.planDetails = planDetails; + return this; + } + + /** + * Get planDetails + * @return planDetails + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public CreateSubscriptionRequestPlanDetails getPlanDetails() { + return planDetails; + } + + + public void setPlanDetails(CreateSubscriptionRequestPlanDetails planDetails) { + this.planDetails = planDetails; + } + + + public CreateSubscriptionRequest authorizationDetails(CreateSubscriptionRequestAuthorizationDetails authorizationDetails) { + + this.authorizationDetails = authorizationDetails; + return this; + } + + /** + * Get authorizationDetails + * @return authorizationDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public CreateSubscriptionRequestAuthorizationDetails getAuthorizationDetails() { + return authorizationDetails; + } + + + public void setAuthorizationDetails(CreateSubscriptionRequestAuthorizationDetails authorizationDetails) { + this.authorizationDetails = authorizationDetails; + } + + + public CreateSubscriptionRequest subscriptionMeta(CreateSubscriptionRequestSubscriptionMeta subscriptionMeta) { + + this.subscriptionMeta = subscriptionMeta; + return this; + } + + /** + * Get subscriptionMeta + * @return subscriptionMeta + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public CreateSubscriptionRequestSubscriptionMeta getSubscriptionMeta() { + return subscriptionMeta; + } + + + public void setSubscriptionMeta(CreateSubscriptionRequestSubscriptionMeta subscriptionMeta) { + this.subscriptionMeta = subscriptionMeta; + } + + + public CreateSubscriptionRequest subscriptionExpiryTime(String subscriptionExpiryTime) { + + this.subscriptionExpiryTime = subscriptionExpiryTime; + return this; + } + + /** + * Expiry date for the subscription. + * @return subscriptionExpiryTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Expiry date for the subscription.") + public String getSubscriptionExpiryTime() { + return subscriptionExpiryTime; + } + + + public void setSubscriptionExpiryTime(String subscriptionExpiryTime) { + this.subscriptionExpiryTime = subscriptionExpiryTime; + } + + + public CreateSubscriptionRequest subscriptionFirstChargeTime(String subscriptionFirstChargeTime) { + + this.subscriptionFirstChargeTime = subscriptionFirstChargeTime; + return this; + } + + /** + * Time at which the first charge will be made for the subscription after authorization. Applicable only for PERIODIC plans. + * @return subscriptionFirstChargeTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Time at which the first charge will be made for the subscription after authorization. Applicable only for PERIODIC plans.") + public String getSubscriptionFirstChargeTime() { + return subscriptionFirstChargeTime; + } + + + public void setSubscriptionFirstChargeTime(String subscriptionFirstChargeTime) { + this.subscriptionFirstChargeTime = subscriptionFirstChargeTime; + } + + + public CreateSubscriptionRequest subscriptionNote(String subscriptionNote) { + + this.subscriptionNote = subscriptionNote; + return this; + } + + /** + * Note for the subscription. + * @return subscriptionNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Note for the subscription.") + public String getSubscriptionNote() { + return subscriptionNote; + } + + + public void setSubscriptionNote(String subscriptionNote) { + this.subscriptionNote = subscriptionNote; + } + + + public CreateSubscriptionRequest subscriptionTags(Object subscriptionTags) { + + this.subscriptionTags = subscriptionTags; + return this; + } + + /** + * Tags for the subscription. + * @return subscriptionTags + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Tags for the subscription.") + public Object getSubscriptionTags() { + return subscriptionTags; + } + + + public void setSubscriptionTags(Object subscriptionTags) { + this.subscriptionTags = subscriptionTags; + } + + + public CreateSubscriptionRequest subscriptionPaymentSplits(List subscriptionPaymentSplits) { + + this.subscriptionPaymentSplits = subscriptionPaymentSplits; + return this; + } + + public CreateSubscriptionRequest addSubscriptionPaymentSplitsItem(SubscriptionPaymentSplitItem subscriptionPaymentSplitsItem) { + if (this.subscriptionPaymentSplits == null) { + this.subscriptionPaymentSplits = new ArrayList<>(); + } + this.subscriptionPaymentSplits.add(subscriptionPaymentSplitsItem); + return this; + } + + /** + * Payment splits for the subscription. + * @return subscriptionPaymentSplits + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment splits for the subscription.") + public List getSubscriptionPaymentSplits() { + return subscriptionPaymentSplits; + } + + + public void setSubscriptionPaymentSplits(List subscriptionPaymentSplits) { + this.subscriptionPaymentSplits = subscriptionPaymentSplits; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionRequest createSubscriptionRequest = (CreateSubscriptionRequest) o; + return Objects.equals(this.subscriptionId, createSubscriptionRequest.subscriptionId) && + Objects.equals(this.customerDetails, createSubscriptionRequest.customerDetails) && + Objects.equals(this.planDetails, createSubscriptionRequest.planDetails) && + Objects.equals(this.authorizationDetails, createSubscriptionRequest.authorizationDetails) && + Objects.equals(this.subscriptionMeta, createSubscriptionRequest.subscriptionMeta) && + Objects.equals(this.subscriptionExpiryTime, createSubscriptionRequest.subscriptionExpiryTime) && + Objects.equals(this.subscriptionFirstChargeTime, createSubscriptionRequest.subscriptionFirstChargeTime) && + Objects.equals(this.subscriptionNote, createSubscriptionRequest.subscriptionNote) && + Objects.equals(this.subscriptionTags, createSubscriptionRequest.subscriptionTags) && + Objects.equals(this.subscriptionPaymentSplits, createSubscriptionRequest.subscriptionPaymentSplits); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId, customerDetails, planDetails, authorizationDetails, subscriptionMeta, subscriptionExpiryTime, subscriptionFirstChargeTime, subscriptionNote, subscriptionTags, subscriptionPaymentSplits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" customerDetails: ").append(toIndentedString(customerDetails)).append("\n"); + sb.append(" planDetails: ").append(toIndentedString(planDetails)).append("\n"); + sb.append(" authorizationDetails: ").append(toIndentedString(authorizationDetails)).append("\n"); + sb.append(" subscriptionMeta: ").append(toIndentedString(subscriptionMeta)).append("\n"); + sb.append(" subscriptionExpiryTime: ").append(toIndentedString(subscriptionExpiryTime)).append("\n"); + sb.append(" subscriptionFirstChargeTime: ").append(toIndentedString(subscriptionFirstChargeTime)).append("\n"); + sb.append(" subscriptionNote: ").append(toIndentedString(subscriptionNote)).append("\n"); + sb.append(" subscriptionTags: ").append(toIndentedString(subscriptionTags)).append("\n"); + sb.append(" subscriptionPaymentSplits: ").append(toIndentedString(subscriptionPaymentSplits)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + openapiFields.add("customer_details"); + openapiFields.add("plan_details"); + openapiFields.add("authorization_details"); + openapiFields.add("subscription_meta"); + openapiFields.add("subscription_expiry_time"); + openapiFields.add("subscription_first_charge_time"); + openapiFields.add("subscription_note"); + openapiFields.add("subscription_tags"); + openapiFields.add("subscription_payment_splits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + openapiRequiredFields.add("customer_details"); + openapiRequiredFields.add("plan_details"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + // validate the required field `customer_details` + SubscriptionCustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + // validate the required field `plan_details` + CreateSubscriptionRequestPlanDetails.validateJsonElement(jsonObj.get("plan_details")); + // validate the optional field `authorization_details` + if (jsonObj.get("authorization_details") != null && !jsonObj.get("authorization_details").isJsonNull()) { + CreateSubscriptionRequestAuthorizationDetails.validateJsonElement(jsonObj.get("authorization_details")); + } + // validate the optional field `subscription_meta` + if (jsonObj.get("subscription_meta") != null && !jsonObj.get("subscription_meta").isJsonNull()) { + CreateSubscriptionRequestSubscriptionMeta.validateJsonElement(jsonObj.get("subscription_meta")); + } + if ((jsonObj.get("subscription_expiry_time") != null && !jsonObj.get("subscription_expiry_time").isJsonNull()) && !jsonObj.get("subscription_expiry_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_expiry_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_expiry_time").toString())); + } + if ((jsonObj.get("subscription_first_charge_time") != null && !jsonObj.get("subscription_first_charge_time").isJsonNull()) && !jsonObj.get("subscription_first_charge_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_first_charge_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_first_charge_time").toString())); + } + if ((jsonObj.get("subscription_note") != null && !jsonObj.get("subscription_note").isJsonNull()) && !jsonObj.get("subscription_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_note").toString())); + } + if (jsonObj.get("subscription_payment_splits") != null && !jsonObj.get("subscription_payment_splits").isJsonNull()) { + JsonArray jsonArraysubscriptionPaymentSplits = jsonObj.getAsJsonArray("subscription_payment_splits"); + if (jsonArraysubscriptionPaymentSplits != null) { + // ensure the json data is an array + if (!jsonObj.get("subscription_payment_splits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_payment_splits` to be an array in the JSON string but got `%s`", jsonObj.get("subscription_payment_splits").toString())); + } + + // validate the optional field `subscription_payment_splits` (array) + for (int i = 0; i < jsonArraysubscriptionPaymentSplits.size(); i++) { + SubscriptionPaymentSplitItem.validateJsonElement(jsonArraysubscriptionPaymentSplits.get(i)); + }; + } + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSubscriptionRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + // validate the required field `customer_details` + SubscriptionCustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + // validate the required field `plan_details` + CreateSubscriptionRequestPlanDetails.validateJsonElement(jsonObj.get("plan_details")); + // validate the optional field `authorization_details` + if (jsonObj.get("authorization_details") != null && !jsonObj.get("authorization_details").isJsonNull()) { + CreateSubscriptionRequestAuthorizationDetails.validateJsonElement(jsonObj.get("authorization_details")); + return true; + } + // validate the optional field `subscription_meta` + if (jsonObj.get("subscription_meta") != null && !jsonObj.get("subscription_meta").isJsonNull()) { + CreateSubscriptionRequestSubscriptionMeta.validateJsonElement(jsonObj.get("subscription_meta")); + return true; + } + if ((jsonObj.get("subscription_expiry_time") != null && !jsonObj.get("subscription_expiry_time").isJsonNull()) && !jsonObj.get("subscription_expiry_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_expiry_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_expiry_time").toString())); + } + if ((jsonObj.get("subscription_first_charge_time") != null && !jsonObj.get("subscription_first_charge_time").isJsonNull()) && !jsonObj.get("subscription_first_charge_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_first_charge_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_first_charge_time").toString())); + } + if ((jsonObj.get("subscription_note") != null && !jsonObj.get("subscription_note").isJsonNull()) && !jsonObj.get("subscription_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_note").toString())); + } + if (jsonObj.get("subscription_payment_splits") != null && !jsonObj.get("subscription_payment_splits").isJsonNull()) { + JsonArray jsonArraysubscriptionPaymentSplits = jsonObj.getAsJsonArray("subscription_payment_splits"); + if (jsonArraysubscriptionPaymentSplits != null) { + // ensure the json data is an array + if (!jsonObj.get("subscription_payment_splits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_payment_splits` to be an array in the JSON string but got `%s`", jsonObj.get("subscription_payment_splits").toString())); + } + + // validate the optional field `subscription_payment_splits` (array) + for (int i = 0; i < jsonArraysubscriptionPaymentSplits.size(); i++) { + SubscriptionPaymentSplitItem.validateJsonElement(jsonArraysubscriptionPaymentSplits.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionRequest + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionRequest + */ + public static CreateSubscriptionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionRequest.class); + } + + /** + * Convert an instance of CreateSubscriptionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetails.java b/src/main/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetails.java new file mode 100644 index 00000000..c98d0e75 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionRequestAuthorizationDetails.java @@ -0,0 +1,239 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * CreateSubscriptionRequestAuthorizationDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionRequestAuthorizationDetails { + public static final String SERIALIZED_NAME_AUTHORIZATION_AMOUNT = "authorization_amount"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_AMOUNT) + private BigDecimal authorizationAmount; + + public static final String SERIALIZED_NAME_AUTHORIZATION_AMOUNT_REFUND = "authorization_amount_refund"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_AMOUNT_REFUND) + private Boolean authorizationAmountRefund; + + public CreateSubscriptionRequestAuthorizationDetails() { + } + + public CreateSubscriptionRequestAuthorizationDetails authorizationAmount(BigDecimal authorizationAmount) { + + this.authorizationAmount = authorizationAmount; + return this; + } + + /** + * Authorization amount for the auth payment. + * @return authorizationAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Authorization amount for the auth payment.") + public BigDecimal getAuthorizationAmount() { + return authorizationAmount; + } + + + public void setAuthorizationAmount(BigDecimal authorizationAmount) { + this.authorizationAmount = authorizationAmount; + } + + + public CreateSubscriptionRequestAuthorizationDetails authorizationAmountRefund(Boolean authorizationAmountRefund) { + + this.authorizationAmountRefund = authorizationAmountRefund; + return this; + } + + /** + * Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription. + * @return authorizationAmountRefund + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Indicates whether the authorization amount should be refunded to the customer automatically. Merchants can use this field to specify if the authorized funds should be returned to the customer after authorization of the subscription.") + public Boolean getAuthorizationAmountRefund() { + return authorizationAmountRefund; + } + + + public void setAuthorizationAmountRefund(Boolean authorizationAmountRefund) { + this.authorizationAmountRefund = authorizationAmountRefund; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionRequestAuthorizationDetails createSubscriptionRequestAuthorizationDetails = (CreateSubscriptionRequestAuthorizationDetails) o; + return Objects.equals(this.authorizationAmount, createSubscriptionRequestAuthorizationDetails.authorizationAmount) && + Objects.equals(this.authorizationAmountRefund, createSubscriptionRequestAuthorizationDetails.authorizationAmountRefund); + } + + @Override + public int hashCode() { + return Objects.hash(authorizationAmount, authorizationAmountRefund); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionRequestAuthorizationDetails {\n"); + sb.append(" authorizationAmount: ").append(toIndentedString(authorizationAmount)).append("\n"); + sb.append(" authorizationAmountRefund: ").append(toIndentedString(authorizationAmountRefund)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authorization_amount"); + openapiFields.add("authorization_amount_refund"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestAuthorizationDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestAuthorizationDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionRequestAuthorizationDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionRequestAuthorizationDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionRequestAuthorizationDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionRequestAuthorizationDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionRequestAuthorizationDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionRequestAuthorizationDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionRequestAuthorizationDetails + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionRequestAuthorizationDetails + */ + public static CreateSubscriptionRequestAuthorizationDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionRequestAuthorizationDetails.class); + } + + /** + * Convert an instance of CreateSubscriptionRequestAuthorizationDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionRequestPlanDetails.java b/src/main/java/com/cashfree/model/CreateSubscriptionRequestPlanDetails.java new file mode 100644 index 00000000..4605c4bc --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionRequestPlanDetails.java @@ -0,0 +1,507 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * CreateSubscriptionRequestPlanDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionRequestPlanDetails { + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private String planId; + + public static final String SERIALIZED_NAME_PLAN_NAME = "plan_name"; + @SerializedName(SERIALIZED_NAME_PLAN_NAME) + private String planName; + + public static final String SERIALIZED_NAME_PLAN_TYPE = "plan_type"; + @SerializedName(SERIALIZED_NAME_PLAN_TYPE) + private String planType; + + public static final String SERIALIZED_NAME_PLAN_CURRENCY = "plan_currency"; + @SerializedName(SERIALIZED_NAME_PLAN_CURRENCY) + private String planCurrency; + + public static final String SERIALIZED_NAME_PLAN_AMOUNT = "plan_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_AMOUNT) + private BigDecimal planAmount; + + public static final String SERIALIZED_NAME_PLAN_MAX_AMOUNT = "plan_max_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_AMOUNT) + private BigDecimal planMaxAmount; + + public static final String SERIALIZED_NAME_PLAN_MAX_CYCLES = "plan_max_cycles"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_CYCLES) + private Integer planMaxCycles; + + public static final String SERIALIZED_NAME_PLAN_INTERVALS = "plan_intervals"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVALS) + private Integer planIntervals; + + public static final String SERIALIZED_NAME_PLAN_INTERVAL_TYPE = "plan_interval_type"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVAL_TYPE) + private String planIntervalType; + + public static final String SERIALIZED_NAME_PLAN_NOTE = "plan_note"; + @SerializedName(SERIALIZED_NAME_PLAN_NOTE) + private String planNote; + + public CreateSubscriptionRequestPlanDetails() { + } + + public CreateSubscriptionRequestPlanDetails planId(String planId) { + + this.planId = planId; + return this; + } + + /** + * The unique identifier used to create plan. You only need to pass this field if you had already created plan. Otherwise use the other fields here to define the plan. + * @return planId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The unique identifier used to create plan. You only need to pass this field if you had already created plan. Otherwise use the other fields here to define the plan.") + public String getPlanId() { + return planId; + } + + + public void setPlanId(String planId) { + this.planId = planId; + } + + + public CreateSubscriptionRequestPlanDetails planName(String planName) { + + this.planName = planName; + return this; + } + + /** + * Specify plan name for easy reference. + * @return planName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Specify plan name for easy reference.") + public String getPlanName() { + return planName; + } + + + public void setPlanName(String planName) { + this.planName = planName; + } + + + public CreateSubscriptionRequestPlanDetails planType(String planType) { + + this.planType = planType; + return this; + } + + /** + * Possible values ON_DEMAND or PERIODIC. PERIODIC - Payments are triggered automatically at fixed intervals defined by the merchant. ON_DEMAND - Merchant needs to trigger/charge the customer explicitly with the required amount. + * @return planType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Possible values ON_DEMAND or PERIODIC. PERIODIC - Payments are triggered automatically at fixed intervals defined by the merchant. ON_DEMAND - Merchant needs to trigger/charge the customer explicitly with the required amount.") + public String getPlanType() { + return planType; + } + + + public void setPlanType(String planType) { + this.planType = planType; + } + + + public CreateSubscriptionRequestPlanDetails planCurrency(String planCurrency) { + + this.planCurrency = planCurrency; + return this; + } + + /** + * INR by default. + * @return planCurrency + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "INR by default.") + public String getPlanCurrency() { + return planCurrency; + } + + + public void setPlanCurrency(String planCurrency) { + this.planCurrency = planCurrency; + } + + + public CreateSubscriptionRequestPlanDetails planAmount(BigDecimal planAmount) { + + this.planAmount = planAmount; + return this; + } + + /** + * The amount to be charged for PERIODIC plan. This is a conditional parameter, only required for PERIODIC plans. + * @return planAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The amount to be charged for PERIODIC plan. This is a conditional parameter, only required for PERIODIC plans.") + public BigDecimal getPlanAmount() { + return planAmount; + } + + + public void setPlanAmount(BigDecimal planAmount) { + this.planAmount = planAmount; + } + + + public CreateSubscriptionRequestPlanDetails planMaxAmount(BigDecimal planMaxAmount) { + + this.planMaxAmount = planMaxAmount; + return this; + } + + /** + * This is the maximum amount that can be charged on a subscription. + * @return planMaxAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "This is the maximum amount that can be charged on a subscription.") + public BigDecimal getPlanMaxAmount() { + return planMaxAmount; + } + + + public void setPlanMaxAmount(BigDecimal planMaxAmount) { + this.planMaxAmount = planMaxAmount; + } + + + public CreateSubscriptionRequestPlanDetails planMaxCycles(Integer planMaxCycles) { + + this.planMaxCycles = planMaxCycles; + return this; + } + + /** + * Maximum number of debits set for the plan. The subscription will automatically change to COMPLETED status once this limit is reached. + * @return planMaxCycles + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Maximum number of debits set for the plan. The subscription will automatically change to COMPLETED status once this limit is reached.") + public Integer getPlanMaxCycles() { + return planMaxCycles; + } + + + public void setPlanMaxCycles(Integer planMaxCycles) { + this.planMaxCycles = planMaxCycles; + } + + + public CreateSubscriptionRequestPlanDetails planIntervals(Integer planIntervals) { + + this.planIntervals = planIntervals; + return this; + } + + /** + * Number of intervals of intervalType between every subscription payment. For example, to charge a customer bi-weekly use intervalType as “week” and intervals as 2. Required for PERIODIC plan. The default value is 1. + * @return planIntervals + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Number of intervals of intervalType between every subscription payment. For example, to charge a customer bi-weekly use intervalType as “week” and intervals as 2. Required for PERIODIC plan. The default value is 1.") + public Integer getPlanIntervals() { + return planIntervals; + } + + + public void setPlanIntervals(Integer planIntervals) { + this.planIntervals = planIntervals; + } + + + public CreateSubscriptionRequestPlanDetails planIntervalType(String planIntervalType) { + + this.planIntervalType = planIntervalType; + return this; + } + + /** + * The type of interval for a PERIODIC plan like DAY, WEEK, MONTH, or YEAR. This is a conditional parameter only applicable for PERIODIC plans. + * @return planIntervalType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The type of interval for a PERIODIC plan like DAY, WEEK, MONTH, or YEAR. This is a conditional parameter only applicable for PERIODIC plans.") + public String getPlanIntervalType() { + return planIntervalType; + } + + + public void setPlanIntervalType(String planIntervalType) { + this.planIntervalType = planIntervalType; + } + + + public CreateSubscriptionRequestPlanDetails planNote(String planNote) { + + this.planNote = planNote; + return this; + } + + /** + * Note for the plan. + * @return planNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Note for the plan.") + public String getPlanNote() { + return planNote; + } + + + public void setPlanNote(String planNote) { + this.planNote = planNote; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionRequestPlanDetails createSubscriptionRequestPlanDetails = (CreateSubscriptionRequestPlanDetails) o; + return Objects.equals(this.planId, createSubscriptionRequestPlanDetails.planId) && + Objects.equals(this.planName, createSubscriptionRequestPlanDetails.planName) && + Objects.equals(this.planType, createSubscriptionRequestPlanDetails.planType) && + Objects.equals(this.planCurrency, createSubscriptionRequestPlanDetails.planCurrency) && + Objects.equals(this.planAmount, createSubscriptionRequestPlanDetails.planAmount) && + Objects.equals(this.planMaxAmount, createSubscriptionRequestPlanDetails.planMaxAmount) && + Objects.equals(this.planMaxCycles, createSubscriptionRequestPlanDetails.planMaxCycles) && + Objects.equals(this.planIntervals, createSubscriptionRequestPlanDetails.planIntervals) && + Objects.equals(this.planIntervalType, createSubscriptionRequestPlanDetails.planIntervalType) && + Objects.equals(this.planNote, createSubscriptionRequestPlanDetails.planNote); + } + + @Override + public int hashCode() { + return Objects.hash(planId, planName, planType, planCurrency, planAmount, planMaxAmount, planMaxCycles, planIntervals, planIntervalType, planNote); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionRequestPlanDetails {\n"); + sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); + sb.append(" planName: ").append(toIndentedString(planName)).append("\n"); + sb.append(" planType: ").append(toIndentedString(planType)).append("\n"); + sb.append(" planCurrency: ").append(toIndentedString(planCurrency)).append("\n"); + sb.append(" planAmount: ").append(toIndentedString(planAmount)).append("\n"); + sb.append(" planMaxAmount: ").append(toIndentedString(planMaxAmount)).append("\n"); + sb.append(" planMaxCycles: ").append(toIndentedString(planMaxCycles)).append("\n"); + sb.append(" planIntervals: ").append(toIndentedString(planIntervals)).append("\n"); + sb.append(" planIntervalType: ").append(toIndentedString(planIntervalType)).append("\n"); + sb.append(" planNote: ").append(toIndentedString(planNote)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("plan_id"); + openapiFields.add("plan_name"); + openapiFields.add("plan_type"); + openapiFields.add("plan_currency"); + openapiFields.add("plan_amount"); + openapiFields.add("plan_max_amount"); + openapiFields.add("plan_max_cycles"); + openapiFields.add("plan_intervals"); + openapiFields.add("plan_interval_type"); + openapiFields.add("plan_note"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestPlanDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if ((jsonObj.get("plan_name") != null && !jsonObj.get("plan_name").isJsonNull()) && !jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if ((jsonObj.get("plan_type") != null && !jsonObj.get("plan_type").isJsonNull()) && !jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestPlanDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if ((jsonObj.get("plan_name") != null && !jsonObj.get("plan_name").isJsonNull()) && !jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if ((jsonObj.get("plan_type") != null && !jsonObj.get("plan_type").isJsonNull()) && !jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionRequestPlanDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionRequestPlanDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionRequestPlanDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionRequestPlanDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionRequestPlanDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionRequestPlanDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionRequestPlanDetails + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionRequestPlanDetails + */ + public static CreateSubscriptionRequestPlanDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionRequestPlanDetails.class); + } + + /** + * Convert an instance of CreateSubscriptionRequestPlanDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMeta.java b/src/main/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMeta.java new file mode 100644 index 00000000..4981ff63 --- /dev/null +++ b/src/main/java/com/cashfree/model/CreateSubscriptionRequestSubscriptionMeta.java @@ -0,0 +1,262 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * CreateSubscriptionRequestSubscriptionMeta + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CreateSubscriptionRequestSubscriptionMeta { + public static final String SERIALIZED_NAME_RETURN_URL = "return_url"; + @SerializedName(SERIALIZED_NAME_RETURN_URL) + private String returnUrl; + + public static final String SERIALIZED_NAME_NOTIFICATION_CHANNEL = "notification_channel"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_CHANNEL) + private List notificationChannel; + + public CreateSubscriptionRequestSubscriptionMeta() { + } + + public CreateSubscriptionRequestSubscriptionMeta returnUrl(String returnUrl) { + + this.returnUrl = returnUrl; + return this; + } + + /** + * The url to redirect after checkout. + * @return returnUrl + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The url to redirect after checkout.") + public String getReturnUrl() { + return returnUrl; + } + + + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + + public CreateSubscriptionRequestSubscriptionMeta notificationChannel(List notificationChannel) { + + this.notificationChannel = notificationChannel; + return this; + } + + public CreateSubscriptionRequestSubscriptionMeta addNotificationChannelItem(String notificationChannelItem) { + if (this.notificationChannel == null) { + this.notificationChannel = new ArrayList<>(); + } + this.notificationChannel.add(notificationChannelItem); + return this; + } + + /** + * Notification channel for the subscription. SMS, EMAIL are possible values. + * @return notificationChannel + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Notification channel for the subscription. SMS, EMAIL are possible values.") + public List getNotificationChannel() { + return notificationChannel; + } + + + public void setNotificationChannel(List notificationChannel) { + this.notificationChannel = notificationChannel; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSubscriptionRequestSubscriptionMeta createSubscriptionRequestSubscriptionMeta = (CreateSubscriptionRequestSubscriptionMeta) o; + return Objects.equals(this.returnUrl, createSubscriptionRequestSubscriptionMeta.returnUrl) && + Objects.equals(this.notificationChannel, createSubscriptionRequestSubscriptionMeta.notificationChannel); + } + + @Override + public int hashCode() { + return Objects.hash(returnUrl, notificationChannel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSubscriptionRequestSubscriptionMeta {\n"); + sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).append("\n"); + sb.append(" notificationChannel: ").append(toIndentedString(notificationChannel)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return_url"); + openapiFields.add("notification_channel"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestSubscriptionMeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("return_url") != null && !jsonObj.get("return_url").isJsonNull()) && !jsonObj.get("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("notification_channel") != null && !jsonObj.get("notification_channel").isJsonNull() && !jsonObj.get("notification_channel").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_channel` to be an array in the JSON string but got `%s`", jsonObj.get("notification_channel").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateSubscriptionRequestSubscriptionMeta + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("return_url") != null && !jsonObj.get("return_url").isJsonNull()) && !jsonObj.get("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("notification_channel") != null && !jsonObj.get("notification_channel").isJsonNull() && !jsonObj.get("notification_channel").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_channel` to be an array in the JSON string but got `%s`", jsonObj.get("notification_channel").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateSubscriptionRequestSubscriptionMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSubscriptionRequestSubscriptionMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionRequestSubscriptionMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateSubscriptionRequestSubscriptionMeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateSubscriptionRequestSubscriptionMeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSubscriptionRequestSubscriptionMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSubscriptionRequestSubscriptionMeta + * @throws IOException if the JSON string is invalid with respect to CreateSubscriptionRequestSubscriptionMeta + */ + public static CreateSubscriptionRequestSubscriptionMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSubscriptionRequestSubscriptionMeta.class); + } + + /** + * Convert an instance of CreateSubscriptionRequestSubscriptionMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CreateTerminalRequest.java b/src/main/java/com/cashfree/model/CreateTerminalRequest.java index 16f7bd47..944f64a7 100644 --- a/src/main/java/com/cashfree/model/CreateTerminalRequest.java +++ b/src/main/java/com/cashfree/model/CreateTerminalRequest.java @@ -53,7 +53,7 @@ * Request body to create a terminal */ @Schema(description = "Request body to create a terminal") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateTerminalRequest { public static final String SERIALIZED_NAME_TERMINAL_ID = "terminal_id"; @SerializedName(SERIALIZED_NAME_TERMINAL_ID) diff --git a/src/main/java/com/cashfree/model/CreateTerminalRequestTerminalMeta.java b/src/main/java/com/cashfree/model/CreateTerminalRequestTerminalMeta.java index 8e9a1c21..5f3f9cc3 100644 --- a/src/main/java/com/cashfree/model/CreateTerminalRequestTerminalMeta.java +++ b/src/main/java/com/cashfree/model/CreateTerminalRequestTerminalMeta.java @@ -52,7 +52,7 @@ * terminal metadata. required field for storefront. */ @Schema(description = "terminal metadata. required field for storefront.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateTerminalRequestTerminalMeta { public static final String SERIALIZED_NAME_TERMINAL_OPERATOR = "terminal_operator"; @SerializedName(SERIALIZED_NAME_TERMINAL_OPERATOR) diff --git a/src/main/java/com/cashfree/model/CreateTerminalTransactionRequest.java b/src/main/java/com/cashfree/model/CreateTerminalTransactionRequest.java index 3318e54e..856a5143 100644 --- a/src/main/java/com/cashfree/model/CreateTerminalTransactionRequest.java +++ b/src/main/java/com/cashfree/model/CreateTerminalTransactionRequest.java @@ -52,7 +52,7 @@ * Request body to create a terminal transaction */ @Schema(description = "Request body to create a terminal transaction") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateTerminalTransactionRequest { public static final String SERIALIZED_NAME_CF_ORDER_ID = "cf_order_id"; @SerializedName(SERIALIZED_NAME_CF_ORDER_ID) @@ -70,6 +70,10 @@ public class CreateTerminalTransactionRequest { @SerializedName(SERIALIZED_NAME_TERMINAL_PHONE_NO) private String terminalPhoneNo; + public static final String SERIALIZED_NAME_ADD_INVOICE = "add_invoice"; + @SerializedName(SERIALIZED_NAME_ADD_INVOICE) + private Boolean addInvoice; + public CreateTerminalTransactionRequest() { } @@ -161,6 +165,28 @@ public void setTerminalPhoneNo(String terminalPhoneNo) { } + public CreateTerminalTransactionRequest addInvoice(Boolean addInvoice) { + + this.addInvoice = addInvoice; + return this; + } + + /** + * make it true to have request be sent to create a Dynamic GST QR Code. + * @return addInvoice + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "make it true to have request be sent to create a Dynamic GST QR Code.") + public Boolean getAddInvoice() { + return addInvoice; + } + + + public void setAddInvoice(Boolean addInvoice) { + this.addInvoice = addInvoice; + } + + @Override public boolean equals(Object o) { @@ -174,12 +200,13 @@ public boolean equals(Object o) { return Objects.equals(this.cfOrderId, createTerminalTransactionRequest.cfOrderId) && Objects.equals(this.cfTerminalId, createTerminalTransactionRequest.cfTerminalId) && Objects.equals(this.paymentMethod, createTerminalTransactionRequest.paymentMethod) && - Objects.equals(this.terminalPhoneNo, createTerminalTransactionRequest.terminalPhoneNo); + Objects.equals(this.terminalPhoneNo, createTerminalTransactionRequest.terminalPhoneNo) && + Objects.equals(this.addInvoice, createTerminalTransactionRequest.addInvoice); } @Override public int hashCode() { - return Objects.hash(cfOrderId, cfTerminalId, paymentMethod, terminalPhoneNo); + return Objects.hash(cfOrderId, cfTerminalId, paymentMethod, terminalPhoneNo, addInvoice); } @Override @@ -190,6 +217,7 @@ public String toString() { sb.append(" cfTerminalId: ").append(toIndentedString(cfTerminalId)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" terminalPhoneNo: ").append(toIndentedString(terminalPhoneNo)).append("\n"); + sb.append(" addInvoice: ").append(toIndentedString(addInvoice)).append("\n"); sb.append("}"); return sb.toString(); } @@ -216,6 +244,7 @@ private String toIndentedString(Object o) { openapiFields.add("cf_terminal_id"); openapiFields.add("payment_method"); openapiFields.add("terminal_phone_no"); + openapiFields.add("add_invoice"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/cashfree/model/CreateVendorRequest.java b/src/main/java/com/cashfree/model/CreateVendorRequest.java index 2c513370..2dd0eb84 100644 --- a/src/main/java/com/cashfree/model/CreateVendorRequest.java +++ b/src/main/java/com/cashfree/model/CreateVendorRequest.java @@ -58,7 +58,7 @@ * Create Vendor Request */ @Schema(description = "Create Vendor Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateVendorRequest { public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; @SerializedName(SERIALIZED_NAME_VENDOR_ID) @@ -268,11 +268,11 @@ public CreateVendorRequest scheduleOption(BigDecimal scheduleOption) { } /** - * Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. + * Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. * @return scheduleOption **/ @javax.annotation.Nullable - @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements.") + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements.") public BigDecimal getScheduleOption() { return scheduleOption; } diff --git a/src/main/java/com/cashfree/model/CreateVendorResponse.java b/src/main/java/com/cashfree/model/CreateVendorResponse.java index 3abd7b84..acd3778a 100644 --- a/src/main/java/com/cashfree/model/CreateVendorResponse.java +++ b/src/main/java/com/cashfree/model/CreateVendorResponse.java @@ -58,7 +58,7 @@ * Create Vendor Response */ @Schema(description = "Create Vendor Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CreateVendorResponse { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) diff --git a/src/main/java/com/cashfree/model/CryptogramEntity.java b/src/main/java/com/cashfree/model/CryptogramEntity.java index 3e5cbf1d..fd85d6be 100644 --- a/src/main/java/com/cashfree/model/CryptogramEntity.java +++ b/src/main/java/com/cashfree/model/CryptogramEntity.java @@ -52,7 +52,7 @@ * Crytogram Card object */ @Schema(description = "Crytogram Card object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CryptogramEntity { public static final String SERIALIZED_NAME_INSTRUMENT_ID = "instrument_id"; @SerializedName(SERIALIZED_NAME_INSTRUMENT_ID) diff --git a/src/main/java/com/cashfree/model/CustomerDetails.java b/src/main/java/com/cashfree/model/CustomerDetails.java index 55420b08..1a6bb86c 100644 --- a/src/main/java/com/cashfree/model/CustomerDetails.java +++ b/src/main/java/com/cashfree/model/CustomerDetails.java @@ -50,10 +50,10 @@ import com.cashfree.JSON; /** - * The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. + * The customer details that are necessary. */ -@Schema(description = "The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@Schema(description = "The customer details that are necessary.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CustomerDetails { public static final String SERIALIZED_NAME_CUSTOMER_ID = "customer_id"; @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) @@ -100,8 +100,8 @@ public CustomerDetails customerId(String customerId) { * A unique identifier for the customer. Use alphanumeric values only. * @return customerId **/ - @javax.annotation.Nullable - @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique identifier for the customer. Use alphanumeric values only.") + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique identifier for the customer. Use alphanumeric values only.") public String getCustomerId() { return customerId; } @@ -336,6 +336,7 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("customer_id"); openapiRequiredFields.add("customer_phone"); } @@ -355,7 +356,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("customer_id") != null && !jsonObj.get("customer_id").isJsonNull()) && !jsonObj.get("customer_id").isJsonPrimitive()) { + if (!jsonObj.get("customer_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_id").toString())); } if ((jsonObj.get("customer_email") != null && !jsonObj.get("customer_email").isJsonNull()) && !jsonObj.get("customer_email").isJsonPrimitive()) { @@ -395,7 +396,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("customer_id") != null && !jsonObj.get("customer_id").isJsonNull()) && !jsonObj.get("customer_id").isJsonPrimitive()) { + if (!jsonObj.get("customer_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_id").toString())); } if ((jsonObj.get("customer_email") != null && !jsonObj.get("customer_email").isJsonNull()) && !jsonObj.get("customer_email").isJsonPrimitive()) { diff --git a/src/main/java/com/cashfree/model/CustomerDetailsCardlessEMI.java b/src/main/java/com/cashfree/model/CustomerDetailsCardlessEMI.java index a52d7742..13f8b34d 100644 --- a/src/main/java/com/cashfree/model/CustomerDetailsCardlessEMI.java +++ b/src/main/java/com/cashfree/model/CustomerDetailsCardlessEMI.java @@ -52,7 +52,7 @@ * Details of the customer for whom eligibility is being checked. */ @Schema(description = "Details of the customer for whom eligibility is being checked.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CustomerDetailsCardlessEMI { public static final String SERIALIZED_NAME_CUSTOMER_PHONE = "customer_phone"; @SerializedName(SERIALIZED_NAME_CUSTOMER_PHONE) diff --git a/src/main/java/com/cashfree/model/CustomerDetailsResponse.java b/src/main/java/com/cashfree/model/CustomerDetailsResponse.java new file mode 100644 index 00000000..76e9610b --- /dev/null +++ b/src/main/java/com/cashfree/model/CustomerDetailsResponse.java @@ -0,0 +1,456 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. + */ +@Schema(description = "The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class CustomerDetailsResponse { + public static final String SERIALIZED_NAME_CUSTOMER_ID = "customer_id"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) + private String customerId; + + public static final String SERIALIZED_NAME_CUSTOMER_EMAIL = "customer_email"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_EMAIL) + private String customerEmail; + + public static final String SERIALIZED_NAME_CUSTOMER_PHONE = "customer_phone"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_PHONE) + private String customerPhone; + + public static final String SERIALIZED_NAME_CUSTOMER_NAME = "customer_name"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_NAME) + private String customerName; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER = "customer_bank_account_number"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER) + private String customerBankAccountNumber; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_IFSC = "customer_bank_ifsc"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_IFSC) + private String customerBankIfsc; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_CODE = "customer_bank_code"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_CODE) + private BigDecimal customerBankCode; + + public static final String SERIALIZED_NAME_CUSTOMER_UID = "customer_uid"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_UID) + private String customerUid; + + public CustomerDetailsResponse() { + } + + public CustomerDetailsResponse customerId(String customerId) { + + this.customerId = customerId; + return this; + } + + /** + * A unique identifier for the customer. Use alphanumeric values only. + * @return customerId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique identifier for the customer. Use alphanumeric values only.") + public String getCustomerId() { + return customerId; + } + + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + + public CustomerDetailsResponse customerEmail(String customerEmail) { + + this.customerEmail = customerEmail; + return this; + } + + /** + * Customer email address. + * @return customerEmail + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer email address.") + public String getCustomerEmail() { + return customerEmail; + } + + + public void setCustomerEmail(String customerEmail) { + this.customerEmail = customerEmail; + } + + + public CustomerDetailsResponse customerPhone(String customerPhone) { + + this.customerPhone = customerPhone; + return this; + } + + /** + * Customer phone number. + * @return customerPhone + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer phone number.") + public String getCustomerPhone() { + return customerPhone; + } + + + public void setCustomerPhone(String customerPhone) { + this.customerPhone = customerPhone; + } + + + public CustomerDetailsResponse customerName(String customerName) { + + this.customerName = customerName; + return this; + } + + /** + * Name of the customer. + * @return customerName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the customer.") + public String getCustomerName() { + return customerName; + } + + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + + public CustomerDetailsResponse customerBankAccountNumber(String customerBankAccountNumber) { + + this.customerBankAccountNumber = customerBankAccountNumber; + return this; + } + + /** + * Customer bank account. Required if you want to do a bank account check (TPV) + * @return customerBankAccountNumber + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer bank account. Required if you want to do a bank account check (TPV)") + public String getCustomerBankAccountNumber() { + return customerBankAccountNumber; + } + + + public void setCustomerBankAccountNumber(String customerBankAccountNumber) { + this.customerBankAccountNumber = customerBankAccountNumber; + } + + + public CustomerDetailsResponse customerBankIfsc(String customerBankIfsc) { + + this.customerBankIfsc = customerBankIfsc; + return this; + } + + /** + * Customer bank IFSC. Required if you want to do a bank account check (TPV) + * @return customerBankIfsc + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer bank IFSC. Required if you want to do a bank account check (TPV)") + public String getCustomerBankIfsc() { + return customerBankIfsc; + } + + + public void setCustomerBankIfsc(String customerBankIfsc) { + this.customerBankIfsc = customerBankIfsc; + } + + + public CustomerDetailsResponse customerBankCode(BigDecimal customerBankCode) { + + this.customerBankCode = customerBankCode; + return this; + } + + /** + * Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV) + * @return customerBankCode + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV)") + public BigDecimal getCustomerBankCode() { + return customerBankCode; + } + + + public void setCustomerBankCode(BigDecimal customerBankCode) { + this.customerBankCode = customerBankCode; + } + + + public CustomerDetailsResponse customerUid(String customerUid) { + + this.customerUid = customerUid; + return this; + } + + /** + * Customer identifier at Cashfree. You will get this when you create/get customer + * @return customerUid + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer identifier at Cashfree. You will get this when you create/get customer ") + public String getCustomerUid() { + return customerUid; + } + + + public void setCustomerUid(String customerUid) { + this.customerUid = customerUid; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomerDetailsResponse customerDetailsResponse = (CustomerDetailsResponse) o; + return Objects.equals(this.customerId, customerDetailsResponse.customerId) && + Objects.equals(this.customerEmail, customerDetailsResponse.customerEmail) && + Objects.equals(this.customerPhone, customerDetailsResponse.customerPhone) && + Objects.equals(this.customerName, customerDetailsResponse.customerName) && + Objects.equals(this.customerBankAccountNumber, customerDetailsResponse.customerBankAccountNumber) && + Objects.equals(this.customerBankIfsc, customerDetailsResponse.customerBankIfsc) && + Objects.equals(this.customerBankCode, customerDetailsResponse.customerBankCode) && + Objects.equals(this.customerUid, customerDetailsResponse.customerUid); + } + + @Override + public int hashCode() { + return Objects.hash(customerId, customerEmail, customerPhone, customerName, customerBankAccountNumber, customerBankIfsc, customerBankCode, customerUid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomerDetailsResponse {\n"); + sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); + sb.append(" customerEmail: ").append(toIndentedString(customerEmail)).append("\n"); + sb.append(" customerPhone: ").append(toIndentedString(customerPhone)).append("\n"); + sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n"); + sb.append(" customerBankAccountNumber: ").append(toIndentedString(customerBankAccountNumber)).append("\n"); + sb.append(" customerBankIfsc: ").append(toIndentedString(customerBankIfsc)).append("\n"); + sb.append(" customerBankCode: ").append(toIndentedString(customerBankCode)).append("\n"); + sb.append(" customerUid: ").append(toIndentedString(customerUid)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("customer_id"); + openapiFields.add("customer_email"); + openapiFields.add("customer_phone"); + openapiFields.add("customer_name"); + openapiFields.add("customer_bank_account_number"); + openapiFields.add("customer_bank_ifsc"); + openapiFields.add("customer_bank_code"); + openapiFields.add("customer_uid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CustomerDetailsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("customer_id") != null && !jsonObj.get("customer_id").isJsonNull()) && !jsonObj.get("customer_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_id").toString())); + } + if ((jsonObj.get("customer_email") != null && !jsonObj.get("customer_email").isJsonNull()) && !jsonObj.get("customer_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_email").toString())); + } + if ((jsonObj.get("customer_phone") != null && !jsonObj.get("customer_phone").isJsonNull()) && !jsonObj.get("customer_phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_phone").toString())); + } + if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); + } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } + if ((jsonObj.get("customer_uid") != null && !jsonObj.get("customer_uid").isJsonNull()) && !jsonObj.get("customer_uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_uid").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CustomerDetailsResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("customer_id") != null && !jsonObj.get("customer_id").isJsonNull()) && !jsonObj.get("customer_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_id").toString())); + } + if ((jsonObj.get("customer_email") != null && !jsonObj.get("customer_email").isJsonNull()) && !jsonObj.get("customer_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_email").toString())); + } + if ((jsonObj.get("customer_phone") != null && !jsonObj.get("customer_phone").isJsonNull()) && !jsonObj.get("customer_phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_phone").toString())); + } + if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); + } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } + if ((jsonObj.get("customer_uid") != null && !jsonObj.get("customer_uid").isJsonNull()) && !jsonObj.get("customer_uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_uid").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CustomerDetailsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomerDetailsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomerDetailsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CustomerDetailsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CustomerDetailsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomerDetailsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomerDetailsResponse + * @throws IOException if the JSON string is invalid with respect to CustomerDetailsResponse + */ + public static CustomerDetailsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomerDetailsResponse.class); + } + + /** + * Convert an instance of CustomerDetailsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/CustomerEntity.java b/src/main/java/com/cashfree/model/CustomerEntity.java index ae69fb52..b531ffc9 100644 --- a/src/main/java/com/cashfree/model/CustomerEntity.java +++ b/src/main/java/com/cashfree/model/CustomerEntity.java @@ -52,7 +52,7 @@ * The complete customer entity */ @Schema(description = "The complete customer entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class CustomerEntity { public static final String SERIALIZED_NAME_CUSTOMER_UID = "customer_uid"; @SerializedName(SERIALIZED_NAME_CUSTOMER_UID) diff --git a/src/main/java/com/cashfree/model/DiscountDetails.java b/src/main/java/com/cashfree/model/DiscountDetails.java index 3f5714c7..a444705e 100644 --- a/src/main/java/com/cashfree/model/DiscountDetails.java +++ b/src/main/java/com/cashfree/model/DiscountDetails.java @@ -53,7 +53,7 @@ * detils of the discount object of offer */ @Schema(description = "detils of the discount object of offer") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class DiscountDetails { /** * Type of discount diff --git a/src/main/java/com/cashfree/model/EMIOffer.java b/src/main/java/com/cashfree/model/EMIOffer.java index 7f9317a5..9d79f426 100644 --- a/src/main/java/com/cashfree/model/EMIOffer.java +++ b/src/main/java/com/cashfree/model/EMIOffer.java @@ -53,7 +53,7 @@ /** * EMIOffer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EMIOffer { public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) diff --git a/src/main/java/com/cashfree/model/EMIPlansArray.java b/src/main/java/com/cashfree/model/EMIPlansArray.java index 9df3f283..bb6a5ef0 100644 --- a/src/main/java/com/cashfree/model/EMIPlansArray.java +++ b/src/main/java/com/cashfree/model/EMIPlansArray.java @@ -53,7 +53,7 @@ * Single EMI object */ @Schema(description = "Single EMI object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EMIPlansArray { public static final String SERIALIZED_NAME_TENURE = "tenure"; @SerializedName(SERIALIZED_NAME_TENURE) diff --git a/src/main/java/com/cashfree/model/ESOrderReconRequest.java b/src/main/java/com/cashfree/model/ESOrderReconRequest.java index 4108b0aa..c5afbe2f 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconRequest.java +++ b/src/main/java/com/cashfree/model/ESOrderReconRequest.java @@ -54,7 +54,7 @@ * ES Order Recon Request */ @Schema(description = "ES Order Recon Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconRequest { public static final String SERIALIZED_NAME_FILTERS = "filters"; @SerializedName(SERIALIZED_NAME_FILTERS) diff --git a/src/main/java/com/cashfree/model/ESOrderReconRequestFilters.java b/src/main/java/com/cashfree/model/ESOrderReconRequestFilters.java index d80012bd..05fedd8b 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconRequestFilters.java +++ b/src/main/java/com/cashfree/model/ESOrderReconRequestFilters.java @@ -54,7 +54,7 @@ * Provide the filter object details. */ @Schema(description = "Provide the filter object details.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconRequestFilters { public static final String SERIALIZED_NAME_START_DATE = "start_date"; @SerializedName(SERIALIZED_NAME_START_DATE) diff --git a/src/main/java/com/cashfree/model/ESOrderReconRequestPagination.java b/src/main/java/com/cashfree/model/ESOrderReconRequestPagination.java index af85ccee..ca52f72b 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconRequestPagination.java +++ b/src/main/java/com/cashfree/model/ESOrderReconRequestPagination.java @@ -52,7 +52,7 @@ * Set limit based on your requirement. Pagination limit will fetch a set of orders, next set of orders can be generated using the cursor shared in previous response of the same API. */ @Schema(description = "Set limit based on your requirement. Pagination limit will fetch a set of orders, next set of orders can be generated using the cursor shared in previous response of the same API.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconRequestPagination { public static final String SERIALIZED_NAME_CURSOR = "cursor"; @SerializedName(SERIALIZED_NAME_CURSOR) diff --git a/src/main/java/com/cashfree/model/ESOrderReconResponse.java b/src/main/java/com/cashfree/model/ESOrderReconResponse.java index 0c54fe61..0bb0aad5 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconResponse.java +++ b/src/main/java/com/cashfree/model/ESOrderReconResponse.java @@ -55,7 +55,7 @@ * ES Order Recon Response */ @Schema(description = "ES Order Recon Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconResponse { public static final String SERIALIZED_NAME_CURSOR = "cursor"; @SerializedName(SERIALIZED_NAME_CURSOR) diff --git a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInner.java b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInner.java index 32679256..7b810e3c 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInner.java +++ b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInner.java @@ -55,7 +55,7 @@ /** * ESOrderReconResponseDataInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconResponseDataInner { public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) diff --git a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInner.java b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInner.java index a80397f4..e5980cc3 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInner.java +++ b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInner.java @@ -54,7 +54,7 @@ /** * ESOrderReconResponseDataInnerOrderSplitsInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconResponseDataInnerOrderSplitsInner { public static final String SERIALIZED_NAME_SPLIT = "split"; @SerializedName(SERIALIZED_NAME_SPLIT) diff --git a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner.java b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner.java index 2674f144..2794e19d 100644 --- a/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner.java +++ b/src/main/java/com/cashfree/model/ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner.java @@ -52,7 +52,7 @@ /** * ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ESOrderReconResponseDataInnerOrderSplitsInnerSplitInner { public static final String SERIALIZED_NAME_MERCHANT_VENDOR_ID = "merchant_vendor_id"; @SerializedName(SERIALIZED_NAME_MERCHANT_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/EligibilityCardlessEMIEntity.java b/src/main/java/com/cashfree/model/EligibilityCardlessEMIEntity.java index ca47072d..b1e87aaf 100644 --- a/src/main/java/com/cashfree/model/EligibilityCardlessEMIEntity.java +++ b/src/main/java/com/cashfree/model/EligibilityCardlessEMIEntity.java @@ -53,7 +53,7 @@ * Carless EMI eligible entity */ @Schema(description = "Carless EMI eligible entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityCardlessEMIEntity { public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; @SerializedName(SERIALIZED_NAME_ELIGIBILITY) diff --git a/src/main/java/com/cashfree/model/EligibilityFetchCardlessEMIRequest.java b/src/main/java/com/cashfree/model/EligibilityFetchCardlessEMIRequest.java index 94e57fa3..0bf52628 100644 --- a/src/main/java/com/cashfree/model/EligibilityFetchCardlessEMIRequest.java +++ b/src/main/java/com/cashfree/model/EligibilityFetchCardlessEMIRequest.java @@ -53,7 +53,7 @@ * eligibilty request for cardless */ @Schema(description = "eligibilty request for cardless") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityFetchCardlessEMIRequest { public static final String SERIALIZED_NAME_QUERIES = "queries"; @SerializedName(SERIALIZED_NAME_QUERIES) diff --git a/src/main/java/com/cashfree/model/EligibilityFetchOffersRequest.java b/src/main/java/com/cashfree/model/EligibilityFetchOffersRequest.java index 74bf53b7..9bc9e832 100644 --- a/src/main/java/com/cashfree/model/EligibilityFetchOffersRequest.java +++ b/src/main/java/com/cashfree/model/EligibilityFetchOffersRequest.java @@ -54,7 +54,7 @@ * Eligiblty API request */ @Schema(description = "Eligiblty API request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityFetchOffersRequest { public static final String SERIALIZED_NAME_QUERIES = "queries"; @SerializedName(SERIALIZED_NAME_QUERIES) diff --git a/src/main/java/com/cashfree/model/EligibilityFetchPaylaterRequest.java b/src/main/java/com/cashfree/model/EligibilityFetchPaylaterRequest.java index c4f6ad97..0620b8c0 100644 --- a/src/main/java/com/cashfree/model/EligibilityFetchPaylaterRequest.java +++ b/src/main/java/com/cashfree/model/EligibilityFetchPaylaterRequest.java @@ -53,7 +53,7 @@ * Request to get eligible paylater payment methods */ @Schema(description = "Request to get eligible paylater payment methods") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityFetchPaylaterRequest { public static final String SERIALIZED_NAME_QUERIES = "queries"; @SerializedName(SERIALIZED_NAME_QUERIES) diff --git a/src/main/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequest.java b/src/main/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequest.java index efbd9627..d8669885 100644 --- a/src/main/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequest.java +++ b/src/main/java/com/cashfree/model/EligibilityFetchPaymentMethodsRequest.java @@ -54,7 +54,7 @@ * eligibilty request to find eligible payment method */ @Schema(description = "eligibilty request to find eligible payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityFetchPaymentMethodsRequest { public static final String SERIALIZED_NAME_QUERIES = "queries"; @SerializedName(SERIALIZED_NAME_QUERIES) diff --git a/src/main/java/com/cashfree/model/EligibilityMethodItem.java b/src/main/java/com/cashfree/model/EligibilityMethodItem.java new file mode 100644 index 00000000..b163c41c --- /dev/null +++ b/src/main/java/com/cashfree/model/EligibilityMethodItem.java @@ -0,0 +1,319 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.EligibilityMethodItemEntityDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Eligibile payment method object + */ +@Schema(description = "Eligibile payment method object") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class EligibilityMethodItem { + public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; + @SerializedName(SERIALIZED_NAME_ELIGIBILITY) + private Boolean eligibility; + + public static final String SERIALIZED_NAME_ENTITY_TYPE = "entity_type"; + @SerializedName(SERIALIZED_NAME_ENTITY_TYPE) + private String entityType; + + public static final String SERIALIZED_NAME_ENTITY_VALUE = "entity_value"; + @SerializedName(SERIALIZED_NAME_ENTITY_VALUE) + private String entityValue; + + public static final String SERIALIZED_NAME_ENTITY_DETAILS = "entity_details"; + @SerializedName(SERIALIZED_NAME_ENTITY_DETAILS) + private EligibilityMethodItemEntityDetails entityDetails; + + public EligibilityMethodItem() { + } + + public EligibilityMethodItem eligibility(Boolean eligibility) { + + this.eligibility = eligibility; + return this; + } + + /** + * Indicates whether the payment method is eligible. + * @return eligibility + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Indicates whether the payment method is eligible.") + public Boolean getEligibility() { + return eligibility; + } + + + public void setEligibility(Boolean eligibility) { + this.eligibility = eligibility; + } + + + public EligibilityMethodItem entityType(String entityType) { + + this.entityType = entityType; + return this; + } + + /** + * Type of entity (e.g., \"payment_methods\"). + * @return entityType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Type of entity (e.g., \"payment_methods\").") + public String getEntityType() { + return entityType; + } + + + public void setEntityType(String entityType) { + this.entityType = entityType; + } + + + public EligibilityMethodItem entityValue(String entityValue) { + + this.entityValue = entityValue; + return this; + } + + /** + * Payment method (e.g., enach, pnach, upi, card). + * @return entityValue + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment method (e.g., enach, pnach, upi, card).") + public String getEntityValue() { + return entityValue; + } + + + public void setEntityValue(String entityValue) { + this.entityValue = entityValue; + } + + + public EligibilityMethodItem entityDetails(EligibilityMethodItemEntityDetails entityDetails) { + + this.entityDetails = entityDetails; + return this; + } + + /** + * Get entityDetails + * @return entityDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public EligibilityMethodItemEntityDetails getEntityDetails() { + return entityDetails; + } + + + public void setEntityDetails(EligibilityMethodItemEntityDetails entityDetails) { + this.entityDetails = entityDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EligibilityMethodItem eligibilityMethodItem = (EligibilityMethodItem) o; + return Objects.equals(this.eligibility, eligibilityMethodItem.eligibility) && + Objects.equals(this.entityType, eligibilityMethodItem.entityType) && + Objects.equals(this.entityValue, eligibilityMethodItem.entityValue) && + Objects.equals(this.entityDetails, eligibilityMethodItem.entityDetails); + } + + @Override + public int hashCode() { + return Objects.hash(eligibility, entityType, entityValue, entityDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EligibilityMethodItem {\n"); + sb.append(" eligibility: ").append(toIndentedString(eligibility)).append("\n"); + sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n"); + sb.append(" entityValue: ").append(toIndentedString(entityValue)).append("\n"); + sb.append(" entityDetails: ").append(toIndentedString(entityDetails)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("eligibility"); + openapiFields.add("entity_type"); + openapiFields.add("entity_value"); + openapiFields.add("entity_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("entity_type") != null && !jsonObj.get("entity_type").isJsonNull()) && !jsonObj.get("entity_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_type").toString())); + } + if ((jsonObj.get("entity_value") != null && !jsonObj.get("entity_value").isJsonNull()) && !jsonObj.get("entity_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_value").toString())); + } + // validate the optional field `entity_details` + if (jsonObj.get("entity_details") != null && !jsonObj.get("entity_details").isJsonNull()) { + EligibilityMethodItemEntityDetails.validateJsonElement(jsonObj.get("entity_details")); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItem + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("entity_type") != null && !jsonObj.get("entity_type").isJsonNull()) && !jsonObj.get("entity_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_type").toString())); + } + if ((jsonObj.get("entity_value") != null && !jsonObj.get("entity_value").isJsonNull()) && !jsonObj.get("entity_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_value").toString())); + } + // validate the optional field `entity_details` + if (jsonObj.get("entity_details") != null && !jsonObj.get("entity_details").isJsonNull()) { + EligibilityMethodItemEntityDetails.validateJsonElement(jsonObj.get("entity_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EligibilityMethodItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EligibilityMethodItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EligibilityMethodItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EligibilityMethodItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EligibilityMethodItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EligibilityMethodItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of EligibilityMethodItem + * @throws IOException if the JSON string is invalid with respect to EligibilityMethodItem + */ + public static EligibilityMethodItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EligibilityMethodItem.class); + } + + /** + * Convert an instance of EligibilityMethodItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetails.java b/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetails.java new file mode 100644 index 00000000..27454e75 --- /dev/null +++ b/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetails.java @@ -0,0 +1,469 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.EligibilityMethodItemEntityDetailsAvailableHandlesInner; +import com.cashfree.model.SubscriptionBankDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * EligibilityMethodItemEntityDetails + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class EligibilityMethodItemEntityDetails { + public static final String SERIALIZED_NAME_ACCOUNT_TYPES = "account_types"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPES) + private List accountTypes; + + public static final String SERIALIZED_NAME_FREQUENT_BANK_DETAILS = "frequent_bank_details"; + @SerializedName(SERIALIZED_NAME_FREQUENT_BANK_DETAILS) + private List frequentBankDetails; + + public static final String SERIALIZED_NAME_ALL_BANK_DETAILS = "all_bank_details"; + @SerializedName(SERIALIZED_NAME_ALL_BANK_DETAILS) + private List allBankDetails; + + public static final String SERIALIZED_NAME_AVAILABLE_HANDLES = "available_handles"; + @SerializedName(SERIALIZED_NAME_AVAILABLE_HANDLES) + private List availableHandles; + + public static final String SERIALIZED_NAME_ALLOWED_CARD_TYPES = "allowed_card_types"; + @SerializedName(SERIALIZED_NAME_ALLOWED_CARD_TYPES) + private List allowedCardTypes; + + public EligibilityMethodItemEntityDetails() { + } + + public EligibilityMethodItemEntityDetails accountTypes(List accountTypes) { + + this.accountTypes = accountTypes; + return this; + } + + public EligibilityMethodItemEntityDetails addAccountTypesItem(String accountTypesItem) { + if (this.accountTypes == null) { + this.accountTypes = new ArrayList<>(); + } + this.accountTypes.add(accountTypesItem); + return this; + } + + /** + * List of account types associated with the payment method. (e.g. SAVINGS or CURRENT) + * @return accountTypes + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of account types associated with the payment method. (e.g. SAVINGS or CURRENT)") + public List getAccountTypes() { + return accountTypes; + } + + + public void setAccountTypes(List accountTypes) { + this.accountTypes = accountTypes; + } + + + public EligibilityMethodItemEntityDetails frequentBankDetails(List frequentBankDetails) { + + this.frequentBankDetails = frequentBankDetails; + return this; + } + + public EligibilityMethodItemEntityDetails addFrequentBankDetailsItem(SubscriptionBankDetails frequentBankDetailsItem) { + if (this.frequentBankDetails == null) { + this.frequentBankDetails = new ArrayList<>(); + } + this.frequentBankDetails.add(frequentBankDetailsItem); + return this; + } + + /** + * List of the most frequently used banks. + * @return frequentBankDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of the most frequently used banks.") + public List getFrequentBankDetails() { + return frequentBankDetails; + } + + + public void setFrequentBankDetails(List frequentBankDetails) { + this.frequentBankDetails = frequentBankDetails; + } + + + public EligibilityMethodItemEntityDetails allBankDetails(List allBankDetails) { + + this.allBankDetails = allBankDetails; + return this; + } + + public EligibilityMethodItemEntityDetails addAllBankDetailsItem(SubscriptionBankDetails allBankDetailsItem) { + if (this.allBankDetails == null) { + this.allBankDetails = new ArrayList<>(); + } + this.allBankDetails.add(allBankDetailsItem); + return this; + } + + /** + * Details about all banks associated with the payment method. + * @return allBankDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Details about all banks associated with the payment method.") + public List getAllBankDetails() { + return allBankDetails; + } + + + public void setAllBankDetails(List allBankDetails) { + this.allBankDetails = allBankDetails; + } + + + public EligibilityMethodItemEntityDetails availableHandles(List availableHandles) { + + this.availableHandles = availableHandles; + return this; + } + + public EligibilityMethodItemEntityDetails addAvailableHandlesItem(EligibilityMethodItemEntityDetailsAvailableHandlesInner availableHandlesItem) { + if (this.availableHandles == null) { + this.availableHandles = new ArrayList<>(); + } + this.availableHandles.add(availableHandlesItem); + return this; + } + + /** + * List of supported VPA handles. + * @return availableHandles + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of supported VPA handles.") + public List getAvailableHandles() { + return availableHandles; + } + + + public void setAvailableHandles(List availableHandles) { + this.availableHandles = availableHandles; + } + + + public EligibilityMethodItemEntityDetails allowedCardTypes(List allowedCardTypes) { + + this.allowedCardTypes = allowedCardTypes; + return this; + } + + public EligibilityMethodItemEntityDetails addAllowedCardTypesItem(String allowedCardTypesItem) { + if (this.allowedCardTypes == null) { + this.allowedCardTypes = new ArrayList<>(); + } + this.allowedCardTypes.add(allowedCardTypesItem); + return this; + } + + /** + * List of allowed card types. (e.g. DEBIT_CARD, CREDIT_CARD) + * @return allowedCardTypes + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of allowed card types. (e.g. DEBIT_CARD, CREDIT_CARD)") + public List getAllowedCardTypes() { + return allowedCardTypes; + } + + + public void setAllowedCardTypes(List allowedCardTypes) { + this.allowedCardTypes = allowedCardTypes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EligibilityMethodItemEntityDetails eligibilityMethodItemEntityDetails = (EligibilityMethodItemEntityDetails) o; + return Objects.equals(this.accountTypes, eligibilityMethodItemEntityDetails.accountTypes) && + Objects.equals(this.frequentBankDetails, eligibilityMethodItemEntityDetails.frequentBankDetails) && + Objects.equals(this.allBankDetails, eligibilityMethodItemEntityDetails.allBankDetails) && + Objects.equals(this.availableHandles, eligibilityMethodItemEntityDetails.availableHandles) && + Objects.equals(this.allowedCardTypes, eligibilityMethodItemEntityDetails.allowedCardTypes); + } + + @Override + public int hashCode() { + return Objects.hash(accountTypes, frequentBankDetails, allBankDetails, availableHandles, allowedCardTypes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EligibilityMethodItemEntityDetails {\n"); + sb.append(" accountTypes: ").append(toIndentedString(accountTypes)).append("\n"); + sb.append(" frequentBankDetails: ").append(toIndentedString(frequentBankDetails)).append("\n"); + sb.append(" allBankDetails: ").append(toIndentedString(allBankDetails)).append("\n"); + sb.append(" availableHandles: ").append(toIndentedString(availableHandles)).append("\n"); + sb.append(" allowedCardTypes: ").append(toIndentedString(allowedCardTypes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("account_types"); + openapiFields.add("frequent_bank_details"); + openapiFields.add("all_bank_details"); + openapiFields.add("available_handles"); + openapiFields.add("allowed_card_types"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItemEntityDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("account_types") != null && !jsonObj.get("account_types").isJsonNull() && !jsonObj.get("account_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `account_types` to be an array in the JSON string but got `%s`", jsonObj.get("account_types").toString())); + } + if (jsonObj.get("frequent_bank_details") != null && !jsonObj.get("frequent_bank_details").isJsonNull()) { + JsonArray jsonArrayfrequentBankDetails = jsonObj.getAsJsonArray("frequent_bank_details"); + if (jsonArrayfrequentBankDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("frequent_bank_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `frequent_bank_details` to be an array in the JSON string but got `%s`", jsonObj.get("frequent_bank_details").toString())); + } + + // validate the optional field `frequent_bank_details` (array) + for (int i = 0; i < jsonArrayfrequentBankDetails.size(); i++) { + SubscriptionBankDetails.validateJsonElement(jsonArrayfrequentBankDetails.get(i)); + }; + } + } + if (jsonObj.get("all_bank_details") != null && !jsonObj.get("all_bank_details").isJsonNull()) { + JsonArray jsonArrayallBankDetails = jsonObj.getAsJsonArray("all_bank_details"); + if (jsonArrayallBankDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("all_bank_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `all_bank_details` to be an array in the JSON string but got `%s`", jsonObj.get("all_bank_details").toString())); + } + + // validate the optional field `all_bank_details` (array) + for (int i = 0; i < jsonArrayallBankDetails.size(); i++) { + SubscriptionBankDetails.validateJsonElement(jsonArrayallBankDetails.get(i)); + }; + } + } + if (jsonObj.get("available_handles") != null && !jsonObj.get("available_handles").isJsonNull()) { + JsonArray jsonArrayavailableHandles = jsonObj.getAsJsonArray("available_handles"); + if (jsonArrayavailableHandles != null) { + // ensure the json data is an array + if (!jsonObj.get("available_handles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `available_handles` to be an array in the JSON string but got `%s`", jsonObj.get("available_handles").toString())); + } + + // validate the optional field `available_handles` (array) + for (int i = 0; i < jsonArrayavailableHandles.size(); i++) { + EligibilityMethodItemEntityDetailsAvailableHandlesInner.validateJsonElement(jsonArrayavailableHandles.get(i)); + }; + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_card_types") != null && !jsonObj.get("allowed_card_types").isJsonNull() && !jsonObj.get("allowed_card_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowed_card_types` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_card_types").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItemEntityDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("account_types") != null && !jsonObj.get("account_types").isJsonNull() && !jsonObj.get("account_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `account_types` to be an array in the JSON string but got `%s`", jsonObj.get("account_types").toString())); + } + if (jsonObj.get("frequent_bank_details") != null && !jsonObj.get("frequent_bank_details").isJsonNull()) { + JsonArray jsonArrayfrequentBankDetails = jsonObj.getAsJsonArray("frequent_bank_details"); + if (jsonArrayfrequentBankDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("frequent_bank_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `frequent_bank_details` to be an array in the JSON string but got `%s`", jsonObj.get("frequent_bank_details").toString())); + } + + // validate the optional field `frequent_bank_details` (array) + for (int i = 0; i < jsonArrayfrequentBankDetails.size(); i++) { + SubscriptionBankDetails.validateJsonElement(jsonArrayfrequentBankDetails.get(i)); + }; + } + } + if (jsonObj.get("all_bank_details") != null && !jsonObj.get("all_bank_details").isJsonNull()) { + JsonArray jsonArrayallBankDetails = jsonObj.getAsJsonArray("all_bank_details"); + if (jsonArrayallBankDetails != null) { + // ensure the json data is an array + if (!jsonObj.get("all_bank_details").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `all_bank_details` to be an array in the JSON string but got `%s`", jsonObj.get("all_bank_details").toString())); + } + + // validate the optional field `all_bank_details` (array) + for (int i = 0; i < jsonArrayallBankDetails.size(); i++) { + SubscriptionBankDetails.validateJsonElement(jsonArrayallBankDetails.get(i)); + }; + } + } + if (jsonObj.get("available_handles") != null && !jsonObj.get("available_handles").isJsonNull()) { + JsonArray jsonArrayavailableHandles = jsonObj.getAsJsonArray("available_handles"); + if (jsonArrayavailableHandles != null) { + // ensure the json data is an array + if (!jsonObj.get("available_handles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `available_handles` to be an array in the JSON string but got `%s`", jsonObj.get("available_handles").toString())); + } + + // validate the optional field `available_handles` (array) + for (int i = 0; i < jsonArrayavailableHandles.size(); i++) { + EligibilityMethodItemEntityDetailsAvailableHandlesInner.validateJsonElement(jsonArrayavailableHandles.get(i)); + }; + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("allowed_card_types") != null && !jsonObj.get("allowed_card_types").isJsonNull() && !jsonObj.get("allowed_card_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowed_card_types` to be an array in the JSON string but got `%s`", jsonObj.get("allowed_card_types").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EligibilityMethodItemEntityDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EligibilityMethodItemEntityDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EligibilityMethodItemEntityDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EligibilityMethodItemEntityDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EligibilityMethodItemEntityDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EligibilityMethodItemEntityDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of EligibilityMethodItemEntityDetails + * @throws IOException if the JSON string is invalid with respect to EligibilityMethodItemEntityDetails + */ + public static EligibilityMethodItemEntityDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EligibilityMethodItemEntityDetails.class); + } + + /** + * Convert an instance of EligibilityMethodItemEntityDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.java b/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.java new file mode 100644 index 00000000..45b464f5 --- /dev/null +++ b/src/main/java/com/cashfree/model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.java @@ -0,0 +1,250 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * EligibilityMethodItemEntityDetailsAvailableHandlesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class EligibilityMethodItemEntityDetailsAvailableHandlesInner { + public static final String SERIALIZED_NAME_HANDLE = "handle"; + @SerializedName(SERIALIZED_NAME_HANDLE) + private String handle; + + public static final String SERIALIZED_NAME_APPLICATION = "application"; + @SerializedName(SERIALIZED_NAME_APPLICATION) + private String application; + + public EligibilityMethodItemEntityDetailsAvailableHandlesInner() { + } + + public EligibilityMethodItemEntityDetailsAvailableHandlesInner handle(String handle) { + + this.handle = handle; + return this; + } + + /** + * VPA handle + * @return handle + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "VPA handle") + public String getHandle() { + return handle; + } + + + public void setHandle(String handle) { + this.handle = handle; + } + + + public EligibilityMethodItemEntityDetailsAvailableHandlesInner application(String application) { + + this.application = application; + return this; + } + + /** + * Application or service related to the VPA handle. + * @return application + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Application or service related to the VPA handle.") + public String getApplication() { + return application; + } + + + public void setApplication(String application) { + this.application = application; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EligibilityMethodItemEntityDetailsAvailableHandlesInner eligibilityMethodItemEntityDetailsAvailableHandlesInner = (EligibilityMethodItemEntityDetailsAvailableHandlesInner) o; + return Objects.equals(this.handle, eligibilityMethodItemEntityDetailsAvailableHandlesInner.handle) && + Objects.equals(this.application, eligibilityMethodItemEntityDetailsAvailableHandlesInner.application); + } + + @Override + public int hashCode() { + return Objects.hash(handle, application); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EligibilityMethodItemEntityDetailsAvailableHandlesInner {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" application: ").append(toIndentedString(application)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("handle"); + openapiFields.add("application"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItemEntityDetailsAvailableHandlesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("handle") != null && !jsonObj.get("handle").isJsonNull()) && !jsonObj.get("handle").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `handle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("handle").toString())); + } + if ((jsonObj.get("application") != null && !jsonObj.get("application").isJsonNull()) && !jsonObj.get("application").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EligibilityMethodItemEntityDetailsAvailableHandlesInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("handle") != null && !jsonObj.get("handle").isJsonNull()) && !jsonObj.get("handle").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `handle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("handle").toString())); + } + if ((jsonObj.get("application") != null && !jsonObj.get("application").isJsonNull()) && !jsonObj.get("application").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EligibilityMethodItemEntityDetailsAvailableHandlesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EligibilityMethodItemEntityDetailsAvailableHandlesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EligibilityMethodItemEntityDetailsAvailableHandlesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EligibilityMethodItemEntityDetailsAvailableHandlesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EligibilityMethodItemEntityDetailsAvailableHandlesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EligibilityMethodItemEntityDetailsAvailableHandlesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of EligibilityMethodItemEntityDetailsAvailableHandlesInner + * @throws IOException if the JSON string is invalid with respect to EligibilityMethodItemEntityDetailsAvailableHandlesInner + */ + public static EligibilityMethodItemEntityDetailsAvailableHandlesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EligibilityMethodItemEntityDetailsAvailableHandlesInner.class); + } + + /** + * Convert an instance of EligibilityMethodItemEntityDetailsAvailableHandlesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/EligibilityOfferEntity.java b/src/main/java/com/cashfree/model/EligibilityOfferEntity.java index 217ea6cd..be783aae 100644 --- a/src/main/java/com/cashfree/model/EligibilityOfferEntity.java +++ b/src/main/java/com/cashfree/model/EligibilityOfferEntity.java @@ -53,7 +53,7 @@ * Eligible offer object */ @Schema(description = "Eligible offer object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityOfferEntity { public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; @SerializedName(SERIALIZED_NAME_ELIGIBILITY) diff --git a/src/main/java/com/cashfree/model/EligibilityPaylaterEntity.java b/src/main/java/com/cashfree/model/EligibilityPaylaterEntity.java index ad342afc..3bc91dec 100644 --- a/src/main/java/com/cashfree/model/EligibilityPaylaterEntity.java +++ b/src/main/java/com/cashfree/model/EligibilityPaylaterEntity.java @@ -53,7 +53,7 @@ * Eligible paylater payment method */ @Schema(description = "Eligible paylater payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityPaylaterEntity { public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; @SerializedName(SERIALIZED_NAME_ELIGIBILITY) diff --git a/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntity.java b/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntity.java index 40434604..62c5e86d 100644 --- a/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntity.java +++ b/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntity.java @@ -53,7 +53,7 @@ * Eligible payment methods details */ @Schema(description = "Eligible payment methods details") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityPaymentMethodsEntity { public static final String SERIALIZED_NAME_ELIGIBILITY = "eligibility"; @SerializedName(SERIALIZED_NAME_ELIGIBILITY) diff --git a/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetails.java b/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetails.java index c842c808..775ddddc 100644 --- a/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetails.java +++ b/src/main/java/com/cashfree/model/EligibilityPaymentMethodsEntityEntityDetails.java @@ -54,7 +54,7 @@ /** * EligibilityPaymentMethodsEntityEntityDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class EligibilityPaymentMethodsEntityEntityDetails { public static final String SERIALIZED_NAME_PAYMENT_METHOD_DETAILS = "payment_method_details"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD_DETAILS) diff --git a/src/main/java/com/cashfree/model/EntitySimulationRequest.java b/src/main/java/com/cashfree/model/EntitySimulationRequest.java new file mode 100644 index 00000000..598c6070 --- /dev/null +++ b/src/main/java/com/cashfree/model/EntitySimulationRequest.java @@ -0,0 +1,319 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Entity Simulation it contains payment_status and payment_error_code + */ +@Schema(description = "Entity Simulation it contains payment_status and payment_error_code") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class EntitySimulationRequest { + /** + * Payment Status + */ + @JsonAdapter(PaymentStatusEnum.Adapter.class) + public enum PaymentStatusEnum { + SUCCESS("SUCCESS"), + + FAILED("FAILED"), + + PENDING("PENDING"), + + USER_DROPPED("USER_DROPPED"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PaymentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PaymentStatusEnum fromValue(String value) { + for (PaymentStatusEnum b : PaymentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PaymentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PaymentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PaymentStatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private PaymentStatusEnum paymentStatus; + + public static final String SERIALIZED_NAME_PAYMENT_ERROR_CODE = "payment_error_code"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ERROR_CODE) + private String paymentErrorCode; + + public EntitySimulationRequest() { + } + + public EntitySimulationRequest paymentStatus(PaymentStatusEnum paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * Payment Status + * @return paymentStatus + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Payment Status") + public PaymentStatusEnum getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(PaymentStatusEnum paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public EntitySimulationRequest paymentErrorCode(String paymentErrorCode) { + + this.paymentErrorCode = paymentErrorCode; + return this; + } + + /** + * Payment Error Code + * @return paymentErrorCode + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment Error Code") + public String getPaymentErrorCode() { + return paymentErrorCode; + } + + + public void setPaymentErrorCode(String paymentErrorCode) { + this.paymentErrorCode = paymentErrorCode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntitySimulationRequest entitySimulationRequest = (EntitySimulationRequest) o; + return Objects.equals(this.paymentStatus, entitySimulationRequest.paymentStatus) && + Objects.equals(this.paymentErrorCode, entitySimulationRequest.paymentErrorCode); + } + + @Override + public int hashCode() { + return Objects.hash(paymentStatus, paymentErrorCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntitySimulationRequest {\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" paymentErrorCode: ").append(toIndentedString(paymentErrorCode)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payment_status"); + openapiFields.add("payment_error_code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payment_status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntitySimulationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntitySimulationRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_error_code") != null && !jsonObj.get("payment_error_code").isJsonNull()) && !jsonObj.get("payment_error_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_error_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_error_code").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntitySimulationRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntitySimulationRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_error_code") != null && !jsonObj.get("payment_error_code").isJsonNull()) && !jsonObj.get("payment_error_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_error_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_error_code").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntitySimulationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntitySimulationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EntitySimulationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EntitySimulationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EntitySimulationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EntitySimulationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntitySimulationRequest + * @throws IOException if the JSON string is invalid with respect to EntitySimulationRequest + */ + public static EntitySimulationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntitySimulationRequest.class); + } + + /** + * Convert an instance of EntitySimulationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/EntitySimulationResponse.java b/src/main/java/com/cashfree/model/EntitySimulationResponse.java new file mode 100644 index 00000000..ba9b9c27 --- /dev/null +++ b/src/main/java/com/cashfree/model/EntitySimulationResponse.java @@ -0,0 +1,266 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Entity Simulation it contains payment_status and payment_error_code + */ +@Schema(description = "Entity Simulation it contains payment_status and payment_error_code") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class EntitySimulationResponse { + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private String paymentStatus; + + public static final String SERIALIZED_NAME_PAYMENT_ERROR_CODE = "payment_error_code"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ERROR_CODE) + private String paymentErrorCode; + + public EntitySimulationResponse() { + } + + public EntitySimulationResponse paymentStatus(String paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * Payment Status + * @return paymentStatus + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Payment Status") + public String getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(String paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public EntitySimulationResponse paymentErrorCode(String paymentErrorCode) { + + this.paymentErrorCode = paymentErrorCode; + return this; + } + + /** + * Payment Error Code + * @return paymentErrorCode + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment Error Code") + public String getPaymentErrorCode() { + return paymentErrorCode; + } + + + public void setPaymentErrorCode(String paymentErrorCode) { + this.paymentErrorCode = paymentErrorCode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EntitySimulationResponse entitySimulationResponse = (EntitySimulationResponse) o; + return Objects.equals(this.paymentStatus, entitySimulationResponse.paymentStatus) && + Objects.equals(this.paymentErrorCode, entitySimulationResponse.paymentErrorCode); + } + + @Override + public int hashCode() { + return Objects.hash(paymentStatus, paymentErrorCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EntitySimulationResponse {\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" paymentErrorCode: ").append(toIndentedString(paymentErrorCode)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payment_status"); + openapiFields.add("payment_error_code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("payment_status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntitySimulationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntitySimulationResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_error_code") != null && !jsonObj.get("payment_error_code").isJsonNull()) && !jsonObj.get("payment_error_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_error_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_error_code").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EntitySimulationResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EntitySimulationResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_error_code") != null && !jsonObj.get("payment_error_code").isJsonNull()) && !jsonObj.get("payment_error_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_error_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_error_code").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EntitySimulationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntitySimulationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EntitySimulationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EntitySimulationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EntitySimulationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EntitySimulationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EntitySimulationResponse + * @throws IOException if the JSON string is invalid with respect to EntitySimulationResponse + */ + public static EntitySimulationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntitySimulationResponse.class); + } + + /** + * Convert an instance of EntitySimulationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ErrorDetailsInPaymentsEntity.java b/src/main/java/com/cashfree/model/ErrorDetailsInPaymentsEntity.java index 9d3463b4..fc082783 100644 --- a/src/main/java/com/cashfree/model/ErrorDetailsInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/ErrorDetailsInPaymentsEntity.java @@ -52,7 +52,7 @@ * The error details are present only for failed payments */ @Schema(description = "The error details are present only for failed payments") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ErrorDetailsInPaymentsEntity { public static final String SERIALIZED_NAME_ERROR_CODE = "error_code"; @SerializedName(SERIALIZED_NAME_ERROR_CODE) diff --git a/src/main/java/com/cashfree/model/FetchReconRequest.java b/src/main/java/com/cashfree/model/FetchReconRequest.java index 93cfbfbc..9213a551 100644 --- a/src/main/java/com/cashfree/model/FetchReconRequest.java +++ b/src/main/java/com/cashfree/model/FetchReconRequest.java @@ -54,7 +54,7 @@ * Recon object */ @Schema(description = "Recon object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchReconRequest { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) diff --git a/src/main/java/com/cashfree/model/FetchReconRequestFilters.java b/src/main/java/com/cashfree/model/FetchReconRequestFilters.java index 0bce7dae..3cb5e7b7 100644 --- a/src/main/java/com/cashfree/model/FetchReconRequestFilters.java +++ b/src/main/java/com/cashfree/model/FetchReconRequestFilters.java @@ -51,7 +51,7 @@ /** * FetchReconRequestFilters */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchReconRequestFilters { public static final String SERIALIZED_NAME_START_DATE = "start_date"; @SerializedName(SERIALIZED_NAME_START_DATE) diff --git a/src/main/java/com/cashfree/model/FetchReconRequestPagination.java b/src/main/java/com/cashfree/model/FetchReconRequestPagination.java index 008b37ac..da3a8afe 100644 --- a/src/main/java/com/cashfree/model/FetchReconRequestPagination.java +++ b/src/main/java/com/cashfree/model/FetchReconRequestPagination.java @@ -52,7 +52,7 @@ * To fetch the next set of settlements, pass the cursor received in the response to the next API call. To receive the data for the first time, pass the cursor as null. Limit would be number of settlements that you want to receive. */ @Schema(description = "To fetch the next set of settlements, pass the cursor received in the response to the next API call. To receive the data for the first time, pass the cursor as null. Limit would be number of settlements that you want to receive.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchReconRequestPagination { public static final String SERIALIZED_NAME_LIMIT = "limit"; @SerializedName(SERIALIZED_NAME_LIMIT) diff --git a/src/main/java/com/cashfree/model/FetchSettlementsRequest.java b/src/main/java/com/cashfree/model/FetchSettlementsRequest.java index 5bea694c..de121df8 100644 --- a/src/main/java/com/cashfree/model/FetchSettlementsRequest.java +++ b/src/main/java/com/cashfree/model/FetchSettlementsRequest.java @@ -54,7 +54,7 @@ * Request to fetch settlement */ @Schema(description = "Request to fetch settlement") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchSettlementsRequest { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) diff --git a/src/main/java/com/cashfree/model/FetchSettlementsRequestFilters.java b/src/main/java/com/cashfree/model/FetchSettlementsRequestFilters.java index ae03fc66..a60482b4 100644 --- a/src/main/java/com/cashfree/model/FetchSettlementsRequestFilters.java +++ b/src/main/java/com/cashfree/model/FetchSettlementsRequestFilters.java @@ -54,7 +54,7 @@ * Specify either the Settlement ID, Settlement UTR, or start date and end date to fetch the settlement details. */ @Schema(description = "Specify either the Settlement ID, Settlement UTR, or start date and end date to fetch the settlement details.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchSettlementsRequestFilters { public static final String SERIALIZED_NAME_CF_SETTLEMENT_IDS = "cf_settlement_ids"; @SerializedName(SERIALIZED_NAME_CF_SETTLEMENT_IDS) diff --git a/src/main/java/com/cashfree/model/FetchSettlementsRequestPagination.java b/src/main/java/com/cashfree/model/FetchSettlementsRequestPagination.java index 68a18047..f67a426f 100644 --- a/src/main/java/com/cashfree/model/FetchSettlementsRequestPagination.java +++ b/src/main/java/com/cashfree/model/FetchSettlementsRequestPagination.java @@ -52,7 +52,7 @@ * To fetch the next set of settlements, pass the cursor received in the response to the next API call. To receive the data for the first time, pass the cursor as null. Limit would be number of settlements that you want to receive. */ @Schema(description = "To fetch the next set of settlements, pass the cursor received in the response to the next API call. To receive the data for the first time, pass the cursor as null. Limit would be number of settlements that you want to receive.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchSettlementsRequestPagination { public static final String SERIALIZED_NAME_LIMIT = "limit"; @SerializedName(SERIALIZED_NAME_LIMIT) diff --git a/src/main/java/com/cashfree/model/FetchTerminalQRCodesEntity.java b/src/main/java/com/cashfree/model/FetchTerminalQRCodesEntity.java index e34e877a..ad74ddd0 100644 --- a/src/main/java/com/cashfree/model/FetchTerminalQRCodesEntity.java +++ b/src/main/java/com/cashfree/model/FetchTerminalQRCodesEntity.java @@ -52,7 +52,7 @@ * Fetch Static QR Codes using terminal ID or phone number */ @Schema(description = "Fetch Static QR Codes using terminal ID or phone number") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class FetchTerminalQRCodesEntity { public static final String SERIALIZED_NAME_BANK = "bank"; @SerializedName(SERIALIZED_NAME_BANK) diff --git a/src/main/java/com/cashfree/model/IdempotencyError.java b/src/main/java/com/cashfree/model/IdempotencyError.java index 8ffa8e25..3ed56c95 100644 --- a/src/main/java/com/cashfree/model/IdempotencyError.java +++ b/src/main/java/com/cashfree/model/IdempotencyError.java @@ -52,7 +52,7 @@ * Error when idempotency fails. Different request body with the same idempotent key */ @Schema(description = "Error when idempotency fails. Different request body with the same idempotent key") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class IdempotencyError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/InstrumentEntity.java b/src/main/java/com/cashfree/model/InstrumentEntity.java index 4b6dc263..de60f4ea 100644 --- a/src/main/java/com/cashfree/model/InstrumentEntity.java +++ b/src/main/java/com/cashfree/model/InstrumentEntity.java @@ -53,7 +53,7 @@ * Saved card instrument object */ @Schema(description = "Saved card instrument object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class InstrumentEntity { public static final String SERIALIZED_NAME_CUSTOMER_ID = "customer_id"; @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) diff --git a/src/main/java/com/cashfree/model/InstrumentWebhook.java b/src/main/java/com/cashfree/model/InstrumentWebhook.java index 2cb49c06..dfd11f70 100644 --- a/src/main/java/com/cashfree/model/InstrumentWebhook.java +++ b/src/main/java/com/cashfree/model/InstrumentWebhook.java @@ -53,7 +53,7 @@ * Instrument webhook object */ @Schema(description = "Instrument webhook object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class InstrumentWebhook { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/com/cashfree/model/InstrumentWebhookData.java b/src/main/java/com/cashfree/model/InstrumentWebhookData.java index def55a52..ddde4e81 100644 --- a/src/main/java/com/cashfree/model/InstrumentWebhookData.java +++ b/src/main/java/com/cashfree/model/InstrumentWebhookData.java @@ -52,7 +52,7 @@ /** * InstrumentWebhookData */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class InstrumentWebhookData { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/com/cashfree/model/InstrumentWebhookDataEntity.java b/src/main/java/com/cashfree/model/InstrumentWebhookDataEntity.java index 8dadf126..4c1ec712 100644 --- a/src/main/java/com/cashfree/model/InstrumentWebhookDataEntity.java +++ b/src/main/java/com/cashfree/model/InstrumentWebhookDataEntity.java @@ -53,7 +53,7 @@ * data entity in webhook */ @Schema(description = "data entity in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class InstrumentWebhookDataEntity { public static final String SERIALIZED_NAME_INSTRUMENT = "instrument"; @SerializedName(SERIALIZED_NAME_INSTRUMENT) diff --git a/src/main/java/com/cashfree/model/KycDetails.java b/src/main/java/com/cashfree/model/KycDetails.java index 3173f0d4..9206d87c 100644 --- a/src/main/java/com/cashfree/model/KycDetails.java +++ b/src/main/java/com/cashfree/model/KycDetails.java @@ -52,7 +52,7 @@ /** * KycDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class KycDetails { public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "account_type"; @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) diff --git a/src/main/java/com/cashfree/model/LinkCustomerDetailsEntity.java b/src/main/java/com/cashfree/model/LinkCustomerDetailsEntity.java index 642d3c13..7d0b8e62 100644 --- a/src/main/java/com/cashfree/model/LinkCustomerDetailsEntity.java +++ b/src/main/java/com/cashfree/model/LinkCustomerDetailsEntity.java @@ -52,7 +52,7 @@ * Payment link customer entity */ @Schema(description = "Payment link customer entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class LinkCustomerDetailsEntity { public static final String SERIALIZED_NAME_CUSTOMER_PHONE = "customer_phone"; @SerializedName(SERIALIZED_NAME_CUSTOMER_PHONE) @@ -66,6 +66,141 @@ public class LinkCustomerDetailsEntity { @SerializedName(SERIALIZED_NAME_CUSTOMER_NAME) private String customerName; + public static final String SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER = "customer_bank_account_number"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER) + private String customerBankAccountNumber; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_IFSC = "customer_bank_ifsc"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_IFSC) + private String customerBankIfsc; + + /** + * Customer Bank Code + */ + @JsonAdapter(CustomerBankCodeEnum.Adapter.class) + public enum CustomerBankCodeEnum { + NUMBER_3003(3003), + + NUMBER_3005(3005), + + NUMBER_3006(3006), + + NUMBER_3010(3010), + + NUMBER_3012(3012), + + NUMBER_3016(3016), + + NUMBER_3019(3019), + + NUMBER_3020(3020), + + NUMBER_3021(3021), + + NUMBER_3022(3022), + + NUMBER_3023(3023), + + NUMBER_3024(3024), + + NUMBER_3026(3026), + + NUMBER_3027(3027), + + NUMBER_3028(3028), + + NUMBER_3029(3029), + + NUMBER_3030(3030), + + NUMBER_3031(3031), + + NUMBER_3032(3032), + + NUMBER_3033(3033), + + NUMBER_3038(3038), + + NUMBER_3039(3039), + + NUMBER_3040(3040), + + NUMBER_3042(3042), + + NUMBER_3044(3044), + + NUMBER_3054(3054), + + NUMBER_3055(3055), + + NUMBER_3058(3058), + + NUMBER_3086(3086), + + NUMBER_3087(3087), + + NUMBER_3088(3088), + + NUMBER_3089(3089), + + NUMBER_3090(3090), + + NUMBER_3091(3091), + + NUMBER_3092(3092), + + NUMBER_3098(3098), + + NUMBER_3115(3115), + + NUMBER_3117(3117), + + NUMBER_7001(7001), + + NUMBER_unknown_default_open_api(11184809); + + private Integer value; + + CustomerBankCodeEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CustomerBankCodeEnum fromValue(Integer value) { + for (CustomerBankCodeEnum b : CustomerBankCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return NUMBER_unknown_default_open_api; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CustomerBankCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CustomerBankCodeEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return CustomerBankCodeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_CODE = "customer_bank_code"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_CODE) + private CustomerBankCodeEnum customerBankCode; + public LinkCustomerDetailsEntity() { } @@ -135,6 +270,72 @@ public void setCustomerName(String customerName) { } + public LinkCustomerDetailsEntity customerBankAccountNumber(String customerBankAccountNumber) { + + this.customerBankAccountNumber = customerBankAccountNumber; + return this; + } + + /** + * Customer Bank Account Number + * @return customerBankAccountNumber + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer Bank Account Number") + public String getCustomerBankAccountNumber() { + return customerBankAccountNumber; + } + + + public void setCustomerBankAccountNumber(String customerBankAccountNumber) { + this.customerBankAccountNumber = customerBankAccountNumber; + } + + + public LinkCustomerDetailsEntity customerBankIfsc(String customerBankIfsc) { + + this.customerBankIfsc = customerBankIfsc; + return this; + } + + /** + * Customer Bank Ifsc + * @return customerBankIfsc + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer Bank Ifsc") + public String getCustomerBankIfsc() { + return customerBankIfsc; + } + + + public void setCustomerBankIfsc(String customerBankIfsc) { + this.customerBankIfsc = customerBankIfsc; + } + + + public LinkCustomerDetailsEntity customerBankCode(CustomerBankCodeEnum customerBankCode) { + + this.customerBankCode = customerBankCode; + return this; + } + + /** + * Customer Bank Code + * @return customerBankCode + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Customer Bank Code") + public CustomerBankCodeEnum getCustomerBankCode() { + return customerBankCode; + } + + + public void setCustomerBankCode(CustomerBankCodeEnum customerBankCode) { + this.customerBankCode = customerBankCode; + } + + @Override public boolean equals(Object o) { @@ -147,12 +348,15 @@ public boolean equals(Object o) { LinkCustomerDetailsEntity linkCustomerDetailsEntity = (LinkCustomerDetailsEntity) o; return Objects.equals(this.customerPhone, linkCustomerDetailsEntity.customerPhone) && Objects.equals(this.customerEmail, linkCustomerDetailsEntity.customerEmail) && - Objects.equals(this.customerName, linkCustomerDetailsEntity.customerName); + Objects.equals(this.customerName, linkCustomerDetailsEntity.customerName) && + Objects.equals(this.customerBankAccountNumber, linkCustomerDetailsEntity.customerBankAccountNumber) && + Objects.equals(this.customerBankIfsc, linkCustomerDetailsEntity.customerBankIfsc) && + Objects.equals(this.customerBankCode, linkCustomerDetailsEntity.customerBankCode); } @Override public int hashCode() { - return Objects.hash(customerPhone, customerEmail, customerName); + return Objects.hash(customerPhone, customerEmail, customerName, customerBankAccountNumber, customerBankIfsc, customerBankCode); } @Override @@ -162,6 +366,9 @@ public String toString() { sb.append(" customerPhone: ").append(toIndentedString(customerPhone)).append("\n"); sb.append(" customerEmail: ").append(toIndentedString(customerEmail)).append("\n"); sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n"); + sb.append(" customerBankAccountNumber: ").append(toIndentedString(customerBankAccountNumber)).append("\n"); + sb.append(" customerBankIfsc: ").append(toIndentedString(customerBankIfsc)).append("\n"); + sb.append(" customerBankCode: ").append(toIndentedString(customerBankCode)).append("\n"); sb.append("}"); return sb.toString(); } @@ -187,6 +394,9 @@ private String toIndentedString(Object o) { openapiFields.add("customer_phone"); openapiFields.add("customer_email"); openapiFields.add("customer_name"); + openapiFields.add("customer_bank_account_number"); + openapiFields.add("customer_bank_ifsc"); + openapiFields.add("customer_bank_code"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -218,6 +428,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } } @@ -246,6 +462,12 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } return false; } diff --git a/src/main/java/com/cashfree/model/LinkEntity.java b/src/main/java/com/cashfree/model/LinkEntity.java index 959eccfa..e79dacc4 100644 --- a/src/main/java/com/cashfree/model/LinkEntity.java +++ b/src/main/java/com/cashfree/model/LinkEntity.java @@ -61,7 +61,7 @@ * Payment link success creation response object */ @Schema(description = "Payment link success creation response object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class LinkEntity { public static final String SERIALIZED_NAME_CF_LINK_ID = "cf_link_id"; @SerializedName(SERIALIZED_NAME_CF_LINK_ID) diff --git a/src/main/java/com/cashfree/model/LinkMetaResponseEntity.java b/src/main/java/com/cashfree/model/LinkMetaResponseEntity.java index c7a242c9..bd93ff79 100644 --- a/src/main/java/com/cashfree/model/LinkMetaResponseEntity.java +++ b/src/main/java/com/cashfree/model/LinkMetaResponseEntity.java @@ -52,7 +52,7 @@ * Payment link meta information object */ @Schema(description = "Payment link meta information object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class LinkMetaResponseEntity { public static final String SERIALIZED_NAME_NOTIFY_URL = "notify_url"; @SerializedName(SERIALIZED_NAME_NOTIFY_URL) diff --git a/src/main/java/com/cashfree/model/LinkNotifyEntity.java b/src/main/java/com/cashfree/model/LinkNotifyEntity.java index 3eae55ae..c1d800ce 100644 --- a/src/main/java/com/cashfree/model/LinkNotifyEntity.java +++ b/src/main/java/com/cashfree/model/LinkNotifyEntity.java @@ -52,7 +52,7 @@ * Payment link Notify Object for SMS and Email */ @Schema(description = "Payment link Notify Object for SMS and Email") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class LinkNotifyEntity { public static final String SERIALIZED_NAME_SEND_SMS = "send_sms"; @SerializedName(SERIALIZED_NAME_SEND_SMS) diff --git a/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequest.java b/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequest.java new file mode 100644 index 00000000..1f36e388 --- /dev/null +++ b/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequest.java @@ -0,0 +1,342 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ManageSubscriptionPaymentRequestActionDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to manage a subscription payment. + */ +@Schema(description = "Request body to manage a subscription payment.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class ManageSubscriptionPaymentRequest { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_ACTION_DETAILS = "action_details"; + @SerializedName(SERIALIZED_NAME_ACTION_DETAILS) + private ManageSubscriptionPaymentRequestActionDetails actionDetails; + + public ManageSubscriptionPaymentRequest() { + } + + public ManageSubscriptionPaymentRequest subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * The unique ID which was used to create subscription. + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "The unique ID which was used to create subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public ManageSubscriptionPaymentRequest paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * The unique ID which was used to create payment. + * @return paymentId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "The unique ID which was used to create payment.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public ManageSubscriptionPaymentRequest action(String action) { + + this.action = action; + return this; + } + + /** + * Action to be performed on the payment. Possible values - CANCEL, RETRY. + * @return action + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Action to be performed on the payment. Possible values - CANCEL, RETRY.") + public String getAction() { + return action; + } + + + public void setAction(String action) { + this.action = action; + } + + + public ManageSubscriptionPaymentRequest actionDetails(ManageSubscriptionPaymentRequestActionDetails actionDetails) { + + this.actionDetails = actionDetails; + return this; + } + + /** + * Get actionDetails + * @return actionDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public ManageSubscriptionPaymentRequestActionDetails getActionDetails() { + return actionDetails; + } + + + public void setActionDetails(ManageSubscriptionPaymentRequestActionDetails actionDetails) { + this.actionDetails = actionDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageSubscriptionPaymentRequest manageSubscriptionPaymentRequest = (ManageSubscriptionPaymentRequest) o; + return Objects.equals(this.subscriptionId, manageSubscriptionPaymentRequest.subscriptionId) && + Objects.equals(this.paymentId, manageSubscriptionPaymentRequest.paymentId) && + Objects.equals(this.action, manageSubscriptionPaymentRequest.action) && + Objects.equals(this.actionDetails, manageSubscriptionPaymentRequest.actionDetails); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId, paymentId, action, actionDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageSubscriptionPaymentRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" actionDetails: ").append(toIndentedString(actionDetails)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + openapiFields.add("payment_id"); + openapiFields.add("action"); + openapiFields.add("action_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + openapiRequiredFields.add("payment_id"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionPaymentRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ManageSubscriptionPaymentRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if (!jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + // validate the optional field `action_details` + if (jsonObj.get("action_details") != null && !jsonObj.get("action_details").isJsonNull()) { + ManageSubscriptionPaymentRequestActionDetails.validateJsonElement(jsonObj.get("action_details")); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionPaymentRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ManageSubscriptionPaymentRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if (!jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + // validate the optional field `action_details` + if (jsonObj.get("action_details") != null && !jsonObj.get("action_details").isJsonNull()) { + ManageSubscriptionPaymentRequestActionDetails.validateJsonElement(jsonObj.get("action_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ManageSubscriptionPaymentRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageSubscriptionPaymentRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageSubscriptionPaymentRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ManageSubscriptionPaymentRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ManageSubscriptionPaymentRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageSubscriptionPaymentRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageSubscriptionPaymentRequest + * @throws IOException if the JSON string is invalid with respect to ManageSubscriptionPaymentRequest + */ + public static ManageSubscriptionPaymentRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageSubscriptionPaymentRequest.class); + } + + /** + * Convert an instance of ManageSubscriptionPaymentRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetails.java b/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetails.java new file mode 100644 index 00000000..eb7f9b98 --- /dev/null +++ b/src/main/java/com/cashfree/model/ManageSubscriptionPaymentRequestActionDetails.java @@ -0,0 +1,216 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Details of the action to be performed. Needed for retry action. + */ +@Schema(description = "Details of the action to be performed. Needed for retry action.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class ManageSubscriptionPaymentRequestActionDetails { + public static final String SERIALIZED_NAME_NEXT_SCHEDULED_TIME = "next_scheduled_time"; + @SerializedName(SERIALIZED_NAME_NEXT_SCHEDULED_TIME) + private String nextScheduledTime; + + public ManageSubscriptionPaymentRequestActionDetails() { + } + + public ManageSubscriptionPaymentRequestActionDetails nextScheduledTime(String nextScheduledTime) { + + this.nextScheduledTime = nextScheduledTime; + return this; + } + + /** + * Next scheduled time for the retry of the FAILED payment. Required for retry action. + * @return nextScheduledTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Next scheduled time for the retry of the FAILED payment. Required for retry action.") + public String getNextScheduledTime() { + return nextScheduledTime; + } + + + public void setNextScheduledTime(String nextScheduledTime) { + this.nextScheduledTime = nextScheduledTime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageSubscriptionPaymentRequestActionDetails manageSubscriptionPaymentRequestActionDetails = (ManageSubscriptionPaymentRequestActionDetails) o; + return Objects.equals(this.nextScheduledTime, manageSubscriptionPaymentRequestActionDetails.nextScheduledTime); + } + + @Override + public int hashCode() { + return Objects.hash(nextScheduledTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageSubscriptionPaymentRequestActionDetails {\n"); + sb.append(" nextScheduledTime: ").append(toIndentedString(nextScheduledTime)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("next_scheduled_time"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionPaymentRequestActionDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("next_scheduled_time") != null && !jsonObj.get("next_scheduled_time").isJsonNull()) && !jsonObj.get("next_scheduled_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next_scheduled_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_scheduled_time").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionPaymentRequestActionDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("next_scheduled_time") != null && !jsonObj.get("next_scheduled_time").isJsonNull()) && !jsonObj.get("next_scheduled_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next_scheduled_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_scheduled_time").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ManageSubscriptionPaymentRequestActionDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageSubscriptionPaymentRequestActionDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageSubscriptionPaymentRequestActionDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ManageSubscriptionPaymentRequestActionDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ManageSubscriptionPaymentRequestActionDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageSubscriptionPaymentRequestActionDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageSubscriptionPaymentRequestActionDetails + * @throws IOException if the JSON string is invalid with respect to ManageSubscriptionPaymentRequestActionDetails + */ + public static ManageSubscriptionPaymentRequestActionDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageSubscriptionPaymentRequestActionDetails.class); + } + + /** + * Convert an instance of ManageSubscriptionPaymentRequestActionDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ManageSubscriptionRequest.java b/src/main/java/com/cashfree/model/ManageSubscriptionRequest.java new file mode 100644 index 00000000..f775db89 --- /dev/null +++ b/src/main/java/com/cashfree/model/ManageSubscriptionRequest.java @@ -0,0 +1,306 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.ManageSubscriptionRequestActionDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to manage a subscription. + */ +@Schema(description = "Request body to manage a subscription.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class ManageSubscriptionRequest { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_ACTION_DETAILS = "action_details"; + @SerializedName(SERIALIZED_NAME_ACTION_DETAILS) + private ManageSubscriptionRequestActionDetails actionDetails; + + public ManageSubscriptionRequest() { + } + + public ManageSubscriptionRequest subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * The unique ID which was used to create subscription. + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "The unique ID which was used to create subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public ManageSubscriptionRequest action(String action) { + + this.action = action; + return this; + } + + /** + * Action to be performed on the subscription. Possible values - CANCEL, PAUSE, ACTIVATE, CHANGE_PLAN. + * @return action + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Action to be performed on the subscription. Possible values - CANCEL, PAUSE, ACTIVATE, CHANGE_PLAN.") + public String getAction() { + return action; + } + + + public void setAction(String action) { + this.action = action; + } + + + public ManageSubscriptionRequest actionDetails(ManageSubscriptionRequestActionDetails actionDetails) { + + this.actionDetails = actionDetails; + return this; + } + + /** + * Get actionDetails + * @return actionDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public ManageSubscriptionRequestActionDetails getActionDetails() { + return actionDetails; + } + + + public void setActionDetails(ManageSubscriptionRequestActionDetails actionDetails) { + this.actionDetails = actionDetails; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageSubscriptionRequest manageSubscriptionRequest = (ManageSubscriptionRequest) o; + return Objects.equals(this.subscriptionId, manageSubscriptionRequest.subscriptionId) && + Objects.equals(this.action, manageSubscriptionRequest.action) && + Objects.equals(this.actionDetails, manageSubscriptionRequest.actionDetails); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId, action, actionDetails); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageSubscriptionRequest {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" actionDetails: ").append(toIndentedString(actionDetails)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + openapiFields.add("action"); + openapiFields.add("action_details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + openapiRequiredFields.add("action"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ManageSubscriptionRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + // validate the optional field `action_details` + if (jsonObj.get("action_details") != null && !jsonObj.get("action_details").isJsonNull()) { + ManageSubscriptionRequestActionDetails.validateJsonElement(jsonObj.get("action_details")); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ManageSubscriptionRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + if (!jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + // validate the optional field `action_details` + if (jsonObj.get("action_details") != null && !jsonObj.get("action_details").isJsonNull()) { + ManageSubscriptionRequestActionDetails.validateJsonElement(jsonObj.get("action_details")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ManageSubscriptionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageSubscriptionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageSubscriptionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ManageSubscriptionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ManageSubscriptionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageSubscriptionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageSubscriptionRequest + * @throws IOException if the JSON string is invalid with respect to ManageSubscriptionRequest + */ + public static ManageSubscriptionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageSubscriptionRequest.class); + } + + /** + * Convert an instance of ManageSubscriptionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/ManageSubscriptionRequestActionDetails.java b/src/main/java/com/cashfree/model/ManageSubscriptionRequestActionDetails.java new file mode 100644 index 00000000..07d543f1 --- /dev/null +++ b/src/main/java/com/cashfree/model/ManageSubscriptionRequestActionDetails.java @@ -0,0 +1,251 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Details of the action to be performed. + */ +@Schema(description = "Details of the action to be performed.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class ManageSubscriptionRequestActionDetails { + public static final String SERIALIZED_NAME_NEXT_SCHEDULED_TIME = "next_scheduled_time"; + @SerializedName(SERIALIZED_NAME_NEXT_SCHEDULED_TIME) + private String nextScheduledTime; + + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private String planId; + + public ManageSubscriptionRequestActionDetails() { + } + + public ManageSubscriptionRequestActionDetails nextScheduledTime(String nextScheduledTime) { + + this.nextScheduledTime = nextScheduledTime; + return this; + } + + /** + * Next scheduled time for the action. Required for ACTIVATE action. + * @return nextScheduledTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Next scheduled time for the action. Required for ACTIVATE action.") + public String getNextScheduledTime() { + return nextScheduledTime; + } + + + public void setNextScheduledTime(String nextScheduledTime) { + this.nextScheduledTime = nextScheduledTime; + } + + + public ManageSubscriptionRequestActionDetails planId(String planId) { + + this.planId = planId; + return this; + } + + /** + * Plan ID to update. Required for CHANGE_PLAN action. + * @return planId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Plan ID to update. Required for CHANGE_PLAN action.") + public String getPlanId() { + return planId; + } + + + public void setPlanId(String planId) { + this.planId = planId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageSubscriptionRequestActionDetails manageSubscriptionRequestActionDetails = (ManageSubscriptionRequestActionDetails) o; + return Objects.equals(this.nextScheduledTime, manageSubscriptionRequestActionDetails.nextScheduledTime) && + Objects.equals(this.planId, manageSubscriptionRequestActionDetails.planId); + } + + @Override + public int hashCode() { + return Objects.hash(nextScheduledTime, planId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageSubscriptionRequestActionDetails {\n"); + sb.append(" nextScheduledTime: ").append(toIndentedString(nextScheduledTime)).append("\n"); + sb.append(" planId: ").append(toIndentedString(planId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("next_scheduled_time"); + openapiFields.add("plan_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionRequestActionDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("next_scheduled_time") != null && !jsonObj.get("next_scheduled_time").isJsonNull()) && !jsonObj.get("next_scheduled_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next_scheduled_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_scheduled_time").toString())); + } + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ManageSubscriptionRequestActionDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("next_scheduled_time") != null && !jsonObj.get("next_scheduled_time").isJsonNull()) && !jsonObj.get("next_scheduled_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next_scheduled_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next_scheduled_time").toString())); + } + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ManageSubscriptionRequestActionDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageSubscriptionRequestActionDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageSubscriptionRequestActionDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ManageSubscriptionRequestActionDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ManageSubscriptionRequestActionDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageSubscriptionRequestActionDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageSubscriptionRequestActionDetails + * @throws IOException if the JSON string is invalid with respect to ManageSubscriptionRequestActionDetails + */ + public static ManageSubscriptionRequestActionDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageSubscriptionRequestActionDetails.class); + } + + /** + * Convert an instance of ManageSubscriptionRequestActionDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/NetBankingPaymentMethod.java b/src/main/java/com/cashfree/model/NetBankingPaymentMethod.java index 886a57e9..d5997dc8 100644 --- a/src/main/java/com/cashfree/model/NetBankingPaymentMethod.java +++ b/src/main/java/com/cashfree/model/NetBankingPaymentMethod.java @@ -53,7 +53,7 @@ * Payment method for netbanking object */ @Schema(description = "Payment method for netbanking object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class NetBankingPaymentMethod { public static final String SERIALIZED_NAME_NETBANKING = "netbanking"; @SerializedName(SERIALIZED_NAME_NETBANKING) diff --git a/src/main/java/com/cashfree/model/Netbanking.java b/src/main/java/com/cashfree/model/Netbanking.java index 22a922ef..064bf9e1 100644 --- a/src/main/java/com/cashfree/model/Netbanking.java +++ b/src/main/java/com/cashfree/model/Netbanking.java @@ -52,7 +52,7 @@ * Netbanking payment method request body */ @Schema(description = "Netbanking payment method request body") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Netbanking { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/OfferAll.java b/src/main/java/com/cashfree/model/OfferAll.java index eb40badd..395298cb 100644 --- a/src/main/java/com/cashfree/model/OfferAll.java +++ b/src/main/java/com/cashfree/model/OfferAll.java @@ -52,7 +52,7 @@ * returns all offers */ @Schema(description = "returns all offers") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferAll { public static final String SERIALIZED_NAME_ALL = "all"; @SerializedName(SERIALIZED_NAME_ALL) diff --git a/src/main/java/com/cashfree/model/OfferCard.java b/src/main/java/com/cashfree/model/OfferCard.java index 0be83b34..03513ccb 100644 --- a/src/main/java/com/cashfree/model/OfferCard.java +++ b/src/main/java/com/cashfree/model/OfferCard.java @@ -53,7 +53,7 @@ * Offers related to cards */ @Schema(description = "Offers related to cards") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferCard { public static final String SERIALIZED_NAME_CARD = "card"; @SerializedName(SERIALIZED_NAME_CARD) diff --git a/src/main/java/com/cashfree/model/OfferDetails.java b/src/main/java/com/cashfree/model/OfferDetails.java index 741d7b31..e3d8fc9b 100644 --- a/src/main/java/com/cashfree/model/OfferDetails.java +++ b/src/main/java/com/cashfree/model/OfferDetails.java @@ -54,7 +54,7 @@ * Offer details and type */ @Schema(description = "Offer details and type") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferDetails { /** * Offer Type for the Offer. diff --git a/src/main/java/com/cashfree/model/OfferEMI.java b/src/main/java/com/cashfree/model/OfferEMI.java index 1c96a603..1c45f8fd 100644 --- a/src/main/java/com/cashfree/model/OfferEMI.java +++ b/src/main/java/com/cashfree/model/OfferEMI.java @@ -53,7 +53,7 @@ * EMI offer object */ @Schema(description = "EMI offer object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferEMI { public static final String SERIALIZED_NAME_EMI = "emi"; @SerializedName(SERIALIZED_NAME_EMI) diff --git a/src/main/java/com/cashfree/model/OfferEntity.java b/src/main/java/com/cashfree/model/OfferEntity.java index 00ce1031..654c55fa 100644 --- a/src/main/java/com/cashfree/model/OfferEntity.java +++ b/src/main/java/com/cashfree/model/OfferEntity.java @@ -56,7 +56,7 @@ * Offer entity object */ @Schema(description = "Offer entity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferEntity { public static final String SERIALIZED_NAME_OFFER_ID = "offer_id"; @SerializedName(SERIALIZED_NAME_OFFER_ID) diff --git a/src/main/java/com/cashfree/model/OfferFilters.java b/src/main/java/com/cashfree/model/OfferFilters.java index 845343c2..e55e1c7e 100644 --- a/src/main/java/com/cashfree/model/OfferFilters.java +++ b/src/main/java/com/cashfree/model/OfferFilters.java @@ -55,7 +55,7 @@ * Filter for offers */ @Schema(description = "Filter for offers") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferFilters { public static final String SERIALIZED_NAME_OFFER_TYPE = "offer_type"; @SerializedName(SERIALIZED_NAME_OFFER_TYPE) diff --git a/src/main/java/com/cashfree/model/OfferMeta.java b/src/main/java/com/cashfree/model/OfferMeta.java index ac9d7fb3..8980970d 100644 --- a/src/main/java/com/cashfree/model/OfferMeta.java +++ b/src/main/java/com/cashfree/model/OfferMeta.java @@ -52,7 +52,7 @@ * Offer meta details object */ @Schema(description = "Offer meta details object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferMeta { public static final String SERIALIZED_NAME_OFFER_TITLE = "offer_title"; @SerializedName(SERIALIZED_NAME_OFFER_TITLE) diff --git a/src/main/java/com/cashfree/model/OfferNB.java b/src/main/java/com/cashfree/model/OfferNB.java index a2235577..d11cb7ae 100644 --- a/src/main/java/com/cashfree/model/OfferNB.java +++ b/src/main/java/com/cashfree/model/OfferNB.java @@ -53,7 +53,7 @@ * Offer object ofr NetBanking */ @Schema(description = "Offer object ofr NetBanking") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferNB { public static final String SERIALIZED_NAME_NETBANKING = "netbanking"; @SerializedName(SERIALIZED_NAME_NETBANKING) diff --git a/src/main/java/com/cashfree/model/OfferNBNetbanking.java b/src/main/java/com/cashfree/model/OfferNBNetbanking.java index 083c1276..ad45500c 100644 --- a/src/main/java/com/cashfree/model/OfferNBNetbanking.java +++ b/src/main/java/com/cashfree/model/OfferNBNetbanking.java @@ -51,7 +51,7 @@ /** * OfferNBNetbanking */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferNBNetbanking { public static final String SERIALIZED_NAME_BANK_NAME = "bank_name"; @SerializedName(SERIALIZED_NAME_BANK_NAME) diff --git a/src/main/java/com/cashfree/model/OfferPaylater.java b/src/main/java/com/cashfree/model/OfferPaylater.java index 2bb19346..3d07fc83 100644 --- a/src/main/java/com/cashfree/model/OfferPaylater.java +++ b/src/main/java/com/cashfree/model/OfferPaylater.java @@ -53,7 +53,7 @@ * Offer object for paylater */ @Schema(description = "Offer object for paylater") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferPaylater { public static final String SERIALIZED_NAME_PAYLATER = "paylater"; @SerializedName(SERIALIZED_NAME_PAYLATER) diff --git a/src/main/java/com/cashfree/model/OfferQueries.java b/src/main/java/com/cashfree/model/OfferQueries.java index 2cfceac2..59d50adc 100644 --- a/src/main/java/com/cashfree/model/OfferQueries.java +++ b/src/main/java/com/cashfree/model/OfferQueries.java @@ -53,7 +53,7 @@ * Offer Query Object */ @Schema(description = "Offer Query Object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferQueries { public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; @SerializedName(SERIALIZED_NAME_ORDER_ID) diff --git a/src/main/java/com/cashfree/model/OfferTnc.java b/src/main/java/com/cashfree/model/OfferTnc.java index 80c2ba10..c476ec98 100644 --- a/src/main/java/com/cashfree/model/OfferTnc.java +++ b/src/main/java/com/cashfree/model/OfferTnc.java @@ -52,7 +52,7 @@ * Offer terms and condition object */ @Schema(description = "Offer terms and condition object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferTnc { /** * TnC Type for the Offer. It can be either `text` or `link` diff --git a/src/main/java/com/cashfree/model/OfferUPI.java b/src/main/java/com/cashfree/model/OfferUPI.java index 69afad96..a93b7808 100644 --- a/src/main/java/com/cashfree/model/OfferUPI.java +++ b/src/main/java/com/cashfree/model/OfferUPI.java @@ -52,7 +52,7 @@ * Offer object for UPI */ @Schema(description = "Offer object for UPI") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferUPI { public static final String SERIALIZED_NAME_UPI = "upi"; @SerializedName(SERIALIZED_NAME_UPI) diff --git a/src/main/java/com/cashfree/model/OfferValidations.java b/src/main/java/com/cashfree/model/OfferValidations.java index 31727f71..2686675b 100644 --- a/src/main/java/com/cashfree/model/OfferValidations.java +++ b/src/main/java/com/cashfree/model/OfferValidations.java @@ -54,7 +54,7 @@ * Offer validation object */ @Schema(description = "Offer validation object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferValidations { public static final String SERIALIZED_NAME_MIN_AMOUNT = "min_amount"; @SerializedName(SERIALIZED_NAME_MIN_AMOUNT) diff --git a/src/main/java/com/cashfree/model/OfferValidationsPaymentMethod.java b/src/main/java/com/cashfree/model/OfferValidationsPaymentMethod.java index 506cf9c2..d2bc9cdd 100644 --- a/src/main/java/com/cashfree/model/OfferValidationsPaymentMethod.java +++ b/src/main/java/com/cashfree/model/OfferValidationsPaymentMethod.java @@ -70,7 +70,7 @@ import com.cashfree.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferValidationsPaymentMethod extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(OfferValidationsPaymentMethod.class.getName()); diff --git a/src/main/java/com/cashfree/model/OfferWallet.java b/src/main/java/com/cashfree/model/OfferWallet.java index ef22ce64..832a9787 100644 --- a/src/main/java/com/cashfree/model/OfferWallet.java +++ b/src/main/java/com/cashfree/model/OfferWallet.java @@ -53,7 +53,7 @@ * Offer object for wallet payment method */ @Schema(description = "Offer object for wallet payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OfferWallet { public static final String SERIALIZED_NAME_APP = "app"; @SerializedName(SERIALIZED_NAME_APP) diff --git a/src/main/java/com/cashfree/model/OrderAuthenticateEntity.java b/src/main/java/com/cashfree/model/OrderAuthenticateEntity.java index 806dbeb9..5982a3c5 100644 --- a/src/main/java/com/cashfree/model/OrderAuthenticateEntity.java +++ b/src/main/java/com/cashfree/model/OrderAuthenticateEntity.java @@ -52,7 +52,7 @@ * This is the response shared when merchant inovkes the OTP submit or resend API */ @Schema(description = "This is the response shared when merchant inovkes the OTP submit or resend API") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderAuthenticateEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/OrderAuthenticatePaymentRequest.java b/src/main/java/com/cashfree/model/OrderAuthenticatePaymentRequest.java index 5ef6878c..c1f7a08b 100644 --- a/src/main/java/com/cashfree/model/OrderAuthenticatePaymentRequest.java +++ b/src/main/java/com/cashfree/model/OrderAuthenticatePaymentRequest.java @@ -52,7 +52,7 @@ * OTP to be submitted for headless/native OTP */ @Schema(description = "OTP to be submitted for headless/native OTP") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderAuthenticatePaymentRequest { public static final String SERIALIZED_NAME_OTP = "otp"; @SerializedName(SERIALIZED_NAME_OTP) diff --git a/src/main/java/com/cashfree/model/OrderCreateRefundRequest.java b/src/main/java/com/cashfree/model/OrderCreateRefundRequest.java index d5ae45fc..d8562538 100644 --- a/src/main/java/com/cashfree/model/OrderCreateRefundRequest.java +++ b/src/main/java/com/cashfree/model/OrderCreateRefundRequest.java @@ -55,7 +55,7 @@ * create refund request object */ @Schema(description = "create refund request object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderCreateRefundRequest { public static final String SERIALIZED_NAME_REFUND_AMOUNT = "refund_amount"; @SerializedName(SERIALIZED_NAME_REFUND_AMOUNT) diff --git a/src/main/java/com/cashfree/model/OrderEntity.java b/src/main/java/com/cashfree/model/OrderEntity.java index ee991218..921d42ec 100644 --- a/src/main/java/com/cashfree/model/OrderEntity.java +++ b/src/main/java/com/cashfree/model/OrderEntity.java @@ -14,7 +14,7 @@ package com.cashfree.model; import java.util.Objects; -import com.cashfree.model.CustomerDetails; +import com.cashfree.model.CustomerDetailsResponse; import com.cashfree.model.OrderMeta; import com.cashfree.model.VendorSplit; import com.google.gson.TypeAdapter; @@ -61,7 +61,7 @@ * The complete order entity */ @Schema(description = "The complete order entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderEntity { public static final String SERIALIZED_NAME_CF_ORDER_ID = "cf_order_id"; @SerializedName(SERIALIZED_NAME_CF_ORDER_ID) @@ -109,7 +109,7 @@ public class OrderEntity { public static final String SERIALIZED_NAME_CUSTOMER_DETAILS = "customer_details"; @SerializedName(SERIALIZED_NAME_CUSTOMER_DETAILS) - private CustomerDetails customerDetails; + private CustomerDetailsResponse customerDetails; public static final String SERIALIZED_NAME_ORDER_META = "order_meta"; @SerializedName(SERIALIZED_NAME_ORDER_META) @@ -372,7 +372,7 @@ public void setOrderSplits(List orderSplits) { } - public OrderEntity customerDetails(CustomerDetails customerDetails) { + public OrderEntity customerDetails(CustomerDetailsResponse customerDetails) { this.customerDetails = customerDetails; return this; @@ -384,12 +384,12 @@ public OrderEntity customerDetails(CustomerDetails customerDetails) { **/ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") - public CustomerDetails getCustomerDetails() { + public CustomerDetailsResponse getCustomerDetails() { return customerDetails; } - public void setCustomerDetails(CustomerDetails customerDetails) { + public void setCustomerDetails(CustomerDetailsResponse customerDetails) { this.customerDetails = customerDetails; } @@ -582,7 +582,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `customer_details` if (jsonObj.get("customer_details") != null && !jsonObj.get("customer_details").isJsonNull()) { - CustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + CustomerDetailsResponse.validateJsonElement(jsonObj.get("customer_details")); } // validate the optional field `order_meta` if (jsonObj.get("order_meta") != null && !jsonObj.get("order_meta").isJsonNull()) { @@ -637,7 +637,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw } // validate the optional field `customer_details` if (jsonObj.get("customer_details") != null && !jsonObj.get("customer_details").isJsonNull()) { - CustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + CustomerDetailsResponse.validateJsonElement(jsonObj.get("customer_details")); return true; } // validate the optional field `order_meta` diff --git a/src/main/java/com/cashfree/model/OrderMeta.java b/src/main/java/com/cashfree/model/OrderMeta.java index 28e002b4..478023ed 100644 --- a/src/main/java/com/cashfree/model/OrderMeta.java +++ b/src/main/java/com/cashfree/model/OrderMeta.java @@ -53,7 +53,7 @@ * Optional meta details to control how the customer pays and how payment journey completes */ @Schema(description = "Optional meta details to control how the customer pays and how payment journey completes") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderMeta { public static final String SERIALIZED_NAME_RETURN_URL = "return_url"; @SerializedName(SERIALIZED_NAME_RETURN_URL) @@ -77,11 +77,11 @@ public OrderMeta returnUrl(String returnUrl) { } /** - * The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://example.com/return?order_id=myOrderId + * The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://www.cashfree.com/devstudio/thankyou * @return returnUrl **/ @javax.annotation.Nullable - @Schema(example = "https://example.com/return?order_id=myOrderId", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://example.com/return?order_id=myOrderId") + @Schema(example = "https://www.cashfree.com/devstudio/thankyou", requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The URL to which user will be redirected to after the payment on bank OTP page. Maximum length: 250. We suggest to keep context of order_id in your return_url so that you can identify the order when customer lands on your page. Example of return_url format could be https://www.cashfree.com/devstudio/thankyou") public String getReturnUrl() { return returnUrl; } diff --git a/src/main/java/com/cashfree/model/OrderPayData.java b/src/main/java/com/cashfree/model/OrderPayData.java index 08f47e63..4984b502 100644 --- a/src/main/java/com/cashfree/model/OrderPayData.java +++ b/src/main/java/com/cashfree/model/OrderPayData.java @@ -52,7 +52,7 @@ * the data object pay api */ @Schema(description = "the data object pay api") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class OrderPayData { public static final String SERIALIZED_NAME_URL = "url"; @SerializedName(SERIALIZED_NAME_URL) diff --git a/src/main/java/com/cashfree/model/PayOrderEntity.java b/src/main/java/com/cashfree/model/PayOrderEntity.java index 49333bd3..4c0040d4 100644 --- a/src/main/java/com/cashfree/model/PayOrderEntity.java +++ b/src/main/java/com/cashfree/model/PayOrderEntity.java @@ -54,7 +54,7 @@ * Order Pay response once you create a transaction for that order */ @Schema(description = "Order Pay response once you create a transaction for that order") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PayOrderEntity { public static final String SERIALIZED_NAME_PAYMENT_AMOUNT = "payment_amount"; @SerializedName(SERIALIZED_NAME_PAYMENT_AMOUNT) diff --git a/src/main/java/com/cashfree/model/PayOrderRequest.java b/src/main/java/com/cashfree/model/PayOrderRequest.java index 379ff9e1..a477da6f 100644 --- a/src/main/java/com/cashfree/model/PayOrderRequest.java +++ b/src/main/java/com/cashfree/model/PayOrderRequest.java @@ -53,7 +53,7 @@ * Complete object for the pay api that uses payment method objects */ @Schema(description = "Complete object for the pay api that uses payment method objects") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PayOrderRequest { public static final String SERIALIZED_NAME_PAYMENT_SESSION_ID = "payment_session_id"; @SerializedName(SERIALIZED_NAME_PAYMENT_SESSION_ID) diff --git a/src/main/java/com/cashfree/model/PayOrderRequestPaymentMethod.java b/src/main/java/com/cashfree/model/PayOrderRequestPaymentMethod.java index 96b5f138..1d4741a7 100644 --- a/src/main/java/com/cashfree/model/PayOrderRequestPaymentMethod.java +++ b/src/main/java/com/cashfree/model/PayOrderRequestPaymentMethod.java @@ -74,7 +74,7 @@ import com.cashfree.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PayOrderRequestPaymentMethod extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(PayOrderRequestPaymentMethod.class.getName()); diff --git a/src/main/java/com/cashfree/model/Paylater.java b/src/main/java/com/cashfree/model/Paylater.java index c63aea1a..e7437176 100644 --- a/src/main/java/com/cashfree/model/Paylater.java +++ b/src/main/java/com/cashfree/model/Paylater.java @@ -52,7 +52,7 @@ * Paylater payment method */ @Schema(description = "Paylater payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Paylater { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaylaterEntity.java b/src/main/java/com/cashfree/model/PaylaterEntity.java index e5b5dc38..dd3ac97e 100644 --- a/src/main/java/com/cashfree/model/PaylaterEntity.java +++ b/src/main/java/com/cashfree/model/PaylaterEntity.java @@ -52,7 +52,7 @@ * Paylater Entity */ @Schema(description = "Paylater Entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaylaterEntity { public static final String SERIALIZED_NAME_PAYMENT_METHOD = "payment_method"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) diff --git a/src/main/java/com/cashfree/model/PaylaterOffer.java b/src/main/java/com/cashfree/model/PaylaterOffer.java index 1ab9fb37..7624fc6d 100644 --- a/src/main/java/com/cashfree/model/PaylaterOffer.java +++ b/src/main/java/com/cashfree/model/PaylaterOffer.java @@ -51,7 +51,7 @@ /** * PaylaterOffer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaylaterOffer { public static final String SERIALIZED_NAME_PROVIDER = "provider"; @SerializedName(SERIALIZED_NAME_PROVIDER) diff --git a/src/main/java/com/cashfree/model/PaylaterPaymentMethod.java b/src/main/java/com/cashfree/model/PaylaterPaymentMethod.java index 96e6188e..347f56af 100644 --- a/src/main/java/com/cashfree/model/PaylaterPaymentMethod.java +++ b/src/main/java/com/cashfree/model/PaylaterPaymentMethod.java @@ -53,7 +53,7 @@ * paylater payment method */ @Schema(description = "paylater payment method") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaylaterPaymentMethod { public static final String SERIALIZED_NAME_PAYLATER = "paylater"; @SerializedName(SERIALIZED_NAME_PAYLATER) diff --git a/src/main/java/com/cashfree/model/PaymentEntity.java b/src/main/java/com/cashfree/model/PaymentEntity.java index b3be96bb..88380dcf 100644 --- a/src/main/java/com/cashfree/model/PaymentEntity.java +++ b/src/main/java/com/cashfree/model/PaymentEntity.java @@ -56,7 +56,7 @@ * payment entity full object */ @Schema(description = "payment entity full object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/PaymentEntityPaymentMethod.java b/src/main/java/com/cashfree/model/PaymentEntityPaymentMethod.java index b2ac29cd..1a191a70 100644 --- a/src/main/java/com/cashfree/model/PaymentEntityPaymentMethod.java +++ b/src/main/java/com/cashfree/model/PaymentEntityPaymentMethod.java @@ -72,7 +72,7 @@ import com.cashfree.JSON; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentEntityPaymentMethod extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(PaymentEntityPaymentMethod.class.getName()); diff --git a/src/main/java/com/cashfree/model/PaymentLinkCustomerDetails.java b/src/main/java/com/cashfree/model/PaymentLinkCustomerDetails.java index b9d3ee59..46a56e12 100644 --- a/src/main/java/com/cashfree/model/PaymentLinkCustomerDetails.java +++ b/src/main/java/com/cashfree/model/PaymentLinkCustomerDetails.java @@ -53,7 +53,7 @@ * The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. */ @Schema(description = "The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentLinkCustomerDetails { public static final String SERIALIZED_NAME_CUSTOMER_ID = "customer_id"; @SerializedName(SERIALIZED_NAME_CUSTOMER_ID) diff --git a/src/main/java/com/cashfree/model/PaymentLinkOrderEntity.java b/src/main/java/com/cashfree/model/PaymentLinkOrderEntity.java index 2d4f5c75..ff8fa2b4 100644 --- a/src/main/java/com/cashfree/model/PaymentLinkOrderEntity.java +++ b/src/main/java/com/cashfree/model/PaymentLinkOrderEntity.java @@ -61,7 +61,7 @@ * The complete order entity */ @Schema(description = "The complete order entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentLinkOrderEntity { public static final String SERIALIZED_NAME_CF_ORDER_ID = "cf_order_id"; @SerializedName(SERIALIZED_NAME_CF_ORDER_ID) diff --git a/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntity.java index f8ae36bd..192ce3dd 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntity.java @@ -53,7 +53,7 @@ * payment method app object in payment entity */ @Schema(description = "payment method app object in payment entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodAppInPaymentsEntity { public static final String SERIALIZED_NAME_APP = "app"; @SerializedName(SERIALIZED_NAME_APP) diff --git a/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntityApp.java b/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntityApp.java index 7f3e5792..28624b64 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntityApp.java +++ b/src/main/java/com/cashfree/model/PaymentMethodAppInPaymentsEntityApp.java @@ -51,7 +51,7 @@ /** * PaymentMethodAppInPaymentsEntityApp */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodAppInPaymentsEntityApp { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntity.java index 9f7c9718..96d28614 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntity.java @@ -53,7 +53,7 @@ * payment method bank transfer object in payment entity */ @Schema(description = "payment method bank transfer object in payment entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodBankTransferInPaymentsEntity { public static final String SERIALIZED_NAME_BANKTRANSFER = "banktransfer"; @SerializedName(SERIALIZED_NAME_BANKTRANSFER) diff --git a/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntityBanktransfer.java b/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntityBanktransfer.java index 84186d10..0e49e15a 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntityBanktransfer.java +++ b/src/main/java/com/cashfree/model/PaymentMethodBankTransferInPaymentsEntityBanktransfer.java @@ -51,7 +51,7 @@ /** * PaymentMethodBankTransferInPaymentsEntityBanktransfer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodBankTransferInPaymentsEntityBanktransfer { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntity.java index 5b676c95..c2cf522f 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntity.java @@ -53,7 +53,7 @@ * payment method card emi object in payment entity */ @Schema(description = "payment method card emi object in payment entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardEMIInPaymentsEntity { public static final String SERIALIZED_NAME_EMI = "emi"; @SerializedName(SERIALIZED_NAME_EMI) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmi.java b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmi.java index 21bfb26d..da8f8a67 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmi.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmi.java @@ -53,7 +53,7 @@ /** * PaymentMethodCardEMIInPaymentsEntityEmi */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardEMIInPaymentsEntityEmi { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails.java b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails.java index dabe5bdf..2a4333f8 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails.java @@ -52,7 +52,7 @@ /** * PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardEMIInPaymentsEntityEmiEmiDetails { public static final String SERIALIZED_NAME_EMI_AMOUNT = "emi_amount"; @SerializedName(SERIALIZED_NAME_EMI_AMOUNT) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntity.java index 8f4ae30e..6652289d 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntity.java @@ -53,7 +53,7 @@ * payment method card object in payment entity */ @Schema(description = "payment method card object in payment entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardInPaymentsEntity { public static final String SERIALIZED_NAME_CARD = "card"; @SerializedName(SERIALIZED_NAME_CARD) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntityCard.java b/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntityCard.java index badf4951..702adc4a 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntityCard.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardInPaymentsEntityCard.java @@ -51,7 +51,7 @@ /** * PaymentMethodCardInPaymentsEntityCard */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardInPaymentsEntityCard { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodCardlessEMIInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodCardlessEMIInPaymentsEntity.java index 45197784..4ef99c65 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodCardlessEMIInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodCardlessEMIInPaymentsEntity.java @@ -53,7 +53,7 @@ * payment method carless object in payment entity */ @Schema(description = "payment method carless object in payment entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodCardlessEMIInPaymentsEntity { public static final String SERIALIZED_NAME_CARDLESS_EMI = "cardless_emi"; @SerializedName(SERIALIZED_NAME_CARDLESS_EMI) diff --git a/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntity.java index 2fd4b298..a6ff20c0 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntity.java @@ -53,7 +53,7 @@ * netbanking payment method object for pay */ @Schema(description = "netbanking payment method object for pay") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodNetBankingInPaymentsEntity { public static final String SERIALIZED_NAME_NETBANKING = "netbanking"; @SerializedName(SERIALIZED_NAME_NETBANKING) diff --git a/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntityNetbanking.java b/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntityNetbanking.java index 19934fb2..b365cb01 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntityNetbanking.java +++ b/src/main/java/com/cashfree/model/PaymentMethodNetBankingInPaymentsEntityNetbanking.java @@ -51,7 +51,7 @@ /** * PaymentMethodNetBankingInPaymentsEntityNetbanking */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodNetBankingInPaymentsEntityNetbanking { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodPaylaterInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodPaylaterInPaymentsEntity.java index f4bc15da..9dee1168 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodPaylaterInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodPaylaterInPaymentsEntity.java @@ -53,7 +53,7 @@ * paylater payment method object for pay api */ @Schema(description = "paylater payment method object for pay api") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodPaylaterInPaymentsEntity { public static final String SERIALIZED_NAME_PAYLATER = "paylater"; @SerializedName(SERIALIZED_NAME_PAYLATER) diff --git a/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntity.java b/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntity.java index a4cc9d09..33f3cc32 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntity.java @@ -53,7 +53,7 @@ * UPI payment method for pay api */ @Schema(description = "UPI payment method for pay api") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodUPIInPaymentsEntity { public static final String SERIALIZED_NAME_UPI = "upi"; @SerializedName(SERIALIZED_NAME_UPI) diff --git a/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntityUpi.java b/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntityUpi.java index 5064308f..e6896e61 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntityUpi.java +++ b/src/main/java/com/cashfree/model/PaymentMethodUPIInPaymentsEntityUpi.java @@ -51,7 +51,7 @@ /** * PaymentMethodUPIInPaymentsEntityUpi */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodUPIInPaymentsEntityUpi { public static final String SERIALIZED_NAME_CHANNEL = "channel"; @SerializedName(SERIALIZED_NAME_CHANNEL) diff --git a/src/main/java/com/cashfree/model/PaymentMethodsFilters.java b/src/main/java/com/cashfree/model/PaymentMethodsFilters.java index e8ff3a18..dcb42a1a 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodsFilters.java +++ b/src/main/java/com/cashfree/model/PaymentMethodsFilters.java @@ -54,7 +54,7 @@ * Filter for Payment Methods */ @Schema(description = "Filter for Payment Methods") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodsFilters { public static final String SERIALIZED_NAME_PAYMENT_METHODS = "payment_methods"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHODS) diff --git a/src/main/java/com/cashfree/model/PaymentMethodsQueries.java b/src/main/java/com/cashfree/model/PaymentMethodsQueries.java index 56ab9d2c..9cf90a16 100644 --- a/src/main/java/com/cashfree/model/PaymentMethodsQueries.java +++ b/src/main/java/com/cashfree/model/PaymentMethodsQueries.java @@ -53,7 +53,7 @@ * Payment Method Query Object */ @Schema(description = "Payment Method Query Object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentMethodsQueries { public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) diff --git a/src/main/java/com/cashfree/model/PaymentModeDetails.java b/src/main/java/com/cashfree/model/PaymentModeDetails.java index 6a062a61..d4dc7ff3 100644 --- a/src/main/java/com/cashfree/model/PaymentModeDetails.java +++ b/src/main/java/com/cashfree/model/PaymentModeDetails.java @@ -53,7 +53,7 @@ * payment mode eligiblity object */ @Schema(description = "payment mode eligiblity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentModeDetails { public static final String SERIALIZED_NAME_NICK = "nick"; @SerializedName(SERIALIZED_NAME_NICK) diff --git a/src/main/java/com/cashfree/model/PaymentWebhook.java b/src/main/java/com/cashfree/model/PaymentWebhook.java index c0155346..dfc8d77c 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhook.java +++ b/src/main/java/com/cashfree/model/PaymentWebhook.java @@ -53,7 +53,7 @@ * payment webhook object */ @Schema(description = "payment webhook object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhook { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/com/cashfree/model/PaymentWebhookCustomerEntity.java b/src/main/java/com/cashfree/model/PaymentWebhookCustomerEntity.java index 68ec668f..d29ea389 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhookCustomerEntity.java +++ b/src/main/java/com/cashfree/model/PaymentWebhookCustomerEntity.java @@ -52,7 +52,7 @@ * customer details object in webhook */ @Schema(description = "customer details object in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhookCustomerEntity { public static final String SERIALIZED_NAME_CUSTOMER_NAME = "customer_name"; @SerializedName(SERIALIZED_NAME_CUSTOMER_NAME) diff --git a/src/main/java/com/cashfree/model/PaymentWebhookDataEntity.java b/src/main/java/com/cashfree/model/PaymentWebhookDataEntity.java index 67f72db2..0bcd9174 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhookDataEntity.java +++ b/src/main/java/com/cashfree/model/PaymentWebhookDataEntity.java @@ -60,7 +60,7 @@ * data entity in webhook */ @Schema(description = "data entity in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhookDataEntity { public static final String SERIALIZED_NAME_ORDER = "order"; @SerializedName(SERIALIZED_NAME_ORDER) diff --git a/src/main/java/com/cashfree/model/PaymentWebhookErrorEntity.java b/src/main/java/com/cashfree/model/PaymentWebhookErrorEntity.java index 4a656b00..76dfc301 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhookErrorEntity.java +++ b/src/main/java/com/cashfree/model/PaymentWebhookErrorEntity.java @@ -52,7 +52,7 @@ * error details present in the webhook */ @Schema(description = "error details present in the webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhookErrorEntity { public static final String SERIALIZED_NAME_ERROR_CODE = "error_code"; @SerializedName(SERIALIZED_NAME_ERROR_CODE) diff --git a/src/main/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntity.java b/src/main/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntity.java index 1e909e0e..9aa27066 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntity.java +++ b/src/main/java/com/cashfree/model/PaymentWebhookGatewayDetailsEntity.java @@ -52,7 +52,7 @@ * payment gatewat details present in the webhook response */ @Schema(description = "payment gatewat details present in the webhook response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhookGatewayDetailsEntity { public static final String SERIALIZED_NAME_GATEWAY_NAME = "gateway_name"; @SerializedName(SERIALIZED_NAME_GATEWAY_NAME) diff --git a/src/main/java/com/cashfree/model/PaymentWebhookOrderEntity.java b/src/main/java/com/cashfree/model/PaymentWebhookOrderEntity.java index 419a9f0a..d0d1d88d 100644 --- a/src/main/java/com/cashfree/model/PaymentWebhookOrderEntity.java +++ b/src/main/java/com/cashfree/model/PaymentWebhookOrderEntity.java @@ -54,7 +54,7 @@ * order entity in webhook */ @Schema(description = "order entity in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class PaymentWebhookOrderEntity { public static final String SERIALIZED_NAME_ORDER_ID = "order_id"; @SerializedName(SERIALIZED_NAME_ORDER_ID) diff --git a/src/main/java/com/cashfree/model/PlanEntity.java b/src/main/java/com/cashfree/model/PlanEntity.java new file mode 100644 index 00000000..872aa1a9 --- /dev/null +++ b/src/main/java/com/cashfree/model/PlanEntity.java @@ -0,0 +1,543 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The response returned for Get, Create and Manage Plan APIs + */ +@Schema(description = "The response returned for Get, Create and Manage Plan APIs") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class PlanEntity { + public static final String SERIALIZED_NAME_PLAN_CURRENCY = "plan_currency"; + @SerializedName(SERIALIZED_NAME_PLAN_CURRENCY) + private String planCurrency; + + public static final String SERIALIZED_NAME_PLAN_ID = "plan_id"; + @SerializedName(SERIALIZED_NAME_PLAN_ID) + private String planId; + + public static final String SERIALIZED_NAME_PLAN_INTERVAL_TYPE = "plan_interval_type"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVAL_TYPE) + private String planIntervalType; + + public static final String SERIALIZED_NAME_PLAN_INTERVALS = "plan_intervals"; + @SerializedName(SERIALIZED_NAME_PLAN_INTERVALS) + private Integer planIntervals; + + public static final String SERIALIZED_NAME_PLAN_MAX_AMOUNT = "plan_max_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_AMOUNT) + private BigDecimal planMaxAmount; + + public static final String SERIALIZED_NAME_PLAN_MAX_CYCLES = "plan_max_cycles"; + @SerializedName(SERIALIZED_NAME_PLAN_MAX_CYCLES) + private Integer planMaxCycles; + + public static final String SERIALIZED_NAME_PLAN_NAME = "plan_name"; + @SerializedName(SERIALIZED_NAME_PLAN_NAME) + private String planName; + + public static final String SERIALIZED_NAME_PLAN_NOTE = "plan_note"; + @SerializedName(SERIALIZED_NAME_PLAN_NOTE) + private String planNote; + + public static final String SERIALIZED_NAME_PLAN_RECURRING_AMOUNT = "plan_recurring_amount"; + @SerializedName(SERIALIZED_NAME_PLAN_RECURRING_AMOUNT) + private BigDecimal planRecurringAmount; + + public static final String SERIALIZED_NAME_PLAN_STATUS = "plan_status"; + @SerializedName(SERIALIZED_NAME_PLAN_STATUS) + private String planStatus; + + public static final String SERIALIZED_NAME_PLAN_TYPE = "plan_type"; + @SerializedName(SERIALIZED_NAME_PLAN_TYPE) + private String planType; + + public PlanEntity() { + } + + public PlanEntity planCurrency(String planCurrency) { + + this.planCurrency = planCurrency; + return this; + } + + /** + * Currency for the plan. + * @return planCurrency + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Currency for the plan.") + public String getPlanCurrency() { + return planCurrency; + } + + + public void setPlanCurrency(String planCurrency) { + this.planCurrency = planCurrency; + } + + + public PlanEntity planId(String planId) { + + this.planId = planId; + return this; + } + + /** + * Plan ID provided by merchant. + * @return planId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Plan ID provided by merchant.") + public String getPlanId() { + return planId; + } + + + public void setPlanId(String planId) { + this.planId = planId; + } + + + public PlanEntity planIntervalType(String planIntervalType) { + + this.planIntervalType = planIntervalType; + return this; + } + + /** + * Interval type for the plan. + * @return planIntervalType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Interval type for the plan.") + public String getPlanIntervalType() { + return planIntervalType; + } + + + public void setPlanIntervalType(String planIntervalType) { + this.planIntervalType = planIntervalType; + } + + + public PlanEntity planIntervals(Integer planIntervals) { + + this.planIntervals = planIntervals; + return this; + } + + /** + * Number of intervals for the plan. + * @return planIntervals + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Number of intervals for the plan.") + public Integer getPlanIntervals() { + return planIntervals; + } + + + public void setPlanIntervals(Integer planIntervals) { + this.planIntervals = planIntervals; + } + + + public PlanEntity planMaxAmount(BigDecimal planMaxAmount) { + + this.planMaxAmount = planMaxAmount; + return this; + } + + /** + * Maximum amount for the plan. + * @return planMaxAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Maximum amount for the plan.") + public BigDecimal getPlanMaxAmount() { + return planMaxAmount; + } + + + public void setPlanMaxAmount(BigDecimal planMaxAmount) { + this.planMaxAmount = planMaxAmount; + } + + + public PlanEntity planMaxCycles(Integer planMaxCycles) { + + this.planMaxCycles = planMaxCycles; + return this; + } + + /** + * Maximum number of payment cycles for the plan. + * @return planMaxCycles + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Maximum number of payment cycles for the plan.") + public Integer getPlanMaxCycles() { + return planMaxCycles; + } + + + public void setPlanMaxCycles(Integer planMaxCycles) { + this.planMaxCycles = planMaxCycles; + } + + + public PlanEntity planName(String planName) { + + this.planName = planName; + return this; + } + + /** + * Name of the plan. + * @return planName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the plan.") + public String getPlanName() { + return planName; + } + + + public void setPlanName(String planName) { + this.planName = planName; + } + + + public PlanEntity planNote(String planNote) { + + this.planNote = planNote; + return this; + } + + /** + * Note for the plan. + * @return planNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Note for the plan.") + public String getPlanNote() { + return planNote; + } + + + public void setPlanNote(String planNote) { + this.planNote = planNote; + } + + + public PlanEntity planRecurringAmount(BigDecimal planRecurringAmount) { + + this.planRecurringAmount = planRecurringAmount; + return this; + } + + /** + * Recurring amount for the plan. + * @return planRecurringAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Recurring amount for the plan.") + public BigDecimal getPlanRecurringAmount() { + return planRecurringAmount; + } + + + public void setPlanRecurringAmount(BigDecimal planRecurringAmount) { + this.planRecurringAmount = planRecurringAmount; + } + + + public PlanEntity planStatus(String planStatus) { + + this.planStatus = planStatus; + return this; + } + + /** + * Status of the plan. + * @return planStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the plan.") + public String getPlanStatus() { + return planStatus; + } + + + public void setPlanStatus(String planStatus) { + this.planStatus = planStatus; + } + + + public PlanEntity planType(String planType) { + + this.planType = planType; + return this; + } + + /** + * Type of the plan. + * @return planType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Type of the plan.") + public String getPlanType() { + return planType; + } + + + public void setPlanType(String planType) { + this.planType = planType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlanEntity planEntity = (PlanEntity) o; + return Objects.equals(this.planCurrency, planEntity.planCurrency) && + Objects.equals(this.planId, planEntity.planId) && + Objects.equals(this.planIntervalType, planEntity.planIntervalType) && + Objects.equals(this.planIntervals, planEntity.planIntervals) && + Objects.equals(this.planMaxAmount, planEntity.planMaxAmount) && + Objects.equals(this.planMaxCycles, planEntity.planMaxCycles) && + Objects.equals(this.planName, planEntity.planName) && + Objects.equals(this.planNote, planEntity.planNote) && + Objects.equals(this.planRecurringAmount, planEntity.planRecurringAmount) && + Objects.equals(this.planStatus, planEntity.planStatus) && + Objects.equals(this.planType, planEntity.planType); + } + + @Override + public int hashCode() { + return Objects.hash(planCurrency, planId, planIntervalType, planIntervals, planMaxAmount, planMaxCycles, planName, planNote, planRecurringAmount, planStatus, planType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlanEntity {\n"); + sb.append(" planCurrency: ").append(toIndentedString(planCurrency)).append("\n"); + sb.append(" planId: ").append(toIndentedString(planId)).append("\n"); + sb.append(" planIntervalType: ").append(toIndentedString(planIntervalType)).append("\n"); + sb.append(" planIntervals: ").append(toIndentedString(planIntervals)).append("\n"); + sb.append(" planMaxAmount: ").append(toIndentedString(planMaxAmount)).append("\n"); + sb.append(" planMaxCycles: ").append(toIndentedString(planMaxCycles)).append("\n"); + sb.append(" planName: ").append(toIndentedString(planName)).append("\n"); + sb.append(" planNote: ").append(toIndentedString(planNote)).append("\n"); + sb.append(" planRecurringAmount: ").append(toIndentedString(planRecurringAmount)).append("\n"); + sb.append(" planStatus: ").append(toIndentedString(planStatus)).append("\n"); + sb.append(" planType: ").append(toIndentedString(planType)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("plan_currency"); + openapiFields.add("plan_id"); + openapiFields.add("plan_interval_type"); + openapiFields.add("plan_intervals"); + openapiFields.add("plan_max_amount"); + openapiFields.add("plan_max_cycles"); + openapiFields.add("plan_name"); + openapiFields.add("plan_note"); + openapiFields.add("plan_recurring_amount"); + openapiFields.add("plan_status"); + openapiFields.add("plan_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PlanEntity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_name") != null && !jsonObj.get("plan_name").isJsonNull()) && !jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + if ((jsonObj.get("plan_status") != null && !jsonObj.get("plan_status").isJsonNull()) && !jsonObj.get("plan_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_status").toString())); + } + if ((jsonObj.get("plan_type") != null && !jsonObj.get("plan_type").isJsonNull()) && !jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PlanEntity + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("plan_currency") != null && !jsonObj.get("plan_currency").isJsonNull()) && !jsonObj.get("plan_currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_currency").toString())); + } + if ((jsonObj.get("plan_id") != null && !jsonObj.get("plan_id").isJsonNull()) && !jsonObj.get("plan_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_id").toString())); + } + if ((jsonObj.get("plan_interval_type") != null && !jsonObj.get("plan_interval_type").isJsonNull()) && !jsonObj.get("plan_interval_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_interval_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_interval_type").toString())); + } + if ((jsonObj.get("plan_name") != null && !jsonObj.get("plan_name").isJsonNull()) && !jsonObj.get("plan_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_name").toString())); + } + if ((jsonObj.get("plan_note") != null && !jsonObj.get("plan_note").isJsonNull()) && !jsonObj.get("plan_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_note").toString())); + } + if ((jsonObj.get("plan_status") != null && !jsonObj.get("plan_status").isJsonNull()) && !jsonObj.get("plan_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_status").toString())); + } + if ((jsonObj.get("plan_type") != null && !jsonObj.get("plan_type").isJsonNull()) && !jsonObj.get("plan_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `plan_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("plan_type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PlanEntity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PlanEntity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PlanEntity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PlanEntity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PlanEntity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PlanEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of PlanEntity + * @throws IOException if the JSON string is invalid with respect to PlanEntity + */ + public static PlanEntity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PlanEntity.class); + } + + /** + * Convert an instance of PlanEntity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/RateLimitError.java b/src/main/java/com/cashfree/model/RateLimitError.java index 3ff23c38..7e5e7d28 100644 --- a/src/main/java/com/cashfree/model/RateLimitError.java +++ b/src/main/java/com/cashfree/model/RateLimitError.java @@ -52,7 +52,7 @@ * Error when rate limit is breached for your api */ @Schema(description = "Error when rate limit is breached for your api") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class RateLimitError { public static final String SERIALIZED_NAME_MESSAGE = "message"; @SerializedName(SERIALIZED_NAME_MESSAGE) diff --git a/src/main/java/com/cashfree/model/ReconEntity.java b/src/main/java/com/cashfree/model/ReconEntity.java index edbb005c..f9175e1b 100644 --- a/src/main/java/com/cashfree/model/ReconEntity.java +++ b/src/main/java/com/cashfree/model/ReconEntity.java @@ -55,7 +55,7 @@ * Settlement detailed recon response */ @Schema(description = "Settlement detailed recon response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ReconEntity { public static final String SERIALIZED_NAME_CURSOR = "cursor"; @SerializedName(SERIALIZED_NAME_CURSOR) diff --git a/src/main/java/com/cashfree/model/ReconEntityDataInner.java b/src/main/java/com/cashfree/model/ReconEntityDataInner.java index 0d91e82d..4bdfecf4 100644 --- a/src/main/java/com/cashfree/model/ReconEntityDataInner.java +++ b/src/main/java/com/cashfree/model/ReconEntityDataInner.java @@ -52,7 +52,7 @@ /** * ReconEntityDataInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ReconEntityDataInner { public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) diff --git a/src/main/java/com/cashfree/model/RefundEntity.java b/src/main/java/com/cashfree/model/RefundEntity.java index 2a6e0c89..d9fd8c48 100644 --- a/src/main/java/com/cashfree/model/RefundEntity.java +++ b/src/main/java/com/cashfree/model/RefundEntity.java @@ -57,7 +57,7 @@ * The refund entity */ @Schema(description = "The refund entity") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class RefundEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/RefundSpeed.java b/src/main/java/com/cashfree/model/RefundSpeed.java index 58a8097e..4699629d 100644 --- a/src/main/java/com/cashfree/model/RefundSpeed.java +++ b/src/main/java/com/cashfree/model/RefundSpeed.java @@ -52,7 +52,7 @@ * How fast refund has to be proecessed */ @Schema(description = "How fast refund has to be proecessed") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class RefundSpeed { public static final String SERIALIZED_NAME_REQUESTED = "requested"; @SerializedName(SERIALIZED_NAME_REQUESTED) diff --git a/src/main/java/com/cashfree/model/RefundWebhook.java b/src/main/java/com/cashfree/model/RefundWebhook.java index 628a4f18..d340f92e 100644 --- a/src/main/java/com/cashfree/model/RefundWebhook.java +++ b/src/main/java/com/cashfree/model/RefundWebhook.java @@ -53,7 +53,7 @@ * refund webhook object */ @Schema(description = "refund webhook object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class RefundWebhook { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/com/cashfree/model/RefundWebhookDataEntity.java b/src/main/java/com/cashfree/model/RefundWebhookDataEntity.java index 7ec637b2..4eedfe0f 100644 --- a/src/main/java/com/cashfree/model/RefundWebhookDataEntity.java +++ b/src/main/java/com/cashfree/model/RefundWebhookDataEntity.java @@ -53,7 +53,7 @@ * data entity in webhook */ @Schema(description = "data entity in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class RefundWebhookDataEntity { public static final String SERIALIZED_NAME_REFUND = "refund"; @SerializedName(SERIALIZED_NAME_REFUND) diff --git a/src/main/java/com/cashfree/model/SavedInstrumentMeta.java b/src/main/java/com/cashfree/model/SavedInstrumentMeta.java index 81c5faa6..2d5f72ef 100644 --- a/src/main/java/com/cashfree/model/SavedInstrumentMeta.java +++ b/src/main/java/com/cashfree/model/SavedInstrumentMeta.java @@ -52,7 +52,7 @@ * Card instrument meta information */ @Schema(description = "Card instrument meta information") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SavedInstrumentMeta { public static final String SERIALIZED_NAME_CARD_NETWORK = "card_network"; @SerializedName(SERIALIZED_NAME_CARD_NETWORK) diff --git a/src/main/java/com/cashfree/model/ScheduleOption.java b/src/main/java/com/cashfree/model/ScheduleOption.java index 9423ff16..75b31a29 100644 --- a/src/main/java/com/cashfree/model/ScheduleOption.java +++ b/src/main/java/com/cashfree/model/ScheduleOption.java @@ -52,7 +52,7 @@ /** * ScheduleOption */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class ScheduleOption { public static final String SERIALIZED_NAME_SETTLEMENT_SCHEDULE_MESSAGE = "settlement_schedule_message"; @SerializedName(SERIALIZED_NAME_SETTLEMENT_SCHEDULE_MESSAGE) diff --git a/src/main/java/com/cashfree/model/SettlementEntity.java b/src/main/java/com/cashfree/model/SettlementEntity.java index 21017bc7..41a3de8f 100644 --- a/src/main/java/com/cashfree/model/SettlementEntity.java +++ b/src/main/java/com/cashfree/model/SettlementEntity.java @@ -53,7 +53,7 @@ * Settlement entity object */ @Schema(description = "Settlement entity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/SettlementFetchReconRequest.java b/src/main/java/com/cashfree/model/SettlementFetchReconRequest.java index 476bce3d..78a4acaf 100644 --- a/src/main/java/com/cashfree/model/SettlementFetchReconRequest.java +++ b/src/main/java/com/cashfree/model/SettlementFetchReconRequest.java @@ -54,7 +54,7 @@ * Recon Request Object */ @Schema(description = "Recon Request Object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementFetchReconRequest { public static final String SERIALIZED_NAME_PAGINATION = "pagination"; @SerializedName(SERIALIZED_NAME_PAGINATION) diff --git a/src/main/java/com/cashfree/model/SettlementReconEntity.java b/src/main/java/com/cashfree/model/SettlementReconEntity.java index 9da1b778..2d01b64b 100644 --- a/src/main/java/com/cashfree/model/SettlementReconEntity.java +++ b/src/main/java/com/cashfree/model/SettlementReconEntity.java @@ -55,7 +55,7 @@ * Recon object for settlement */ @Schema(description = "Recon object for settlement") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementReconEntity { public static final String SERIALIZED_NAME_CURSOR = "cursor"; @SerializedName(SERIALIZED_NAME_CURSOR) diff --git a/src/main/java/com/cashfree/model/SettlementReconEntityDataInner.java b/src/main/java/com/cashfree/model/SettlementReconEntityDataInner.java index 10282dbe..38afe2a5 100644 --- a/src/main/java/com/cashfree/model/SettlementReconEntityDataInner.java +++ b/src/main/java/com/cashfree/model/SettlementReconEntityDataInner.java @@ -52,7 +52,7 @@ /** * SettlementReconEntityDataInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementReconEntityDataInner { public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; @SerializedName(SERIALIZED_NAME_EVENT_ID) diff --git a/src/main/java/com/cashfree/model/SettlementWebhook.java b/src/main/java/com/cashfree/model/SettlementWebhook.java index 9ba0593c..30bd2468 100644 --- a/src/main/java/com/cashfree/model/SettlementWebhook.java +++ b/src/main/java/com/cashfree/model/SettlementWebhook.java @@ -53,7 +53,7 @@ * Settlement webhook object */ @Schema(description = "Settlement webhook object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementWebhook { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) diff --git a/src/main/java/com/cashfree/model/SettlementWebhookDataEntity.java b/src/main/java/com/cashfree/model/SettlementWebhookDataEntity.java index 825f616d..3e2232a0 100644 --- a/src/main/java/com/cashfree/model/SettlementWebhookDataEntity.java +++ b/src/main/java/com/cashfree/model/SettlementWebhookDataEntity.java @@ -53,7 +53,7 @@ * data entity in webhook */ @Schema(description = "data entity in webhook") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SettlementWebhookDataEntity { public static final String SERIALIZED_NAME_SETTLEMENT = "settlement"; @SerializedName(SERIALIZED_NAME_SETTLEMENT) diff --git a/src/main/java/com/cashfree/model/SimulateRequest.java b/src/main/java/com/cashfree/model/SimulateRequest.java new file mode 100644 index 00000000..e3c7a093 --- /dev/null +++ b/src/main/java/com/cashfree/model/SimulateRequest.java @@ -0,0 +1,349 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.EntitySimulationRequest; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * simulate payment request object + */ +@Schema(description = "simulate payment request object") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SimulateRequest { + /** + * Entity type should be PAYMENTS only. + */ + @JsonAdapter(EntityEnum.Adapter.class) + public enum EntityEnum { + PAYMENTS("PAYMENTS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EntityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EntityEnum fromValue(String value) { + for (EntityEnum b : EntityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ENTITY = "entity"; + @SerializedName(SERIALIZED_NAME_ENTITY) + private EntityEnum entity; + + public static final String SERIALIZED_NAME_ENTITY_ID = "entity_id"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + private String entityId; + + public static final String SERIALIZED_NAME_ENTITY_SIMULATION = "entity_simulation"; + @SerializedName(SERIALIZED_NAME_ENTITY_SIMULATION) + private EntitySimulationRequest entitySimulation; + + public SimulateRequest() { + } + + public SimulateRequest entity(EntityEnum entity) { + + this.entity = entity; + return this; + } + + /** + * Entity type should be PAYMENTS only. + * @return entity + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Entity type should be PAYMENTS only.") + public EntityEnum getEntity() { + return entity; + } + + + public void setEntity(EntityEnum entity) { + this.entity = entity; + } + + + public SimulateRequest entityId(String entityId) { + + this.entityId = entityId; + return this; + } + + /** + * In case of Entity type is PAYMENTS, entity_id will be transactionId + * @return entityId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "In case of Entity type is PAYMENTS, entity_id will be transactionId") + public String getEntityId() { + return entityId; + } + + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + + public SimulateRequest entitySimulation(EntitySimulationRequest entitySimulation) { + + this.entitySimulation = entitySimulation; + return this; + } + + /** + * Get entitySimulation + * @return entitySimulation + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public EntitySimulationRequest getEntitySimulation() { + return entitySimulation; + } + + + public void setEntitySimulation(EntitySimulationRequest entitySimulation) { + this.entitySimulation = entitySimulation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimulateRequest simulateRequest = (SimulateRequest) o; + return Objects.equals(this.entity, simulateRequest.entity) && + Objects.equals(this.entityId, simulateRequest.entityId) && + Objects.equals(this.entitySimulation, simulateRequest.entitySimulation); + } + + @Override + public int hashCode() { + return Objects.hash(entity, entityId, entitySimulation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimulateRequest {\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" entitySimulation: ").append(toIndentedString(entitySimulation)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("entity"); + openapiFields.add("entity_id"); + openapiFields.add("entity_simulation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("entity"); + openapiRequiredFields.add("entity_id"); + openapiRequiredFields.add("entity_simulation"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimulateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimulateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + if (!jsonObj.get("entity_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_id").toString())); + } + // validate the required field `entity_simulation` + EntitySimulationRequest.validateJsonElement(jsonObj.get("entity_simulation")); + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimulateRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimulateRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + if (!jsonObj.get("entity_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_id").toString())); + } + // validate the required field `entity_simulation` + EntitySimulationRequest.validateJsonElement(jsonObj.get("entity_simulation")); + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimulateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimulateRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SimulateRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SimulateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SimulateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SimulateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimulateRequest + * @throws IOException if the JSON string is invalid with respect to SimulateRequest + */ + public static SimulateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimulateRequest.class); + } + + /** + * Convert an instance of SimulateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SimulationResponse.java b/src/main/java/com/cashfree/model/SimulationResponse.java new file mode 100644 index 00000000..7c88ea83 --- /dev/null +++ b/src/main/java/com/cashfree/model/SimulationResponse.java @@ -0,0 +1,325 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.EntitySimulationResponse; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Simulation response object + */ +@Schema(description = "Simulation response object") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SimulationResponse { + public static final String SERIALIZED_NAME_SIMULATION_ID = "simulation_id"; + @SerializedName(SERIALIZED_NAME_SIMULATION_ID) + private String simulationId; + + public static final String SERIALIZED_NAME_ENTITY = "entity"; + @SerializedName(SERIALIZED_NAME_ENTITY) + private String entity; + + public static final String SERIALIZED_NAME_ENTITY_ID = "entity_id"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + private String entityId; + + public static final String SERIALIZED_NAME_ENTITY_SIMULATION = "entity_simulation"; + @SerializedName(SERIALIZED_NAME_ENTITY_SIMULATION) + private EntitySimulationResponse entitySimulation; + + public SimulationResponse() { + } + + public SimulationResponse simulationId(String simulationId) { + + this.simulationId = simulationId; + return this; + } + + /** + * Get simulationId + * @return simulationId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getSimulationId() { + return simulationId; + } + + + public void setSimulationId(String simulationId) { + this.simulationId = simulationId; + } + + + public SimulationResponse entity(String entity) { + + this.entity = entity; + return this; + } + + /** + * Get entity + * @return entity + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getEntity() { + return entity; + } + + + public void setEntity(String entity) { + this.entity = entity; + } + + + public SimulationResponse entityId(String entityId) { + + this.entityId = entityId; + return this; + } + + /** + * Get entityId + * @return entityId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getEntityId() { + return entityId; + } + + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + + public SimulationResponse entitySimulation(EntitySimulationResponse entitySimulation) { + + this.entitySimulation = entitySimulation; + return this; + } + + /** + * Get entitySimulation + * @return entitySimulation + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public EntitySimulationResponse getEntitySimulation() { + return entitySimulation; + } + + + public void setEntitySimulation(EntitySimulationResponse entitySimulation) { + this.entitySimulation = entitySimulation; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimulationResponse simulationResponse = (SimulationResponse) o; + return Objects.equals(this.simulationId, simulationResponse.simulationId) && + Objects.equals(this.entity, simulationResponse.entity) && + Objects.equals(this.entityId, simulationResponse.entityId) && + Objects.equals(this.entitySimulation, simulationResponse.entitySimulation); + } + + @Override + public int hashCode() { + return Objects.hash(simulationId, entity, entityId, entitySimulation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimulationResponse {\n"); + sb.append(" simulationId: ").append(toIndentedString(simulationId)).append("\n"); + sb.append(" entity: ").append(toIndentedString(entity)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" entitySimulation: ").append(toIndentedString(entitySimulation)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("simulation_id"); + openapiFields.add("entity"); + openapiFields.add("entity_id"); + openapiFields.add("entity_simulation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimulationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("simulation_id") != null && !jsonObj.get("simulation_id").isJsonNull()) && !jsonObj.get("simulation_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `simulation_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("simulation_id").toString())); + } + if ((jsonObj.get("entity") != null && !jsonObj.get("entity").isJsonNull()) && !jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + if ((jsonObj.get("entity_id") != null && !jsonObj.get("entity_id").isJsonNull()) && !jsonObj.get("entity_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_id").toString())); + } + // validate the optional field `entity_simulation` + if (jsonObj.get("entity_simulation") != null && !jsonObj.get("entity_simulation").isJsonNull()) { + EntitySimulationResponse.validateJsonElement(jsonObj.get("entity_simulation")); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SimulationResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("simulation_id") != null && !jsonObj.get("simulation_id").isJsonNull()) && !jsonObj.get("simulation_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `simulation_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("simulation_id").toString())); + } + if ((jsonObj.get("entity") != null && !jsonObj.get("entity").isJsonNull()) && !jsonObj.get("entity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + } + if ((jsonObj.get("entity_id") != null && !jsonObj.get("entity_id").isJsonNull()) && !jsonObj.get("entity_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_id").toString())); + } + // validate the optional field `entity_simulation` + if (jsonObj.get("entity_simulation") != null && !jsonObj.get("entity_simulation").isJsonNull()) { + EntitySimulationResponse.validateJsonElement(jsonObj.get("entity_simulation")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SimulationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimulationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SimulationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SimulationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SimulationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SimulationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimulationResponse + * @throws IOException if the JSON string is invalid with respect to SimulationResponse + */ + public static SimulationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimulationResponse.class); + } + + /** + * Convert an instance of SimulationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SplitAfterPaymentRequest.java b/src/main/java/com/cashfree/model/SplitAfterPaymentRequest.java index 72c361fc..5d30fb64 100644 --- a/src/main/java/com/cashfree/model/SplitAfterPaymentRequest.java +++ b/src/main/java/com/cashfree/model/SplitAfterPaymentRequest.java @@ -55,7 +55,7 @@ * Split After Payment Request */ @Schema(description = "Split After Payment Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SplitAfterPaymentRequest { public static final String SERIALIZED_NAME_SPLIT = "split"; @SerializedName(SERIALIZED_NAME_SPLIT) diff --git a/src/main/java/com/cashfree/model/SplitAfterPaymentRequestSplitInner.java b/src/main/java/com/cashfree/model/SplitAfterPaymentRequestSplitInner.java index 9448a6ef..465c3957 100644 --- a/src/main/java/com/cashfree/model/SplitAfterPaymentRequestSplitInner.java +++ b/src/main/java/com/cashfree/model/SplitAfterPaymentRequestSplitInner.java @@ -54,7 +54,7 @@ /** * SplitAfterPaymentRequestSplitInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SplitAfterPaymentRequestSplitInner { public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; @SerializedName(SERIALIZED_NAME_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/SplitAfterPaymentResponse.java b/src/main/java/com/cashfree/model/SplitAfterPaymentResponse.java index d1fa156b..d37e8ecc 100644 --- a/src/main/java/com/cashfree/model/SplitAfterPaymentResponse.java +++ b/src/main/java/com/cashfree/model/SplitAfterPaymentResponse.java @@ -52,7 +52,7 @@ * Split After Payment Response */ @Schema(description = "Split After Payment Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class SplitAfterPaymentResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) diff --git a/src/main/java/com/cashfree/model/StaticSplitRequest.java b/src/main/java/com/cashfree/model/StaticSplitRequest.java index b2810171..2564422c 100644 --- a/src/main/java/com/cashfree/model/StaticSplitRequest.java +++ b/src/main/java/com/cashfree/model/StaticSplitRequest.java @@ -56,7 +56,7 @@ * Static Split Request */ @Schema(description = "Static Split Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class StaticSplitRequest { public static final String SERIALIZED_NAME_ACTIVE = "active"; @SerializedName(SERIALIZED_NAME_ACTIVE) diff --git a/src/main/java/com/cashfree/model/StaticSplitRequestSchemeInner.java b/src/main/java/com/cashfree/model/StaticSplitRequestSchemeInner.java index 0b82e58d..0134e67c 100644 --- a/src/main/java/com/cashfree/model/StaticSplitRequestSchemeInner.java +++ b/src/main/java/com/cashfree/model/StaticSplitRequestSchemeInner.java @@ -51,7 +51,7 @@ /** * StaticSplitRequestSchemeInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class StaticSplitRequestSchemeInner { public static final String SERIALIZED_NAME_MERCHANT_VENDOR_ID = "merchantVendorId"; @SerializedName(SERIALIZED_NAME_MERCHANT_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/StaticSplitResponse.java b/src/main/java/com/cashfree/model/StaticSplitResponse.java index 9e085995..abd2b5bb 100644 --- a/src/main/java/com/cashfree/model/StaticSplitResponse.java +++ b/src/main/java/com/cashfree/model/StaticSplitResponse.java @@ -56,7 +56,7 @@ * Static Split Response */ @Schema(description = "Static Split Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class StaticSplitResponse { public static final String SERIALIZED_NAME_ACTIVE = "active"; @SerializedName(SERIALIZED_NAME_ACTIVE) diff --git a/src/main/java/com/cashfree/model/StaticSplitResponseSchemeInner.java b/src/main/java/com/cashfree/model/StaticSplitResponseSchemeInner.java index 4db93a51..eeb52f46 100644 --- a/src/main/java/com/cashfree/model/StaticSplitResponseSchemeInner.java +++ b/src/main/java/com/cashfree/model/StaticSplitResponseSchemeInner.java @@ -51,7 +51,7 @@ /** * StaticSplitResponseSchemeInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class StaticSplitResponseSchemeInner { public static final String SERIALIZED_NAME_MERCHANT_VENDOR_ID = "merchantVendorId"; @SerializedName(SERIALIZED_NAME_MERCHANT_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/SubsCreatePayment200Response.java b/src/main/java/com/cashfree/model/SubsCreatePayment200Response.java new file mode 100644 index 00000000..7dc10247 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubsCreatePayment200Response.java @@ -0,0 +1,283 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.CreateSubscriptionPaymentAuthResponse; +import com.cashfree.model.CreateSubscriptionPaymentAuthResponseFailureDetails; +import com.cashfree.model.CreateSubscriptionPaymentChargeResponse; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.cashfree.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubsCreatePayment200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SubsCreatePayment200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubsCreatePayment200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubsCreatePayment200Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCreateSubscriptionPaymentAuthResponse = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentAuthResponse.class)); + final TypeAdapter adapterCreateSubscriptionPaymentChargeResponse = gson.getDelegateAdapter(this, TypeToken.get(CreateSubscriptionPaymentChargeResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubsCreatePayment200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `CreateSubscriptionPaymentAuthResponse` + if (value.getActualInstance() instanceof CreateSubscriptionPaymentAuthResponse) { + JsonElement element = adapterCreateSubscriptionPaymentAuthResponse.toJsonTree((CreateSubscriptionPaymentAuthResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `CreateSubscriptionPaymentChargeResponse` + if (value.getActualInstance() instanceof CreateSubscriptionPaymentChargeResponse) { + JsonElement element = adapterCreateSubscriptionPaymentChargeResponse.toJsonTree((CreateSubscriptionPaymentChargeResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse"); + } + + @Override + public SubsCreatePayment200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CreateSubscriptionPaymentAuthResponse + try { + // validate the JSON object to see if any exception is thrown + if(CreateSubscriptionPaymentAuthResponse.validateJsonElementForOneOf(jsonElement)) { + actualAdapter = adapterCreateSubscriptionPaymentAuthResponse; + } + match++; + log.log(Level.FINER, "Input data matches schema 'CreateSubscriptionPaymentAuthResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateSubscriptionPaymentAuthResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateSubscriptionPaymentAuthResponse'", e); + } + // deserialize CreateSubscriptionPaymentChargeResponse + try { + // validate the JSON object to see if any exception is thrown + if(CreateSubscriptionPaymentChargeResponse.validateJsonElementForOneOf(jsonElement)) { + actualAdapter = adapterCreateSubscriptionPaymentChargeResponse; + } + match++; + log.log(Level.FINER, "Input data matches schema 'CreateSubscriptionPaymentChargeResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CreateSubscriptionPaymentChargeResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CreateSubscriptionPaymentChargeResponse'", e); + } + + // if (match == 1) { + SubsCreatePayment200Response ret = new SubsCreatePayment200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + // } + + // throw new IOException(String.format("Failed deserialization for SubsCreatePayment200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public SubsCreatePayment200Response() { + super("oneOf", Boolean.FALSE); + } + + public SubsCreatePayment200Response(CreateSubscriptionPaymentAuthResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SubsCreatePayment200Response(CreateSubscriptionPaymentChargeResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateSubscriptionPaymentAuthResponse", CreateSubscriptionPaymentAuthResponse.class); + schemas.put("CreateSubscriptionPaymentChargeResponse", CreateSubscriptionPaymentChargeResponse.class); + } + + @Override + public Map> getSchemas() { + return SubsCreatePayment200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CreateSubscriptionPaymentAuthResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CreateSubscriptionPaymentChargeResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse"); + } + + /** + * Get the actual instance, which can be the following: + * CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse + * + * @return The actual instance (CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateSubscriptionPaymentAuthResponse`. If the actual instance is not `CreateSubscriptionPaymentAuthResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateSubscriptionPaymentAuthResponse` + * @throws ClassCastException if the instance is not `CreateSubscriptionPaymentAuthResponse` + */ + public CreateSubscriptionPaymentAuthResponse getCreateSubscriptionPaymentAuthResponse() throws ClassCastException { + return (CreateSubscriptionPaymentAuthResponse)super.getActualInstance(); + } + /** + * Get the actual instance of `CreateSubscriptionPaymentChargeResponse`. If the actual instance is not `CreateSubscriptionPaymentChargeResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CreateSubscriptionPaymentChargeResponse` + * @throws ClassCastException if the instance is not `CreateSubscriptionPaymentChargeResponse` + */ + public CreateSubscriptionPaymentChargeResponse getCreateSubscriptionPaymentChargeResponse() throws ClassCastException { + return (CreateSubscriptionPaymentChargeResponse)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubsCreatePayment200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with CreateSubscriptionPaymentAuthResponse + try { + CreateSubscriptionPaymentAuthResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateSubscriptionPaymentAuthResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CreateSubscriptionPaymentChargeResponse + try { + CreateSubscriptionPaymentChargeResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CreateSubscriptionPaymentChargeResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // if (validCount != 1) { + // throw new IOException(String.format("The JSON string is invalid for SubsCreatePayment200Response with oneOf schemas: CreateSubscriptionPaymentAuthResponse, CreateSubscriptionPaymentChargeResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + // } + } + + /** + * Create an instance of SubsCreatePayment200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubsCreatePayment200Response + * @throws IOException if the JSON string is invalid with respect to SubsCreatePayment200Response + */ + public static SubsCreatePayment200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubsCreatePayment200Response.class); + } + + /** + * Convert an instance of SubsCreatePayment200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionBankDetails.java b/src/main/java/com/cashfree/model/SubscriptionBankDetails.java new file mode 100644 index 00000000..46f32c27 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionBankDetails.java @@ -0,0 +1,298 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Bank details object + */ +@Schema(description = "Bank details object") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionBankDetails { + public static final String SERIALIZED_NAME_BANK_ID = "bank_id"; + @SerializedName(SERIALIZED_NAME_BANK_ID) + private String bankId; + + public static final String SERIALIZED_NAME_BANK_NAME = "bank_name"; + @SerializedName(SERIALIZED_NAME_BANK_NAME) + private String bankName; + + public static final String SERIALIZED_NAME_ACCOUNT_AUTH_MODES = "account_auth_modes"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_AUTH_MODES) + private List accountAuthModes; + + public SubscriptionBankDetails() { + } + + public SubscriptionBankDetails bankId(String bankId) { + + this.bankId = bankId; + return this; + } + + /** + * ID of the bank. + * @return bankId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "ID of the bank.") + public String getBankId() { + return bankId; + } + + + public void setBankId(String bankId) { + this.bankId = bankId; + } + + + public SubscriptionBankDetails bankName(String bankName) { + + this.bankName = bankName; + return this; + } + + /** + * Name of the bank. + * @return bankName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the bank.") + public String getBankName() { + return bankName; + } + + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + + public SubscriptionBankDetails accountAuthModes(List accountAuthModes) { + + this.accountAuthModes = accountAuthModes; + return this; + } + + public SubscriptionBankDetails addAccountAuthModesItem(String accountAuthModesItem) { + if (this.accountAuthModes == null) { + this.accountAuthModes = new ArrayList<>(); + } + this.accountAuthModes.add(accountAuthModesItem); + return this; + } + + /** + * List of account authentication modes supported by the bank. (e.g. DEBIT_CARD, NET_BANKING, AADHAAR) + * @return accountAuthModes + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of account authentication modes supported by the bank. (e.g. DEBIT_CARD, NET_BANKING, AADHAAR)") + public List getAccountAuthModes() { + return accountAuthModes; + } + + + public void setAccountAuthModes(List accountAuthModes) { + this.accountAuthModes = accountAuthModes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionBankDetails subscriptionBankDetails = (SubscriptionBankDetails) o; + return Objects.equals(this.bankId, subscriptionBankDetails.bankId) && + Objects.equals(this.bankName, subscriptionBankDetails.bankName) && + Objects.equals(this.accountAuthModes, subscriptionBankDetails.accountAuthModes); + } + + @Override + public int hashCode() { + return Objects.hash(bankId, bankName, accountAuthModes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionBankDetails {\n"); + sb.append(" bankId: ").append(toIndentedString(bankId)).append("\n"); + sb.append(" bankName: ").append(toIndentedString(bankName)).append("\n"); + sb.append(" accountAuthModes: ").append(toIndentedString(accountAuthModes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bank_id"); + openapiFields.add("bank_name"); + openapiFields.add("account_auth_modes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionBankDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bank_id") != null && !jsonObj.get("bank_id").isJsonNull()) && !jsonObj.get("bank_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_id").toString())); + } + if ((jsonObj.get("bank_name") != null && !jsonObj.get("bank_name").isJsonNull()) && !jsonObj.get("bank_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_name").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("account_auth_modes") != null && !jsonObj.get("account_auth_modes").isJsonNull() && !jsonObj.get("account_auth_modes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `account_auth_modes` to be an array in the JSON string but got `%s`", jsonObj.get("account_auth_modes").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionBankDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("bank_id") != null && !jsonObj.get("bank_id").isJsonNull()) && !jsonObj.get("bank_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_id").toString())); + } + if ((jsonObj.get("bank_name") != null && !jsonObj.get("bank_name").isJsonNull()) && !jsonObj.get("bank_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bank_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bank_name").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("account_auth_modes") != null && !jsonObj.get("account_auth_modes").isJsonNull() && !jsonObj.get("account_auth_modes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `account_auth_modes` to be an array in the JSON string but got `%s`", jsonObj.get("account_auth_modes").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionBankDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionBankDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionBankDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionBankDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionBankDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionBankDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionBankDetails + * @throws IOException if the JSON string is invalid with respect to SubscriptionBankDetails + */ + public static SubscriptionBankDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionBankDetails.class); + } + + /** + * Convert an instance of SubscriptionBankDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionCustomerDetails.java b/src/main/java/com/cashfree/model/SubscriptionCustomerDetails.java new file mode 100644 index 00000000..2ac6458d --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionCustomerDetails.java @@ -0,0 +1,477 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Subscription customer details. + */ +@Schema(description = "Subscription customer details.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionCustomerDetails { + public static final String SERIALIZED_NAME_CUSTOMER_NAME = "customer_name"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_NAME) + private String customerName; + + public static final String SERIALIZED_NAME_CUSTOMER_EMAIL = "customer_email"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_EMAIL) + private String customerEmail; + + public static final String SERIALIZED_NAME_CUSTOMER_PHONE = "customer_phone"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_PHONE) + private String customerPhone; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_HOLDER_NAME = "customer_bank_account_holder_name"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_HOLDER_NAME) + private String customerBankAccountHolderName; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER = "customer_bank_account_number"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_NUMBER) + private String customerBankAccountNumber; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_IFSC = "customer_bank_ifsc"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_IFSC) + private String customerBankIfsc; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_CODE = "customer_bank_code"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_CODE) + private String customerBankCode; + + public static final String SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_TYPE = "customer_bank_account_type"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_BANK_ACCOUNT_TYPE) + private String customerBankAccountType; + + public SubscriptionCustomerDetails() { + } + + public SubscriptionCustomerDetails customerName(String customerName) { + + this.customerName = customerName; + return this; + } + + /** + * Name of the customer. + * @return customerName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Name of the customer.") + public String getCustomerName() { + return customerName; + } + + + public void setCustomerName(String customerName) { + this.customerName = customerName; + } + + + public SubscriptionCustomerDetails customerEmail(String customerEmail) { + + this.customerEmail = customerEmail; + return this; + } + + /** + * Email of the customer. + * @return customerEmail + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Email of the customer.") + public String getCustomerEmail() { + return customerEmail; + } + + + public void setCustomerEmail(String customerEmail) { + this.customerEmail = customerEmail; + } + + + public SubscriptionCustomerDetails customerPhone(String customerPhone) { + + this.customerPhone = customerPhone; + return this; + } + + /** + * Phone number of the customer. + * @return customerPhone + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Phone number of the customer.") + public String getCustomerPhone() { + return customerPhone; + } + + + public void setCustomerPhone(String customerPhone) { + this.customerPhone = customerPhone; + } + + + public SubscriptionCustomerDetails customerBankAccountHolderName(String customerBankAccountHolderName) { + + this.customerBankAccountHolderName = customerBankAccountHolderName; + return this; + } + + /** + * Bank holder name of the customer. + * @return customerBankAccountHolderName + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Bank holder name of the customer.") + public String getCustomerBankAccountHolderName() { + return customerBankAccountHolderName; + } + + + public void setCustomerBankAccountHolderName(String customerBankAccountHolderName) { + this.customerBankAccountHolderName = customerBankAccountHolderName; + } + + + public SubscriptionCustomerDetails customerBankAccountNumber(String customerBankAccountNumber) { + + this.customerBankAccountNumber = customerBankAccountNumber; + return this; + } + + /** + * Bank account number of the customer. + * @return customerBankAccountNumber + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Bank account number of the customer.") + public String getCustomerBankAccountNumber() { + return customerBankAccountNumber; + } + + + public void setCustomerBankAccountNumber(String customerBankAccountNumber) { + this.customerBankAccountNumber = customerBankAccountNumber; + } + + + public SubscriptionCustomerDetails customerBankIfsc(String customerBankIfsc) { + + this.customerBankIfsc = customerBankIfsc; + return this; + } + + /** + * IFSC code of the customer. + * @return customerBankIfsc + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "IFSC code of the customer.") + public String getCustomerBankIfsc() { + return customerBankIfsc; + } + + + public void setCustomerBankIfsc(String customerBankIfsc) { + this.customerBankIfsc = customerBankIfsc; + } + + + public SubscriptionCustomerDetails customerBankCode(String customerBankCode) { + + this.customerBankCode = customerBankCode; + return this; + } + + /** + * Bank code of the customer. + * @return customerBankCode + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Bank code of the customer.") + public String getCustomerBankCode() { + return customerBankCode; + } + + + public void setCustomerBankCode(String customerBankCode) { + this.customerBankCode = customerBankCode; + } + + + public SubscriptionCustomerDetails customerBankAccountType(String customerBankAccountType) { + + this.customerBankAccountType = customerBankAccountType; + return this; + } + + /** + * Bank account type of the customer. + * @return customerBankAccountType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Bank account type of the customer.") + public String getCustomerBankAccountType() { + return customerBankAccountType; + } + + + public void setCustomerBankAccountType(String customerBankAccountType) { + this.customerBankAccountType = customerBankAccountType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionCustomerDetails subscriptionCustomerDetails = (SubscriptionCustomerDetails) o; + return Objects.equals(this.customerName, subscriptionCustomerDetails.customerName) && + Objects.equals(this.customerEmail, subscriptionCustomerDetails.customerEmail) && + Objects.equals(this.customerPhone, subscriptionCustomerDetails.customerPhone) && + Objects.equals(this.customerBankAccountHolderName, subscriptionCustomerDetails.customerBankAccountHolderName) && + Objects.equals(this.customerBankAccountNumber, subscriptionCustomerDetails.customerBankAccountNumber) && + Objects.equals(this.customerBankIfsc, subscriptionCustomerDetails.customerBankIfsc) && + Objects.equals(this.customerBankCode, subscriptionCustomerDetails.customerBankCode) && + Objects.equals(this.customerBankAccountType, subscriptionCustomerDetails.customerBankAccountType); + } + + @Override + public int hashCode() { + return Objects.hash(customerName, customerEmail, customerPhone, customerBankAccountHolderName, customerBankAccountNumber, customerBankIfsc, customerBankCode, customerBankAccountType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionCustomerDetails {\n"); + sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n"); + sb.append(" customerEmail: ").append(toIndentedString(customerEmail)).append("\n"); + sb.append(" customerPhone: ").append(toIndentedString(customerPhone)).append("\n"); + sb.append(" customerBankAccountHolderName: ").append(toIndentedString(customerBankAccountHolderName)).append("\n"); + sb.append(" customerBankAccountNumber: ").append(toIndentedString(customerBankAccountNumber)).append("\n"); + sb.append(" customerBankIfsc: ").append(toIndentedString(customerBankIfsc)).append("\n"); + sb.append(" customerBankCode: ").append(toIndentedString(customerBankCode)).append("\n"); + sb.append(" customerBankAccountType: ").append(toIndentedString(customerBankAccountType)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("customer_name"); + openapiFields.add("customer_email"); + openapiFields.add("customer_phone"); + openapiFields.add("customer_bank_account_holder_name"); + openapiFields.add("customer_bank_account_number"); + openapiFields.add("customer_bank_ifsc"); + openapiFields.add("customer_bank_code"); + openapiFields.add("customer_bank_account_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("customer_email"); + openapiRequiredFields.add("customer_phone"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionCustomerDetails + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionCustomerDetails.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); + } + if (!jsonObj.get("customer_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_email").toString())); + } + if (!jsonObj.get("customer_phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_phone").toString())); + } + if ((jsonObj.get("customer_bank_account_holder_name") != null && !jsonObj.get("customer_bank_account_holder_name").isJsonNull()) && !jsonObj.get("customer_bank_account_holder_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_holder_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_holder_name").toString())); + } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } + if ((jsonObj.get("customer_bank_code") != null && !jsonObj.get("customer_bank_code").isJsonNull()) && !jsonObj.get("customer_bank_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_code").toString())); + } + if ((jsonObj.get("customer_bank_account_type") != null && !jsonObj.get("customer_bank_account_type").isJsonNull()) && !jsonObj.get("customer_bank_account_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_type").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionCustomerDetails + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionCustomerDetails.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("customer_name") != null && !jsonObj.get("customer_name").isJsonNull()) && !jsonObj.get("customer_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_name").toString())); + } + if (!jsonObj.get("customer_email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_email").toString())); + } + if (!jsonObj.get("customer_phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_phone").toString())); + } + if ((jsonObj.get("customer_bank_account_holder_name") != null && !jsonObj.get("customer_bank_account_holder_name").isJsonNull()) && !jsonObj.get("customer_bank_account_holder_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_holder_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_holder_name").toString())); + } + if ((jsonObj.get("customer_bank_account_number") != null && !jsonObj.get("customer_bank_account_number").isJsonNull()) && !jsonObj.get("customer_bank_account_number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_number").toString())); + } + if ((jsonObj.get("customer_bank_ifsc") != null && !jsonObj.get("customer_bank_ifsc").isJsonNull()) && !jsonObj.get("customer_bank_ifsc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_ifsc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_ifsc").toString())); + } + if ((jsonObj.get("customer_bank_code") != null && !jsonObj.get("customer_bank_code").isJsonNull()) && !jsonObj.get("customer_bank_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_code").toString())); + } + if ((jsonObj.get("customer_bank_account_type") != null && !jsonObj.get("customer_bank_account_type").isJsonNull()) && !jsonObj.get("customer_bank_account_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `customer_bank_account_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customer_bank_account_type").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionCustomerDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionCustomerDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionCustomerDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionCustomerDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionCustomerDetails read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionCustomerDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionCustomerDetails + * @throws IOException if the JSON string is invalid with respect to SubscriptionCustomerDetails + */ + public static SubscriptionCustomerDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionCustomerDetails.class); + } + + /** + * Convert an instance of SubscriptionCustomerDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEligibilityRequest.java b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequest.java new file mode 100644 index 00000000..6455b579 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequest.java @@ -0,0 +1,269 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.SubscriptionEligibilityRequestFilters; +import com.cashfree.model.SubscriptionEligibilityRequestQueries; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Request body to fetch subscription eligibile payment method details. + */ +@Schema(description = "Request body to fetch subscription eligibile payment method details.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEligibilityRequest { + public static final String SERIALIZED_NAME_QUERIES = "queries"; + @SerializedName(SERIALIZED_NAME_QUERIES) + private SubscriptionEligibilityRequestQueries queries; + + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private SubscriptionEligibilityRequestFilters filters; + + public SubscriptionEligibilityRequest() { + } + + public SubscriptionEligibilityRequest queries(SubscriptionEligibilityRequestQueries queries) { + + this.queries = queries; + return this; + } + + /** + * Get queries + * @return queries + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "") + public SubscriptionEligibilityRequestQueries getQueries() { + return queries; + } + + + public void setQueries(SubscriptionEligibilityRequestQueries queries) { + this.queries = queries; + } + + + public SubscriptionEligibilityRequest filters(SubscriptionEligibilityRequestFilters filters) { + + this.filters = filters; + return this; + } + + /** + * Get filters + * @return filters + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SubscriptionEligibilityRequestFilters getFilters() { + return filters; + } + + + public void setFilters(SubscriptionEligibilityRequestFilters filters) { + this.filters = filters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEligibilityRequest subscriptionEligibilityRequest = (SubscriptionEligibilityRequest) o; + return Objects.equals(this.queries, subscriptionEligibilityRequest.queries) && + Objects.equals(this.filters, subscriptionEligibilityRequest.filters); + } + + @Override + public int hashCode() { + return Objects.hash(queries, filters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEligibilityRequest {\n"); + sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("queries"); + openapiFields.add("filters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("queries"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionEligibilityRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `queries` + SubscriptionEligibilityRequestQueries.validateJsonElement(jsonObj.get("queries")); + // validate the optional field `filters` + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + SubscriptionEligibilityRequestFilters.validateJsonElement(jsonObj.get("filters")); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequest + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionEligibilityRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `queries` + SubscriptionEligibilityRequestQueries.validateJsonElement(jsonObj.get("queries")); + // validate the optional field `filters` + if (jsonObj.get("filters") != null && !jsonObj.get("filters").isJsonNull()) { + SubscriptionEligibilityRequestFilters.validateJsonElement(jsonObj.get("filters")); + return true; + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEligibilityRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEligibilityRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEligibilityRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEligibilityRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEligibilityRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEligibilityRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEligibilityRequest + * @throws IOException if the JSON string is invalid with respect to SubscriptionEligibilityRequest + */ + public static SubscriptionEligibilityRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEligibilityRequest.class); + } + + /** + * Convert an instance of SubscriptionEligibilityRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestFilters.java b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestFilters.java new file mode 100644 index 00000000..ac9981d3 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestFilters.java @@ -0,0 +1,228 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Filters to refine eligible payment method selection. + */ +@Schema(description = "Filters to refine eligible payment method selection.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEligibilityRequestFilters { + public static final String SERIALIZED_NAME_PAYMENT_METHODS = "payment_methods"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHODS) + private List paymentMethods; + + public SubscriptionEligibilityRequestFilters() { + } + + public SubscriptionEligibilityRequestFilters paymentMethods(List paymentMethods) { + + this.paymentMethods = paymentMethods; + return this; + } + + public SubscriptionEligibilityRequestFilters addPaymentMethodsItem(String paymentMethodsItem) { + if (this.paymentMethods == null) { + this.paymentMethods = new ArrayList<>(); + } + this.paymentMethods.add(paymentMethodsItem); + return this; + } + + /** + * Possbile values in array - enach, pnach, upi, card. + * @return paymentMethods + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Possbile values in array - enach, pnach, upi, card.") + public List getPaymentMethods() { + return paymentMethods; + } + + + public void setPaymentMethods(List paymentMethods) { + this.paymentMethods = paymentMethods; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEligibilityRequestFilters subscriptionEligibilityRequestFilters = (SubscriptionEligibilityRequestFilters) o; + return Objects.equals(this.paymentMethods, subscriptionEligibilityRequestFilters.paymentMethods); + } + + @Override + public int hashCode() { + return Objects.hash(paymentMethods); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEligibilityRequestFilters {\n"); + sb.append(" paymentMethods: ").append(toIndentedString(paymentMethods)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payment_methods"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequestFilters + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("payment_methods") != null && !jsonObj.get("payment_methods").isJsonNull() && !jsonObj.get("payment_methods").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_methods` to be an array in the JSON string but got `%s`", jsonObj.get("payment_methods").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequestFilters + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("payment_methods") != null && !jsonObj.get("payment_methods").isJsonNull() && !jsonObj.get("payment_methods").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_methods` to be an array in the JSON string but got `%s`", jsonObj.get("payment_methods").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEligibilityRequestFilters.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEligibilityRequestFilters' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEligibilityRequestFilters.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEligibilityRequestFilters value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEligibilityRequestFilters read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEligibilityRequestFilters given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEligibilityRequestFilters + * @throws IOException if the JSON string is invalid with respect to SubscriptionEligibilityRequestFilters + */ + public static SubscriptionEligibilityRequestFilters fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEligibilityRequestFilters.class); + } + + /** + * Convert an instance of SubscriptionEligibilityRequestFilters to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestQueries.java b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestQueries.java new file mode 100644 index 00000000..56da23f2 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEligibilityRequestQueries.java @@ -0,0 +1,231 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Necessary parameters to fetch eligible payment methods. + */ +@Schema(description = "Necessary parameters to fetch eligible payment methods.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEligibilityRequestQueries { + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public SubscriptionEligibilityRequestQueries() { + } + + public SubscriptionEligibilityRequestQueries subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription + * @return subscriptionId + **/ + @javax.annotation.Nonnull + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A unique ID passed by merchant for identifying the subscription") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEligibilityRequestQueries subscriptionEligibilityRequestQueries = (SubscriptionEligibilityRequestQueries) o; + return Objects.equals(this.subscriptionId, subscriptionEligibilityRequestQueries.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEligibilityRequestQueries {\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("subscription_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("subscription_id"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequestQueries + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionEligibilityRequestQueries.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityRequestQueries + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SubscriptionEligibilityRequestQueries.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEligibilityRequestQueries.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEligibilityRequestQueries' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEligibilityRequestQueries.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEligibilityRequestQueries value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEligibilityRequestQueries read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEligibilityRequestQueries given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEligibilityRequestQueries + * @throws IOException if the JSON string is invalid with respect to SubscriptionEligibilityRequestQueries + */ + public static SubscriptionEligibilityRequestQueries fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEligibilityRequestQueries.class); + } + + /** + * Convert an instance of SubscriptionEligibilityRequestQueries to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEligibilityResponse.java b/src/main/java/com/cashfree/model/SubscriptionEligibilityResponse.java new file mode 100644 index 00000000..ae2db00c --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEligibilityResponse.java @@ -0,0 +1,249 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.EligibilityMethodItem; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Subscrition eligibility API response + */ +@Schema(description = "Subscrition eligibility API response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEligibilityResponse { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private List type; + + public SubscriptionEligibilityResponse() { + } + + public SubscriptionEligibilityResponse type(List type) { + + this.type = type; + return this; + } + + public SubscriptionEligibilityResponse addTypeItem(EligibilityMethodItem typeItem) { + if (this.type == null) { + this.type = new ArrayList<>(); + } + this.type.add(typeItem); + return this; + } + + /** + * List of eligibile payment methods for the subscription. + * @return type + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "List of eligibile payment methods for the subscription.") + public List getType() { + return type; + } + + + public void setType(List type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEligibilityResponse subscriptionEligibilityResponse = (SubscriptionEligibilityResponse) o; + return Objects.equals(this.type, subscriptionEligibilityResponse.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEligibilityResponse {\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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + JsonArray jsonArraytype = jsonObj.getAsJsonArray("type"); + if (jsonArraytype != null) { + // ensure the json data is an array + if (!jsonObj.get("type").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be an array in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + + // validate the optional field `type` (array) + for (int i = 0; i < jsonArraytype.size(); i++) { + EligibilityMethodItem.validateJsonElement(jsonArraytype.get(i)); + }; + } + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEligibilityResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + JsonArray jsonArraytype = jsonObj.getAsJsonArray("type"); + if (jsonArraytype != null) { + // ensure the json data is an array + if (!jsonObj.get("type").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be an array in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + + // validate the optional field `type` (array) + for (int i = 0; i < jsonArraytype.size(); i++) { + EligibilityMethodItem.validateJsonElement(jsonArraytype.get(i)); + }; + } + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEligibilityResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEligibilityResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEligibilityResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEligibilityResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEligibilityResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEligibilityResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEligibilityResponse + * @throws IOException if the JSON string is invalid with respect to SubscriptionEligibilityResponse + */ + public static SubscriptionEligibilityResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEligibilityResponse.class); + } + + /** + * Convert an instance of SubscriptionEligibilityResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEntity.java b/src/main/java/com/cashfree/model/SubscriptionEntity.java new file mode 100644 index 00000000..12b1f7d6 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEntity.java @@ -0,0 +1,644 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AuthorizationDetails; +import com.cashfree.model.PlanEntity; +import com.cashfree.model.SubscriptionCustomerDetails; +import com.cashfree.model.SubscriptionEntitySubscriptionMeta; +import com.cashfree.model.SubscriptionPaymentSplitItem; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The response returned for Get, Create or Manage Subscription APIs. + */ +@Schema(description = "The response returned for Get, Create or Manage Subscription APIs.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEntity { + public static final String SERIALIZED_NAME_AUTHORISATION_DETAILS = "authorisation_details"; + @SerializedName(SERIALIZED_NAME_AUTHORISATION_DETAILS) + private AuthorizationDetails authorisationDetails; + + public static final String SERIALIZED_NAME_CF_SUBSCRIPTION_ID = "cf_subscription_id"; + @SerializedName(SERIALIZED_NAME_CF_SUBSCRIPTION_ID) + private String cfSubscriptionId; + + public static final String SERIALIZED_NAME_CUSTOMER_DETAILS = "customer_details"; + @SerializedName(SERIALIZED_NAME_CUSTOMER_DETAILS) + private SubscriptionCustomerDetails customerDetails; + + public static final String SERIALIZED_NAME_PLAN_DETAILS = "plan_details"; + @SerializedName(SERIALIZED_NAME_PLAN_DETAILS) + private PlanEntity planDetails; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_EXPIRY_TIME = "subscription_expiry_time"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_EXPIRY_TIME) + private String subscriptionExpiryTime; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_FIRST_CHARGE_TIME = "subscription_first_charge_time"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_FIRST_CHARGE_TIME) + private String subscriptionFirstChargeTime; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_META = "subscription_meta"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_META) + private SubscriptionEntitySubscriptionMeta subscriptionMeta; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_NOTE = "subscription_note"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_NOTE) + private String subscriptionNote; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_PAYMENT_SPLITS = "subscription_payment_splits"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_PAYMENT_SPLITS) + private List subscriptionPaymentSplits; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_STATUS = "subscription_status"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_STATUS) + private String subscriptionStatus; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_TAGS = "subscription_tags"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_TAGS) + private Object subscriptionTags; + + public SubscriptionEntity() { + } + + public SubscriptionEntity authorisationDetails(AuthorizationDetails authorisationDetails) { + + this.authorisationDetails = authorisationDetails; + return this; + } + + /** + * Get authorisationDetails + * @return authorisationDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AuthorizationDetails getAuthorisationDetails() { + return authorisationDetails; + } + + + public void setAuthorisationDetails(AuthorizationDetails authorisationDetails) { + this.authorisationDetails = authorisationDetails; + } + + + public SubscriptionEntity cfSubscriptionId(String cfSubscriptionId) { + + this.cfSubscriptionId = cfSubscriptionId; + return this; + } + + /** + * Cashfree subscription reference number + * @return cfSubscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription reference number") + public String getCfSubscriptionId() { + return cfSubscriptionId; + } + + + public void setCfSubscriptionId(String cfSubscriptionId) { + this.cfSubscriptionId = cfSubscriptionId; + } + + + public SubscriptionEntity customerDetails(SubscriptionCustomerDetails customerDetails) { + + this.customerDetails = customerDetails; + return this; + } + + /** + * Get customerDetails + * @return customerDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SubscriptionCustomerDetails getCustomerDetails() { + return customerDetails; + } + + + public void setCustomerDetails(SubscriptionCustomerDetails customerDetails) { + this.customerDetails = customerDetails; + } + + + public SubscriptionEntity planDetails(PlanEntity planDetails) { + + this.planDetails = planDetails; + return this; + } + + /** + * Get planDetails + * @return planDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public PlanEntity getPlanDetails() { + return planDetails; + } + + + public void setPlanDetails(PlanEntity planDetails) { + this.planDetails = planDetails; + } + + + public SubscriptionEntity subscriptionExpiryTime(String subscriptionExpiryTime) { + + this.subscriptionExpiryTime = subscriptionExpiryTime; + return this; + } + + /** + * Time at which the subscription will expire. + * @return subscriptionExpiryTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Time at which the subscription will expire.") + public String getSubscriptionExpiryTime() { + return subscriptionExpiryTime; + } + + + public void setSubscriptionExpiryTime(String subscriptionExpiryTime) { + this.subscriptionExpiryTime = subscriptionExpiryTime; + } + + + public SubscriptionEntity subscriptionFirstChargeTime(String subscriptionFirstChargeTime) { + + this.subscriptionFirstChargeTime = subscriptionFirstChargeTime; + return this; + } + + /** + * Time at which the first charge will be made for the subscription. Applicable only for PERIODIC plans. + * @return subscriptionFirstChargeTime + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Time at which the first charge will be made for the subscription. Applicable only for PERIODIC plans.") + public String getSubscriptionFirstChargeTime() { + return subscriptionFirstChargeTime; + } + + + public void setSubscriptionFirstChargeTime(String subscriptionFirstChargeTime) { + this.subscriptionFirstChargeTime = subscriptionFirstChargeTime; + } + + + public SubscriptionEntity subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + public SubscriptionEntity subscriptionMeta(SubscriptionEntitySubscriptionMeta subscriptionMeta) { + + this.subscriptionMeta = subscriptionMeta; + return this; + } + + /** + * Get subscriptionMeta + * @return subscriptionMeta + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public SubscriptionEntitySubscriptionMeta getSubscriptionMeta() { + return subscriptionMeta; + } + + + public void setSubscriptionMeta(SubscriptionEntitySubscriptionMeta subscriptionMeta) { + this.subscriptionMeta = subscriptionMeta; + } + + + public SubscriptionEntity subscriptionNote(String subscriptionNote) { + + this.subscriptionNote = subscriptionNote; + return this; + } + + /** + * Note for the subscription. + * @return subscriptionNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Note for the subscription.") + public String getSubscriptionNote() { + return subscriptionNote; + } + + + public void setSubscriptionNote(String subscriptionNote) { + this.subscriptionNote = subscriptionNote; + } + + + public SubscriptionEntity subscriptionPaymentSplits(List subscriptionPaymentSplits) { + + this.subscriptionPaymentSplits = subscriptionPaymentSplits; + return this; + } + + public SubscriptionEntity addSubscriptionPaymentSplitsItem(SubscriptionPaymentSplitItem subscriptionPaymentSplitsItem) { + if (this.subscriptionPaymentSplits == null) { + this.subscriptionPaymentSplits = new ArrayList<>(); + } + this.subscriptionPaymentSplits.add(subscriptionPaymentSplitsItem); + return this; + } + + /** + * Payment splits for the subscription. + * @return subscriptionPaymentSplits + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment splits for the subscription.") + public List getSubscriptionPaymentSplits() { + return subscriptionPaymentSplits; + } + + + public void setSubscriptionPaymentSplits(List subscriptionPaymentSplits) { + this.subscriptionPaymentSplits = subscriptionPaymentSplits; + } + + + public SubscriptionEntity subscriptionStatus(String subscriptionStatus) { + + this.subscriptionStatus = subscriptionStatus; + return this; + } + + /** + * Status of the subscription. + * @return subscriptionStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the subscription.") + public String getSubscriptionStatus() { + return subscriptionStatus; + } + + + public void setSubscriptionStatus(String subscriptionStatus) { + this.subscriptionStatus = subscriptionStatus; + } + + + public SubscriptionEntity subscriptionTags(Object subscriptionTags) { + + this.subscriptionTags = subscriptionTags; + return this; + } + + /** + * Tags for the subscription. + * @return subscriptionTags + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Tags for the subscription.") + public Object getSubscriptionTags() { + return subscriptionTags; + } + + + public void setSubscriptionTags(Object subscriptionTags) { + this.subscriptionTags = subscriptionTags; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEntity subscriptionEntity = (SubscriptionEntity) o; + return Objects.equals(this.authorisationDetails, subscriptionEntity.authorisationDetails) && + Objects.equals(this.cfSubscriptionId, subscriptionEntity.cfSubscriptionId) && + Objects.equals(this.customerDetails, subscriptionEntity.customerDetails) && + Objects.equals(this.planDetails, subscriptionEntity.planDetails) && + Objects.equals(this.subscriptionExpiryTime, subscriptionEntity.subscriptionExpiryTime) && + Objects.equals(this.subscriptionFirstChargeTime, subscriptionEntity.subscriptionFirstChargeTime) && + Objects.equals(this.subscriptionId, subscriptionEntity.subscriptionId) && + Objects.equals(this.subscriptionMeta, subscriptionEntity.subscriptionMeta) && + Objects.equals(this.subscriptionNote, subscriptionEntity.subscriptionNote) && + Objects.equals(this.subscriptionPaymentSplits, subscriptionEntity.subscriptionPaymentSplits) && + Objects.equals(this.subscriptionStatus, subscriptionEntity.subscriptionStatus) && + Objects.equals(this.subscriptionTags, subscriptionEntity.subscriptionTags); + } + + @Override + public int hashCode() { + return Objects.hash(authorisationDetails, cfSubscriptionId, customerDetails, planDetails, subscriptionExpiryTime, subscriptionFirstChargeTime, subscriptionId, subscriptionMeta, subscriptionNote, subscriptionPaymentSplits, subscriptionStatus, subscriptionTags); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEntity {\n"); + sb.append(" authorisationDetails: ").append(toIndentedString(authorisationDetails)).append("\n"); + sb.append(" cfSubscriptionId: ").append(toIndentedString(cfSubscriptionId)).append("\n"); + sb.append(" customerDetails: ").append(toIndentedString(customerDetails)).append("\n"); + sb.append(" planDetails: ").append(toIndentedString(planDetails)).append("\n"); + sb.append(" subscriptionExpiryTime: ").append(toIndentedString(subscriptionExpiryTime)).append("\n"); + sb.append(" subscriptionFirstChargeTime: ").append(toIndentedString(subscriptionFirstChargeTime)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).append("\n"); + sb.append(" subscriptionMeta: ").append(toIndentedString(subscriptionMeta)).append("\n"); + sb.append(" subscriptionNote: ").append(toIndentedString(subscriptionNote)).append("\n"); + sb.append(" subscriptionPaymentSplits: ").append(toIndentedString(subscriptionPaymentSplits)).append("\n"); + sb.append(" subscriptionStatus: ").append(toIndentedString(subscriptionStatus)).append("\n"); + sb.append(" subscriptionTags: ").append(toIndentedString(subscriptionTags)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authorisation_details"); + openapiFields.add("cf_subscription_id"); + openapiFields.add("customer_details"); + openapiFields.add("plan_details"); + openapiFields.add("subscription_expiry_time"); + openapiFields.add("subscription_first_charge_time"); + openapiFields.add("subscription_id"); + openapiFields.add("subscription_meta"); + openapiFields.add("subscription_note"); + openapiFields.add("subscription_payment_splits"); + openapiFields.add("subscription_status"); + openapiFields.add("subscription_tags"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEntity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `authorisation_details` + if (jsonObj.get("authorisation_details") != null && !jsonObj.get("authorisation_details").isJsonNull()) { + AuthorizationDetails.validateJsonElement(jsonObj.get("authorisation_details")); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `customer_details` + if (jsonObj.get("customer_details") != null && !jsonObj.get("customer_details").isJsonNull()) { + SubscriptionCustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + } + // validate the optional field `plan_details` + if (jsonObj.get("plan_details") != null && !jsonObj.get("plan_details").isJsonNull()) { + PlanEntity.validateJsonElement(jsonObj.get("plan_details")); + } + if ((jsonObj.get("subscription_expiry_time") != null && !jsonObj.get("subscription_expiry_time").isJsonNull()) && !jsonObj.get("subscription_expiry_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_expiry_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_expiry_time").toString())); + } + if ((jsonObj.get("subscription_first_charge_time") != null && !jsonObj.get("subscription_first_charge_time").isJsonNull()) && !jsonObj.get("subscription_first_charge_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_first_charge_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_first_charge_time").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + // validate the optional field `subscription_meta` + if (jsonObj.get("subscription_meta") != null && !jsonObj.get("subscription_meta").isJsonNull()) { + SubscriptionEntitySubscriptionMeta.validateJsonElement(jsonObj.get("subscription_meta")); + } + if ((jsonObj.get("subscription_note") != null && !jsonObj.get("subscription_note").isJsonNull()) && !jsonObj.get("subscription_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_note").toString())); + } + if (jsonObj.get("subscription_payment_splits") != null && !jsonObj.get("subscription_payment_splits").isJsonNull()) { + JsonArray jsonArraysubscriptionPaymentSplits = jsonObj.getAsJsonArray("subscription_payment_splits"); + if (jsonArraysubscriptionPaymentSplits != null) { + // ensure the json data is an array + if (!jsonObj.get("subscription_payment_splits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_payment_splits` to be an array in the JSON string but got `%s`", jsonObj.get("subscription_payment_splits").toString())); + } + + // validate the optional field `subscription_payment_splits` (array) + for (int i = 0; i < jsonArraysubscriptionPaymentSplits.size(); i++) { + SubscriptionPaymentSplitItem.validateJsonElement(jsonArraysubscriptionPaymentSplits.get(i)); + }; + } + } + if ((jsonObj.get("subscription_status") != null && !jsonObj.get("subscription_status").isJsonNull()) && !jsonObj.get("subscription_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_status").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEntity + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `authorisation_details` + if (jsonObj.get("authorisation_details") != null && !jsonObj.get("authorisation_details").isJsonNull()) { + AuthorizationDetails.validateJsonElement(jsonObj.get("authorisation_details")); + return true; + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + // validate the optional field `customer_details` + if (jsonObj.get("customer_details") != null && !jsonObj.get("customer_details").isJsonNull()) { + SubscriptionCustomerDetails.validateJsonElement(jsonObj.get("customer_details")); + return true; + } + // validate the optional field `plan_details` + if (jsonObj.get("plan_details") != null && !jsonObj.get("plan_details").isJsonNull()) { + PlanEntity.validateJsonElement(jsonObj.get("plan_details")); + return true; + } + if ((jsonObj.get("subscription_expiry_time") != null && !jsonObj.get("subscription_expiry_time").isJsonNull()) && !jsonObj.get("subscription_expiry_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_expiry_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_expiry_time").toString())); + } + if ((jsonObj.get("subscription_first_charge_time") != null && !jsonObj.get("subscription_first_charge_time").isJsonNull()) && !jsonObj.get("subscription_first_charge_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_first_charge_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_first_charge_time").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + // validate the optional field `subscription_meta` + if (jsonObj.get("subscription_meta") != null && !jsonObj.get("subscription_meta").isJsonNull()) { + SubscriptionEntitySubscriptionMeta.validateJsonElement(jsonObj.get("subscription_meta")); + return true; + } + if ((jsonObj.get("subscription_note") != null && !jsonObj.get("subscription_note").isJsonNull()) && !jsonObj.get("subscription_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_note").toString())); + } + if (jsonObj.get("subscription_payment_splits") != null && !jsonObj.get("subscription_payment_splits").isJsonNull()) { + JsonArray jsonArraysubscriptionPaymentSplits = jsonObj.getAsJsonArray("subscription_payment_splits"); + if (jsonArraysubscriptionPaymentSplits != null) { + // ensure the json data is an array + if (!jsonObj.get("subscription_payment_splits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_payment_splits` to be an array in the JSON string but got `%s`", jsonObj.get("subscription_payment_splits").toString())); + } + + // validate the optional field `subscription_payment_splits` (array) + for (int i = 0; i < jsonArraysubscriptionPaymentSplits.size(); i++) { + SubscriptionPaymentSplitItem.validateJsonElement(jsonArraysubscriptionPaymentSplits.get(i)); + }; + } + } + if ((jsonObj.get("subscription_status") != null && !jsonObj.get("subscription_status").isJsonNull()) && !jsonObj.get("subscription_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEntity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEntity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEntity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEntity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEntity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEntity + * @throws IOException if the JSON string is invalid with respect to SubscriptionEntity + */ + public static SubscriptionEntity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEntity.class); + } + + /** + * Convert an instance of SubscriptionEntity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionEntitySubscriptionMeta.java b/src/main/java/com/cashfree/model/SubscriptionEntitySubscriptionMeta.java new file mode 100644 index 00000000..7da8266f --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionEntitySubscriptionMeta.java @@ -0,0 +1,216 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Subscription metadata. + */ +@Schema(description = "Subscription metadata.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionEntitySubscriptionMeta { + public static final String SERIALIZED_NAME_RETURN_URL = "return_url"; + @SerializedName(SERIALIZED_NAME_RETURN_URL) + private String returnUrl; + + public SubscriptionEntitySubscriptionMeta() { + } + + public SubscriptionEntitySubscriptionMeta returnUrl(String returnUrl) { + + this.returnUrl = returnUrl; + return this; + } + + /** + * Return URL for the subscription. + * @return returnUrl + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Return URL for the subscription.") + public String getReturnUrl() { + return returnUrl; + } + + + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionEntitySubscriptionMeta subscriptionEntitySubscriptionMeta = (SubscriptionEntitySubscriptionMeta) o; + return Objects.equals(this.returnUrl, subscriptionEntitySubscriptionMeta.returnUrl); + } + + @Override + public int hashCode() { + return Objects.hash(returnUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionEntitySubscriptionMeta {\n"); + sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("return_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEntitySubscriptionMeta + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("return_url") != null && !jsonObj.get("return_url").isJsonNull()) && !jsonObj.get("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionEntitySubscriptionMeta + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("return_url") != null && !jsonObj.get("return_url").isJsonNull()) && !jsonObj.get("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionEntitySubscriptionMeta.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionEntitySubscriptionMeta' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionEntitySubscriptionMeta.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionEntitySubscriptionMeta value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionEntitySubscriptionMeta read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionEntitySubscriptionMeta given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionEntitySubscriptionMeta + * @throws IOException if the JSON string is invalid with respect to SubscriptionEntitySubscriptionMeta + */ + public static SubscriptionEntitySubscriptionMeta fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionEntitySubscriptionMeta.class); + } + + /** + * Convert an instance of SubscriptionEntitySubscriptionMeta to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionPaymentEntity.java b/src/main/java/com/cashfree/model/SubscriptionPaymentEntity.java new file mode 100644 index 00000000..106f4310 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionPaymentEntity.java @@ -0,0 +1,703 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +import com.cashfree.model.AuthorizationDetails; +import com.cashfree.model.CreateSubscriptionPaymentAuthResponseFailureDetails; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * The response returned in Get, Create or Manage Subscription Payment APIs. + */ +@Schema(description = "The response returned in Get, Create or Manage Subscription Payment APIs.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionPaymentEntity { + public static final String SERIALIZED_NAME_AUTHORIZATION_DETAILS = "authorization_details"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_DETAILS) + private AuthorizationDetails authorizationDetails; + + public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; + @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) + private String cfPaymentId; + + public static final String SERIALIZED_NAME_CF_SUBSCRIPTION_ID = "cf_subscription_id"; + @SerializedName(SERIALIZED_NAME_CF_SUBSCRIPTION_ID) + private String cfSubscriptionId; + + public static final String SERIALIZED_NAME_CF_TXN_ID = "cf_txn_id"; + @SerializedName(SERIALIZED_NAME_CF_TXN_ID) + private String cfTxnId; + + public static final String SERIALIZED_NAME_CF_ORDER_ID = "cf_order_id"; + @SerializedName(SERIALIZED_NAME_CF_ORDER_ID) + private String cfOrderId; + + public static final String SERIALIZED_NAME_FAILURE_DETAILS = "failure_details"; + @SerializedName(SERIALIZED_NAME_FAILURE_DETAILS) + private CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails; + + public static final String SERIALIZED_NAME_PAYMENT_AMOUNT = "payment_amount"; + @SerializedName(SERIALIZED_NAME_PAYMENT_AMOUNT) + private BigDecimal paymentAmount; + + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_PAYMENT_INITIATED_DATE = "payment_initiated_date"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INITIATED_DATE) + private String paymentInitiatedDate; + + public static final String SERIALIZED_NAME_PAYMENT_REMARKS = "payment_remarks"; + @SerializedName(SERIALIZED_NAME_PAYMENT_REMARKS) + private String paymentRemarks; + + public static final String SERIALIZED_NAME_PAYMENT_SCHEDULE_DATE = "payment_schedule_date"; + @SerializedName(SERIALIZED_NAME_PAYMENT_SCHEDULE_DATE) + private String paymentScheduleDate; + + public static final String SERIALIZED_NAME_PAYMENT_STATUS = "payment_status"; + @SerializedName(SERIALIZED_NAME_PAYMENT_STATUS) + private String paymentStatus; + + public static final String SERIALIZED_NAME_PAYMENT_TYPE = "payment_type"; + @SerializedName(SERIALIZED_NAME_PAYMENT_TYPE) + private String paymentType; + + public static final String SERIALIZED_NAME_RETRY_ATTEMPTS = "retry_attempts"; + @SerializedName(SERIALIZED_NAME_RETRY_ATTEMPTS) + private Integer retryAttempts; + + public static final String SERIALIZED_NAME_SUBSCRIPTION_ID = "subscription_id"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_ID) + private String subscriptionId; + + public SubscriptionPaymentEntity() { + } + + public SubscriptionPaymentEntity authorizationDetails(AuthorizationDetails authorizationDetails) { + + this.authorizationDetails = authorizationDetails; + return this; + } + + /** + * Get authorizationDetails + * @return authorizationDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public AuthorizationDetails getAuthorizationDetails() { + return authorizationDetails; + } + + + public void setAuthorizationDetails(AuthorizationDetails authorizationDetails) { + this.authorizationDetails = authorizationDetails; + } + + + public SubscriptionPaymentEntity cfPaymentId(String cfPaymentId) { + + this.cfPaymentId = cfPaymentId; + return this; + } + + /** + * Cashfree subscription payment reference number + * @return cfPaymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment reference number") + public String getCfPaymentId() { + return cfPaymentId; + } + + + public void setCfPaymentId(String cfPaymentId) { + this.cfPaymentId = cfPaymentId; + } + + + public SubscriptionPaymentEntity cfSubscriptionId(String cfSubscriptionId) { + + this.cfSubscriptionId = cfSubscriptionId; + return this; + } + + /** + * Cashfree subscription reference number + * @return cfSubscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription reference number") + public String getCfSubscriptionId() { + return cfSubscriptionId; + } + + + public void setCfSubscriptionId(String cfSubscriptionId) { + this.cfSubscriptionId = cfSubscriptionId; + } + + + public SubscriptionPaymentEntity cfTxnId(String cfTxnId) { + + this.cfTxnId = cfTxnId; + return this; + } + + /** + * Cashfree subscription payment transaction ID + * @return cfTxnId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment transaction ID") + public String getCfTxnId() { + return cfTxnId; + } + + + public void setCfTxnId(String cfTxnId) { + this.cfTxnId = cfTxnId; + } + + + public SubscriptionPaymentEntity cfOrderId(String cfOrderId) { + + this.cfOrderId = cfOrderId; + return this; + } + + /** + * Cashfree subscription payment order ID + * @return cfOrderId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment order ID") + public String getCfOrderId() { + return cfOrderId; + } + + + public void setCfOrderId(String cfOrderId) { + this.cfOrderId = cfOrderId; + } + + + public SubscriptionPaymentEntity failureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + + this.failureDetails = failureDetails; + return this; + } + + /** + * Get failureDetails + * @return failureDetails + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public CreateSubscriptionPaymentAuthResponseFailureDetails getFailureDetails() { + return failureDetails; + } + + + public void setFailureDetails(CreateSubscriptionPaymentAuthResponseFailureDetails failureDetails) { + this.failureDetails = failureDetails; + } + + + public SubscriptionPaymentEntity paymentAmount(BigDecimal paymentAmount) { + + this.paymentAmount = paymentAmount; + return this; + } + + /** + * The charge amount of the payment. + * @return paymentAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The charge amount of the payment.") + public BigDecimal getPaymentAmount() { + return paymentAmount; + } + + + public void setPaymentAmount(BigDecimal paymentAmount) { + this.paymentAmount = paymentAmount; + } + + + public SubscriptionPaymentEntity paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public SubscriptionPaymentEntity paymentInitiatedDate(String paymentInitiatedDate) { + + this.paymentInitiatedDate = paymentInitiatedDate; + return this; + } + + /** + * The date on which the payment was initiated. + * @return paymentInitiatedDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The date on which the payment was initiated.") + public String getPaymentInitiatedDate() { + return paymentInitiatedDate; + } + + + public void setPaymentInitiatedDate(String paymentInitiatedDate) { + this.paymentInitiatedDate = paymentInitiatedDate; + } + + + public SubscriptionPaymentEntity paymentRemarks(String paymentRemarks) { + + this.paymentRemarks = paymentRemarks; + return this; + } + + /** + * Payment remarks. + * @return paymentRemarks + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment remarks.") + public String getPaymentRemarks() { + return paymentRemarks; + } + + + public void setPaymentRemarks(String paymentRemarks) { + this.paymentRemarks = paymentRemarks; + } + + + public SubscriptionPaymentEntity paymentScheduleDate(String paymentScheduleDate) { + + this.paymentScheduleDate = paymentScheduleDate; + return this; + } + + /** + * The date on which the payment is scheduled to be processed. + * @return paymentScheduleDate + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The date on which the payment is scheduled to be processed.") + public String getPaymentScheduleDate() { + return paymentScheduleDate; + } + + + public void setPaymentScheduleDate(String paymentScheduleDate) { + this.paymentScheduleDate = paymentScheduleDate; + } + + + public SubscriptionPaymentEntity paymentStatus(String paymentStatus) { + + this.paymentStatus = paymentStatus; + return this; + } + + /** + * Status of the payment. + * @return paymentStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the payment.") + public String getPaymentStatus() { + return paymentStatus; + } + + + public void setPaymentStatus(String paymentStatus) { + this.paymentStatus = paymentStatus; + } + + + public SubscriptionPaymentEntity paymentType(String paymentType) { + + this.paymentType = paymentType; + return this; + } + + /** + * Payment type. Can be AUTH or CHARGE. + * @return paymentType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Payment type. Can be AUTH or CHARGE.") + public String getPaymentType() { + return paymentType; + } + + + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + + public SubscriptionPaymentEntity retryAttempts(Integer retryAttempts) { + + this.retryAttempts = retryAttempts; + return this; + } + + /** + * Retry attempts. + * @return retryAttempts + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Retry attempts.") + public Integer getRetryAttempts() { + return retryAttempts; + } + + + public void setRetryAttempts(Integer retryAttempts) { + this.retryAttempts = retryAttempts; + } + + + public SubscriptionPaymentEntity subscriptionId(String subscriptionId) { + + this.subscriptionId = subscriptionId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the subscription. + * @return subscriptionId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the subscription.") + public String getSubscriptionId() { + return subscriptionId; + } + + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionPaymentEntity subscriptionPaymentEntity = (SubscriptionPaymentEntity) o; + return Objects.equals(this.authorizationDetails, subscriptionPaymentEntity.authorizationDetails) && + Objects.equals(this.cfPaymentId, subscriptionPaymentEntity.cfPaymentId) && + Objects.equals(this.cfSubscriptionId, subscriptionPaymentEntity.cfSubscriptionId) && + Objects.equals(this.cfTxnId, subscriptionPaymentEntity.cfTxnId) && + Objects.equals(this.cfOrderId, subscriptionPaymentEntity.cfOrderId) && + Objects.equals(this.failureDetails, subscriptionPaymentEntity.failureDetails) && + Objects.equals(this.paymentAmount, subscriptionPaymentEntity.paymentAmount) && + Objects.equals(this.paymentId, subscriptionPaymentEntity.paymentId) && + Objects.equals(this.paymentInitiatedDate, subscriptionPaymentEntity.paymentInitiatedDate) && + Objects.equals(this.paymentRemarks, subscriptionPaymentEntity.paymentRemarks) && + Objects.equals(this.paymentScheduleDate, subscriptionPaymentEntity.paymentScheduleDate) && + Objects.equals(this.paymentStatus, subscriptionPaymentEntity.paymentStatus) && + Objects.equals(this.paymentType, subscriptionPaymentEntity.paymentType) && + Objects.equals(this.retryAttempts, subscriptionPaymentEntity.retryAttempts) && + Objects.equals(this.subscriptionId, subscriptionPaymentEntity.subscriptionId); + } + + @Override + public int hashCode() { + return Objects.hash(authorizationDetails, cfPaymentId, cfSubscriptionId, cfTxnId, cfOrderId, failureDetails, paymentAmount, paymentId, paymentInitiatedDate, paymentRemarks, paymentScheduleDate, paymentStatus, paymentType, retryAttempts, subscriptionId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionPaymentEntity {\n"); + sb.append(" authorizationDetails: ").append(toIndentedString(authorizationDetails)).append("\n"); + sb.append(" cfPaymentId: ").append(toIndentedString(cfPaymentId)).append("\n"); + sb.append(" cfSubscriptionId: ").append(toIndentedString(cfSubscriptionId)).append("\n"); + sb.append(" cfTxnId: ").append(toIndentedString(cfTxnId)).append("\n"); + sb.append(" cfOrderId: ").append(toIndentedString(cfOrderId)).append("\n"); + sb.append(" failureDetails: ").append(toIndentedString(failureDetails)).append("\n"); + sb.append(" paymentAmount: ").append(toIndentedString(paymentAmount)).append("\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" paymentInitiatedDate: ").append(toIndentedString(paymentInitiatedDate)).append("\n"); + sb.append(" paymentRemarks: ").append(toIndentedString(paymentRemarks)).append("\n"); + sb.append(" paymentScheduleDate: ").append(toIndentedString(paymentScheduleDate)).append("\n"); + sb.append(" paymentStatus: ").append(toIndentedString(paymentStatus)).append("\n"); + sb.append(" paymentType: ").append(toIndentedString(paymentType)).append("\n"); + sb.append(" retryAttempts: ").append(toIndentedString(retryAttempts)).append("\n"); + sb.append(" subscriptionId: ").append(toIndentedString(subscriptionId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authorization_details"); + openapiFields.add("cf_payment_id"); + openapiFields.add("cf_subscription_id"); + openapiFields.add("cf_txn_id"); + openapiFields.add("cf_order_id"); + openapiFields.add("failure_details"); + openapiFields.add("payment_amount"); + openapiFields.add("payment_id"); + openapiFields.add("payment_initiated_date"); + openapiFields.add("payment_remarks"); + openapiFields.add("payment_schedule_date"); + openapiFields.add("payment_status"); + openapiFields.add("payment_type"); + openapiFields.add("retry_attempts"); + openapiFields.add("subscription_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentEntity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `authorization_details` + if (jsonObj.get("authorization_details") != null && !jsonObj.get("authorization_details").isJsonNull()) { + AuthorizationDetails.validateJsonElement(jsonObj.get("authorization_details")); + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + if ((jsonObj.get("cf_txn_id") != null && !jsonObj.get("cf_txn_id").isJsonNull()) && !jsonObj.get("cf_txn_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_txn_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_txn_id").toString())); + } + if ((jsonObj.get("cf_order_id") != null && !jsonObj.get("cf_order_id").isJsonNull()) && !jsonObj.get("cf_order_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_order_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_order_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_remarks") != null && !jsonObj.get("payment_remarks").isJsonNull()) && !jsonObj.get("payment_remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_remarks").toString())); + } + if ((jsonObj.get("payment_schedule_date") != null && !jsonObj.get("payment_schedule_date").isJsonNull()) && !jsonObj.get("payment_schedule_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_schedule_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_schedule_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentEntity + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `authorization_details` + if (jsonObj.get("authorization_details") != null && !jsonObj.get("authorization_details").isJsonNull()) { + AuthorizationDetails.validateJsonElement(jsonObj.get("authorization_details")); + return true; + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("cf_subscription_id") != null && !jsonObj.get("cf_subscription_id").isJsonNull()) && !jsonObj.get("cf_subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_subscription_id").toString())); + } + if ((jsonObj.get("cf_txn_id") != null && !jsonObj.get("cf_txn_id").isJsonNull()) && !jsonObj.get("cf_txn_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_txn_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_txn_id").toString())); + } + if ((jsonObj.get("cf_order_id") != null && !jsonObj.get("cf_order_id").isJsonNull()) && !jsonObj.get("cf_order_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_order_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_order_id").toString())); + } + // validate the optional field `failure_details` + if (jsonObj.get("failure_details") != null && !jsonObj.get("failure_details").isJsonNull()) { + CreateSubscriptionPaymentAuthResponseFailureDetails.validateJsonElement(jsonObj.get("failure_details")); + return true; + } + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("payment_initiated_date") != null && !jsonObj.get("payment_initiated_date").isJsonNull()) && !jsonObj.get("payment_initiated_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_initiated_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_initiated_date").toString())); + } + if ((jsonObj.get("payment_remarks") != null && !jsonObj.get("payment_remarks").isJsonNull()) && !jsonObj.get("payment_remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_remarks").toString())); + } + if ((jsonObj.get("payment_schedule_date") != null && !jsonObj.get("payment_schedule_date").isJsonNull()) && !jsonObj.get("payment_schedule_date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_schedule_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_schedule_date").toString())); + } + if ((jsonObj.get("payment_status") != null && !jsonObj.get("payment_status").isJsonNull()) && !jsonObj.get("payment_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_status").toString())); + } + if ((jsonObj.get("payment_type") != null && !jsonObj.get("payment_type").isJsonNull()) && !jsonObj.get("payment_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_type").toString())); + } + if ((jsonObj.get("subscription_id") != null && !jsonObj.get("subscription_id").isJsonNull()) && !jsonObj.get("subscription_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscription_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscription_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionPaymentEntity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionPaymentEntity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionPaymentEntity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionPaymentEntity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionPaymentEntity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionPaymentEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionPaymentEntity + * @throws IOException if the JSON string is invalid with respect to SubscriptionPaymentEntity + */ + public static SubscriptionPaymentEntity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionPaymentEntity.class); + } + + /** + * Convert an instance of SubscriptionPaymentEntity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionPaymentRefundEntity.java b/src/main/java/com/cashfree/model/SubscriptionPaymentRefundEntity.java new file mode 100644 index 00000000..2d5575c3 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionPaymentRefundEntity.java @@ -0,0 +1,456 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Get/Create Subscription Payment Refund Response + */ +@Schema(description = "Get/Create Subscription Payment Refund Response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionPaymentRefundEntity { + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; + @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) + private String cfPaymentId; + + public static final String SERIALIZED_NAME_REFUND_ID = "refund_id"; + @SerializedName(SERIALIZED_NAME_REFUND_ID) + private String refundId; + + public static final String SERIALIZED_NAME_CF_REFUND_ID = "cf_refund_id"; + @SerializedName(SERIALIZED_NAME_CF_REFUND_ID) + private String cfRefundId; + + public static final String SERIALIZED_NAME_REFUND_AMOUNT = "refund_amount"; + @SerializedName(SERIALIZED_NAME_REFUND_AMOUNT) + private BigDecimal refundAmount; + + public static final String SERIALIZED_NAME_REFUND_NOTE = "refund_note"; + @SerializedName(SERIALIZED_NAME_REFUND_NOTE) + private String refundNote; + + public static final String SERIALIZED_NAME_REFUND_SPEED = "refund_speed"; + @SerializedName(SERIALIZED_NAME_REFUND_SPEED) + private String refundSpeed; + + public static final String SERIALIZED_NAME_REFUND_STATUS = "refund_status"; + @SerializedName(SERIALIZED_NAME_REFUND_STATUS) + private String refundStatus; + + public SubscriptionPaymentRefundEntity() { + } + + public SubscriptionPaymentRefundEntity paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the transaction. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the transaction.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public SubscriptionPaymentRefundEntity cfPaymentId(String cfPaymentId) { + + this.cfPaymentId = cfPaymentId; + return this; + } + + /** + * Cashfree subscription payment reference number. + * @return cfPaymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment reference number.") + public String getCfPaymentId() { + return cfPaymentId; + } + + + public void setCfPaymentId(String cfPaymentId) { + this.cfPaymentId = cfPaymentId; + } + + + public SubscriptionPaymentRefundEntity refundId(String refundId) { + + this.refundId = refundId; + return this; + } + + /** + * A unique ID passed by merchant for identifying the refund. + * @return refundId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "A unique ID passed by merchant for identifying the refund.") + public String getRefundId() { + return refundId; + } + + + public void setRefundId(String refundId) { + this.refundId = refundId; + } + + + public SubscriptionPaymentRefundEntity cfRefundId(String cfRefundId) { + + this.cfRefundId = cfRefundId; + return this; + } + + /** + * Cashfree subscription payment refund reference number. + * @return cfRefundId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Cashfree subscription payment refund reference number.") + public String getCfRefundId() { + return cfRefundId; + } + + + public void setCfRefundId(String cfRefundId) { + this.cfRefundId = cfRefundId; + } + + + public SubscriptionPaymentRefundEntity refundAmount(BigDecimal refundAmount) { + + this.refundAmount = refundAmount; + return this; + } + + /** + * The refund amount. + * @return refundAmount + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The refund amount.") + public BigDecimal getRefundAmount() { + return refundAmount; + } + + + public void setRefundAmount(BigDecimal refundAmount) { + this.refundAmount = refundAmount; + } + + + public SubscriptionPaymentRefundEntity refundNote(String refundNote) { + + this.refundNote = refundNote; + return this; + } + + /** + * Refund note. + * @return refundNote + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Refund note.") + public String getRefundNote() { + return refundNote; + } + + + public void setRefundNote(String refundNote) { + this.refundNote = refundNote; + } + + + public SubscriptionPaymentRefundEntity refundSpeed(String refundSpeed) { + + this.refundSpeed = refundSpeed; + return this; + } + + /** + * Refund speed. Can be INSTANT or NORMAL. + * @return refundSpeed + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Refund speed. Can be INSTANT or NORMAL.") + public String getRefundSpeed() { + return refundSpeed; + } + + + public void setRefundSpeed(String refundSpeed) { + this.refundSpeed = refundSpeed; + } + + + public SubscriptionPaymentRefundEntity refundStatus(String refundStatus) { + + this.refundStatus = refundStatus; + return this; + } + + /** + * Status of the refund. + * @return refundStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Status of the refund.") + public String getRefundStatus() { + return refundStatus; + } + + + public void setRefundStatus(String refundStatus) { + this.refundStatus = refundStatus; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionPaymentRefundEntity subscriptionPaymentRefundEntity = (SubscriptionPaymentRefundEntity) o; + return Objects.equals(this.paymentId, subscriptionPaymentRefundEntity.paymentId) && + Objects.equals(this.cfPaymentId, subscriptionPaymentRefundEntity.cfPaymentId) && + Objects.equals(this.refundId, subscriptionPaymentRefundEntity.refundId) && + Objects.equals(this.cfRefundId, subscriptionPaymentRefundEntity.cfRefundId) && + Objects.equals(this.refundAmount, subscriptionPaymentRefundEntity.refundAmount) && + Objects.equals(this.refundNote, subscriptionPaymentRefundEntity.refundNote) && + Objects.equals(this.refundSpeed, subscriptionPaymentRefundEntity.refundSpeed) && + Objects.equals(this.refundStatus, subscriptionPaymentRefundEntity.refundStatus); + } + + @Override + public int hashCode() { + return Objects.hash(paymentId, cfPaymentId, refundId, cfRefundId, refundAmount, refundNote, refundSpeed, refundStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionPaymentRefundEntity {\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" cfPaymentId: ").append(toIndentedString(cfPaymentId)).append("\n"); + sb.append(" refundId: ").append(toIndentedString(refundId)).append("\n"); + sb.append(" cfRefundId: ").append(toIndentedString(cfRefundId)).append("\n"); + sb.append(" refundAmount: ").append(toIndentedString(refundAmount)).append("\n"); + sb.append(" refundNote: ").append(toIndentedString(refundNote)).append("\n"); + sb.append(" refundSpeed: ").append(toIndentedString(refundSpeed)).append("\n"); + sb.append(" refundStatus: ").append(toIndentedString(refundStatus)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payment_id"); + openapiFields.add("cf_payment_id"); + openapiFields.add("refund_id"); + openapiFields.add("cf_refund_id"); + openapiFields.add("refund_amount"); + openapiFields.add("refund_note"); + openapiFields.add("refund_speed"); + openapiFields.add("refund_status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentRefundEntity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("refund_id") != null && !jsonObj.get("refund_id").isJsonNull()) && !jsonObj.get("refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_id").toString())); + } + if ((jsonObj.get("cf_refund_id") != null && !jsonObj.get("cf_refund_id").isJsonNull()) && !jsonObj.get("cf_refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_refund_id").toString())); + } + if ((jsonObj.get("refund_note") != null && !jsonObj.get("refund_note").isJsonNull()) && !jsonObj.get("refund_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_note").toString())); + } + if ((jsonObj.get("refund_speed") != null && !jsonObj.get("refund_speed").isJsonNull()) && !jsonObj.get("refund_speed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_speed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_speed").toString())); + } + if ((jsonObj.get("refund_status") != null && !jsonObj.get("refund_status").isJsonNull()) && !jsonObj.get("refund_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_status").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentRefundEntity + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("cf_payment_id") != null && !jsonObj.get("cf_payment_id").isJsonNull()) && !jsonObj.get("cf_payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_payment_id").toString())); + } + if ((jsonObj.get("refund_id") != null && !jsonObj.get("refund_id").isJsonNull()) && !jsonObj.get("refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_id").toString())); + } + if ((jsonObj.get("cf_refund_id") != null && !jsonObj.get("cf_refund_id").isJsonNull()) && !jsonObj.get("cf_refund_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cf_refund_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cf_refund_id").toString())); + } + if ((jsonObj.get("refund_note") != null && !jsonObj.get("refund_note").isJsonNull()) && !jsonObj.get("refund_note").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_note` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_note").toString())); + } + if ((jsonObj.get("refund_speed") != null && !jsonObj.get("refund_speed").isJsonNull()) && !jsonObj.get("refund_speed").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_speed` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_speed").toString())); + } + if ((jsonObj.get("refund_status") != null && !jsonObj.get("refund_status").isJsonNull()) && !jsonObj.get("refund_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refund_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refund_status").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionPaymentRefundEntity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionPaymentRefundEntity' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionPaymentRefundEntity.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionPaymentRefundEntity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionPaymentRefundEntity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionPaymentRefundEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionPaymentRefundEntity + * @throws IOException if the JSON string is invalid with respect to SubscriptionPaymentRefundEntity + */ + public static SubscriptionPaymentRefundEntity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionPaymentRefundEntity.class); + } + + /** + * Convert an instance of SubscriptionPaymentRefundEntity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/SubscriptionPaymentSplitItem.java b/src/main/java/com/cashfree/model/SubscriptionPaymentSplitItem.java new file mode 100644 index 00000000..61078db5 --- /dev/null +++ b/src/main/java/com/cashfree/model/SubscriptionPaymentSplitItem.java @@ -0,0 +1,246 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Subscription Payment Split Item + */ +@Schema(description = "Subscription Payment Split Item") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class SubscriptionPaymentSplitItem { + public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; + @SerializedName(SERIALIZED_NAME_VENDOR_ID) + private String vendorId; + + public static final String SERIALIZED_NAME_PERCENTAGE = "percentage"; + @SerializedName(SERIALIZED_NAME_PERCENTAGE) + private BigDecimal percentage; + + public SubscriptionPaymentSplitItem() { + } + + public SubscriptionPaymentSplitItem vendorId(String vendorId) { + + this.vendorId = vendorId; + return this; + } + + /** + * Vendor ID + * @return vendorId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Vendor ID") + public String getVendorId() { + return vendorId; + } + + + public void setVendorId(String vendorId) { + this.vendorId = vendorId; + } + + + public SubscriptionPaymentSplitItem percentage(BigDecimal percentage) { + + this.percentage = percentage; + return this; + } + + /** + * Percentage of the payment to be split to vendor + * @return percentage + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Percentage of the payment to be split to vendor") + public BigDecimal getPercentage() { + return percentage; + } + + + public void setPercentage(BigDecimal percentage) { + this.percentage = percentage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubscriptionPaymentSplitItem subscriptionPaymentSplitItem = (SubscriptionPaymentSplitItem) o; + return Objects.equals(this.vendorId, subscriptionPaymentSplitItem.vendorId) && + Objects.equals(this.percentage, subscriptionPaymentSplitItem.percentage); + } + + @Override + public int hashCode() { + return Objects.hash(vendorId, percentage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubscriptionPaymentSplitItem {\n"); + sb.append(" vendorId: ").append(toIndentedString(vendorId)).append("\n"); + sb.append(" percentage: ").append(toIndentedString(percentage)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("vendor_id"); + openapiFields.add("percentage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentSplitItem + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor_id") != null && !jsonObj.get("vendor_id").isJsonNull()) && !jsonObj.get("vendor_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor_id").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubscriptionPaymentSplitItem + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor_id") != null && !jsonObj.get("vendor_id").isJsonNull()) && !jsonObj.get("vendor_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor_id").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubscriptionPaymentSplitItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubscriptionPaymentSplitItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubscriptionPaymentSplitItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubscriptionPaymentSplitItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubscriptionPaymentSplitItem read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubscriptionPaymentSplitItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubscriptionPaymentSplitItem + * @throws IOException if the JSON string is invalid with respect to SubscriptionPaymentSplitItem + */ + public static SubscriptionPaymentSplitItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubscriptionPaymentSplitItem.class); + } + + /** + * Convert an instance of SubscriptionPaymentSplitItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/TerminalDetails.java b/src/main/java/com/cashfree/model/TerminalDetails.java index 50d6c502..5f722a47 100644 --- a/src/main/java/com/cashfree/model/TerminalDetails.java +++ b/src/main/java/com/cashfree/model/TerminalDetails.java @@ -52,7 +52,7 @@ * Use this if you are creating an order for cashfree's softPOS */ @Schema(description = "Use this if you are creating an order for cashfree's softPOS") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TerminalDetails { public static final String SERIALIZED_NAME_ADDED_ON = "added_on"; @SerializedName(SERIALIZED_NAME_ADDED_ON) @@ -195,8 +195,8 @@ public TerminalDetails terminalId(String terminalId) { * terminal id for merchant reference * @return terminalId **/ - @javax.annotation.Nonnull - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "terminal id for merchant reference") + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "terminal id for merchant reference") public String getTerminalId() { return terminalId; } @@ -393,7 +393,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("terminal_id"); openapiRequiredFields.add("terminal_phone_no"); openapiRequiredFields.add("terminal_type"); } @@ -426,7 +425,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("terminal_address") != null && !jsonObj.get("terminal_address").isJsonNull()) && !jsonObj.get("terminal_address").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `terminal_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_address").toString())); } - if (!jsonObj.get("terminal_id").isJsonPrimitive()) { + if ((jsonObj.get("terminal_id") != null && !jsonObj.get("terminal_id").isJsonNull()) && !jsonObj.get("terminal_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `terminal_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_id").toString())); } if ((jsonObj.get("terminal_name") != null && !jsonObj.get("terminal_name").isJsonNull()) && !jsonObj.get("terminal_name").isJsonPrimitive()) { @@ -475,7 +474,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw if ((jsonObj.get("terminal_address") != null && !jsonObj.get("terminal_address").isJsonNull()) && !jsonObj.get("terminal_address").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `terminal_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_address").toString())); } - if (!jsonObj.get("terminal_id").isJsonPrimitive()) { + if ((jsonObj.get("terminal_id") != null && !jsonObj.get("terminal_id").isJsonNull()) && !jsonObj.get("terminal_id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `terminal_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal_id").toString())); } if ((jsonObj.get("terminal_name") != null && !jsonObj.get("terminal_name").isJsonNull()) && !jsonObj.get("terminal_name").isJsonPrimitive()) { diff --git a/src/main/java/com/cashfree/model/TerminalEntity.java b/src/main/java/com/cashfree/model/TerminalEntity.java index 6e146534..9845268c 100644 --- a/src/main/java/com/cashfree/model/TerminalEntity.java +++ b/src/main/java/com/cashfree/model/TerminalEntity.java @@ -52,7 +52,7 @@ * Create terminal response object */ @Schema(description = "Create terminal response object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TerminalEntity { public static final String SERIALIZED_NAME_ADDED_ON = "added_on"; @SerializedName(SERIALIZED_NAME_ADDED_ON) diff --git a/src/main/java/com/cashfree/model/TerminalPaymentEntity.java b/src/main/java/com/cashfree/model/TerminalPaymentEntity.java index 40a6142f..762a5012 100644 --- a/src/main/java/com/cashfree/model/TerminalPaymentEntity.java +++ b/src/main/java/com/cashfree/model/TerminalPaymentEntity.java @@ -57,7 +57,7 @@ * terminal payment entity full object */ @Schema(description = "terminal payment entity full object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TerminalPaymentEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/TerminalTransactionEntity.java b/src/main/java/com/cashfree/model/TerminalTransactionEntity.java index ba9995f3..93322205 100644 --- a/src/main/java/com/cashfree/model/TerminalTransactionEntity.java +++ b/src/main/java/com/cashfree/model/TerminalTransactionEntity.java @@ -52,7 +52,7 @@ * Create terminal response object */ @Schema(description = "Create terminal response object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TerminalTransactionEntity { public static final String SERIALIZED_NAME_CF_PAYMENT_ID = "cf_payment_id"; @SerializedName(SERIALIZED_NAME_CF_PAYMENT_ID) diff --git a/src/main/java/com/cashfree/model/TerminateOrderRequest.java b/src/main/java/com/cashfree/model/TerminateOrderRequest.java index 8b8f1efb..01ec8770 100644 --- a/src/main/java/com/cashfree/model/TerminateOrderRequest.java +++ b/src/main/java/com/cashfree/model/TerminateOrderRequest.java @@ -52,7 +52,7 @@ * Request to terminate an active order at Cashfree */ @Schema(description = "Request to terminate an active order at Cashfree") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TerminateOrderRequest { public static final String SERIALIZED_NAME_ORDER_STATUS = "order_status"; @SerializedName(SERIALIZED_NAME_ORDER_STATUS) @@ -68,11 +68,11 @@ public TerminateOrderRequest orderStatus(String orderStatus) { } /** - * To terminate an order, pass order_status as \"TERMINATE\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated. + * To terminate an order, pass order_status as \"TERMINATED\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated. * @return orderStatus **/ @javax.annotation.Nonnull - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "To terminate an order, pass order_status as \"TERMINATE\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "To terminate an order, pass order_status as \"TERMINATED\". Please note, order might not be terminated - confirm with the order_status in response. \"TERMINATION_REQUESTED\" states that the request is recieved and we are working on it. If the order terminates successfully, status will change to \"TERMINATED\". Incase there's any active transaction which moved to success - order might not get terminated.") public String getOrderStatus() { return orderStatus; } diff --git a/src/main/java/com/cashfree/model/TransferDetails.java b/src/main/java/com/cashfree/model/TransferDetails.java index d6a4143f..ae85609a 100644 --- a/src/main/java/com/cashfree/model/TransferDetails.java +++ b/src/main/java/com/cashfree/model/TransferDetails.java @@ -55,7 +55,7 @@ /** * TransferDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TransferDetails { public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; @SerializedName(SERIALIZED_NAME_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/TransferDetailsTagsInner.java b/src/main/java/com/cashfree/model/TransferDetailsTagsInner.java index 4a034ae5..6c55967a 100644 --- a/src/main/java/com/cashfree/model/TransferDetailsTagsInner.java +++ b/src/main/java/com/cashfree/model/TransferDetailsTagsInner.java @@ -52,7 +52,7 @@ /** * TransferDetailsTagsInner */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class TransferDetailsTagsInner { public static final String SERIALIZED_NAME_PRODUCT = "product"; @SerializedName(SERIALIZED_NAME_PRODUCT) diff --git a/src/main/java/com/cashfree/model/UPIAuthorizeDetails.java b/src/main/java/com/cashfree/model/UPIAuthorizeDetails.java index 158f822b..991e655f 100644 --- a/src/main/java/com/cashfree/model/UPIAuthorizeDetails.java +++ b/src/main/java/com/cashfree/model/UPIAuthorizeDetails.java @@ -52,7 +52,7 @@ * object when you are using preauth in UPI in order pay */ @Schema(description = "object when you are using preauth in UPI in order pay") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UPIAuthorizeDetails { public static final String SERIALIZED_NAME_APPROVE_BY = "approve_by"; @SerializedName(SERIALIZED_NAME_APPROVE_BY) diff --git a/src/main/java/com/cashfree/model/UPIPaymentMethod.java b/src/main/java/com/cashfree/model/UPIPaymentMethod.java index 86aa6df0..5d70596a 100644 --- a/src/main/java/com/cashfree/model/UPIPaymentMethod.java +++ b/src/main/java/com/cashfree/model/UPIPaymentMethod.java @@ -53,7 +53,7 @@ * Complete payment method for UPI collect */ @Schema(description = "Complete payment method for UPI collect") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UPIPaymentMethod { public static final String SERIALIZED_NAME_UPI = "upi"; @SerializedName(SERIALIZED_NAME_UPI) diff --git a/src/main/java/com/cashfree/model/UpdateTerminalEntity.java b/src/main/java/com/cashfree/model/UpdateTerminalEntity.java index 20bb6e76..eb41123d 100644 --- a/src/main/java/com/cashfree/model/UpdateTerminalEntity.java +++ b/src/main/java/com/cashfree/model/UpdateTerminalEntity.java @@ -52,7 +52,7 @@ * Update terminal response */ @Schema(description = "Update terminal response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateTerminalEntity { public static final String SERIALIZED_NAME_ADDED_ON = "added_on"; @SerializedName(SERIALIZED_NAME_ADDED_ON) diff --git a/src/main/java/com/cashfree/model/UpdateTerminalRequest.java b/src/main/java/com/cashfree/model/UpdateTerminalRequest.java index 37769cfe..160d9859 100644 --- a/src/main/java/com/cashfree/model/UpdateTerminalRequest.java +++ b/src/main/java/com/cashfree/model/UpdateTerminalRequest.java @@ -53,7 +53,7 @@ * Request body to update terminal details. */ @Schema(description = "Request body to update terminal details.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateTerminalRequest { public static final String SERIALIZED_NAME_TERMINAL_EMAIL = "terminal_email"; @SerializedName(SERIALIZED_NAME_TERMINAL_EMAIL) diff --git a/src/main/java/com/cashfree/model/UpdateTerminalRequestTerminalMeta.java b/src/main/java/com/cashfree/model/UpdateTerminalRequestTerminalMeta.java index c3ebf763..2886f21c 100644 --- a/src/main/java/com/cashfree/model/UpdateTerminalRequestTerminalMeta.java +++ b/src/main/java/com/cashfree/model/UpdateTerminalRequestTerminalMeta.java @@ -52,7 +52,7 @@ * Terminal metadata. */ @Schema(description = "Terminal metadata.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateTerminalRequestTerminalMeta { public static final String SERIALIZED_NAME_TERMINAL_OPERATOR = "terminal_operator"; @SerializedName(SERIALIZED_NAME_TERMINAL_OPERATOR) diff --git a/src/main/java/com/cashfree/model/UpdateTerminalStatusRequest.java b/src/main/java/com/cashfree/model/UpdateTerminalStatusRequest.java index 0cd3e246..d600e1cb 100644 --- a/src/main/java/com/cashfree/model/UpdateTerminalStatusRequest.java +++ b/src/main/java/com/cashfree/model/UpdateTerminalStatusRequest.java @@ -52,7 +52,7 @@ * Request body to update terminal status. */ @Schema(description = "Request body to update terminal status.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateTerminalStatusRequest { public static final String SERIALIZED_NAME_TERMINAL_STATUS = "terminal_status"; @SerializedName(SERIALIZED_NAME_TERMINAL_STATUS) diff --git a/src/main/java/com/cashfree/model/UpdateVendorRequest.java b/src/main/java/com/cashfree/model/UpdateVendorRequest.java index 32b0d3bc..5ad9222e 100644 --- a/src/main/java/com/cashfree/model/UpdateVendorRequest.java +++ b/src/main/java/com/cashfree/model/UpdateVendorRequest.java @@ -58,7 +58,7 @@ * Update Vendor Request */ @Schema(description = "Update Vendor Request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateVendorRequest { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @@ -242,11 +242,11 @@ public UpdateVendorRequest scheduleOption(BigDecimal scheduleOption) { } /** - * Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. + * Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements. * @return scheduleOption **/ @javax.annotation.Nonnull - @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Specify the settlement cycle to be updated. View the settlement cycle details from the \"Settlement Cycles Supported\" table. If no schedule option is configured, the settlement cycle ID \"1\" will be in effect. Select \"8\" or \"9\" if you want to schedule instant vendor settlements.") public BigDecimal getScheduleOption() { return scheduleOption; } diff --git a/src/main/java/com/cashfree/model/UpdateVendorResponse.java b/src/main/java/com/cashfree/model/UpdateVendorResponse.java index 1f704e02..b89f6f42 100644 --- a/src/main/java/com/cashfree/model/UpdateVendorResponse.java +++ b/src/main/java/com/cashfree/model/UpdateVendorResponse.java @@ -17,7 +17,7 @@ import com.cashfree.model.BankDetails; import com.cashfree.model.KycDetails; import com.cashfree.model.ScheduleOption; -import com.cashfree.model.VendorEntityRelatedDocsInner; +import com.cashfree.model.UpdateVendorResponseRelatedDocsInner; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -59,7 +59,7 @@ * Update Vendor Response */ @Schema(description = "Update Vendor Response") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpdateVendorResponse { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -127,7 +127,7 @@ public class UpdateVendorResponse { public static final String SERIALIZED_NAME_RELATED_DOCS = "related_docs"; @SerializedName(SERIALIZED_NAME_RELATED_DOCS) - private List relatedDocs; + private List relatedDocs; public UpdateVendorResponse() { } @@ -508,13 +508,13 @@ public void setBankDetails(String bankDetails) { } - public UpdateVendorResponse relatedDocs(List relatedDocs) { + public UpdateVendorResponse relatedDocs(List relatedDocs) { this.relatedDocs = relatedDocs; return this; } - public UpdateVendorResponse addRelatedDocsItem(VendorEntityRelatedDocsInner relatedDocsItem) { + public UpdateVendorResponse addRelatedDocsItem(UpdateVendorResponseRelatedDocsInner relatedDocsItem) { if (this.relatedDocs == null) { this.relatedDocs = new ArrayList<>(); } @@ -528,12 +528,12 @@ public UpdateVendorResponse addRelatedDocsItem(VendorEntityRelatedDocsInner rela **/ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") - public List getRelatedDocs() { + public List getRelatedDocs() { return relatedDocs; } - public void setRelatedDocs(List relatedDocs) { + public void setRelatedDocs(List relatedDocs) { this.relatedDocs = relatedDocs; } @@ -731,7 +731,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `related_docs` (array) for (int i = 0; i < jsonArrayrelatedDocs.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); }; } } @@ -832,7 +832,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw // validate the optional field `related_docs` (array) for (int i = 0; i < jsonArrayrelatedDocs.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); }; } } diff --git a/src/main/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInner.java b/src/main/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInner.java new file mode 100644 index 00000000..91cec98e --- /dev/null +++ b/src/main/java/com/cashfree/model/UpdateVendorResponseRelatedDocsInner.java @@ -0,0 +1,355 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * UpdateVendorResponseRelatedDocsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class UpdateVendorResponseRelatedDocsInner { + public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; + @SerializedName(SERIALIZED_NAME_VENDOR_ID) + private String vendorId; + + public static final String SERIALIZED_NAME_DOC_TYPE = "doc_type"; + @SerializedName(SERIALIZED_NAME_DOC_TYPE) + private String docType; + + public static final String SERIALIZED_NAME_DOC_VALUE = "doc_value"; + @SerializedName(SERIALIZED_NAME_DOC_VALUE) + private String docValue; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_REMARKS = "remarks"; + @SerializedName(SERIALIZED_NAME_REMARKS) + private String remarks; + + public UpdateVendorResponseRelatedDocsInner() { + } + + public UpdateVendorResponseRelatedDocsInner vendorId(String vendorId) { + + this.vendorId = vendorId; + return this; + } + + /** + * Get vendorId + * @return vendorId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getVendorId() { + return vendorId; + } + + + public void setVendorId(String vendorId) { + this.vendorId = vendorId; + } + + + public UpdateVendorResponseRelatedDocsInner docType(String docType) { + + this.docType = docType; + return this; + } + + /** + * Get docType + * @return docType + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getDocType() { + return docType; + } + + + public void setDocType(String docType) { + this.docType = docType; + } + + + public UpdateVendorResponseRelatedDocsInner docValue(String docValue) { + + this.docValue = docValue; + return this; + } + + /** + * Get docValue + * @return docValue + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getDocValue() { + return docValue; + } + + + public void setDocValue(String docValue) { + this.docValue = docValue; + } + + + public UpdateVendorResponseRelatedDocsInner status(String status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public UpdateVendorResponseRelatedDocsInner remarks(String remarks) { + + this.remarks = remarks; + return this; + } + + /** + * Get remarks + * @return remarks + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getRemarks() { + return remarks; + } + + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateVendorResponseRelatedDocsInner updateVendorResponseRelatedDocsInner = (UpdateVendorResponseRelatedDocsInner) o; + return Objects.equals(this.vendorId, updateVendorResponseRelatedDocsInner.vendorId) && + Objects.equals(this.docType, updateVendorResponseRelatedDocsInner.docType) && + Objects.equals(this.docValue, updateVendorResponseRelatedDocsInner.docValue) && + Objects.equals(this.status, updateVendorResponseRelatedDocsInner.status) && + Objects.equals(this.remarks, updateVendorResponseRelatedDocsInner.remarks); + } + + @Override + public int hashCode() { + return Objects.hash(vendorId, docType, docValue, status, remarks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateVendorResponseRelatedDocsInner {\n"); + sb.append(" vendorId: ").append(toIndentedString(vendorId)).append("\n"); + sb.append(" docType: ").append(toIndentedString(docType)).append("\n"); + sb.append(" docValue: ").append(toIndentedString(docValue)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" remarks: ").append(toIndentedString(remarks)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("vendor_id"); + openapiFields.add("doc_type"); + openapiFields.add("doc_value"); + openapiFields.add("status"); + openapiFields.add("remarks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateVendorResponseRelatedDocsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor_id") != null && !jsonObj.get("vendor_id").isJsonNull()) && !jsonObj.get("vendor_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor_id").toString())); + } + if ((jsonObj.get("doc_type") != null && !jsonObj.get("doc_type").isJsonNull()) && !jsonObj.get("doc_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `doc_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doc_type").toString())); + } + if ((jsonObj.get("doc_value") != null && !jsonObj.get("doc_value").isJsonNull()) && !jsonObj.get("doc_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `doc_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doc_value").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonNull()) && !jsonObj.get("remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateVendorResponseRelatedDocsInner + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("vendor_id") != null && !jsonObj.get("vendor_id").isJsonNull()) && !jsonObj.get("vendor_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `vendor_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vendor_id").toString())); + } + if ((jsonObj.get("doc_type") != null && !jsonObj.get("doc_type").isJsonNull()) && !jsonObj.get("doc_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `doc_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doc_type").toString())); + } + if ((jsonObj.get("doc_value") != null && !jsonObj.get("doc_value").isJsonNull()) && !jsonObj.get("doc_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `doc_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doc_value").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonNull()) && !jsonObj.get("remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateVendorResponseRelatedDocsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateVendorResponseRelatedDocsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateVendorResponseRelatedDocsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateVendorResponseRelatedDocsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateVendorResponseRelatedDocsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateVendorResponseRelatedDocsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateVendorResponseRelatedDocsInner + * @throws IOException if the JSON string is invalid with respect to UpdateVendorResponseRelatedDocsInner + */ + public static UpdateVendorResponseRelatedDocsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateVendorResponseRelatedDocsInner.class); + } + + /** + * Convert an instance of UpdateVendorResponseRelatedDocsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/Upi.java b/src/main/java/com/cashfree/model/Upi.java index 220a3330..b8d04bd8 100644 --- a/src/main/java/com/cashfree/model/Upi.java +++ b/src/main/java/com/cashfree/model/Upi.java @@ -54,7 +54,7 @@ * UPI collect payment method object */ @Schema(description = "UPI collect payment method object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class Upi { /** * Specify the channel through which the payment must be processed. Can be one of [\"link\", \"collect\", \"qrcode\"] diff --git a/src/main/java/com/cashfree/model/UpiDetails.java b/src/main/java/com/cashfree/model/UpiDetails.java index a9331e17..962b3a0e 100644 --- a/src/main/java/com/cashfree/model/UpiDetails.java +++ b/src/main/java/com/cashfree/model/UpiDetails.java @@ -51,7 +51,7 @@ /** * UpiDetails */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UpiDetails { public static final String SERIALIZED_NAME_VPA = "vpa"; @SerializedName(SERIALIZED_NAME_VPA) diff --git a/src/main/java/com/cashfree/model/UploadPnachImageResponse.java b/src/main/java/com/cashfree/model/UploadPnachImageResponse.java new file mode 100644 index 00000000..b3aae6e7 --- /dev/null +++ b/src/main/java/com/cashfree/model/UploadPnachImageResponse.java @@ -0,0 +1,321 @@ +/* + * Cashfree Payment Gateway APIs + * Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites. + * + * The version of the OpenAPI document: 2023-08-01 + * Contact: developers@cashfree.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.cashfree.model; + +import java.util.Objects; +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.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.cashfree.JSON; + +/** + * Response of pnach image upload API. + */ +@Schema(description = "Response of pnach image upload API.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") +public class UploadPnachImageResponse { + public static final String SERIALIZED_NAME_PAYMENT_ID = "payment_id"; + @SerializedName(SERIALIZED_NAME_PAYMENT_ID) + private String paymentId; + + public static final String SERIALIZED_NAME_AUTHORIZATION_STATUS = "authorization_status"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_STATUS) + private String authorizationStatus; + + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + private String action; + + public static final String SERIALIZED_NAME_PAYMENT_MESSAGE = "payment_message"; + @SerializedName(SERIALIZED_NAME_PAYMENT_MESSAGE) + private String paymentMessage; + + public UploadPnachImageResponse() { + } + + public UploadPnachImageResponse paymentId(String paymentId) { + + this.paymentId = paymentId; + return this; + } + + /** + * The payment_id against which the pnach image is uploaded. + * @return paymentId + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "The payment_id against which the pnach image is uploaded.") + public String getPaymentId() { + return paymentId; + } + + + public void setPaymentId(String paymentId) { + this.paymentId = paymentId; + } + + + public UploadPnachImageResponse authorizationStatus(String authorizationStatus) { + + this.authorizationStatus = authorizationStatus; + return this; + } + + /** + * Authorization status of the subscription. + * @return authorizationStatus + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Authorization status of the subscription.") + public String getAuthorizationStatus() { + return authorizationStatus; + } + + + public void setAuthorizationStatus(String authorizationStatus) { + this.authorizationStatus = authorizationStatus; + } + + + public UploadPnachImageResponse action(String action) { + + this.action = action; + return this; + } + + /** + * Action performed on the file. + * @return action + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Action performed on the file.") + public String getAction() { + return action; + } + + + public void setAction(String action) { + this.action = action; + } + + + public UploadPnachImageResponse paymentMessage(String paymentMessage) { + + this.paymentMessage = paymentMessage; + return this; + } + + /** + * Message of the API. + * @return paymentMessage + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "Message of the API.") + public String getPaymentMessage() { + return paymentMessage; + } + + + public void setPaymentMessage(String paymentMessage) { + this.paymentMessage = paymentMessage; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadPnachImageResponse uploadPnachImageResponse = (UploadPnachImageResponse) o; + return Objects.equals(this.paymentId, uploadPnachImageResponse.paymentId) && + Objects.equals(this.authorizationStatus, uploadPnachImageResponse.authorizationStatus) && + Objects.equals(this.action, uploadPnachImageResponse.action) && + Objects.equals(this.paymentMessage, uploadPnachImageResponse.paymentMessage); + } + + @Override + public int hashCode() { + return Objects.hash(paymentId, authorizationStatus, action, paymentMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UploadPnachImageResponse {\n"); + sb.append(" paymentId: ").append(toIndentedString(paymentId)).append("\n"); + sb.append(" authorizationStatus: ").append(toIndentedString(authorizationStatus)).append("\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" paymentMessage: ").append(toIndentedString(paymentMessage)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("payment_id"); + openapiFields.add("authorization_status"); + openapiFields.add("action"); + openapiFields.add("payment_message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UploadPnachImageResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("authorization_status") != null && !jsonObj.get("authorization_status").isJsonNull()) && !jsonObj.get("authorization_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_status").toString())); + } + if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + if ((jsonObj.get("payment_message") != null && !jsonObj.get("payment_message").isJsonNull()) && !jsonObj.get("payment_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_message").toString())); + } + } + + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UploadPnachImageResponse + */ + public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throws IOException { + + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("payment_id") != null && !jsonObj.get("payment_id").isJsonNull()) && !jsonObj.get("payment_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_id").toString())); + } + if ((jsonObj.get("authorization_status") != null && !jsonObj.get("authorization_status").isJsonNull()) && !jsonObj.get("authorization_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_status").toString())); + } + if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString())); + } + if ((jsonObj.get("payment_message") != null && !jsonObj.get("payment_message").isJsonNull()) && !jsonObj.get("payment_message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `payment_message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment_message").toString())); + } + return false; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UploadPnachImageResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UploadPnachImageResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UploadPnachImageResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UploadPnachImageResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UploadPnachImageResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UploadPnachImageResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UploadPnachImageResponse + * @throws IOException if the JSON string is invalid with respect to UploadPnachImageResponse + */ + public static UploadPnachImageResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UploadPnachImageResponse.class); + } + + /** + * Convert an instance of UploadPnachImageResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/cashfree/model/UploadTerminalDocs.java b/src/main/java/com/cashfree/model/UploadTerminalDocs.java index 3dca669f..562b52f9 100644 --- a/src/main/java/com/cashfree/model/UploadTerminalDocs.java +++ b/src/main/java/com/cashfree/model/UploadTerminalDocs.java @@ -52,7 +52,7 @@ * Request body to upload terminal documents. */ @Schema(description = "Request body to upload terminal documents.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UploadTerminalDocs { public static final String SERIALIZED_NAME_DOC_TYPE = "doc_type"; @SerializedName(SERIALIZED_NAME_DOC_TYPE) diff --git a/src/main/java/com/cashfree/model/UploadTerminalDocsEntity.java b/src/main/java/com/cashfree/model/UploadTerminalDocsEntity.java index 0ddc774e..11339c07 100644 --- a/src/main/java/com/cashfree/model/UploadTerminalDocsEntity.java +++ b/src/main/java/com/cashfree/model/UploadTerminalDocsEntity.java @@ -52,7 +52,7 @@ * Upload the terminal documents. */ @Schema(description = "Upload the terminal documents.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UploadTerminalDocsEntity { public static final String SERIALIZED_NAME_CF_TERMINAL_ID = "cf_terminal_id"; @SerializedName(SERIALIZED_NAME_CF_TERMINAL_ID) diff --git a/src/main/java/com/cashfree/model/UploadVendorDocumentsResponse.java b/src/main/java/com/cashfree/model/UploadVendorDocumentsResponse.java index ffa57a24..7ae09ab1 100644 --- a/src/main/java/com/cashfree/model/UploadVendorDocumentsResponse.java +++ b/src/main/java/com/cashfree/model/UploadVendorDocumentsResponse.java @@ -52,7 +52,7 @@ * Upload Vendor Document */ @Schema(description = "Upload Vendor Document") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class UploadVendorDocumentsResponse { public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; @SerializedName(SERIALIZED_NAME_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/VendorBalance.java b/src/main/java/com/cashfree/model/VendorBalance.java index 41c3849d..45d9371d 100644 --- a/src/main/java/com/cashfree/model/VendorBalance.java +++ b/src/main/java/com/cashfree/model/VendorBalance.java @@ -53,7 +53,7 @@ * Vendor Balance entity object */ @Schema(description = "Vendor Balance entity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorBalance { public static final String SERIALIZED_NAME_MERCHANT_ID = "merchant_id"; @SerializedName(SERIALIZED_NAME_MERCHANT_ID) diff --git a/src/main/java/com/cashfree/model/VendorBalanceTransferCharges.java b/src/main/java/com/cashfree/model/VendorBalanceTransferCharges.java index 6b5f62d6..b67768c5 100644 --- a/src/main/java/com/cashfree/model/VendorBalanceTransferCharges.java +++ b/src/main/java/com/cashfree/model/VendorBalanceTransferCharges.java @@ -53,7 +53,7 @@ * Vendor Balance Transfer Charges entity object */ @Schema(description = "Vendor Balance Transfer Charges entity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorBalanceTransferCharges { public static final String SERIALIZED_NAME_SERVICE_CHARGES = "service_charges"; @SerializedName(SERIALIZED_NAME_SERVICE_CHARGES) diff --git a/src/main/java/com/cashfree/model/VendorDocumentDownloadResponse.java b/src/main/java/com/cashfree/model/VendorDocumentDownloadResponse.java index 057d8356..befc5155 100644 --- a/src/main/java/com/cashfree/model/VendorDocumentDownloadResponse.java +++ b/src/main/java/com/cashfree/model/VendorDocumentDownloadResponse.java @@ -52,7 +52,7 @@ * Download Vendor Document */ @Schema(description = "Download Vendor Document") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorDocumentDownloadResponse { public static final String SERIALIZED_NAME_DOWNLOAD_URL = "download_url"; @SerializedName(SERIALIZED_NAME_DOWNLOAD_URL) diff --git a/src/main/java/com/cashfree/model/VendorDocumentsResponse.java b/src/main/java/com/cashfree/model/VendorDocumentsResponse.java index 92041a18..8dd6f57f 100644 --- a/src/main/java/com/cashfree/model/VendorDocumentsResponse.java +++ b/src/main/java/com/cashfree/model/VendorDocumentsResponse.java @@ -14,7 +14,7 @@ package com.cashfree.model; import java.util.Objects; -import com.cashfree.model.VendorEntityRelatedDocsInner; +import com.cashfree.model.UpdateVendorResponseRelatedDocsInner; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -55,22 +55,22 @@ * Get Vendor Documents */ @Schema(description = "Get Vendor Documents") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorDocumentsResponse { public static final String SERIALIZED_NAME_DOCUMENTS = "documents"; @SerializedName(SERIALIZED_NAME_DOCUMENTS) - private List documents; + private List documents; public VendorDocumentsResponse() { } - public VendorDocumentsResponse documents(List documents) { + public VendorDocumentsResponse documents(List documents) { this.documents = documents; return this; } - public VendorDocumentsResponse addDocumentsItem(VendorEntityRelatedDocsInner documentsItem) { + public VendorDocumentsResponse addDocumentsItem(UpdateVendorResponseRelatedDocsInner documentsItem) { if (this.documents == null) { this.documents = new ArrayList<>(); } @@ -84,12 +84,12 @@ public VendorDocumentsResponse addDocumentsItem(VendorEntityRelatedDocsInner doc **/ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") - public List getDocuments() { + public List getDocuments() { return documents; } - public void setDocuments(List documents) { + public void setDocuments(List documents) { this.documents = documents; } @@ -164,7 +164,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `documents` (array) for (int i = 0; i < jsonArraydocuments.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArraydocuments.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArraydocuments.get(i)); }; } } @@ -190,7 +190,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw // validate the optional field `documents` (array) for (int i = 0; i < jsonArraydocuments.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArraydocuments.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArraydocuments.get(i)); }; } } diff --git a/src/main/java/com/cashfree/model/VendorEntity.java b/src/main/java/com/cashfree/model/VendorEntity.java index 3dd18550..afff1a7f 100644 --- a/src/main/java/com/cashfree/model/VendorEntity.java +++ b/src/main/java/com/cashfree/model/VendorEntity.java @@ -16,7 +16,7 @@ import java.util.Objects; import com.cashfree.model.BankDetails; import com.cashfree.model.ScheduleOption; -import com.cashfree.model.VendorEntityRelatedDocsInner; +import com.cashfree.model.UpdateVendorResponseRelatedDocsInner; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -57,7 +57,7 @@ * Vendor entity object */ @Schema(description = "Vendor entity object") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorEntity { public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -111,9 +111,13 @@ public class VendorEntity { @SerializedName(SERIALIZED_NAME_BUSINESS_TYPE) private String businessType; + public static final String SERIALIZED_NAME_REMARKS = "remarks"; + @SerializedName(SERIALIZED_NAME_REMARKS) + private String remarks; + public static final String SERIALIZED_NAME_RELATED_DOCS = "related_docs"; @SerializedName(SERIALIZED_NAME_RELATED_DOCS) - private List relatedDocs; + private List relatedDocs; public VendorEntity() { } @@ -420,13 +424,35 @@ public void setBusinessType(String businessType) { } - public VendorEntity relatedDocs(List relatedDocs) { + public VendorEntity remarks(String remarks) { + + this.remarks = remarks; + return this; + } + + /** + * Get remarks + * @return remarks + **/ + @javax.annotation.Nullable + @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") + public String getRemarks() { + return remarks; + } + + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + + public VendorEntity relatedDocs(List relatedDocs) { this.relatedDocs = relatedDocs; return this; } - public VendorEntity addRelatedDocsItem(VendorEntityRelatedDocsInner relatedDocsItem) { + public VendorEntity addRelatedDocsItem(UpdateVendorResponseRelatedDocsInner relatedDocsItem) { if (this.relatedDocs == null) { this.relatedDocs = new ArrayList<>(); } @@ -440,12 +466,12 @@ public VendorEntity addRelatedDocsItem(VendorEntityRelatedDocsInner relatedDocsI **/ @javax.annotation.Nullable @Schema(requiredMode = Schema.RequiredMode.NOT_REQUIRED, description = "") - public List getRelatedDocs() { + public List getRelatedDocs() { return relatedDocs; } - public void setRelatedDocs(List relatedDocs) { + public void setRelatedDocs(List relatedDocs) { this.relatedDocs = relatedDocs; } @@ -473,12 +499,13 @@ public boolean equals(Object o) { Objects.equals(this.vendorType, vendorEntity.vendorType) && Objects.equals(this.accountType, vendorEntity.accountType) && Objects.equals(this.businessType, vendorEntity.businessType) && + Objects.equals(this.remarks, vendorEntity.remarks) && Objects.equals(this.relatedDocs, vendorEntity.relatedDocs); } @Override public int hashCode() { - return Objects.hash(email, status, phone, name, vendorId, addedOn, updatedOn, bank, upi, scheduleOption, vendorType, accountType, businessType, relatedDocs); + return Objects.hash(email, status, phone, name, vendorId, addedOn, updatedOn, bank, upi, scheduleOption, vendorType, accountType, businessType, remarks, relatedDocs); } @Override @@ -498,6 +525,7 @@ public String toString() { sb.append(" vendorType: ").append(toIndentedString(vendorType)).append("\n"); sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); sb.append(" businessType: ").append(toIndentedString(businessType)).append("\n"); + sb.append(" remarks: ").append(toIndentedString(remarks)).append("\n"); sb.append(" relatedDocs: ").append(toIndentedString(relatedDocs)).append("\n"); sb.append("}"); return sb.toString(); @@ -534,6 +562,7 @@ private String toIndentedString(Object o) { openapiFields.add("vendor_type"); openapiFields.add("account_type"); openapiFields.add("business_type"); + openapiFields.add("remarks"); openapiFields.add("related_docs"); // a set of required properties/fields (JSON key names) @@ -610,6 +639,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("business_type") != null && !jsonObj.get("business_type").isJsonNull()) && !jsonObj.get("business_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `business_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("business_type").toString())); } + if ((jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonNull()) && !jsonObj.get("remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + } if (jsonObj.get("related_docs") != null && !jsonObj.get("related_docs").isJsonNull()) { JsonArray jsonArrayrelatedDocs = jsonObj.getAsJsonArray("related_docs"); if (jsonArrayrelatedDocs != null) { @@ -620,7 +652,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `related_docs` (array) for (int i = 0; i < jsonArrayrelatedDocs.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); }; } } @@ -697,6 +729,9 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw if ((jsonObj.get("business_type") != null && !jsonObj.get("business_type").isJsonNull()) && !jsonObj.get("business_type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `business_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("business_type").toString())); } + if ((jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonNull()) && !jsonObj.get("remarks").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + } if (jsonObj.get("related_docs") != null && !jsonObj.get("related_docs").isJsonNull()) { JsonArray jsonArrayrelatedDocs = jsonObj.getAsJsonArray("related_docs"); if (jsonArrayrelatedDocs != null) { @@ -707,7 +742,7 @@ public static boolean validateJsonElementForOneOf(JsonElement jsonElement) throw // validate the optional field `related_docs` (array) for (int i = 0; i < jsonArrayrelatedDocs.size(); i++) { - VendorEntityRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); + UpdateVendorResponseRelatedDocsInner.validateJsonElement(jsonArrayrelatedDocs.get(i)); }; } } diff --git a/src/main/java/com/cashfree/model/VendorSplit.java b/src/main/java/com/cashfree/model/VendorSplit.java index 2299e646..53e8fc2e 100644 --- a/src/main/java/com/cashfree/model/VendorSplit.java +++ b/src/main/java/com/cashfree/model/VendorSplit.java @@ -55,7 +55,7 @@ * Use to split order when cashfree's Easy Split is enabled for your account. */ @Schema(description = "Use to split order when cashfree's Easy Split is enabled for your account.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class VendorSplit { public static final String SERIALIZED_NAME_VENDOR_ID = "vendor_id"; @SerializedName(SERIALIZED_NAME_VENDOR_ID) diff --git a/src/main/java/com/cashfree/model/WalletOffer.java b/src/main/java/com/cashfree/model/WalletOffer.java index b6dc8ece..b0334ff0 100644 --- a/src/main/java/com/cashfree/model/WalletOffer.java +++ b/src/main/java/com/cashfree/model/WalletOffer.java @@ -51,7 +51,7 @@ /** * WalletOffer */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-18T13:25:41.657534Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-07-12T09:19:49.697679Z[Etc/UTC]") public class WalletOffer { public static final String SERIALIZED_NAME_PROVIDER = "provider"; @SerializedName(SERIALIZED_NAME_PROVIDER)