diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8f7335d..ffd387c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -15,7 +15,9 @@ docs/Api/PaymentsApi.md docs/Api/RefundsApi.md docs/Api/SettlementReconciliationApi.md docs/Api/SettlementsApi.md +docs/Api/SimulationApi.md docs/Api/SoftPOSApi.md +docs/Api/SubscriptionApi.md docs/Api/TokenVaultApi.md docs/Model/AdjustVendorBalanceRequest.md docs/Model/AdjustVendorBalanceResponse.md @@ -26,6 +28,7 @@ docs/Model/ApiError502.md docs/Model/App.md docs/Model/AppPaymentMethod.md docs/Model/AuthenticationError.md +docs/Model/AuthorizationDetails.md docs/Model/AuthorizationInPaymentsEntity.md docs/Model/AuthorizeOrderRequest.md docs/Model/BadRequestError.md @@ -48,6 +51,18 @@ docs/Model/CreateCustomerRequest.md docs/Model/CreateLinkRequest.md docs/Model/CreateOfferRequest.md docs/Model/CreateOrderRequest.md +docs/Model/CreateOrderSettlementRequestBody.md +docs/Model/CreateOrderSettlementRequestBodyMetaData.md +docs/Model/CreatePlanRequest.md +docs/Model/CreateSubscriptionPaymentAuthResponse.md +docs/Model/CreateSubscriptionPaymentAuthResponseFailureDetails.md +docs/Model/CreateSubscriptionPaymentChargeResponse.md +docs/Model/CreateSubscriptionPaymentRequest.md +docs/Model/CreateSubscriptionRefundRequest.md +docs/Model/CreateSubscriptionRequest.md +docs/Model/CreateSubscriptionRequestAuthorizationDetails.md +docs/Model/CreateSubscriptionRequestPlanDetails.md +docs/Model/CreateSubscriptionRequestSubscriptionMeta.md docs/Model/CreateTerminalRequest.md docs/Model/CreateTerminalRequestTerminalMeta.md docs/Model/CreateTerminalTransactionRequest.md @@ -56,6 +71,7 @@ docs/Model/CreateVendorResponse.md docs/Model/CryptogramEntity.md docs/Model/CustomerDetails.md docs/Model/CustomerDetailsCardlessEMI.md +docs/Model/CustomerDetailsResponse.md docs/Model/CustomerEntity.md docs/Model/DiscountDetails.md docs/Model/EMIOffer.md @@ -72,10 +88,15 @@ docs/Model/EligibilityFetchCardlessEMIRequest.md docs/Model/EligibilityFetchOffersRequest.md docs/Model/EligibilityFetchPaylaterRequest.md docs/Model/EligibilityFetchPaymentMethodsRequest.md +docs/Model/EligibilityMethodItem.md +docs/Model/EligibilityMethodItemEntityDetails.md +docs/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.md docs/Model/EligibilityOfferEntity.md docs/Model/EligibilityPaylaterEntity.md docs/Model/EligibilityPaymentMethodsEntity.md docs/Model/EligibilityPaymentMethodsEntityEntityDetails.md +docs/Model/EntitySimulationRequest.md +docs/Model/EntitySimulationResponse.md docs/Model/ErrorDetailsInPaymentsEntity.md docs/Model/FetchReconRequest.md docs/Model/FetchReconRequestFilters.md @@ -94,6 +115,10 @@ docs/Model/LinkCustomerDetailsEntity.md docs/Model/LinkEntity.md docs/Model/LinkMetaResponseEntity.md docs/Model/LinkNotifyEntity.md +docs/Model/ManageSubscriptionPaymentRequest.md +docs/Model/ManageSubscriptionPaymentRequestActionDetails.md +docs/Model/ManageSubscriptionRequest.md +docs/Model/ManageSubscriptionRequestActionDetails.md docs/Model/NetBankingPaymentMethod.md docs/Model/Netbanking.md docs/Model/OfferAll.md @@ -154,6 +179,7 @@ docs/Model/PaymentWebhookDataEntity.md docs/Model/PaymentWebhookErrorEntity.md docs/Model/PaymentWebhookGatewayDetailsEntity.md docs/Model/PaymentWebhookOrderEntity.md +docs/Model/PlanEntity.md docs/Model/RateLimitError.md docs/Model/ReconEntity.md docs/Model/ReconEntityDataInner.md @@ -169,6 +195,8 @@ docs/Model/SettlementReconEntity.md docs/Model/SettlementReconEntityDataInner.md docs/Model/SettlementWebhook.md docs/Model/SettlementWebhookDataEntity.md +docs/Model/SimulateRequest.md +docs/Model/SimulationResponse.md docs/Model/SplitAfterPaymentRequest.md docs/Model/SplitAfterPaymentRequestSplitInner.md docs/Model/SplitAfterPaymentResponse.md @@ -176,6 +204,18 @@ docs/Model/StaticSplitRequest.md docs/Model/StaticSplitRequestSchemeInner.md docs/Model/StaticSplitResponse.md docs/Model/StaticSplitResponseSchemeInner.md +docs/Model/SubsCreatePayment200Response.md +docs/Model/SubscriptionBankDetails.md +docs/Model/SubscriptionCustomerDetails.md +docs/Model/SubscriptionEligibilityRequest.md +docs/Model/SubscriptionEligibilityRequestFilters.md +docs/Model/SubscriptionEligibilityRequestQueries.md +docs/Model/SubscriptionEligibilityResponse.md +docs/Model/SubscriptionEntity.md +docs/Model/SubscriptionEntitySubscriptionMeta.md +docs/Model/SubscriptionPaymentEntity.md +docs/Model/SubscriptionPaymentRefundEntity.md +docs/Model/SubscriptionPaymentSplitItem.md docs/Model/TerminalDetails.md docs/Model/TerminalEntity.md docs/Model/TerminalPaymentEntity.md @@ -191,8 +231,10 @@ docs/Model/UpdateTerminalRequestTerminalMeta.md docs/Model/UpdateTerminalStatusRequest.md docs/Model/UpdateVendorRequest.md docs/Model/UpdateVendorResponse.md +docs/Model/UpdateVendorResponseRelatedDocsInner.md docs/Model/Upi.md docs/Model/UpiDetails.md +docs/Model/UploadPnachImageResponse.md docs/Model/UploadTerminalDocs.md docs/Model/UploadTerminalDocsEntity.md docs/Model/UploadVendorDocumentsResponse.md @@ -201,7 +243,6 @@ docs/Model/VendorBalanceTransferCharges.md docs/Model/VendorDocumentDownloadResponse.md docs/Model/VendorDocumentsResponse.md docs/Model/VendorEntity.md -docs/Model/VendorEntityRelatedDocsInner.md docs/Model/VendorSplit.md docs/Model/WalletOffer.md git_push.sh @@ -216,7 +257,9 @@ lib/Api/PaymentsApi.php lib/Api/RefundsApi.php lib/Api/SettlementReconciliationApi.php lib/Api/SettlementsApi.php +lib/Api/SimulationApi.php lib/Api/SoftPOSApi.php +lib/Api/SubscriptionApi.php lib/Api/TokenVaultApi.php lib/ApiException.php lib/Configuration.php @@ -230,6 +273,7 @@ lib/Model/ApiError502.php lib/Model/App.php lib/Model/AppPaymentMethod.php lib/Model/AuthenticationError.php +lib/Model/AuthorizationDetails.php lib/Model/AuthorizationInPaymentsEntity.php lib/Model/AuthorizeOrderRequest.php lib/Model/BadRequestError.php @@ -252,6 +296,18 @@ lib/Model/CreateCustomerRequest.php lib/Model/CreateLinkRequest.php lib/Model/CreateOfferRequest.php lib/Model/CreateOrderRequest.php +lib/Model/CreateOrderSettlementRequestBody.php +lib/Model/CreateOrderSettlementRequestBodyMetaData.php +lib/Model/CreatePlanRequest.php +lib/Model/CreateSubscriptionPaymentAuthResponse.php +lib/Model/CreateSubscriptionPaymentAuthResponseFailureDetails.php +lib/Model/CreateSubscriptionPaymentChargeResponse.php +lib/Model/CreateSubscriptionPaymentRequest.php +lib/Model/CreateSubscriptionRefundRequest.php +lib/Model/CreateSubscriptionRequest.php +lib/Model/CreateSubscriptionRequestAuthorizationDetails.php +lib/Model/CreateSubscriptionRequestPlanDetails.php +lib/Model/CreateSubscriptionRequestSubscriptionMeta.php lib/Model/CreateTerminalRequest.php lib/Model/CreateTerminalRequestTerminalMeta.php lib/Model/CreateTerminalTransactionRequest.php @@ -260,6 +316,7 @@ lib/Model/CreateVendorResponse.php lib/Model/CryptogramEntity.php lib/Model/CustomerDetails.php lib/Model/CustomerDetailsCardlessEMI.php +lib/Model/CustomerDetailsResponse.php lib/Model/CustomerEntity.php lib/Model/DiscountDetails.php lib/Model/EMIOffer.php @@ -276,10 +333,15 @@ lib/Model/EligibilityFetchCardlessEMIRequest.php lib/Model/EligibilityFetchOffersRequest.php lib/Model/EligibilityFetchPaylaterRequest.php lib/Model/EligibilityFetchPaymentMethodsRequest.php +lib/Model/EligibilityMethodItem.php +lib/Model/EligibilityMethodItemEntityDetails.php +lib/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.php lib/Model/EligibilityOfferEntity.php lib/Model/EligibilityPaylaterEntity.php lib/Model/EligibilityPaymentMethodsEntity.php lib/Model/EligibilityPaymentMethodsEntityEntityDetails.php +lib/Model/EntitySimulationRequest.php +lib/Model/EntitySimulationResponse.php lib/Model/ErrorDetailsInPaymentsEntity.php lib/Model/FetchReconRequest.php lib/Model/FetchReconRequestFilters.php @@ -298,6 +360,10 @@ lib/Model/LinkCustomerDetailsEntity.php lib/Model/LinkEntity.php lib/Model/LinkMetaResponseEntity.php lib/Model/LinkNotifyEntity.php +lib/Model/ManageSubscriptionPaymentRequest.php +lib/Model/ManageSubscriptionPaymentRequestActionDetails.php +lib/Model/ManageSubscriptionRequest.php +lib/Model/ManageSubscriptionRequestActionDetails.php lib/Model/ModelInterface.php lib/Model/NetBankingPaymentMethod.php lib/Model/Netbanking.php @@ -359,6 +425,7 @@ lib/Model/PaymentWebhookDataEntity.php lib/Model/PaymentWebhookErrorEntity.php lib/Model/PaymentWebhookGatewayDetailsEntity.php lib/Model/PaymentWebhookOrderEntity.php +lib/Model/PlanEntity.php lib/Model/RateLimitError.php lib/Model/ReconEntity.php lib/Model/ReconEntityDataInner.php @@ -374,6 +441,8 @@ lib/Model/SettlementReconEntity.php lib/Model/SettlementReconEntityDataInner.php lib/Model/SettlementWebhook.php lib/Model/SettlementWebhookDataEntity.php +lib/Model/SimulateRequest.php +lib/Model/SimulationResponse.php lib/Model/SplitAfterPaymentRequest.php lib/Model/SplitAfterPaymentRequestSplitInner.php lib/Model/SplitAfterPaymentResponse.php @@ -381,6 +450,18 @@ lib/Model/StaticSplitRequest.php lib/Model/StaticSplitRequestSchemeInner.php lib/Model/StaticSplitResponse.php lib/Model/StaticSplitResponseSchemeInner.php +lib/Model/SubsCreatePayment200Response.php +lib/Model/SubscriptionBankDetails.php +lib/Model/SubscriptionCustomerDetails.php +lib/Model/SubscriptionEligibilityRequest.php +lib/Model/SubscriptionEligibilityRequestFilters.php +lib/Model/SubscriptionEligibilityRequestQueries.php +lib/Model/SubscriptionEligibilityResponse.php +lib/Model/SubscriptionEntity.php +lib/Model/SubscriptionEntitySubscriptionMeta.php +lib/Model/SubscriptionPaymentEntity.php +lib/Model/SubscriptionPaymentRefundEntity.php +lib/Model/SubscriptionPaymentSplitItem.php lib/Model/TerminalDetails.php lib/Model/TerminalEntity.php lib/Model/TerminalPaymentEntity.php @@ -396,8 +477,10 @@ lib/Model/UpdateTerminalRequestTerminalMeta.php lib/Model/UpdateTerminalStatusRequest.php lib/Model/UpdateVendorRequest.php lib/Model/UpdateVendorResponse.php +lib/Model/UpdateVendorResponseRelatedDocsInner.php lib/Model/Upi.php lib/Model/UpiDetails.php +lib/Model/UploadPnachImageResponse.php lib/Model/UploadTerminalDocs.php lib/Model/UploadTerminalDocsEntity.php lib/Model/UploadVendorDocumentsResponse.php @@ -406,7 +489,6 @@ lib/Model/VendorBalanceTransferCharges.php lib/Model/VendorDocumentDownloadResponse.php lib/Model/VendorDocumentsResponse.php lib/Model/VendorEntity.php -lib/Model/VendorEntityRelatedDocsInner.php lib/Model/VendorSplit.php lib/Model/WalletOffer.php lib/ObjectSerializer.php @@ -422,7 +504,9 @@ test/Api/PaymentsApiTest.php test/Api/RefundsApiTest.php test/Api/SettlementReconciliationApiTest.php test/Api/SettlementsApiTest.php +test/Api/SimulationApiTest.php test/Api/SoftPOSApiTest.php +test/Api/SubscriptionApiTest.php test/Api/TokenVaultApiTest.php test/Model/AdjustVendorBalanceRequestTest.php test/Model/AdjustVendorBalanceResponseTest.php @@ -433,6 +517,7 @@ test/Model/ApiErrorTest.php test/Model/AppPaymentMethodTest.php test/Model/AppTest.php test/Model/AuthenticationErrorTest.php +test/Model/AuthorizationDetailsTest.php test/Model/AuthorizationInPaymentsEntityTest.php test/Model/AuthorizeOrderRequestTest.php test/Model/BadRequestErrorTest.php @@ -455,6 +540,18 @@ test/Model/CreateCustomerRequestTest.php test/Model/CreateLinkRequestTest.php test/Model/CreateOfferRequestTest.php test/Model/CreateOrderRequestTest.php +test/Model/CreateOrderSettlementRequestBodyMetaDataTest.php +test/Model/CreateOrderSettlementRequestBodyTest.php +test/Model/CreatePlanRequestTest.php +test/Model/CreateSubscriptionPaymentAuthResponseFailureDetailsTest.php +test/Model/CreateSubscriptionPaymentAuthResponseTest.php +test/Model/CreateSubscriptionPaymentChargeResponseTest.php +test/Model/CreateSubscriptionPaymentRequestTest.php +test/Model/CreateSubscriptionRefundRequestTest.php +test/Model/CreateSubscriptionRequestAuthorizationDetailsTest.php +test/Model/CreateSubscriptionRequestPlanDetailsTest.php +test/Model/CreateSubscriptionRequestSubscriptionMetaTest.php +test/Model/CreateSubscriptionRequestTest.php test/Model/CreateTerminalRequestTerminalMetaTest.php test/Model/CreateTerminalRequestTest.php test/Model/CreateTerminalTransactionRequestTest.php @@ -462,6 +559,7 @@ test/Model/CreateVendorRequestTest.php test/Model/CreateVendorResponseTest.php test/Model/CryptogramEntityTest.php test/Model/CustomerDetailsCardlessEMITest.php +test/Model/CustomerDetailsResponseTest.php test/Model/CustomerDetailsTest.php test/Model/CustomerEntityTest.php test/Model/DiscountDetailsTest.php @@ -479,10 +577,15 @@ test/Model/EligibilityFetchCardlessEMIRequestTest.php test/Model/EligibilityFetchOffersRequestTest.php test/Model/EligibilityFetchPaylaterRequestTest.php test/Model/EligibilityFetchPaymentMethodsRequestTest.php +test/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInnerTest.php +test/Model/EligibilityMethodItemEntityDetailsTest.php +test/Model/EligibilityMethodItemTest.php test/Model/EligibilityOfferEntityTest.php test/Model/EligibilityPaylaterEntityTest.php test/Model/EligibilityPaymentMethodsEntityEntityDetailsTest.php test/Model/EligibilityPaymentMethodsEntityTest.php +test/Model/EntitySimulationRequestTest.php +test/Model/EntitySimulationResponseTest.php test/Model/ErrorDetailsInPaymentsEntityTest.php test/Model/FetchReconRequestFiltersTest.php test/Model/FetchReconRequestPaginationTest.php @@ -501,6 +604,10 @@ test/Model/LinkCustomerDetailsEntityTest.php test/Model/LinkEntityTest.php test/Model/LinkMetaResponseEntityTest.php test/Model/LinkNotifyEntityTest.php +test/Model/ManageSubscriptionPaymentRequestActionDetailsTest.php +test/Model/ManageSubscriptionPaymentRequestTest.php +test/Model/ManageSubscriptionRequestActionDetailsTest.php +test/Model/ManageSubscriptionRequestTest.php test/Model/NetBankingPaymentMethodTest.php test/Model/NetbankingTest.php test/Model/OfferAllTest.php @@ -561,6 +668,7 @@ test/Model/PaymentWebhookErrorEntityTest.php test/Model/PaymentWebhookGatewayDetailsEntityTest.php test/Model/PaymentWebhookOrderEntityTest.php test/Model/PaymentWebhookTest.php +test/Model/PlanEntityTest.php test/Model/RateLimitErrorTest.php test/Model/ReconEntityDataInnerTest.php test/Model/ReconEntityTest.php @@ -576,6 +684,8 @@ test/Model/SettlementReconEntityDataInnerTest.php test/Model/SettlementReconEntityTest.php test/Model/SettlementWebhookDataEntityTest.php test/Model/SettlementWebhookTest.php +test/Model/SimulateRequestTest.php +test/Model/SimulationResponseTest.php test/Model/SplitAfterPaymentRequestSplitInnerTest.php test/Model/SplitAfterPaymentRequestTest.php test/Model/SplitAfterPaymentResponseTest.php @@ -583,6 +693,18 @@ test/Model/StaticSplitRequestSchemeInnerTest.php test/Model/StaticSplitRequestTest.php test/Model/StaticSplitResponseSchemeInnerTest.php test/Model/StaticSplitResponseTest.php +test/Model/SubsCreatePayment200ResponseTest.php +test/Model/SubscriptionBankDetailsTest.php +test/Model/SubscriptionCustomerDetailsTest.php +test/Model/SubscriptionEligibilityRequestFiltersTest.php +test/Model/SubscriptionEligibilityRequestQueriesTest.php +test/Model/SubscriptionEligibilityRequestTest.php +test/Model/SubscriptionEligibilityResponseTest.php +test/Model/SubscriptionEntitySubscriptionMetaTest.php +test/Model/SubscriptionEntityTest.php +test/Model/SubscriptionPaymentEntityTest.php +test/Model/SubscriptionPaymentRefundEntityTest.php +test/Model/SubscriptionPaymentSplitItemTest.php test/Model/TerminalDetailsTest.php test/Model/TerminalEntityTest.php test/Model/TerminalPaymentEntityTest.php @@ -597,9 +719,11 @@ test/Model/UpdateTerminalRequestTerminalMetaTest.php test/Model/UpdateTerminalRequestTest.php test/Model/UpdateTerminalStatusRequestTest.php test/Model/UpdateVendorRequestTest.php +test/Model/UpdateVendorResponseRelatedDocsInnerTest.php test/Model/UpdateVendorResponseTest.php test/Model/UpiDetailsTest.php test/Model/UpiTest.php +test/Model/UploadPnachImageResponseTest.php test/Model/UploadTerminalDocsEntityTest.php test/Model/UploadTerminalDocsTest.php test/Model/UploadVendorDocumentsResponseTest.php @@ -607,7 +731,6 @@ test/Model/VendorBalanceTest.php test/Model/VendorBalanceTransferChargesTest.php test/Model/VendorDocumentDownloadResponseTest.php test/Model/VendorDocumentsResponseTest.php -test/Model/VendorEntityRelatedDocsInnerTest.php test/Model/VendorEntityTest.php test/Model/VendorSplitTest.php test/Model/WalletOfferTest.php diff --git a/composer.json b/composer.json index f3fc16d..6534dfb 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "cashfree/cashfree-pg", - "version": "4.1.2", + "version": "4.2.0", "description": "Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.", "keywords": [ "php", diff --git a/lib/Cashfree.php b/lib/Cashfree.php index 84a34fe..9230cc4 100644 --- a/lib/Cashfree.php +++ b/lib/Cashfree.php @@ -193,9 +193,18 @@ public function PGVerifyWebhookSignature($signature, $rawBody, $timestamp) { 'pGSettlementFetchRecon' => [ 'application/json', ], + 'markForSettlement' => [ + 'application/json', + ], 'pGOrderFetchSettlement' => [ 'application/json', ], + 'pGFetchSimulation' => [ + 'application/json', + ], + 'pGSimulatePayment' => [ + 'application/json', + ], 'sposCreateTerminal' => [ 'application/json', ], @@ -220,6 +229,45 @@ public function PGVerifyWebhookSignature($signature, $rawBody, $timestamp) { 'sposUploadTerminalDocs' => [ 'application/json', ], + 'subsCreatePayment' => [ + 'application/json', + ], + 'subsCreatePlan' => [ + 'application/json', + ], + 'subsCreateRefund' => [ + 'application/json', + ], + 'subsCreateSubscription' => [ + 'application/json', + ], + 'subsFetchPlan' => [ + 'application/json', + ], + 'subsFetchSubscription' => [ + 'application/json', + ], + 'subsFetchSubscriptionPayment' => [ + 'application/json', + ], + 'subsFetchSubscriptionPayments' => [ + 'application/json', + ], + 'subsFetchSubscriptionRefund' => [ + 'application/json', + ], + 'subsManageSubscription' => [ + 'application/json', + ], + 'subsManageSubscriptionPayment' => [ + 'application/json', + ], + 'subscriptionDocumentUpload' => [ + 'multipart/form-data', + ], + 'subscriptionEligibility' => [ + 'application/json', + ], 'pGCustomerDeleteInstrument' => [ 'application/json', ], @@ -248,7 +296,7 @@ public function PGCreateCustomer($x_api_version, $create_customer_request, $x_re 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCreateCustomer", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -558,7 +606,7 @@ public function pGCreateCustomerRequest($x_api_version, $create_customer_request $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -656,7 +704,7 @@ public function PGESCreateOnDemandTransfer($x_api_version, $vendor_id, $x_reques 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESCreateOnDemandTransfer", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -829,7 +877,7 @@ public function pGESCreateOnDemandTransferRequest($x_api_version, $vendor_id, $x $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -935,7 +983,7 @@ public function PGESCreateVendors($x_api_version, $x_request_id = null, $x_idemp 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESCreateVendors", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -1101,7 +1149,7 @@ public function pGESCreateVendorsRequest($x_api_version, $x_request_id = null, $ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -1199,7 +1247,7 @@ public function PGESDownloadVendorsDocs($x_api_version, $doc_type, $vendor_id, $ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESDownloadVendorsDocs", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -1355,7 +1403,7 @@ public function pGESDownloadVendorsDocsRequest($x_api_version, $doc_type, $vendo $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -1462,7 +1510,7 @@ public function PGESFetchVendors($x_api_version, $vendor_id, $x_request_id = nul 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESFetchVendors", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -1634,7 +1682,7 @@ public function pGESFetchVendorsRequest($x_api_version, $vendor_id, $x_request_i $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -1733,7 +1781,7 @@ public function PGESGetVendorBalance($x_api_version, $vendor_id, $x_request_id = 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESGetVendorBalance", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -1905,7 +1953,7 @@ public function pGESGetVendorBalanceRequest($x_api_version, $vendor_id, $x_reque $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -2004,7 +2052,7 @@ public function PGESGetVendorBalanceTransferCharges($x_api_version, $amount, $ra 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESGetVendorBalanceTransferCharges", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -2192,7 +2240,7 @@ public function pGESGetVendorBalanceTransferChargesRequest($x_api_version, $amou $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -2291,7 +2339,7 @@ public function PGESGetVendorsDocs($x_api_version, $vendor_id, $x_request_id = n 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESGetVendorsDocs", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -2463,7 +2511,7 @@ public function pGESGetVendorsDocsRequest($x_api_version, $vendor_id, $x_request $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -2562,7 +2610,7 @@ public function PGESOrderRecon($x_api_version, $x_request_id = null, $x_idempote 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESOrderRecon", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -2774,7 +2822,7 @@ public function pGESOrderReconRequest($x_api_version, $x_request_id = null, $x_i $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -2872,7 +2920,7 @@ public function PGESUpdateVendors($x_api_version, $vendor_id, $x_request_id = nu 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESUpdateVendors", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -3045,7 +3093,7 @@ public function pGESUpdateVendorsRequest($x_api_version, $vendor_id, $x_request_ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -3151,7 +3199,7 @@ public function PGESUploadVendorsDocs($x_api_version, $vendor_id, $x_request_id 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGESUploadVendorsDocs", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -3326,7 +3374,7 @@ public function pGESUploadVendorsDocsRequest($x_api_version, $vendor_id, $x_requ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -3445,7 +3493,7 @@ public function PGOrderSplitAfterPayment($x_api_version, $order_id, $x_request_i 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderSplitAfterPayment", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -3664,7 +3712,7 @@ public function pGOrderSplitAfterPaymentRequest($x_api_version, $order_id, $x_re $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -3770,7 +3818,7 @@ public function PGOrderStaticSplit($x_api_version, $x_request_id = null, $x_idem 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderStaticSplit", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -3936,7 +3984,7 @@ public function pGOrderStaticSplitRequest($x_api_version, $x_request_id = null, $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -4034,7 +4082,7 @@ public function PGEligibilityFetchCardlessEMI($x_api_version, $eligibility_fetch 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGEligibilityFetchCardlessEMI", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -4367,7 +4415,7 @@ public function pGEligibilityFetchCardlessEMIRequest($x_api_version, $eligibilit $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -4465,7 +4513,7 @@ public function PGEligibilityFetchOffers($x_api_version, $eligibility_fetch_offe 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGEligibilityFetchOffers", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -4775,7 +4823,7 @@ public function pGEligibilityFetchOffersRequest($x_api_version, $eligibility_fet $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -4873,7 +4921,7 @@ public function PGEligibilityFetchPaylater($x_api_version, $eligibility_fetch_pa 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGEligibilityFetchPaylater", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -5206,7 +5254,7 @@ public function pGEligibilityFetchPaylaterRequest($x_api_version, $eligibility_f $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -5304,7 +5352,7 @@ public function PGEligibilityFetchPaymentMethods($x_api_version, $eligibility_fe 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGEligibilityFetchPaymentMethods", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -5637,7 +5685,7 @@ public function pGEligibilityFetchPaymentMethodsRequest($x_api_version, $eligibi $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -5735,7 +5783,7 @@ public function PGCreateOffer($x_api_version, $create_offer_request, $x_request_ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCreateOffer", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -6045,7 +6093,7 @@ public function pGCreateOfferRequest($x_api_version, $create_offer_request, $x_r $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -6143,7 +6191,7 @@ public function PGFetchOffer($x_api_version, $offer_id, $x_request_id = null, $x 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGFetchOffer", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -6453,7 +6501,7 @@ public function pGFetchOfferRequest($x_api_version, $offer_id, $x_request_id = n $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -6552,7 +6600,7 @@ public function PGCreateOrder($x_api_version, $create_order_request, $x_request_ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCreateOrder", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -6862,7 +6910,7 @@ public function pGCreateOrderRequest($x_api_version, $create_order_request, $x_r $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -6960,7 +7008,7 @@ public function PGFetchOrder($x_api_version, $order_id, $x_request_id = null, $x 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGFetchOrder", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -7270,7 +7318,7 @@ public function pGFetchOrderRequest($x_api_version, $order_id, $x_request_id = n $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -7369,7 +7417,7 @@ public function PGTerminateOrder($x_api_version, $order_id, $terminate_order_req 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGTerminateOrder", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -7686,7 +7734,7 @@ public function pGTerminateOrderRequest($x_api_version, $order_id, $terminate_or $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -7792,7 +7840,7 @@ public function PGFetchRecon($x_api_version, $fetch_recon_request, $content_type 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGFetchRecon", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -8104,7 +8152,7 @@ public function pGFetchReconRequest($x_api_version, $fetch_recon_request, $conte $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -8202,7 +8250,7 @@ public function PGCancelLink($x_api_version, $link_id, $x_request_id = null, $x_ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCancelLink", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -8512,7 +8560,7 @@ public function pGCancelLinkRequest($x_api_version, $link_id, $x_request_id = nu $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -8611,7 +8659,7 @@ public function PGCreateLink($x_api_version, $create_link_request, $x_request_id 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCreateLink", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -8921,7 +8969,7 @@ public function pGCreateLinkRequest($x_api_version, $create_link_request, $x_req $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -9019,7 +9067,7 @@ public function PGFetchLink($x_api_version, $link_id, $x_request_id = null, $x_i 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGFetchLink", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -9352,7 +9400,7 @@ public function pGFetchLinkRequest($x_api_version, $link_id, $x_request_id = nul $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -9451,7 +9499,7 @@ public function PGLinkFetchOrders($x_api_version, $link_id, $x_request_id = null 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGLinkFetchOrders", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -9761,7 +9809,7 @@ public function pGLinkFetchOrdersRequest($x_api_version, $link_id, $x_request_id $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -9860,7 +9908,7 @@ public function PGAuthorizeOrder($x_api_version, $order_id, $authorize_order_req 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGAuthorizeOrder", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -10200,7 +10248,7 @@ public function pGAuthorizeOrderRequest($x_api_version, $order_id, $authorize_or $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -10306,7 +10354,7 @@ public function PGOrderAuthenticatePayment($x_api_version, $cf_payment_id, $orde 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderAuthenticatePayment", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -10646,7 +10694,7 @@ public function pGOrderAuthenticatePaymentRequest($x_api_version, $cf_payment_id $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -10752,7 +10800,7 @@ public function PGOrderFetchPayment($x_api_version, $order_id, $cf_payment_id, $ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderFetchPayment", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -11092,7 +11140,7 @@ public function pGOrderFetchPaymentRequest($x_api_version, $order_id, $cf_paymen $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -11199,7 +11247,7 @@ public function PGOrderFetchPayments($x_api_version, $order_id, $x_request_id = 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderFetchPayments", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -11532,7 +11580,7 @@ public function pGOrderFetchPaymentsRequest($x_api_version, $order_id, $x_reques $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -11631,7 +11679,7 @@ public function PGPayOrder($x_api_version, $pay_order_request, $x_request_id = n 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGPayOrder", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -11964,7 +12012,7 @@ public function pGPayOrderRequest($x_api_version, $pay_order_request, $x_request $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -12062,7 +12110,7 @@ public function PGOrderCreateRefund($x_api_version, $order_id, $order_create_ref 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderCreateRefund", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -12402,7 +12450,7 @@ public function pGOrderCreateRefundRequest($x_api_version, $order_id, $order_cre $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -12508,7 +12556,7 @@ public function PGOrderFetchRefund($x_api_version, $order_id, $refund_id, $x_req 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderFetchRefund", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -12848,7 +12896,7 @@ public function pGOrderFetchRefundRequest($x_api_version, $order_id, $refund_id, $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -12955,7 +13003,7 @@ public function PGOrderFetchRefunds($x_api_version, $order_id, $x_request_id = n 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGOrderFetchRefunds", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -13265,7 +13313,7 @@ public function pGOrderFetchRefundsRequest($x_api_version, $order_id, $x_request $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -13364,7 +13412,7 @@ public function PGFetchSettlements($x_api_version, $fetch_settlements_request, $ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGFetchSettlements", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -13676,7 +13724,7 @@ public function pGFetchSettlementsRequest($x_api_version, $fetch_settlements_req $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -13774,7 +13822,7 @@ public function PGSettlementFetchRecon($x_api_version, $settlement_fetch_recon_r 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGSettlementFetchRecon", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -14086,7 +14134,7 @@ public function pGSettlementFetchReconRequest($x_api_version, $settlement_fetch_ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -14172,7 +14220,7 @@ public function pGSettlementFetchReconRequest($x_api_version, $settlement_fetch_ } - public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function MarkForSettlement($x_api_version, $x_request_id = null, $x_idempotency_key = null, $create_order_settlement_request_body = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -14182,9 +14230,9 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."PGOrderFetchSettlement", + 'environment' => $env."MarkForSettlement", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -14212,8 +14260,8 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['pGOrderFetchSettlement'][0]; - $request = $this->pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['markForSettlement'][0]; + $request = $this->markForSettlementRequest($x_api_version, $x_request_id, $x_idempotency_key, $create_order_settlement_request_body, $contentType); try { $options = $this->createHttpClientOption(); @@ -14251,18 +14299,18 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id } switch($statusCode) { - case 200: - if ('\Cashfree\Model\SettlementEntity' === '\SplFileObject') { + case 202: + if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\SettlementEntity' !== 'string') { + if ('object' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\SettlementEntity', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14297,47 +14345,17 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id $response->getHeaders() ]; case 404: - if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError404' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 422: - if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\IdempotencyError' !== 'string') { + if ('\Cashfree\Model\BadRequestError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14356,39 +14374,9 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id $response->getStatusCode(), $response->getHeaders() ]; - case 500: - if ('\Cashfree\Model\ApiError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 502: - if ('\Cashfree\Model\ApiError502' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError502' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError502', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } - $returnType = '\Cashfree\Model\SettlementEntity'; + $returnType = 'object'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14406,10 +14394,10 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\SettlementEntity', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14433,23 +14421,7 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\ApiError404', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 422: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\IdempotencyError', + '\Cashfree\Model\BadRequestError', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14462,48 +14434,26 @@ public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id ); $e->setResponseObject($data); break; - case 500: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 502: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError502', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } - public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['pGOrderFetchSettlement'][0]) + public function markForSettlementRequest($x_api_version, $x_request_id = null, $x_idempotency_key = null, $create_order_settlement_request_body = null, string $contentType = self::contentTypes['markForSettlement'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling pGOrderFetchSettlement' + 'Missing the required parameter $x_api_version when calling markForSettlement' ); } - // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $order_id when calling pGOrderFetchSettlement' - ); - } - $resourcePath = '/orders/{order_id}/settlements'; + $resourcePath = '/orders/settlements'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14517,7 +14467,7 @@ public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_requ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -14547,18 +14497,17 @@ public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_requ // $headers['x-idempotency-key'] = $x_idempotency_key; // } - // path params - if ($order_id !== null) { - $resourcePath = str_replace( - '{' . 'order_id' . '}', - ObjectSerializer::toPathValue($order_id), - $resourcePath - ); - } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($create_order_settlement_request_body)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_order_settlement_request_body)); + } else { + $httpBody = $create_order_settlement_request_body; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -14596,7 +14545,7 @@ public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_requ } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14604,7 +14553,7 @@ public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_requ } - public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function PGOrderFetchSettlement($x_api_version, $order_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -14614,9 +14563,9 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposCreateTerminal", + 'environment' => $env."PGOrderFetchSettlement", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -14644,8 +14593,8 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposCreateTerminal'][0]; - $request = $this->sposCreateTerminalRequest($x_api_version, $create_terminal_request, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['pGOrderFetchSettlement'][0]; + $request = $this->pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -14684,17 +14633,17 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ switch($statusCode) { case 200: - if ('\Cashfree\Model\TerminalEntity' === '\SplFileObject') { + if ('\Cashfree\Model\SettlementEntity' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\TerminalEntity' !== 'string') { + if ('\Cashfree\Model\SettlementEntity' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalEntity', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SettlementEntity', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -14803,9 +14752,24 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ $response->getStatusCode(), $response->getHeaders() ]; + case 502: + if ('\Cashfree\Model\ApiError502' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError502' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError502', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } - $returnType = '\Cashfree\Model\TerminalEntity'; + $returnType = '\Cashfree\Model\SettlementEntity'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -14826,7 +14790,7 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\TerminalEntity', + '\Cashfree\Model\SettlementEntity', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -14887,32 +14851,40 @@ public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_ ); $e->setResponseObject($data); break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError502', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } - public function sposCreateTerminalRequest($x_api_version, $create_terminal_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposCreateTerminal'][0]) + public function pGOrderFetchSettlementRequest($x_api_version, $order_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['pGOrderFetchSettlement'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposCreateTerminal' + 'Missing the required parameter $x_api_version when calling pGOrderFetchSettlement' ); } - // verify the required parameter 'create_terminal_request' is set - if ($create_terminal_request === null || (is_array($create_terminal_request) && count($create_terminal_request) === 0)) { + // verify the required parameter 'order_id' is set + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_terminal_request when calling sposCreateTerminal' + 'Missing the required parameter $order_id when calling pGOrderFetchSettlement' ); } - $resourcePath = '/terminal'; + $resourcePath = '/orders/{order_id}/settlements'; $formParams = []; $queryParams = []; $headerParams = []; @@ -14926,7 +14898,7 @@ public function sposCreateTerminalRequest($x_api_version, $create_terminal_reque $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -14956,17 +14928,18 @@ public function sposCreateTerminalRequest($x_api_version, $create_terminal_reque // $headers['x-idempotency-key'] = $x_idempotency_key; // } + // path params + if ($order_id !== null) { + $resourcePath = str_replace( + '{' . 'order_id' . '}', + ObjectSerializer::toPathValue($order_id), + $resourcePath + ); + } // for model (json/xml) - if (isset($create_terminal_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_terminal_request)); - } else { - $httpBody = $create_terminal_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -15004,7 +14977,7 @@ public function sposCreateTerminalRequest($x_api_version, $create_terminal_reque } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -15012,7 +14985,7 @@ public function sposCreateTerminalRequest($x_api_version, $create_terminal_reque } - public function SposCreateTerminalTransaction($x_api_version, $create_terminal_transaction_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function PGFetchSimulation($x_api_version, $simulation_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -15022,9 +14995,9 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposCreateTerminalTransaction", + 'environment' => $env."PGFetchSimulation", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -15052,8 +15025,8 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposCreateTerminalTransaction'][0]; - $request = $this->sposCreateTerminalTransactionRequest($x_api_version, $create_terminal_transaction_request, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['pGFetchSimulation'][0]; + $request = $this->pGFetchSimulationRequest($x_api_version, $simulation_id, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -15092,17 +15065,17 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t switch($statusCode) { case 200: - if ('\Cashfree\Model\TerminalTransactionEntity' === '\SplFileObject') { + if ('\Cashfree\Model\SimulationResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\TerminalTransactionEntity' !== 'string') { + if ('\Cashfree\Model\SimulationResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalTransactionEntity', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SimulationResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15151,33 +15124,6354 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { + if ('\Cashfree\Model\RateLimitError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), $response->getStatusCode(), $response->getHeaders() ]; - case 422: + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SimulationResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SimulationResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function pGFetchSimulationRequest($x_api_version, $simulation_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['pGFetchSimulation'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling pGFetchSimulation' + ); + } + + // verify the required parameter 'simulation_id' is set + if ($simulation_id === null || (is_array($simulation_id) && count($simulation_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $simulation_id when calling pGFetchSimulation' + ); + } + + + + + $resourcePath = '/simulate/{simulation_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($simulation_id !== null) { + $resourcePath = str_replace( + '{' . 'simulation_id' . '}', + ObjectSerializer::toPathValue($simulation_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function PGSimulatePayment($x_api_version, $simulate_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."PGSimulatePayment", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['pGSimulatePayment'][0]; + $request = $this->pGSimulatePaymentRequest($x_api_version, $simulate_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SimulationResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SimulationResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SimulationResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SimulationResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SimulationResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function pGSimulatePaymentRequest($x_api_version, $simulate_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['pGSimulatePayment'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling pGSimulatePayment' + ); + } + + // verify the required parameter 'simulate_request' is set + if ($simulate_request === null || (is_array($simulate_request) && count($simulate_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $simulate_request when calling pGSimulatePayment' + ); + } + + + + + $resourcePath = '/simulate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($simulate_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($simulate_request)); + } else { + $httpBody = $simulate_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposCreateTerminal($x_api_version, $create_terminal_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposCreateTerminal", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposCreateTerminal'][0]; + $request = $this->sposCreateTerminalRequest($x_api_version, $create_terminal_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\TerminalEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\TerminalEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\TerminalEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\TerminalEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposCreateTerminalRequest($x_api_version, $create_terminal_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposCreateTerminal'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposCreateTerminal' + ); + } + + // verify the required parameter 'create_terminal_request' is set + if ($create_terminal_request === null || (is_array($create_terminal_request) && count($create_terminal_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_terminal_request when calling sposCreateTerminal' + ); + } + + + + + $resourcePath = '/terminal'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($create_terminal_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_terminal_request)); + } else { + $httpBody = $create_terminal_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposCreateTerminalTransaction($x_api_version, $create_terminal_transaction_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposCreateTerminalTransaction", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposCreateTerminalTransaction'][0]; + $request = $this->sposCreateTerminalTransactionRequest($x_api_version, $create_terminal_transaction_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\TerminalTransactionEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\TerminalTransactionEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalTransactionEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\TerminalTransactionEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\TerminalTransactionEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposCreateTerminalTransactionRequest($x_api_version, $create_terminal_transaction_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposCreateTerminalTransaction'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposCreateTerminalTransaction' + ); + } + + // verify the required parameter 'create_terminal_transaction_request' is set + if ($create_terminal_transaction_request === null || (is_array($create_terminal_transaction_request) && count($create_terminal_transaction_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_terminal_transaction_request when calling sposCreateTerminalTransaction' + ); + } + + + + + $resourcePath = '/terminal/transactions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($create_terminal_transaction_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_terminal_transaction_request)); + } else { + $httpBody = $create_terminal_transaction_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposFetchTerminal", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposFetchTerminal'][0]; + $request = $this->sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\TerminalEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\TerminalEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\TerminalEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\TerminalEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminal'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposFetchTerminal' + ); + } + + // verify the required parameter 'terminal_phone_no' is set + if ($terminal_phone_no === null || (is_array($terminal_phone_no) && count($terminal_phone_no) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $terminal_phone_no when calling sposFetchTerminal' + ); + } + + + + + $resourcePath = '/terminal/{terminal_phone_no}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($terminal_phone_no !== null) { + $resourcePath = str_replace( + '{' . 'terminal_phone_no' . '}', + ObjectSerializer::toPathValue($terminal_phone_no), + $resourcePath + ); + } + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposFetchTerminalQRCodes", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposFetchTerminalQRCodes'][0]; + $request = $this->sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\FetchTerminalQRCodesEntity[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\FetchTerminalQRCodesEntity[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\FetchTerminalQRCodesEntity[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\FetchTerminalQRCodesEntity[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\FetchTerminalQRCodesEntity[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminalQRCodes'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposFetchTerminalQRCodes' + ); + } + + // verify the required parameter 'terminal_phone_no' is set + if ($terminal_phone_no === null || (is_array($terminal_phone_no) && count($terminal_phone_no) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $terminal_phone_no when calling sposFetchTerminalQRCodes' + ); + } + + // verify the required parameter 'cf_terminal_id' is set + if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $cf_terminal_id when calling sposFetchTerminalQRCodes' + ); + } + + + + + $resourcePath = '/terminal/qrcodes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $terminal_phone_no, + 'terminal_phone_no', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cf_terminal_id, + 'cf_terminal_id', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposFetchTerminalTransaction", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposFetchTerminalTransaction'][0]; + $request = $this->sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_terminal_id, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\TerminalPaymentEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\TerminalPaymentEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalPaymentEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\TerminalPaymentEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\TerminalPaymentEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminalTransaction'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposFetchTerminalTransaction' + ); + } + + // verify the required parameter 'utr' is set + if ($utr === null || (is_array($utr) && count($utr) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $utr when calling sposFetchTerminalTransaction' + ); + } + + // verify the required parameter 'cf_terminal_id' is set + if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $cf_terminal_id when calling sposFetchTerminalTransaction' + ); + } + + + + + $resourcePath = '/terminal/{cf_terminal_id}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $utr, + 'utr', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($cf_terminal_id !== null) { + $resourcePath = str_replace( + '{' . 'cf_terminal_id' . '}', + ObjectSerializer::toPathValue($cf_terminal_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposUpdateTerminal", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposUpdateTerminal'][0]; + $request = $this->sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\UpdateTerminalEntity[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\UpdateTerminalEntity[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\UpdateTerminalEntity[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\UpdateTerminalEntity[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\UpdateTerminalEntity[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUpdateTerminal'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposUpdateTerminal' + ); + } + + // verify the required parameter 'cf_terminal_id' is set + if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $cf_terminal_id when calling sposUpdateTerminal' + ); + } + + // verify the required parameter 'update_terminal_request' is set + if ($update_terminal_request === null || (is_array($update_terminal_request) && count($update_terminal_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_terminal_request when calling sposUpdateTerminal' + ); + } + + + + + $resourcePath = '/terminal/{cf_terminal_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($cf_terminal_id !== null) { + $resourcePath = str_replace( + '{' . 'cf_terminal_id' . '}', + ObjectSerializer::toPathValue($cf_terminal_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (isset($update_terminal_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_terminal_request)); + } else { + $httpBody = $update_terminal_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposUpdateTerminalStatus", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposUpdateTerminalStatus'][0]; + $request = $this->sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\UpdateTerminalEntity[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\UpdateTerminalEntity[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\UpdateTerminalEntity[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\UpdateTerminalEntity[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\UpdateTerminalEntity[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUpdateTerminalStatus'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposUpdateTerminalStatus' + ); + } + + // verify the required parameter 'cf_terminal_id' is set + if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $cf_terminal_id when calling sposUpdateTerminalStatus' + ); + } + + // verify the required parameter 'update_terminal_status_request' is set + if ($update_terminal_status_request === null || (is_array($update_terminal_status_request) && count($update_terminal_status_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_terminal_status_request when calling sposUpdateTerminalStatus' + ); + } + + + + + $resourcePath = '/terminal/{cf_terminal_id}/status'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($cf_terminal_id !== null) { + $resourcePath = str_replace( + '{' . 'cf_terminal_id' . '}', + ObjectSerializer::toPathValue($cf_terminal_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (isset($update_terminal_status_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_terminal_status_request)); + } else { + $httpBody = $update_terminal_status_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SposUploadTerminalDocs", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['sposUploadTerminalDocs'][0]; + $request = $this->sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\UploadTerminalDocsEntity[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\UploadTerminalDocsEntity[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\UploadTerminalDocsEntity[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError409' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\UploadTerminalDocsEntity[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\UploadTerminalDocsEntity[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError409', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUploadTerminalDocs'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling sposUploadTerminalDocs' + ); + } + + // verify the required parameter 'cf_terminal_id' is set + if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $cf_terminal_id when calling sposUploadTerminalDocs' + ); + } + + // verify the required parameter 'upload_terminal_docs' is set + if ($upload_terminal_docs === null || (is_array($upload_terminal_docs) && count($upload_terminal_docs) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $upload_terminal_docs when calling sposUploadTerminalDocs' + ); + } + + + + + $resourcePath = '/terminal/{cf_terminal_id}/docs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($cf_terminal_id !== null) { + $resourcePath = str_replace( + '{' . 'cf_terminal_id' . '}', + ObjectSerializer::toPathValue($cf_terminal_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (isset($upload_terminal_docs)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($upload_terminal_docs)); + } else { + $httpBody = $upload_terminal_docs; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsCreatePayment($x_api_version, $create_subscription_payment_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsCreatePayment", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsCreatePayment'][0]; + $request = $this->subsCreatePaymentRequest($x_api_version, $create_subscription_payment_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SubsCreatePayment200Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SubsCreatePayment200Response' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubsCreatePayment200Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SubsCreatePayment200Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SubsCreatePayment200Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsCreatePaymentRequest($x_api_version, $create_subscription_payment_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsCreatePayment'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsCreatePayment' + ); + } + + // verify the required parameter 'create_subscription_payment_request' is set + if ($create_subscription_payment_request === null || (is_array($create_subscription_payment_request) && count($create_subscription_payment_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_subscription_payment_request when calling subsCreatePayment' + ); + } + + + + + $resourcePath = '/subscriptions/pay'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($create_subscription_payment_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_subscription_payment_request)); + } else { + $httpBody = $create_subscription_payment_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsCreatePlan($x_api_version, $create_plan_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsCreatePlan", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsCreatePlan'][0]; + $request = $this->subsCreatePlanRequest($x_api_version, $create_plan_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\PlanEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\PlanEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\PlanEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\PlanEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\PlanEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsCreatePlanRequest($x_api_version, $create_plan_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsCreatePlan'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsCreatePlan' + ); + } + + // verify the required parameter 'create_plan_request' is set + if ($create_plan_request === null || (is_array($create_plan_request) && count($create_plan_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_plan_request when calling subsCreatePlan' + ); + } + + + + + $resourcePath = '/plans'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($create_plan_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_plan_request)); + } else { + $httpBody = $create_plan_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsCreateRefund($x_api_version, $subscription_id, $create_subscription_refund_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsCreateRefund", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsCreateRefund'][0]; + $request = $this->subsCreateRefundRequest($x_api_version, $subscription_id, $create_subscription_refund_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SubscriptionPaymentRefundEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SubscriptionPaymentRefundEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionPaymentRefundEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SubscriptionPaymentRefundEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SubscriptionPaymentRefundEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsCreateRefundRequest($x_api_version, $subscription_id, $create_subscription_refund_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsCreateRefund'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsCreateRefund' + ); + } + + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_id when calling subsCreateRefund' + ); + } + + // verify the required parameter 'create_subscription_refund_request' is set + if ($create_subscription_refund_request === null || (is_array($create_subscription_refund_request) && count($create_subscription_refund_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_subscription_refund_request when calling subsCreateRefund' + ); + } + + + + + $resourcePath = '/subscriptions/{subscription_id}/refunds'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (isset($create_subscription_refund_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_subscription_refund_request)); + } else { + $httpBody = $create_subscription_refund_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsCreateSubscription($x_api_version, $create_subscription_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsCreateSubscription", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsCreateSubscription'][0]; + $request = $this->subsCreateSubscriptionRequest($x_api_version, $create_subscription_request, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SubscriptionEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SubscriptionEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\IdempotencyError' !== 'string') { + if ('\Cashfree\Model\IdempotencyError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SubscriptionEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SubscriptionEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\IdempotencyError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsCreateSubscriptionRequest($x_api_version, $create_subscription_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsCreateSubscription'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsCreateSubscription' + ); + } + + // verify the required parameter 'create_subscription_request' is set + if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_subscription_request when calling subsCreateSubscription' + ); + } + + + + + $resourcePath = '/subscriptions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + + + // for model (json/xml) + if (isset($create_subscription_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_subscription_request)); + } else { + $httpBody = $create_subscription_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsFetchPlan($x_api_version, $plan_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsFetchPlan", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsFetchPlan'][0]; + $request = $this->subsFetchPlanRequest($x_api_version, $plan_id, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\PlanEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\PlanEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\PlanEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\PlanEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\PlanEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsFetchPlanRequest($x_api_version, $plan_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsFetchPlan'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsFetchPlan' + ); + } + + // verify the required parameter 'plan_id' is set + if ($plan_id === null || (is_array($plan_id) && count($plan_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $plan_id when calling subsFetchPlan' + ); + } + + + + + $resourcePath = '/pg/plans/{plan_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($plan_id !== null) { + $resourcePath = str_replace( + '{' . 'plan_id' . '}', + ObjectSerializer::toPathValue($plan_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsFetchSubscription($x_api_version, $subscription_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsFetchSubscription", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsFetchSubscription'][0]; + $request = $this->subsFetchSubscriptionRequest($x_api_version, $subscription_id, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SubscriptionEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SubscriptionEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cashfree\Model\ApiError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cashfree\Model\SubscriptionEntity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\SubscriptionEntity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\BadRequestError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\AuthenticationError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError404', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cashfree\Model\ApiError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + public function subsFetchSubscriptionRequest($x_api_version, $subscription_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsFetchSubscription'][0]) + { + + // verify the required parameter 'x_api_version' is set + if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $x_api_version when calling subsFetchSubscription' + ); + } + + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_id when calling subsFetchSubscription' + ); + } + + + + + $resourcePath = '/subscriptions/{subscription_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; + if (Cashfree::$XPartnerApiKey !== null) { + $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; + } + + if (Cashfree::$XClientSecret !== null) { + $headers['x-client-secret'] = Cashfree::$XClientSecret; + } + + if (Cashfree::$XPartnerMerchantId !== null) { + $headers['x-partner-merchantid'] = Cashfree::$XPartnerMerchantId; + } + + if (Cashfree::$XClientId !== null) { + $headers['x-client-id'] = Cashfree::$XClientId; + } + + if (Cashfree::$XClientSignature !== null) { + $headers['x-client-signature'] = Cashfree::$XClientSignature; + } + + $headers['x-api-version'] = $x_api_version; + if($x_request_id !== null) { + $headers['x-request-id'] = $x_request_id; + } + + // if($x_idempotency_key !== null) { + // $headers['x-idempotency-key'] = $x_idempotency_key; +// } + + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } + + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = "https://sandbox.cashfree.com/pg"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $operationHost = "https://api.cashfree.com/pg"; + } + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + + public function SubsFetchSubscriptionPayment($x_api_version, $subscription_id, $payment_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + { + + $env = "sandbox"; + if(Cashfree::$XEnvironment == Cashfree::$PRODUCTION) { + $env = "production"; + } + if(Cashfree::$XEnableErrorAnalytics) { + \Sentry\init([ + 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', + 'environment' => $env."SubsFetchSubscriptionPayment", + 'attach_stacktrace' => true, + 'release' => '4.2.0', + 'traces_sample_rate' => 1.0, + 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { + $cashfreepg = "cashfree-pg"; + if (count($event->getExceptions()) > 0 && count($event->getExceptions()[0]->getStackTrace()->getFrames()) > 0) { + if (strpos($event->getExceptions()[0]->getStackTrace()->getFrames()[0]->getFile(), $cashfreepg) !== false) { + $osContext = $event->getOsContext(); + $osContext->setKernelVersion(""); + $osContext->setMachineType(""); + $osContext->setKernelVersion(""); + $osContext->setVersion(""); + $event->setOsContext($osContext); + if(Cashfree::$XEnableErrorAnalytics) { + return $event; + } + return null; + } + } + return null; + }, + ]); + } + + $this->client = new Client(); + if($http_client !== null) { + $this->client = $http_client; + } + $this->headerSelector = new HeaderSelector(); + $contentType = self::contentTypes['subsFetchSubscriptionPayment'][0]; + $request = $this->subsFetchSubscriptionPaymentRequest($x_api_version, $subscription_id, $payment_id, $x_request_id, $x_idempotency_key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cashfree\Model\SubscriptionPaymentEntity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\SubscriptionPaymentEntity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionPaymentEntity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cashfree\Model\BadRequestError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\BadRequestError' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\BadRequestError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cashfree\Model\AuthenticationError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\AuthenticationError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\AuthenticationError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cashfree\Model\ApiError404' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cashfree\Model\ApiError404' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15213,7 +21507,7 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t ]; } - $returnType = '\Cashfree\Model\TerminalTransactionEntity'; + $returnType = '\Cashfree\Model\SubscriptionPaymentEntity'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15234,7 +21528,7 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\TerminalTransactionEntity', + '\Cashfree\Model\SubscriptionPaymentEntity', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15263,22 +21557,6 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 422: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\IdempotencyError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15300,27 +21578,34 @@ public function SposCreateTerminalTransaction($x_api_version, $create_terminal_t } } - public function sposCreateTerminalTransactionRequest($x_api_version, $create_terminal_transaction_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposCreateTerminalTransaction'][0]) + public function subsFetchSubscriptionPaymentRequest($x_api_version, $subscription_id, $payment_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsFetchSubscriptionPayment'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposCreateTerminalTransaction' + 'Missing the required parameter $x_api_version when calling subsFetchSubscriptionPayment' ); } - // verify the required parameter 'create_terminal_transaction_request' is set - if ($create_terminal_transaction_request === null || (is_array($create_terminal_transaction_request) && count($create_terminal_transaction_request) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $create_terminal_transaction_request when calling sposCreateTerminalTransaction' + 'Missing the required parameter $subscription_id when calling subsFetchSubscriptionPayment' + ); + } + + // verify the required parameter 'payment_id' is set + if ($payment_id === null || (is_array($payment_id) && count($payment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $payment_id when calling subsFetchSubscriptionPayment' ); } - $resourcePath = '/terminal/transactions'; + $resourcePath = '/subscriptions/{subscription_id}/payments/{payment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15334,7 +21619,7 @@ public function sposCreateTerminalTransactionRequest($x_api_version, $create_ter $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -15364,17 +21649,26 @@ public function sposCreateTerminalTransactionRequest($x_api_version, $create_ter // $headers['x-idempotency-key'] = $x_idempotency_key; // } + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } + // path params + if ($payment_id !== null) { + $resourcePath = str_replace( + '{' . 'payment_id' . '}', + ObjectSerializer::toPathValue($payment_id), + $resourcePath + ); + } // for model (json/xml) - if (isset($create_terminal_transaction_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_terminal_transaction_request)); - } else { - $httpBody = $create_terminal_transaction_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -15412,7 +21706,7 @@ public function sposCreateTerminalTransactionRequest($x_api_version, $create_ter } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -15420,7 +21714,7 @@ public function sposCreateTerminalTransactionRequest($x_api_version, $create_ter } - public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubsFetchSubscriptionPayments($x_api_version, $subscription_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -15430,9 +21724,9 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposFetchTerminal", + 'environment' => $env."SubsFetchSubscriptionPayments", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -15460,8 +21754,8 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposFetchTerminal'][0]; - $request = $this->sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subsFetchSubscriptionPayments'][0]; + $request = $this->subsFetchSubscriptionPaymentsRequest($x_api_version, $subscription_id, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -15500,17 +21794,17 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request switch($statusCode) { case 200: - if ('\Cashfree\Model\TerminalEntity' === '\SplFileObject') { + if ('\Cashfree\Model\SubscriptionPaymentEntity[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\TerminalEntity' !== 'string') { + if ('\Cashfree\Model\SubscriptionPaymentEntity[]' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalEntity', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionPaymentEntity[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15559,21 +21853,6 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 422: if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -15621,7 +21900,7 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request ]; } - $returnType = '\Cashfree\Model\TerminalEntity'; + $returnType = '\Cashfree\Model\SubscriptionPaymentEntity[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -15642,7 +21921,7 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\TerminalEntity', + '\Cashfree\Model\SubscriptionPaymentEntity[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -15671,14 +21950,6 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -15708,27 +21979,27 @@ public function SposFetchTerminal($x_api_version, $terminal_phone_no, $x_request } } - public function sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminal'][0]) + public function subsFetchSubscriptionPaymentsRequest($x_api_version, $subscription_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsFetchSubscriptionPayments'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposFetchTerminal' + 'Missing the required parameter $x_api_version when calling subsFetchSubscriptionPayments' ); } - // verify the required parameter 'terminal_phone_no' is set - if ($terminal_phone_no === null || (is_array($terminal_phone_no) && count($terminal_phone_no) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $terminal_phone_no when calling sposFetchTerminal' + 'Missing the required parameter $subscription_id when calling subsFetchSubscriptionPayments' ); } - $resourcePath = '/terminal/{terminal_phone_no}'; + $resourcePath = '/subscriptions/{subscription_id}/payments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15742,7 +22013,7 @@ public function sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -15773,10 +22044,10 @@ public function sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_ // } // path params - if ($terminal_phone_no !== null) { + if ($subscription_id !== null) { $resourcePath = str_replace( - '{' . 'terminal_phone_no' . '}', - ObjectSerializer::toPathValue($terminal_phone_no), + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), $resourcePath ); } @@ -15829,7 +22100,7 @@ public function sposFetchTerminalRequest($x_api_version, $terminal_phone_no, $x_ } - public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubsFetchSubscriptionRefund($x_api_version, $subscription_id, $refund_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -15839,9 +22110,9 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposFetchTerminalQRCodes", + 'environment' => $env."SubsFetchSubscriptionRefund", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -15869,8 +22140,8 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposFetchTerminalQRCodes'][0]; - $request = $this->sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subsFetchSubscriptionRefund'][0]; + $request = $this->subsFetchSubscriptionRefundRequest($x_api_version, $subscription_id, $refund_id, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -15909,17 +22180,17 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf switch($statusCode) { case 200: - if ('\Cashfree\Model\FetchTerminalQRCodesEntity[]' === '\SplFileObject') { + if ('\Cashfree\Model\SubscriptionPaymentRefundEntity' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\FetchTerminalQRCodesEntity[]' !== 'string') { + if ('\Cashfree\Model\SubscriptionPaymentRefundEntity' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\FetchTerminalQRCodesEntity[]', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionPaymentRefundEntity', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -15968,36 +22239,6 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 422: - if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\IdempotencyError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 429: if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -16030,7 +22271,7 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf ]; } - $returnType = '\Cashfree\Model\FetchTerminalQRCodesEntity[]'; + $returnType = '\Cashfree\Model\SubscriptionPaymentRefundEntity'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16051,7 +22292,7 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\FetchTerminalQRCodesEntity[]', + '\Cashfree\Model\SubscriptionPaymentRefundEntity', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16080,22 +22321,6 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 422: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\IdempotencyError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16117,58 +22342,40 @@ public function SposFetchTerminalQRCodes($x_api_version, $terminal_phone_no, $cf } } - public function sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_no, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminalQRCodes'][0]) + public function subsFetchSubscriptionRefundRequest($x_api_version, $subscription_id, $refund_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsFetchSubscriptionRefund'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposFetchTerminalQRCodes' + 'Missing the required parameter $x_api_version when calling subsFetchSubscriptionRefund' ); } - // verify the required parameter 'terminal_phone_no' is set - if ($terminal_phone_no === null || (is_array($terminal_phone_no) && count($terminal_phone_no) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $terminal_phone_no when calling sposFetchTerminalQRCodes' + 'Missing the required parameter $subscription_id when calling subsFetchSubscriptionRefund' ); } - // verify the required parameter 'cf_terminal_id' is set - if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + // verify the required parameter 'refund_id' is set + if ($refund_id === null || (is_array($refund_id) && count($refund_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $cf_terminal_id when calling sposFetchTerminalQRCodes' + 'Missing the required parameter $refund_id when calling subsFetchSubscriptionRefund' ); } - $resourcePath = '/terminal/qrcodes'; + $resourcePath = '/subscriptions/{subscription_id}/refunds/{refund_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $terminal_phone_no, - 'terminal_phone_no', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $cf_terminal_id, - 'cf_terminal_id', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); $headers = $this->headerSelector->selectHeaders( ['application/json', ], @@ -16176,7 +22383,7 @@ public function sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -16206,6 +22413,22 @@ public function sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_ // $headers['x-idempotency-key'] = $x_idempotency_key; // } + // path params + if ($subscription_id !== null) { + $resourcePath = str_replace( + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } + // path params + if ($refund_id !== null) { + $resourcePath = str_replace( + '{' . 'refund_id' . '}', + ObjectSerializer::toPathValue($refund_id), + $resourcePath + ); + } // for model (json/xml) @@ -16255,7 +22478,7 @@ public function sposFetchTerminalQRCodesRequest($x_api_version, $terminal_phone_ } - public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubsManageSubscription($x_api_version, $subscription_id, $manage_subscription_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -16265,9 +22488,9 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposFetchTerminalTransaction", + 'environment' => $env."SubsManageSubscription", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -16295,8 +22518,8 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposFetchTerminalTransaction'][0]; - $request = $this->sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_terminal_id, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subsManageSubscription'][0]; + $request = $this->subsManageSubscriptionRequest($x_api_version, $subscription_id, $manage_subscription_request, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -16335,17 +22558,17 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ switch($statusCode) { case 200: - if ('\Cashfree\Model\TerminalPaymentEntity' === '\SplFileObject') { + if ('\Cashfree\Model\SubscriptionEntity' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\TerminalPaymentEntity' !== 'string') { + if ('\Cashfree\Model\SubscriptionEntity' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\TerminalPaymentEntity', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionEntity', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -16390,22 +22613,7 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError404', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -16456,7 +22664,7 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ ]; } - $returnType = '\Cashfree\Model\TerminalPaymentEntity'; + $returnType = '\Cashfree\Model\SubscriptionEntity'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16477,7 +22685,7 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\TerminalPaymentEntity', + '\Cashfree\Model\SubscriptionEntity', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16506,14 +22714,6 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16543,49 +22743,40 @@ public function SposFetchTerminalTransaction($x_api_version, $utr, $cf_terminal_ } } - public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_terminal_id, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposFetchTerminalTransaction'][0]) + public function subsManageSubscriptionRequest($x_api_version, $subscription_id, $manage_subscription_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsManageSubscription'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposFetchTerminalTransaction' + 'Missing the required parameter $x_api_version when calling subsManageSubscription' ); } - // verify the required parameter 'utr' is set - if ($utr === null || (is_array($utr) && count($utr) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $utr when calling sposFetchTerminalTransaction' + 'Missing the required parameter $subscription_id when calling subsManageSubscription' ); } - // verify the required parameter 'cf_terminal_id' is set - if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + // verify the required parameter 'manage_subscription_request' is set + if ($manage_subscription_request === null || (is_array($manage_subscription_request) && count($manage_subscription_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $cf_terminal_id when calling sposFetchTerminalTransaction' + 'Missing the required parameter $manage_subscription_request when calling subsManageSubscription' ); } - $resourcePath = '/terminal/{cf_terminal_id}/payments'; + $resourcePath = '/subscriptions/{subscription_id}/manage'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $utr, - 'utr', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); $headers = $this->headerSelector->selectHeaders( ['application/json', ], @@ -16593,7 +22784,7 @@ public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_te $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -16624,17 +22815,24 @@ public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_te // } // path params - if ($cf_terminal_id !== null) { + if ($subscription_id !== null) { $resourcePath = str_replace( - '{' . 'cf_terminal_id' . '}', - ObjectSerializer::toPathValue($cf_terminal_id), + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), $resourcePath ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($manage_subscription_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($manage_subscription_request)); + } else { + $httpBody = $manage_subscription_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -16672,7 +22870,7 @@ public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_te } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -16680,7 +22878,7 @@ public function sposFetchTerminalTransactionRequest($x_api_version, $utr, $cf_te } - public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubsManageSubscriptionPayment($x_api_version, $subscription_id, $payment_id, $manage_subscription_payment_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -16690,9 +22888,9 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposUpdateTerminal", + 'environment' => $env."SubsManageSubscriptionPayment", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -16720,8 +22918,8 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposUpdateTerminal'][0]; - $request = $this->sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subsManageSubscriptionPayment'][0]; + $request = $this->subsManageSubscriptionPaymentRequest($x_api_version, $subscription_id, $payment_id, $manage_subscription_payment_request, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -16760,17 +22958,17 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term switch($statusCode) { case 200: - if ('\Cashfree\Model\UpdateTerminalEntity[]' === '\SplFileObject') { + if ('\Cashfree\Model\SubscriptionPaymentEntity' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\UpdateTerminalEntity[]' !== 'string') { + if ('\Cashfree\Model\SubscriptionPaymentEntity' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\UpdateTerminalEntity[]', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionPaymentEntity', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -16819,36 +23017,6 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 422: - if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\IdempotencyError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\IdempotencyError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 429: if ('\Cashfree\Model\RateLimitError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -16881,7 +23049,7 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term ]; } - $returnType = '\Cashfree\Model\UpdateTerminalEntity[]'; + $returnType = '\Cashfree\Model\SubscriptionPaymentEntity'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -16902,7 +23070,7 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\UpdateTerminalEntity[]', + '\Cashfree\Model\SubscriptionPaymentEntity', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -16931,22 +23099,6 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 422: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\IdempotencyError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -16968,34 +23120,41 @@ public function SposUpdateTerminal($x_api_version, $cf_terminal_id, $update_term } } - public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $update_terminal_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUpdateTerminal'][0]) + public function subsManageSubscriptionPaymentRequest($x_api_version, $subscription_id, $payment_id, $manage_subscription_payment_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subsManageSubscriptionPayment'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposUpdateTerminal' + 'Missing the required parameter $x_api_version when calling subsManageSubscriptionPayment' ); } - // verify the required parameter 'cf_terminal_id' is set - if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $cf_terminal_id when calling sposUpdateTerminal' + 'Missing the required parameter $subscription_id when calling subsManageSubscriptionPayment' ); } - // verify the required parameter 'update_terminal_request' is set - if ($update_terminal_request === null || (is_array($update_terminal_request) && count($update_terminal_request) === 0)) { + // verify the required parameter 'payment_id' is set + if ($payment_id === null || (is_array($payment_id) && count($payment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_terminal_request when calling sposUpdateTerminal' + 'Missing the required parameter $payment_id when calling subsManageSubscriptionPayment' + ); + } + + // verify the required parameter 'manage_subscription_payment_request' is set + if ($manage_subscription_payment_request === null || (is_array($manage_subscription_payment_request) && count($manage_subscription_payment_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $manage_subscription_payment_request when calling subsManageSubscriptionPayment' ); } - $resourcePath = '/terminal/{cf_terminal_id}'; + $resourcePath = '/subscriptions/{subscription_id}/payments/{payment_id}/manage'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17009,7 +23168,7 @@ public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $upda $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -17040,22 +23199,30 @@ public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $upda // } // path params - if ($cf_terminal_id !== null) { + if ($subscription_id !== null) { $resourcePath = str_replace( - '{' . 'cf_terminal_id' . '}', - ObjectSerializer::toPathValue($cf_terminal_id), + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), + $resourcePath + ); + } + // path params + if ($payment_id !== null) { + $resourcePath = str_replace( + '{' . 'payment_id' . '}', + ObjectSerializer::toPathValue($payment_id), $resourcePath ); } // for model (json/xml) - if (isset($update_terminal_request)) { + if (isset($manage_subscription_payment_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_terminal_request)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($manage_subscription_payment_request)); } else { - $httpBody = $update_terminal_request; + $httpBody = $manage_subscription_payment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17095,7 +23262,7 @@ public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $upda } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17103,7 +23270,7 @@ public function sposUpdateTerminalRequest($x_api_version, $cf_terminal_id, $upda } - public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubscriptionDocumentUpload($x_api_version, $payment_id, $file, $payment_id2, $action, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -17113,9 +23280,9 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposUpdateTerminalStatus", + 'environment' => $env."SubscriptionDocumentUpload", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -17143,8 +23310,8 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposUpdateTerminalStatus'][0]; - $request = $this->sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subscriptionDocumentUpload'][0]; + $request = $this->subscriptionDocumentUploadRequest($x_api_version, $payment_id, $file, $payment_id2, $action, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -17183,17 +23350,17 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat switch($statusCode) { case 200: - if ('\Cashfree\Model\UpdateTerminalEntity[]' === '\SplFileObject') { + if ('\Cashfree\Model\UploadPnachImageResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\UpdateTerminalEntity[]' !== 'string') { + if ('\Cashfree\Model\UploadPnachImageResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\UpdateTerminalEntity[]', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\UploadPnachImageResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -17242,21 +23409,6 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 422: if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -17304,7 +23456,7 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat ]; } - $returnType = '\Cashfree\Model\UpdateTerminalEntity[]'; + $returnType = '\Cashfree\Model\UploadPnachImageResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17325,7 +23477,7 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\UpdateTerminalEntity[]', + '\Cashfree\Model\UploadPnachImageResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17354,14 +23506,6 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17391,34 +23535,48 @@ public function SposUpdateTerminalStatus($x_api_version, $cf_terminal_id, $updat } } - public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, $update_terminal_status_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUpdateTerminalStatus'][0]) + public function subscriptionDocumentUploadRequest($x_api_version, $payment_id, $file, $payment_id2, $action, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subscriptionDocumentUpload'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposUpdateTerminalStatus' + 'Missing the required parameter $x_api_version when calling subscriptionDocumentUpload' ); } - // verify the required parameter 'cf_terminal_id' is set - if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { + // verify the required parameter 'payment_id' is set + if ($payment_id === null || (is_array($payment_id) && count($payment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $cf_terminal_id when calling sposUpdateTerminalStatus' + 'Missing the required parameter $payment_id when calling subscriptionDocumentUpload' ); } - // verify the required parameter 'update_terminal_status_request' is set - if ($update_terminal_status_request === null || (is_array($update_terminal_status_request) && count($update_terminal_status_request) === 0)) { + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_terminal_status_request when calling sposUpdateTerminalStatus' + 'Missing the required parameter $file when calling subscriptionDocumentUpload' ); } + // verify the required parameter 'payment_id2' is set + if ($payment_id2 === null || (is_array($payment_id2) && count($payment_id2) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $payment_id2 when calling subscriptionDocumentUpload' + ); + } + // verify the required parameter 'action' is set + if ($action === null || (is_array($action) && count($action) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $action when calling subscriptionDocumentUpload' + ); + } - $resourcePath = '/terminal/{cf_terminal_id}/status'; + + + $resourcePath = '/subscriptions/pay/documents/{payment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17432,7 +23590,7 @@ public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -17463,24 +23621,37 @@ public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, // } // path params - if ($cf_terminal_id !== null) { + if ($payment_id !== null) { $resourcePath = str_replace( - '{' . 'cf_terminal_id' . '}', - ObjectSerializer::toPathValue($cf_terminal_id), + '{' . 'payment_id' . '}', + ObjectSerializer::toPathValue($payment_id), $resourcePath ); } + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + // form params + if ($payment_id2 !== null) { + $formParams['payment_id'] = ObjectSerializer::toFormValue($payment_id2); + } + // form params + if ($action !== null) { + $formParams['action'] = ObjectSerializer::toFormValue($action); + } // for model (json/xml) - if (isset($update_terminal_status_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_terminal_status_request)); - } else { - $httpBody = $update_terminal_status_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -17518,7 +23689,7 @@ public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, } $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17526,7 +23697,7 @@ public function sposUpdateTerminalStatusRequest($x_api_version, $cf_terminal_id, } - public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) + public function SubscriptionEligibility($x_api_version, $subscription_eligibility_request, $x_request_id = null, $x_idempotency_key = null, GuzzleHttp\Client $http_client = null) { $env = "sandbox"; @@ -17536,9 +23707,9 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ if(Cashfree::$XEnableErrorAnalytics) { \Sentry\init([ 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', - 'environment' => $env."SposUploadTerminalDocs", + 'environment' => $env."SubscriptionEligibility", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -17566,8 +23737,8 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ $this->client = $http_client; } $this->headerSelector = new HeaderSelector(); - $contentType = self::contentTypes['sposUploadTerminalDocs'][0]; - $request = $this->sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id, $x_idempotency_key, $contentType); + $contentType = self::contentTypes['subscriptionEligibility'][0]; + $request = $this->subscriptionEligibilityRequest($x_api_version, $subscription_eligibility_request, $x_request_id, $x_idempotency_key, $contentType); try { $options = $this->createHttpClientOption(); @@ -17606,17 +23777,17 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ switch($statusCode) { case 200: - if ('\Cashfree\Model\UploadTerminalDocsEntity[]' === '\SplFileObject') { + if ('\Cashfree\Model\SubscriptionEligibilityResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Cashfree\Model\UploadTerminalDocsEntity[]' !== 'string') { + if ('\Cashfree\Model\SubscriptionEligibilityResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\UploadTerminalDocsEntity[]', []), + ObjectSerializer::deserialize($content, '\Cashfree\Model\SubscriptionEligibilityResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -17665,21 +23836,6 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ $response->getStatusCode(), $response->getHeaders() ]; - case 409: - if ('\Cashfree\Model\ApiError409' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\Cashfree\Model\ApiError409' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\Cashfree\Model\ApiError409', []), - $response->getStatusCode(), - $response->getHeaders() - ]; case 422: if ('\Cashfree\Model\IdempotencyError' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -17727,7 +23883,7 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ ]; } - $returnType = '\Cashfree\Model\UploadTerminalDocsEntity[]'; + $returnType = '\Cashfree\Model\SubscriptionEligibilityResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -17748,7 +23904,7 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Cashfree\Model\UploadTerminalDocsEntity[]', + '\Cashfree\Model\SubscriptionEligibilityResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17777,14 +23933,6 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ ); $e->setResponseObject($data); break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Cashfree\Model\ApiError409', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -17814,34 +23962,27 @@ public function SposUploadTerminalDocs($x_api_version, $cf_terminal_id, $upload_ } } - public function sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $upload_terminal_docs, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['sposUploadTerminalDocs'][0]) + public function subscriptionEligibilityRequest($x_api_version, $subscription_eligibility_request, $x_request_id = null, $x_idempotency_key = null, string $contentType = self::contentTypes['subscriptionEligibility'][0]) { // verify the required parameter 'x_api_version' is set if ($x_api_version === null || (is_array($x_api_version) && count($x_api_version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $x_api_version when calling sposUploadTerminalDocs' - ); - } - - // verify the required parameter 'cf_terminal_id' is set - if ($cf_terminal_id === null || (is_array($cf_terminal_id) && count($cf_terminal_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $cf_terminal_id when calling sposUploadTerminalDocs' + 'Missing the required parameter $x_api_version when calling subscriptionEligibility' ); } - // verify the required parameter 'upload_terminal_docs' is set - if ($upload_terminal_docs === null || (is_array($upload_terminal_docs) && count($upload_terminal_docs) === 0)) { + // verify the required parameter 'subscription_eligibility_request' is set + if ($subscription_eligibility_request === null || (is_array($subscription_eligibility_request) && count($subscription_eligibility_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $upload_terminal_docs when calling sposUploadTerminalDocs' + 'Missing the required parameter $subscription_eligibility_request when calling subscriptionEligibility' ); } - $resourcePath = '/terminal/{cf_terminal_id}/docs'; + $resourcePath = '/subscriptions/eligibility/payment_methods'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17855,7 +23996,7 @@ public function sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -17885,23 +24026,15 @@ public function sposUploadTerminalDocsRequest($x_api_version, $cf_terminal_id, $ // $headers['x-idempotency-key'] = $x_idempotency_key; // } - // path params - if ($cf_terminal_id !== null) { - $resourcePath = str_replace( - '{' . 'cf_terminal_id' . '}', - ObjectSerializer::toPathValue($cf_terminal_id), - $resourcePath - ); - } // for model (json/xml) - if (isset($upload_terminal_docs)) { + if (isset($subscription_eligibility_request)) { if (stripos($headers['Content-Type'], 'application/json') !== false) { # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($upload_terminal_docs)); + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($subscription_eligibility_request)); } else { - $httpBody = $upload_terminal_docs; + $httpBody = $subscription_eligibility_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -17961,7 +24094,7 @@ public function PGCustomerDeleteInstrument($x_api_version, $customer_id, $instru 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCustomerDeleteInstrument", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -18301,7 +24434,7 @@ public function pGCustomerDeleteInstrumentRequest($x_api_version, $customer_id, $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -18408,7 +24541,7 @@ public function PGCustomerFetchInstrument($x_api_version, $customer_id, $instrum 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCustomerFetchInstrument", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -18748,7 +24881,7 @@ public function pGCustomerFetchInstrumentRequest($x_api_version, $customer_id, $ $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -18855,7 +24988,7 @@ public function PGCustomerFetchInstruments($x_api_version, $customer_id, $instru 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCustomerFetchInstruments", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -19181,7 +25314,7 @@ public function pGCustomerFetchInstrumentsRequest($x_api_version, $customer_id, $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } @@ -19280,7 +25413,7 @@ public function PGCustomerInstrumentsFetchCryptogram($x_api_version, $customer_i 'dsn' => 'https://f694e61bc6394e80bd2f687a4249a204@o330525.ingest.sentry.io/4505248768327680', 'environment' => $env."PGCustomerInstrumentsFetchCryptogram", 'attach_stacktrace' => true, - 'release' => '4.1.2', + 'release' => '4.2.0', 'traces_sample_rate' => 1.0, 'before_send' => function (\Sentry\Event $event): ?\Sentry\Event { $cashfreepg = "cashfree-pg"; @@ -19620,7 +25753,7 @@ public function pGCustomerInstrumentsFetchCryptogramRequest($x_api_version, $cus $multipart ); - $headers['x-sdk-platform'] = "phpsdk-4.1.2"; + $headers['x-sdk-platform'] = "phpsdk-4.2.0"; if (Cashfree::$XPartnerApiKey !== null) { $headers['x-partner-apikey'] = Cashfree::$XPartnerApiKey; } diff --git a/lib/Model/AuthorizationDetails.php b/lib/Model/AuthorizationDetails.php new file mode 100644 index 0000000..39c73b3 --- /dev/null +++ b/lib/Model/AuthorizationDetails.php @@ -0,0 +1,615 @@ + + */ +class AuthorizationDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthorizationDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorization_amount' => 'float', + 'authorization_amount_refund' => 'bool', + 'authorization_reference' => 'string', + 'authorization_time' => 'string', + 'authorization_status' => 'string', + 'payment_id' => 'string', + 'payment_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorization_amount' => 'float64', + 'authorization_amount_refund' => null, + 'authorization_reference' => null, + 'authorization_time' => null, + 'authorization_status' => null, + 'payment_id' => null, + 'payment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorization_amount' => false, + 'authorization_amount_refund' => false, + 'authorization_reference' => false, + 'authorization_time' => false, + 'authorization_status' => false, + 'payment_id' => false, + 'payment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authorization_amount' => 'authorization_amount', + 'authorization_amount_refund' => 'authorization_amount_refund', + 'authorization_reference' => 'authorization_reference', + 'authorization_time' => 'authorization_time', + 'authorization_status' => 'authorization_status', + 'payment_id' => 'payment_id', + 'payment_method' => 'payment_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorization_amount' => 'setAuthorizationAmount', + 'authorization_amount_refund' => 'setAuthorizationAmountRefund', + 'authorization_reference' => 'setAuthorizationReference', + 'authorization_time' => 'setAuthorizationTime', + 'authorization_status' => 'setAuthorizationStatus', + 'payment_id' => 'setPaymentId', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorization_amount' => 'getAuthorizationAmount', + 'authorization_amount_refund' => 'getAuthorizationAmountRefund', + 'authorization_reference' => 'getAuthorizationReference', + 'authorization_time' => 'getAuthorizationTime', + 'authorization_status' => 'getAuthorizationStatus', + 'payment_id' => 'getPaymentId', + 'payment_method' => 'getPaymentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authorization_amount', $data ?? [], null); + $this->setIfExists('authorization_amount_refund', $data ?? [], null); + $this->setIfExists('authorization_reference', $data ?? [], null); + $this->setIfExists('authorization_time', $data ?? [], null); + $this->setIfExists('authorization_status', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorization_amount + * + * @return float|null + */ + public function getAuthorizationAmount() + { + return $this->container['authorization_amount']; + } + + /** + * Sets authorization_amount + * + * @param float|null $authorization_amount Authorization amount for the auth payment. + * + * @return self + */ + public function setAuthorizationAmount($authorization_amount) + { + if (is_null($authorization_amount)) { + throw new \InvalidArgumentException('non-nullable authorization_amount cannot be null'); + } + $this->container['authorization_amount'] = $authorization_amount; + + return $this; + } + + /** + * Gets authorization_amount_refund + * + * @return bool|null + */ + public function getAuthorizationAmountRefund() + { + return $this->container['authorization_amount_refund']; + } + + /** + * Sets authorization_amount_refund + * + * @param bool|null $authorization_amount_refund 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 self + */ + public function setAuthorizationAmountRefund($authorization_amount_refund) + { + if (is_null($authorization_amount_refund)) { + throw new \InvalidArgumentException('non-nullable authorization_amount_refund cannot be null'); + } + $this->container['authorization_amount_refund'] = $authorization_amount_refund; + + return $this; + } + + /** + * Gets authorization_reference + * + * @return string|null + */ + public function getAuthorizationReference() + { + return $this->container['authorization_reference']; + } + + /** + * Sets authorization_reference + * + * @param string|null $authorization_reference Authorization reference. UMN for UPI, UMRN for EMandate/Physical Mandate and Enrollment ID for cards. + * + * @return self + */ + public function setAuthorizationReference($authorization_reference) + { + if (is_null($authorization_reference)) { + throw new \InvalidArgumentException('non-nullable authorization_reference cannot be null'); + } + $this->container['authorization_reference'] = $authorization_reference; + + return $this; + } + + /** + * Gets authorization_time + * + * @return string|null + */ + public function getAuthorizationTime() + { + return $this->container['authorization_time']; + } + + /** + * Sets authorization_time + * + * @param string|null $authorization_time Authorization time. + * + * @return self + */ + public function setAuthorizationTime($authorization_time) + { + if (is_null($authorization_time)) { + throw new \InvalidArgumentException('non-nullable authorization_time cannot be null'); + } + $this->container['authorization_time'] = $authorization_time; + + return $this; + } + + /** + * Gets authorization_status + * + * @return string|null + */ + public function getAuthorizationStatus() + { + return $this->container['authorization_status']; + } + + /** + * Sets authorization_status + * + * @param string|null $authorization_status Status of the authorization. + * + * @return self + */ + public function setAuthorizationStatus($authorization_status) + { + if (is_null($authorization_status)) { + throw new \InvalidArgumentException('non-nullable authorization_status cannot be null'); + } + $this->container['authorization_status'] = $authorization_status; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method Payment method used for the authorization. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CardlessEMI.php b/lib/Model/CardlessEMI.php index fcacf2a..970021c 100644 --- a/lib/Model/CardlessEMI.php +++ b/lib/Model/CardlessEMI.php @@ -255,6 +255,8 @@ public function getModelName() public const PROVIDER_CASHE = 'cashe'; public const PROVIDER_IDFC = 'idfc'; public const PROVIDER_KOTAK = 'kotak'; + public const PROVIDER_SNAPMINT = 'snapmint'; + public const PROVIDER_BHARATX = 'bharatx'; public const PROVIDER_UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'; /** @@ -272,6 +274,8 @@ public function getProviderAllowableValues() self::PROVIDER_CASHE, self::PROVIDER_IDFC, self::PROVIDER_KOTAK, + self::PROVIDER_SNAPMINT, + self::PROVIDER_BHARATX, self::PROVIDER_UNKNOWN_DEFAULT_OPEN_API, ]; } @@ -388,7 +392,7 @@ public function getProvider() /** * Sets provider * - * @param string|null $provider One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`] + * @param string|null $provider One of [`flexmoney`, `zestmoney`, `hdfc`, `icici`, `cashe`, `idfc`, `kotak`, `snapmint`, `bharatx`] * * @return self */ diff --git a/lib/Model/CreateOrderSettlementRequestBody.php b/lib/Model/CreateOrderSettlementRequestBody.php new file mode 100644 index 0000000..d8a81e1 --- /dev/null +++ b/lib/Model/CreateOrderSettlementRequestBody.php @@ -0,0 +1,451 @@ + + */ +class CreateOrderSettlementRequestBody implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateOrderSettlementRequestBody'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'order_id' => 'string', + 'meta_data' => '\Cashfree\Model\CreateOrderSettlementRequestBodyMetaData' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'order_id' => null, + 'meta_data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'order_id' => false, + 'meta_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_id' => 'order_id', + 'meta_data' => 'meta_data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_id' => 'setOrderId', + 'meta_data' => 'setMetaData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_id' => 'getOrderId', + 'meta_data' => 'getMetaData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('order_id', $data ?? [], null); + $this->setIfExists('meta_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['order_id'] === null) { + $invalidProperties[] = "'order_id' can't be null"; + } + if ($this->container['meta_data'] === null) { + $invalidProperties[] = "'meta_data' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_id + * + * @return string + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string $order_id OrderId of the order. + * + * @return self + */ + public function setOrderId($order_id) + { + if (is_null($order_id)) { + throw new \InvalidArgumentException('non-nullable order_id cannot be null'); + } + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets meta_data + * + * @return \Cashfree\Model\CreateOrderSettlementRequestBodyMetaData + */ + public function getMetaData() + { + return $this->container['meta_data']; + } + + /** + * Sets meta_data + * + * @param \Cashfree\Model\CreateOrderSettlementRequestBodyMetaData $meta_data meta_data + * + * @return self + */ + public function setMetaData($meta_data) + { + if (is_null($meta_data)) { + throw new \InvalidArgumentException('non-nullable meta_data cannot be null'); + } + $this->container['meta_data'] = $meta_data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateOrderSettlementRequestBodyMetaData.php b/lib/Model/CreateOrderSettlementRequestBodyMetaData.php new file mode 100644 index 0000000..f4eaa05 --- /dev/null +++ b/lib/Model/CreateOrderSettlementRequestBodyMetaData.php @@ -0,0 +1,444 @@ + + */ +class CreateOrderSettlementRequestBodyMetaData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateOrderSettlementRequestBody_meta_data'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cbriks_id' => 'string', + 'settlement_date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cbriks_id' => null, + 'settlement_date' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cbriks_id' => false, + 'settlement_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cbriks_id' => 'cbriks_id', + 'settlement_date' => 'settlement_date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cbriks_id' => 'setCbriksId', + 'settlement_date' => 'setSettlementDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cbriks_id' => 'getCbriksId', + 'settlement_date' => 'getSettlementDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cbriks_id', $data ?? [], null); + $this->setIfExists('settlement_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cbriks_id + * + * @return string|null + */ + public function getCbriksId() + { + return $this->container['cbriks_id']; + } + + /** + * Sets cbriks_id + * + * @param string|null $cbriks_id Meta data cbricks ID to be used for reporting purpose. + * + * @return self + */ + public function setCbriksId($cbriks_id) + { + if (is_null($cbriks_id)) { + throw new \InvalidArgumentException('non-nullable cbriks_id cannot be null'); + } + $this->container['cbriks_id'] = $cbriks_id; + + return $this; + } + + /** + * Gets settlement_date + * + * @return \DateTime|null + */ + public function getSettlementDate() + { + return $this->container['settlement_date']; + } + + /** + * Sets settlement_date + * + * @param \DateTime|null $settlement_date Requested Settlement Date. + * + * @return self + */ + public function setSettlementDate($settlement_date) + { + if (is_null($settlement_date)) { + throw new \InvalidArgumentException('non-nullable settlement_date cannot be null'); + } + $this->container['settlement_date'] = $settlement_date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreatePlanRequest.php b/lib/Model/CreatePlanRequest.php new file mode 100644 index 0000000..87baba7 --- /dev/null +++ b/lib/Model/CreatePlanRequest.php @@ -0,0 +1,759 @@ + + */ +class CreatePlanRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreatePlanRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan_id' => 'string', + 'plan_name' => 'string', + 'plan_type' => 'string', + 'plan_currency' => 'string', + 'plan_recurring_amount' => 'float', + 'plan_max_amount' => 'float', + 'plan_max_cycles' => 'int', + 'plan_intervals' => 'int', + 'plan_interval_type' => 'string', + 'plan_note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan_id' => null, + 'plan_name' => null, + 'plan_type' => null, + 'plan_currency' => null, + 'plan_recurring_amount' => 'float64', + 'plan_max_amount' => 'float64', + 'plan_max_cycles' => null, + 'plan_intervals' => null, + 'plan_interval_type' => null, + 'plan_note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plan_id' => false, + 'plan_name' => false, + 'plan_type' => false, + 'plan_currency' => false, + 'plan_recurring_amount' => false, + 'plan_max_amount' => false, + 'plan_max_cycles' => false, + 'plan_intervals' => false, + 'plan_interval_type' => false, + 'plan_note' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan_id' => 'plan_id', + 'plan_name' => 'plan_name', + 'plan_type' => 'plan_type', + 'plan_currency' => 'plan_currency', + 'plan_recurring_amount' => 'plan_recurring_amount', + 'plan_max_amount' => 'plan_max_amount', + 'plan_max_cycles' => 'plan_max_cycles', + 'plan_intervals' => 'plan_intervals', + 'plan_interval_type' => 'plan_interval_type', + 'plan_note' => 'plan_note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan_id' => 'setPlanId', + 'plan_name' => 'setPlanName', + 'plan_type' => 'setPlanType', + 'plan_currency' => 'setPlanCurrency', + 'plan_recurring_amount' => 'setPlanRecurringAmount', + 'plan_max_amount' => 'setPlanMaxAmount', + 'plan_max_cycles' => 'setPlanMaxCycles', + 'plan_intervals' => 'setPlanIntervals', + 'plan_interval_type' => 'setPlanIntervalType', + 'plan_note' => 'setPlanNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan_id' => 'getPlanId', + 'plan_name' => 'getPlanName', + 'plan_type' => 'getPlanType', + 'plan_currency' => 'getPlanCurrency', + 'plan_recurring_amount' => 'getPlanRecurringAmount', + 'plan_max_amount' => 'getPlanMaxAmount', + 'plan_max_cycles' => 'getPlanMaxCycles', + 'plan_intervals' => 'getPlanIntervals', + 'plan_interval_type' => 'getPlanIntervalType', + 'plan_note' => 'getPlanNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plan_id', $data ?? [], null); + $this->setIfExists('plan_name', $data ?? [], null); + $this->setIfExists('plan_type', $data ?? [], null); + $this->setIfExists('plan_currency', $data ?? [], null); + $this->setIfExists('plan_recurring_amount', $data ?? [], null); + $this->setIfExists('plan_max_amount', $data ?? [], null); + $this->setIfExists('plan_max_cycles', $data ?? [], null); + $this->setIfExists('plan_intervals', $data ?? [], null); + $this->setIfExists('plan_interval_type', $data ?? [], null); + $this->setIfExists('plan_note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['plan_id'] === null) { + $invalidProperties[] = "'plan_id' can't be null"; + } + if ((mb_strlen($this->container['plan_id']) > 40)) { + $invalidProperties[] = "invalid value for 'plan_id', the character length must be smaller than or equal to 40."; + } + + if ((mb_strlen($this->container['plan_id']) < 1)) { + $invalidProperties[] = "invalid value for 'plan_id', the character length must be bigger than or equal to 1."; + } + + if ($this->container['plan_name'] === null) { + $invalidProperties[] = "'plan_name' can't be null"; + } + if ((mb_strlen($this->container['plan_name']) > 40)) { + $invalidProperties[] = "invalid value for 'plan_name', the character length must be smaller than or equal to 40."; + } + + if ((mb_strlen($this->container['plan_name']) < 1)) { + $invalidProperties[] = "invalid value for 'plan_name', the character length must be bigger than or equal to 1."; + } + + if ($this->container['plan_type'] === null) { + $invalidProperties[] = "'plan_type' can't be null"; + } + if ($this->container['plan_max_amount'] === null) { + $invalidProperties[] = "'plan_max_amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan_id + * + * @return string + */ + public function getPlanId() + { + return $this->container['plan_id']; + } + + /** + * Sets plan_id + * + * @param string $plan_id Unique ID to identify the plan. Only alpha-numerics, dot, hyphen and underscore allowed. + * + * @return self + */ + public function setPlanId($plan_id) + { + if (is_null($plan_id)) { + throw new \InvalidArgumentException('non-nullable plan_id cannot be null'); + } + if ((mb_strlen($plan_id) > 40)) { + throw new \InvalidArgumentException('invalid length for $plan_id when calling CreatePlanRequest., must be smaller than or equal to 40.'); + } + if ((mb_strlen($plan_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $plan_id when calling CreatePlanRequest., must be bigger than or equal to 1.'); + } + + $this->container['plan_id'] = $plan_id; + + return $this; + } + + /** + * Gets plan_name + * + * @return string + */ + public function getPlanName() + { + return $this->container['plan_name']; + } + + /** + * Sets plan_name + * + * @param string $plan_name Name of the plan. + * + * @return self + */ + public function setPlanName($plan_name) + { + if (is_null($plan_name)) { + throw new \InvalidArgumentException('non-nullable plan_name cannot be null'); + } + if ((mb_strlen($plan_name) > 40)) { + throw new \InvalidArgumentException('invalid length for $plan_name when calling CreatePlanRequest., must be smaller than or equal to 40.'); + } + if ((mb_strlen($plan_name) < 1)) { + throw new \InvalidArgumentException('invalid length for $plan_name when calling CreatePlanRequest., must be bigger than or equal to 1.'); + } + + $this->container['plan_name'] = $plan_name; + + return $this; + } + + /** + * Gets plan_type + * + * @return string + */ + public function getPlanType() + { + return $this->container['plan_type']; + } + + /** + * Sets plan_type + * + * @param string $plan_type Type of the plan. Possible values - PERIODIC, ON_DEMAND. + * + * @return self + */ + public function setPlanType($plan_type) + { + if (is_null($plan_type)) { + throw new \InvalidArgumentException('non-nullable plan_type cannot be null'); + } + $this->container['plan_type'] = $plan_type; + + return $this; + } + + /** + * Gets plan_currency + * + * @return string|null + */ + public function getPlanCurrency() + { + return $this->container['plan_currency']; + } + + /** + * Sets plan_currency + * + * @param string|null $plan_currency Currency of the plan. + * + * @return self + */ + public function setPlanCurrency($plan_currency) + { + if (is_null($plan_currency)) { + throw new \InvalidArgumentException('non-nullable plan_currency cannot be null'); + } + $this->container['plan_currency'] = $plan_currency; + + return $this; + } + + /** + * Gets plan_recurring_amount + * + * @return float|null + */ + public function getPlanRecurringAmount() + { + return $this->container['plan_recurring_amount']; + } + + /** + * Sets plan_recurring_amount + * + * @param float|null $plan_recurring_amount Recurring amount for the plan. Required for PERIODIC plan_type. + * + * @return self + */ + public function setPlanRecurringAmount($plan_recurring_amount) + { + if (is_null($plan_recurring_amount)) { + throw new \InvalidArgumentException('non-nullable plan_recurring_amount cannot be null'); + } + $this->container['plan_recurring_amount'] = $plan_recurring_amount; + + return $this; + } + + /** + * Gets plan_max_amount + * + * @return float + */ + public function getPlanMaxAmount() + { + return $this->container['plan_max_amount']; + } + + /** + * Sets plan_max_amount + * + * @param float $plan_max_amount Maximum amount for the plan. + * + * @return self + */ + public function setPlanMaxAmount($plan_max_amount) + { + if (is_null($plan_max_amount)) { + throw new \InvalidArgumentException('non-nullable plan_max_amount cannot be null'); + } + $this->container['plan_max_amount'] = $plan_max_amount; + + return $this; + } + + /** + * Gets plan_max_cycles + * + * @return int|null + */ + public function getPlanMaxCycles() + { + return $this->container['plan_max_cycles']; + } + + /** + * Sets plan_max_cycles + * + * @param int|null $plan_max_cycles Maximum number of payment cycles for the plan. + * + * @return self + */ + public function setPlanMaxCycles($plan_max_cycles) + { + if (is_null($plan_max_cycles)) { + throw new \InvalidArgumentException('non-nullable plan_max_cycles cannot be null'); + } + $this->container['plan_max_cycles'] = $plan_max_cycles; + + return $this; + } + + /** + * Gets plan_intervals + * + * @return int|null + */ + public function getPlanIntervals() + { + return $this->container['plan_intervals']; + } + + /** + * Sets plan_intervals + * + * @param int|null $plan_intervals 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 self + */ + public function setPlanIntervals($plan_intervals) + { + if (is_null($plan_intervals)) { + throw new \InvalidArgumentException('non-nullable plan_intervals cannot be null'); + } + $this->container['plan_intervals'] = $plan_intervals; + + return $this; + } + + /** + * Gets plan_interval_type + * + * @return string|null + */ + public function getPlanIntervalType() + { + return $this->container['plan_interval_type']; + } + + /** + * Sets plan_interval_type + * + * @param string|null $plan_interval_type Interval type for the plan. Possible values - DAY, WEEK, MONTH, YEAR. + * + * @return self + */ + public function setPlanIntervalType($plan_interval_type) + { + if (is_null($plan_interval_type)) { + throw new \InvalidArgumentException('non-nullable plan_interval_type cannot be null'); + } + $this->container['plan_interval_type'] = $plan_interval_type; + + return $this; + } + + /** + * Gets plan_note + * + * @return string|null + */ + public function getPlanNote() + { + return $this->container['plan_note']; + } + + /** + * Sets plan_note + * + * @param string|null $plan_note Note for the plan. + * + * @return self + */ + public function setPlanNote($plan_note) + { + if (is_null($plan_note)) { + throw new \InvalidArgumentException('non-nullable plan_note cannot be null'); + } + $this->container['plan_note'] = $plan_note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionPaymentAuthResponse.php b/lib/Model/CreateSubscriptionPaymentAuthResponse.php new file mode 100644 index 0000000..c690ada --- /dev/null +++ b/lib/Model/CreateSubscriptionPaymentAuthResponse.php @@ -0,0 +1,717 @@ + + */ +class CreateSubscriptionPaymentAuthResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionPaymentAuthResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cf_payment_id' => 'string', + 'cf_subscription_id' => 'string', + 'failure_details' => '\Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails', + 'payment_amount' => 'float', + 'payment_id' => 'string', + 'payment_initiated_date' => 'string', + 'payment_status' => 'string', + 'payment_type' => 'string', + 'subscription_id' => 'string', + 'payment_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cf_payment_id' => null, + 'cf_subscription_id' => null, + 'failure_details' => null, + 'payment_amount' => 'float64', + 'payment_id' => null, + 'payment_initiated_date' => null, + 'payment_status' => null, + 'payment_type' => null, + 'subscription_id' => null, + 'payment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cf_payment_id' => false, + 'cf_subscription_id' => false, + 'failure_details' => false, + 'payment_amount' => false, + 'payment_id' => false, + 'payment_initiated_date' => false, + 'payment_status' => false, + 'payment_type' => false, + 'subscription_id' => false, + 'payment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cf_payment_id' => 'cf_payment_id', + 'cf_subscription_id' => 'cf_subscription_id', + 'failure_details' => 'failure_details', + 'payment_amount' => 'payment_amount', + 'payment_id' => 'payment_id', + 'payment_initiated_date' => 'payment_initiated_date', + 'payment_status' => 'payment_status', + 'payment_type' => 'payment_type', + 'subscription_id' => 'subscription_id', + 'payment_method' => 'payment_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cf_payment_id' => 'setCfPaymentId', + 'cf_subscription_id' => 'setCfSubscriptionId', + 'failure_details' => 'setFailureDetails', + 'payment_amount' => 'setPaymentAmount', + 'payment_id' => 'setPaymentId', + 'payment_initiated_date' => 'setPaymentInitiatedDate', + 'payment_status' => 'setPaymentStatus', + 'payment_type' => 'setPaymentType', + 'subscription_id' => 'setSubscriptionId', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cf_payment_id' => 'getCfPaymentId', + 'cf_subscription_id' => 'getCfSubscriptionId', + 'failure_details' => 'getFailureDetails', + 'payment_amount' => 'getPaymentAmount', + 'payment_id' => 'getPaymentId', + 'payment_initiated_date' => 'getPaymentInitiatedDate', + 'payment_status' => 'getPaymentStatus', + 'payment_type' => 'getPaymentType', + 'subscription_id' => 'getSubscriptionId', + 'payment_method' => 'getPaymentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('cf_subscription_id', $data ?? [], null); + $this->setIfExists('failure_details', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_initiated_date', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets cf_subscription_id + * + * @return string|null + */ + public function getCfSubscriptionId() + { + return $this->container['cf_subscription_id']; + } + + /** + * Sets cf_subscription_id + * + * @param string|null $cf_subscription_id Cashfree subscription reference number + * + * @return self + */ + public function setCfSubscriptionId($cf_subscription_id) + { + if (is_null($cf_subscription_id)) { + throw new \InvalidArgumentException('non-nullable cf_subscription_id cannot be null'); + } + $this->container['cf_subscription_id'] = $cf_subscription_id; + + return $this; + } + + /** + * Gets failure_details + * + * @return \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null + */ + public function getFailureDetails() + { + return $this->container['failure_details']; + } + + /** + * Sets failure_details + * + * @param \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null $failure_details failure_details + * + * @return self + */ + public function setFailureDetails($failure_details) + { + if (is_null($failure_details)) { + throw new \InvalidArgumentException('non-nullable failure_details cannot be null'); + } + $this->container['failure_details'] = $failure_details; + + return $this; + } + + /** + * Gets payment_amount + * + * @return float|null + */ + public function getPaymentAmount() + { + return $this->container['payment_amount']; + } + + /** + * Sets payment_amount + * + * @param float|null $payment_amount The charge amount of the payment. + * + * @return self + */ + public function setPaymentAmount($payment_amount) + { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } + $this->container['payment_amount'] = $payment_amount; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_initiated_date + * + * @return string|null + */ + public function getPaymentInitiatedDate() + { + return $this->container['payment_initiated_date']; + } + + /** + * Sets payment_initiated_date + * + * @param string|null $payment_initiated_date The date on which the payment was initiated. + * + * @return self + */ + public function setPaymentInitiatedDate($payment_initiated_date) + { + if (is_null($payment_initiated_date)) { + throw new \InvalidArgumentException('non-nullable payment_initiated_date cannot be null'); + } + $this->container['payment_initiated_date'] = $payment_initiated_date; + + return $this; + } + + /** + * Gets payment_status + * + * @return string|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string|null $payment_status Status of the payment. + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_type + * + * @return string|null + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string|null $payment_type Payment type. Can be AUTH or CHARGE. + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets subscription_id + * + * @return string|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string|null $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method Payment method used for the authorization. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionPaymentAuthResponseFailureDetails.php b/lib/Model/CreateSubscriptionPaymentAuthResponseFailureDetails.php new file mode 100644 index 0000000..09eb232 --- /dev/null +++ b/lib/Model/CreateSubscriptionPaymentAuthResponseFailureDetails.php @@ -0,0 +1,410 @@ + + */ +class CreateSubscriptionPaymentAuthResponseFailureDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionPaymentAuthResponse_failure_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'failure_reason' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'failure_reason' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'failure_reason' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'failure_reason' => 'failure_reason' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'failure_reason' => 'setFailureReason' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'failure_reason' => 'getFailureReason' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('failure_reason', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets failure_reason + * + * @return string|null + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param string|null $failure_reason Failure reason of the payment if the payment_status is failed. + * + * @return self + */ + public function setFailureReason($failure_reason) + { + if (is_null($failure_reason)) { + throw new \InvalidArgumentException('non-nullable failure_reason cannot be null'); + } + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionPaymentChargeResponse.php b/lib/Model/CreateSubscriptionPaymentChargeResponse.php new file mode 100644 index 0000000..654be93 --- /dev/null +++ b/lib/Model/CreateSubscriptionPaymentChargeResponse.php @@ -0,0 +1,717 @@ + + */ +class CreateSubscriptionPaymentChargeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionPaymentChargeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cf_payment_id' => 'string', + 'cf_subscription_id' => 'string', + 'failure_details' => '\Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails', + 'payment_amount' => 'float', + 'payment_id' => 'string', + 'payment_initiated_date' => 'string', + 'payment_status' => 'string', + 'payment_type' => 'string', + 'subscription_id' => 'string', + 'payment_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cf_payment_id' => null, + 'cf_subscription_id' => null, + 'failure_details' => null, + 'payment_amount' => 'float64', + 'payment_id' => null, + 'payment_initiated_date' => null, + 'payment_status' => null, + 'payment_type' => null, + 'subscription_id' => null, + 'payment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cf_payment_id' => false, + 'cf_subscription_id' => false, + 'failure_details' => false, + 'payment_amount' => false, + 'payment_id' => false, + 'payment_initiated_date' => false, + 'payment_status' => false, + 'payment_type' => false, + 'subscription_id' => false, + 'payment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cf_payment_id' => 'cf_payment_id', + 'cf_subscription_id' => 'cf_subscription_id', + 'failure_details' => 'failure_details', + 'payment_amount' => 'payment_amount', + 'payment_id' => 'payment_id', + 'payment_initiated_date' => 'payment_initiated_date', + 'payment_status' => 'payment_status', + 'payment_type' => 'payment_type', + 'subscription_id' => 'subscription_id', + 'payment_method' => 'payment_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cf_payment_id' => 'setCfPaymentId', + 'cf_subscription_id' => 'setCfSubscriptionId', + 'failure_details' => 'setFailureDetails', + 'payment_amount' => 'setPaymentAmount', + 'payment_id' => 'setPaymentId', + 'payment_initiated_date' => 'setPaymentInitiatedDate', + 'payment_status' => 'setPaymentStatus', + 'payment_type' => 'setPaymentType', + 'subscription_id' => 'setSubscriptionId', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cf_payment_id' => 'getCfPaymentId', + 'cf_subscription_id' => 'getCfSubscriptionId', + 'failure_details' => 'getFailureDetails', + 'payment_amount' => 'getPaymentAmount', + 'payment_id' => 'getPaymentId', + 'payment_initiated_date' => 'getPaymentInitiatedDate', + 'payment_status' => 'getPaymentStatus', + 'payment_type' => 'getPaymentType', + 'subscription_id' => 'getSubscriptionId', + 'payment_method' => 'getPaymentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('cf_subscription_id', $data ?? [], null); + $this->setIfExists('failure_details', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_initiated_date', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets cf_subscription_id + * + * @return string|null + */ + public function getCfSubscriptionId() + { + return $this->container['cf_subscription_id']; + } + + /** + * Sets cf_subscription_id + * + * @param string|null $cf_subscription_id Cashfree subscription reference number + * + * @return self + */ + public function setCfSubscriptionId($cf_subscription_id) + { + if (is_null($cf_subscription_id)) { + throw new \InvalidArgumentException('non-nullable cf_subscription_id cannot be null'); + } + $this->container['cf_subscription_id'] = $cf_subscription_id; + + return $this; + } + + /** + * Gets failure_details + * + * @return \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null + */ + public function getFailureDetails() + { + return $this->container['failure_details']; + } + + /** + * Sets failure_details + * + * @param \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null $failure_details failure_details + * + * @return self + */ + public function setFailureDetails($failure_details) + { + if (is_null($failure_details)) { + throw new \InvalidArgumentException('non-nullable failure_details cannot be null'); + } + $this->container['failure_details'] = $failure_details; + + return $this; + } + + /** + * Gets payment_amount + * + * @return float|null + */ + public function getPaymentAmount() + { + return $this->container['payment_amount']; + } + + /** + * Sets payment_amount + * + * @param float|null $payment_amount The charge amount of the payment. + * + * @return self + */ + public function setPaymentAmount($payment_amount) + { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } + $this->container['payment_amount'] = $payment_amount; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_initiated_date + * + * @return string|null + */ + public function getPaymentInitiatedDate() + { + return $this->container['payment_initiated_date']; + } + + /** + * Sets payment_initiated_date + * + * @param string|null $payment_initiated_date The date on which the payment was initiated. + * + * @return self + */ + public function setPaymentInitiatedDate($payment_initiated_date) + { + if (is_null($payment_initiated_date)) { + throw new \InvalidArgumentException('non-nullable payment_initiated_date cannot be null'); + } + $this->container['payment_initiated_date'] = $payment_initiated_date; + + return $this; + } + + /** + * Gets payment_status + * + * @return string|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string|null $payment_status Status of the payment. + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_type + * + * @return string|null + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string|null $payment_type Payment type. Can be AUTH or CHARGE. + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets subscription_id + * + * @return string|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string|null $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method Payment method used for the authorization. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionPaymentRequest.php b/lib/Model/CreateSubscriptionPaymentRequest.php new file mode 100644 index 0000000..610a3f4 --- /dev/null +++ b/lib/Model/CreateSubscriptionPaymentRequest.php @@ -0,0 +1,658 @@ + + */ +class CreateSubscriptionPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionPaymentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string', + 'subscription_session_id' => 'string', + 'payment_id' => 'string', + 'payment_amount' => 'float', + 'payment_schedule_date' => 'string', + 'payment_remarks' => 'string', + 'payment_type' => 'string', + 'payment_method' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null, + 'subscription_session_id' => null, + 'payment_id' => null, + 'payment_amount' => 'float64', + 'payment_schedule_date' => null, + 'payment_remarks' => null, + 'payment_type' => null, + 'payment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false, + 'subscription_session_id' => false, + 'payment_id' => false, + 'payment_amount' => false, + 'payment_schedule_date' => false, + 'payment_remarks' => false, + 'payment_type' => false, + 'payment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id', + 'subscription_session_id' => 'subscription_session_id', + 'payment_id' => 'payment_id', + 'payment_amount' => 'payment_amount', + 'payment_schedule_date' => 'payment_schedule_date', + 'payment_remarks' => 'payment_remarks', + 'payment_type' => 'payment_type', + 'payment_method' => 'payment_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId', + 'subscription_session_id' => 'setSubscriptionSessionId', + 'payment_id' => 'setPaymentId', + 'payment_amount' => 'setPaymentAmount', + 'payment_schedule_date' => 'setPaymentScheduleDate', + 'payment_remarks' => 'setPaymentRemarks', + 'payment_type' => 'setPaymentType', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId', + 'subscription_session_id' => 'getSubscriptionSessionId', + 'payment_id' => 'getPaymentId', + 'payment_amount' => 'getPaymentAmount', + 'payment_schedule_date' => 'getPaymentScheduleDate', + 'payment_remarks' => 'getPaymentRemarks', + 'payment_type' => 'getPaymentType', + 'payment_method' => 'getPaymentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('subscription_session_id', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('payment_schedule_date', $data ?? [], null); + $this->setIfExists('payment_remarks', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + if ($this->container['payment_id'] === null) { + $invalidProperties[] = "'payment_id' can't be null"; + } + if ($this->container['payment_type'] === null) { + $invalidProperties[] = "'payment_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets subscription_session_id + * + * @return string|null + */ + public function getSubscriptionSessionId() + { + return $this->container['subscription_session_id']; + } + + /** + * Sets subscription_session_id + * + * @param string|null $subscription_session_id Session ID for the subscription. Required only for Auth. + * + * @return self + */ + public function setSubscriptionSessionId($subscription_session_id) + { + if (is_null($subscription_session_id)) { + throw new \InvalidArgumentException('non-nullable subscription_session_id cannot be null'); + } + $this->container['subscription_session_id'] = $subscription_session_id; + + return $this; + } + + /** + * Gets payment_id + * + * @return string + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string $payment_id A unique ID passed by merchant for identifying the subscription payment. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_amount + * + * @return float|null + */ + public function getPaymentAmount() + { + return $this->container['payment_amount']; + } + + /** + * Sets payment_amount + * + * @param float|null $payment_amount The charge amount of the payment. Required in case of charge. + * + * @return self + */ + public function setPaymentAmount($payment_amount) + { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } + $this->container['payment_amount'] = $payment_amount; + + return $this; + } + + /** + * Gets payment_schedule_date + * + * @return string|null + */ + public function getPaymentScheduleDate() + { + return $this->container['payment_schedule_date']; + } + + /** + * Sets payment_schedule_date + * + * @param string|null $payment_schedule_date The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes. + * + * @return self + */ + public function setPaymentScheduleDate($payment_schedule_date) + { + if (is_null($payment_schedule_date)) { + throw new \InvalidArgumentException('non-nullable payment_schedule_date cannot be null'); + } + $this->container['payment_schedule_date'] = $payment_schedule_date; + + return $this; + } + + /** + * Gets payment_remarks + * + * @return string|null + */ + public function getPaymentRemarks() + { + return $this->container['payment_remarks']; + } + + /** + * Sets payment_remarks + * + * @param string|null $payment_remarks Payment remarks. + * + * @return self + */ + public function setPaymentRemarks($payment_remarks) + { + if (is_null($payment_remarks)) { + throw new \InvalidArgumentException('non-nullable payment_remarks cannot be null'); + } + $this->container['payment_remarks'] = $payment_remarks; + + return $this; + } + + /** + * Gets payment_type + * + * @return string + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string $payment_type Payment type. Can be AUTH or CHARGE. + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets payment_method + * + * @return object|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param object|null $payment_method Payment method. Can be one of [\"upi\", \"enach\", \"pnach\", \"card\"] + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionRefundRequest.php b/lib/Model/CreateSubscriptionRefundRequest.php new file mode 100644 index 0000000..9878a04 --- /dev/null +++ b/lib/Model/CreateSubscriptionRefundRequest.php @@ -0,0 +1,624 @@ + + */ +class CreateSubscriptionRefundRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionRefundRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string', + 'payment_id' => 'string', + 'cf_payment_id' => 'string', + 'refund_id' => 'string', + 'refund_amount' => 'float', + 'refund_note' => 'string', + 'refund_speed' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null, + 'payment_id' => null, + 'cf_payment_id' => null, + 'refund_id' => null, + 'refund_amount' => 'float64', + 'refund_note' => null, + 'refund_speed' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false, + 'payment_id' => false, + 'cf_payment_id' => false, + 'refund_id' => false, + 'refund_amount' => false, + 'refund_note' => false, + 'refund_speed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id', + 'payment_id' => 'payment_id', + 'cf_payment_id' => 'cf_payment_id', + 'refund_id' => 'refund_id', + 'refund_amount' => 'refund_amount', + 'refund_note' => 'refund_note', + 'refund_speed' => 'refund_speed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId', + 'payment_id' => 'setPaymentId', + 'cf_payment_id' => 'setCfPaymentId', + 'refund_id' => 'setRefundId', + 'refund_amount' => 'setRefundAmount', + 'refund_note' => 'setRefundNote', + 'refund_speed' => 'setRefundSpeed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId', + 'payment_id' => 'getPaymentId', + 'cf_payment_id' => 'getCfPaymentId', + 'refund_id' => 'getRefundId', + 'refund_amount' => 'getRefundAmount', + 'refund_note' => 'getRefundNote', + 'refund_speed' => 'getRefundSpeed' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('refund_id', $data ?? [], null); + $this->setIfExists('refund_amount', $data ?? [], null); + $this->setIfExists('refund_note', $data ?? [], null); + $this->setIfExists('refund_speed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + if ($this->container['refund_id'] === null) { + $invalidProperties[] = "'refund_id' can't be null"; + } + if ($this->container['refund_amount'] === null) { + $invalidProperties[] = "'refund_amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number. + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets refund_id + * + * @return string + */ + public function getRefundId() + { + return $this->container['refund_id']; + } + + /** + * Sets refund_id + * + * @param string $refund_id A unique ID passed by merchant for identifying the refund. + * + * @return self + */ + public function setRefundId($refund_id) + { + if (is_null($refund_id)) { + throw new \InvalidArgumentException('non-nullable refund_id cannot be null'); + } + $this->container['refund_id'] = $refund_id; + + return $this; + } + + /** + * Gets refund_amount + * + * @return float + */ + public function getRefundAmount() + { + return $this->container['refund_amount']; + } + + /** + * Sets refund_amount + * + * @param float $refund_amount The amount to be refunded. Can be partial or full amount of the payment. + * + * @return self + */ + public function setRefundAmount($refund_amount) + { + if (is_null($refund_amount)) { + throw new \InvalidArgumentException('non-nullable refund_amount cannot be null'); + } + $this->container['refund_amount'] = $refund_amount; + + return $this; + } + + /** + * Gets refund_note + * + * @return string|null + */ + public function getRefundNote() + { + return $this->container['refund_note']; + } + + /** + * Sets refund_note + * + * @param string|null $refund_note Refund note. + * + * @return self + */ + public function setRefundNote($refund_note) + { + if (is_null($refund_note)) { + throw new \InvalidArgumentException('non-nullable refund_note cannot be null'); + } + $this->container['refund_note'] = $refund_note; + + return $this; + } + + /** + * Gets refund_speed + * + * @return string|null + */ + public function getRefundSpeed() + { + return $this->container['refund_speed']; + } + + /** + * Sets refund_speed + * + * @param string|null $refund_speed Refund speed. Can be INSTANT or STANDARD. UPI supports only STANDARD refunds, Enach and Pnach supports only INSTANT refunds. + * + * @return self + */ + public function setRefundSpeed($refund_speed) + { + if (is_null($refund_speed)) { + throw new \InvalidArgumentException('non-nullable refund_speed cannot be null'); + } + $this->container['refund_speed'] = $refund_speed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionRequest.php b/lib/Model/CreateSubscriptionRequest.php new file mode 100644 index 0000000..75d463f --- /dev/null +++ b/lib/Model/CreateSubscriptionRequest.php @@ -0,0 +1,741 @@ + + */ +class CreateSubscriptionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string', + 'customer_details' => '\Cashfree\Model\SubscriptionCustomerDetails', + 'plan_details' => '\Cashfree\Model\CreateSubscriptionRequestPlanDetails', + 'authorization_details' => '\Cashfree\Model\CreateSubscriptionRequestAuthorizationDetails', + 'subscription_meta' => '\Cashfree\Model\CreateSubscriptionRequestSubscriptionMeta', + 'subscription_expiry_time' => 'string', + 'subscription_first_charge_time' => 'string', + 'subscription_note' => 'string', + 'subscription_tags' => 'object', + 'subscription_payment_splits' => '\Cashfree\Model\SubscriptionPaymentSplitItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null, + 'customer_details' => null, + 'plan_details' => null, + 'authorization_details' => null, + 'subscription_meta' => null, + 'subscription_expiry_time' => null, + 'subscription_first_charge_time' => null, + 'subscription_note' => null, + 'subscription_tags' => null, + 'subscription_payment_splits' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false, + 'customer_details' => false, + 'plan_details' => false, + 'authorization_details' => false, + 'subscription_meta' => false, + 'subscription_expiry_time' => false, + 'subscription_first_charge_time' => false, + 'subscription_note' => false, + 'subscription_tags' => false, + 'subscription_payment_splits' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id', + 'customer_details' => 'customer_details', + 'plan_details' => 'plan_details', + 'authorization_details' => 'authorization_details', + 'subscription_meta' => 'subscription_meta', + 'subscription_expiry_time' => 'subscription_expiry_time', + 'subscription_first_charge_time' => 'subscription_first_charge_time', + 'subscription_note' => 'subscription_note', + 'subscription_tags' => 'subscription_tags', + 'subscription_payment_splits' => 'subscription_payment_splits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId', + 'customer_details' => 'setCustomerDetails', + 'plan_details' => 'setPlanDetails', + 'authorization_details' => 'setAuthorizationDetails', + 'subscription_meta' => 'setSubscriptionMeta', + 'subscription_expiry_time' => 'setSubscriptionExpiryTime', + 'subscription_first_charge_time' => 'setSubscriptionFirstChargeTime', + 'subscription_note' => 'setSubscriptionNote', + 'subscription_tags' => 'setSubscriptionTags', + 'subscription_payment_splits' => 'setSubscriptionPaymentSplits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId', + 'customer_details' => 'getCustomerDetails', + 'plan_details' => 'getPlanDetails', + 'authorization_details' => 'getAuthorizationDetails', + 'subscription_meta' => 'getSubscriptionMeta', + 'subscription_expiry_time' => 'getSubscriptionExpiryTime', + 'subscription_first_charge_time' => 'getSubscriptionFirstChargeTime', + 'subscription_note' => 'getSubscriptionNote', + 'subscription_tags' => 'getSubscriptionTags', + 'subscription_payment_splits' => 'getSubscriptionPaymentSplits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('customer_details', $data ?? [], null); + $this->setIfExists('plan_details', $data ?? [], null); + $this->setIfExists('authorization_details', $data ?? [], null); + $this->setIfExists('subscription_meta', $data ?? [], null); + $this->setIfExists('subscription_expiry_time', $data ?? [], null); + $this->setIfExists('subscription_first_charge_time', $data ?? [], null); + $this->setIfExists('subscription_note', $data ?? [], null); + $this->setIfExists('subscription_tags', $data ?? [], null); + $this->setIfExists('subscription_payment_splits', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + if ((mb_strlen($this->container['subscription_id']) > 250)) { + $invalidProperties[] = "invalid value for 'subscription_id', the character length must be smaller than or equal to 250."; + } + + if ((mb_strlen($this->container['subscription_id']) < 1)) { + $invalidProperties[] = "invalid value for 'subscription_id', the character length must be bigger than or equal to 1."; + } + + if ($this->container['customer_details'] === null) { + $invalidProperties[] = "'customer_details' can't be null"; + } + if ($this->container['plan_details'] === null) { + $invalidProperties[] = "'plan_details' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id A unique ID for the subscription. It can include alphanumeric characters, underscore, dot, hyphen, and space. Maximum characters allowed is 250. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + if ((mb_strlen($subscription_id) > 250)) { + throw new \InvalidArgumentException('invalid length for $subscription_id when calling CreateSubscriptionRequest., must be smaller than or equal to 250.'); + } + if ((mb_strlen($subscription_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $subscription_id when calling CreateSubscriptionRequest., must be bigger than or equal to 1.'); + } + + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets customer_details + * + * @return \Cashfree\Model\SubscriptionCustomerDetails + */ + public function getCustomerDetails() + { + return $this->container['customer_details']; + } + + /** + * Sets customer_details + * + * @param \Cashfree\Model\SubscriptionCustomerDetails $customer_details customer_details + * + * @return self + */ + public function setCustomerDetails($customer_details) + { + if (is_null($customer_details)) { + throw new \InvalidArgumentException('non-nullable customer_details cannot be null'); + } + $this->container['customer_details'] = $customer_details; + + return $this; + } + + /** + * Gets plan_details + * + * @return \Cashfree\Model\CreateSubscriptionRequestPlanDetails + */ + public function getPlanDetails() + { + return $this->container['plan_details']; + } + + /** + * Sets plan_details + * + * @param \Cashfree\Model\CreateSubscriptionRequestPlanDetails $plan_details plan_details + * + * @return self + */ + public function setPlanDetails($plan_details) + { + if (is_null($plan_details)) { + throw new \InvalidArgumentException('non-nullable plan_details cannot be null'); + } + $this->container['plan_details'] = $plan_details; + + return $this; + } + + /** + * Gets authorization_details + * + * @return \Cashfree\Model\CreateSubscriptionRequestAuthorizationDetails|null + */ + public function getAuthorizationDetails() + { + return $this->container['authorization_details']; + } + + /** + * Sets authorization_details + * + * @param \Cashfree\Model\CreateSubscriptionRequestAuthorizationDetails|null $authorization_details authorization_details + * + * @return self + */ + public function setAuthorizationDetails($authorization_details) + { + if (is_null($authorization_details)) { + throw new \InvalidArgumentException('non-nullable authorization_details cannot be null'); + } + $this->container['authorization_details'] = $authorization_details; + + return $this; + } + + /** + * Gets subscription_meta + * + * @return \Cashfree\Model\CreateSubscriptionRequestSubscriptionMeta|null + */ + public function getSubscriptionMeta() + { + return $this->container['subscription_meta']; + } + + /** + * Sets subscription_meta + * + * @param \Cashfree\Model\CreateSubscriptionRequestSubscriptionMeta|null $subscription_meta subscription_meta + * + * @return self + */ + public function setSubscriptionMeta($subscription_meta) + { + if (is_null($subscription_meta)) { + throw new \InvalidArgumentException('non-nullable subscription_meta cannot be null'); + } + $this->container['subscription_meta'] = $subscription_meta; + + return $this; + } + + /** + * Gets subscription_expiry_time + * + * @return string|null + */ + public function getSubscriptionExpiryTime() + { + return $this->container['subscription_expiry_time']; + } + + /** + * Sets subscription_expiry_time + * + * @param string|null $subscription_expiry_time Expiry date for the subscription. + * + * @return self + */ + public function setSubscriptionExpiryTime($subscription_expiry_time) + { + if (is_null($subscription_expiry_time)) { + throw new \InvalidArgumentException('non-nullable subscription_expiry_time cannot be null'); + } + $this->container['subscription_expiry_time'] = $subscription_expiry_time; + + return $this; + } + + /** + * Gets subscription_first_charge_time + * + * @return string|null + */ + public function getSubscriptionFirstChargeTime() + { + return $this->container['subscription_first_charge_time']; + } + + /** + * Sets subscription_first_charge_time + * + * @param string|null $subscription_first_charge_time Time at which the first charge will be made for the subscription after authorization. Applicable only for PERIODIC plans. + * + * @return self + */ + public function setSubscriptionFirstChargeTime($subscription_first_charge_time) + { + if (is_null($subscription_first_charge_time)) { + throw new \InvalidArgumentException('non-nullable subscription_first_charge_time cannot be null'); + } + $this->container['subscription_first_charge_time'] = $subscription_first_charge_time; + + return $this; + } + + /** + * Gets subscription_note + * + * @return string|null + */ + public function getSubscriptionNote() + { + return $this->container['subscription_note']; + } + + /** + * Sets subscription_note + * + * @param string|null $subscription_note Note for the subscription. + * + * @return self + */ + public function setSubscriptionNote($subscription_note) + { + if (is_null($subscription_note)) { + throw new \InvalidArgumentException('non-nullable subscription_note cannot be null'); + } + $this->container['subscription_note'] = $subscription_note; + + return $this; + } + + /** + * Gets subscription_tags + * + * @return object|null + */ + public function getSubscriptionTags() + { + return $this->container['subscription_tags']; + } + + /** + * Sets subscription_tags + * + * @param object|null $subscription_tags Tags for the subscription. + * + * @return self + */ + public function setSubscriptionTags($subscription_tags) + { + if (is_null($subscription_tags)) { + throw new \InvalidArgumentException('non-nullable subscription_tags cannot be null'); + } + $this->container['subscription_tags'] = $subscription_tags; + + return $this; + } + + /** + * Gets subscription_payment_splits + * + * @return \Cashfree\Model\SubscriptionPaymentSplitItem[]|null + */ + public function getSubscriptionPaymentSplits() + { + return $this->container['subscription_payment_splits']; + } + + /** + * Sets subscription_payment_splits + * + * @param \Cashfree\Model\SubscriptionPaymentSplitItem[]|null $subscription_payment_splits Payment splits for the subscription. + * + * @return self + */ + public function setSubscriptionPaymentSplits($subscription_payment_splits) + { + if (is_null($subscription_payment_splits)) { + throw new \InvalidArgumentException('non-nullable subscription_payment_splits cannot be null'); + } + $this->container['subscription_payment_splits'] = $subscription_payment_splits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionRequestAuthorizationDetails.php b/lib/Model/CreateSubscriptionRequestAuthorizationDetails.php new file mode 100644 index 0000000..9ad2d1b --- /dev/null +++ b/lib/Model/CreateSubscriptionRequestAuthorizationDetails.php @@ -0,0 +1,444 @@ + + */ +class CreateSubscriptionRequestAuthorizationDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionRequest_authorization_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorization_amount' => 'float', + 'authorization_amount_refund' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorization_amount' => 'float64', + 'authorization_amount_refund' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorization_amount' => false, + 'authorization_amount_refund' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authorization_amount' => 'authorization_amount', + 'authorization_amount_refund' => 'authorization_amount_refund' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorization_amount' => 'setAuthorizationAmount', + 'authorization_amount_refund' => 'setAuthorizationAmountRefund' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorization_amount' => 'getAuthorizationAmount', + 'authorization_amount_refund' => 'getAuthorizationAmountRefund' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authorization_amount', $data ?? [], null); + $this->setIfExists('authorization_amount_refund', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorization_amount + * + * @return float|null + */ + public function getAuthorizationAmount() + { + return $this->container['authorization_amount']; + } + + /** + * Sets authorization_amount + * + * @param float|null $authorization_amount Authorization amount for the auth payment. + * + * @return self + */ + public function setAuthorizationAmount($authorization_amount) + { + if (is_null($authorization_amount)) { + throw new \InvalidArgumentException('non-nullable authorization_amount cannot be null'); + } + $this->container['authorization_amount'] = $authorization_amount; + + return $this; + } + + /** + * Gets authorization_amount_refund + * + * @return bool|null + */ + public function getAuthorizationAmountRefund() + { + return $this->container['authorization_amount_refund']; + } + + /** + * Sets authorization_amount_refund + * + * @param bool|null $authorization_amount_refund 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 self + */ + public function setAuthorizationAmountRefund($authorization_amount_refund) + { + if (is_null($authorization_amount_refund)) { + throw new \InvalidArgumentException('non-nullable authorization_amount_refund cannot be null'); + } + $this->container['authorization_amount_refund'] = $authorization_amount_refund; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionRequestPlanDetails.php b/lib/Model/CreateSubscriptionRequestPlanDetails.php new file mode 100644 index 0000000..1720b6a --- /dev/null +++ b/lib/Model/CreateSubscriptionRequestPlanDetails.php @@ -0,0 +1,724 @@ + + */ +class CreateSubscriptionRequestPlanDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionRequest_plan_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan_id' => 'string', + 'plan_name' => 'string', + 'plan_type' => 'string', + 'plan_currency' => 'string', + 'plan_amount' => 'float', + 'plan_max_amount' => 'float', + 'plan_max_cycles' => 'int', + 'plan_intervals' => 'int', + 'plan_interval_type' => 'string', + 'plan_note' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan_id' => null, + 'plan_name' => null, + 'plan_type' => null, + 'plan_currency' => null, + 'plan_amount' => 'float64', + 'plan_max_amount' => 'float64', + 'plan_max_cycles' => null, + 'plan_intervals' => null, + 'plan_interval_type' => null, + 'plan_note' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plan_id' => false, + 'plan_name' => false, + 'plan_type' => false, + 'plan_currency' => false, + 'plan_amount' => false, + 'plan_max_amount' => false, + 'plan_max_cycles' => false, + 'plan_intervals' => false, + 'plan_interval_type' => false, + 'plan_note' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan_id' => 'plan_id', + 'plan_name' => 'plan_name', + 'plan_type' => 'plan_type', + 'plan_currency' => 'plan_currency', + 'plan_amount' => 'plan_amount', + 'plan_max_amount' => 'plan_max_amount', + 'plan_max_cycles' => 'plan_max_cycles', + 'plan_intervals' => 'plan_intervals', + 'plan_interval_type' => 'plan_interval_type', + 'plan_note' => 'plan_note' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan_id' => 'setPlanId', + 'plan_name' => 'setPlanName', + 'plan_type' => 'setPlanType', + 'plan_currency' => 'setPlanCurrency', + 'plan_amount' => 'setPlanAmount', + 'plan_max_amount' => 'setPlanMaxAmount', + 'plan_max_cycles' => 'setPlanMaxCycles', + 'plan_intervals' => 'setPlanIntervals', + 'plan_interval_type' => 'setPlanIntervalType', + 'plan_note' => 'setPlanNote' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan_id' => 'getPlanId', + 'plan_name' => 'getPlanName', + 'plan_type' => 'getPlanType', + 'plan_currency' => 'getPlanCurrency', + 'plan_amount' => 'getPlanAmount', + 'plan_max_amount' => 'getPlanMaxAmount', + 'plan_max_cycles' => 'getPlanMaxCycles', + 'plan_intervals' => 'getPlanIntervals', + 'plan_interval_type' => 'getPlanIntervalType', + 'plan_note' => 'getPlanNote' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plan_id', $data ?? [], null); + $this->setIfExists('plan_name', $data ?? [], null); + $this->setIfExists('plan_type', $data ?? [], null); + $this->setIfExists('plan_currency', $data ?? [], null); + $this->setIfExists('plan_amount', $data ?? [], null); + $this->setIfExists('plan_max_amount', $data ?? [], null); + $this->setIfExists('plan_max_cycles', $data ?? [], null); + $this->setIfExists('plan_intervals', $data ?? [], null); + $this->setIfExists('plan_interval_type', $data ?? [], null); + $this->setIfExists('plan_note', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['plan_name']) && (mb_strlen($this->container['plan_name']) > 40)) { + $invalidProperties[] = "invalid value for 'plan_name', the character length must be smaller than or equal to 40."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan_id + * + * @return string|null + */ + public function getPlanId() + { + return $this->container['plan_id']; + } + + /** + * Sets plan_id + * + * @param string|null $plan_id 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 self + */ + public function setPlanId($plan_id) + { + if (is_null($plan_id)) { + throw new \InvalidArgumentException('non-nullable plan_id cannot be null'); + } + $this->container['plan_id'] = $plan_id; + + return $this; + } + + /** + * Gets plan_name + * + * @return string|null + */ + public function getPlanName() + { + return $this->container['plan_name']; + } + + /** + * Sets plan_name + * + * @param string|null $plan_name Specify plan name for easy reference. + * + * @return self + */ + public function setPlanName($plan_name) + { + if (is_null($plan_name)) { + throw new \InvalidArgumentException('non-nullable plan_name cannot be null'); + } + if ((mb_strlen($plan_name) > 40)) { + throw new \InvalidArgumentException('invalid length for $plan_name when calling CreateSubscriptionRequestPlanDetails., must be smaller than or equal to 40.'); + } + + $this->container['plan_name'] = $plan_name; + + return $this; + } + + /** + * Gets plan_type + * + * @return string|null + */ + public function getPlanType() + { + return $this->container['plan_type']; + } + + /** + * Sets plan_type + * + * @param string|null $plan_type 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 self + */ + public function setPlanType($plan_type) + { + if (is_null($plan_type)) { + throw new \InvalidArgumentException('non-nullable plan_type cannot be null'); + } + $this->container['plan_type'] = $plan_type; + + return $this; + } + + /** + * Gets plan_currency + * + * @return string|null + */ + public function getPlanCurrency() + { + return $this->container['plan_currency']; + } + + /** + * Sets plan_currency + * + * @param string|null $plan_currency INR by default. + * + * @return self + */ + public function setPlanCurrency($plan_currency) + { + if (is_null($plan_currency)) { + throw new \InvalidArgumentException('non-nullable plan_currency cannot be null'); + } + $this->container['plan_currency'] = $plan_currency; + + return $this; + } + + /** + * Gets plan_amount + * + * @return float|null + */ + public function getPlanAmount() + { + return $this->container['plan_amount']; + } + + /** + * Sets plan_amount + * + * @param float|null $plan_amount The amount to be charged for PERIODIC plan. This is a conditional parameter, only required for PERIODIC plans. + * + * @return self + */ + public function setPlanAmount($plan_amount) + { + if (is_null($plan_amount)) { + throw new \InvalidArgumentException('non-nullable plan_amount cannot be null'); + } + $this->container['plan_amount'] = $plan_amount; + + return $this; + } + + /** + * Gets plan_max_amount + * + * @return float|null + */ + public function getPlanMaxAmount() + { + return $this->container['plan_max_amount']; + } + + /** + * Sets plan_max_amount + * + * @param float|null $plan_max_amount This is the maximum amount that can be charged on a subscription. + * + * @return self + */ + public function setPlanMaxAmount($plan_max_amount) + { + if (is_null($plan_max_amount)) { + throw new \InvalidArgumentException('non-nullable plan_max_amount cannot be null'); + } + $this->container['plan_max_amount'] = $plan_max_amount; + + return $this; + } + + /** + * Gets plan_max_cycles + * + * @return int|null + */ + public function getPlanMaxCycles() + { + return $this->container['plan_max_cycles']; + } + + /** + * Sets plan_max_cycles + * + * @param int|null $plan_max_cycles Maximum number of debits set for the plan. The subscription will automatically change to COMPLETED status once this limit is reached. + * + * @return self + */ + public function setPlanMaxCycles($plan_max_cycles) + { + if (is_null($plan_max_cycles)) { + throw new \InvalidArgumentException('non-nullable plan_max_cycles cannot be null'); + } + $this->container['plan_max_cycles'] = $plan_max_cycles; + + return $this; + } + + /** + * Gets plan_intervals + * + * @return int|null + */ + public function getPlanIntervals() + { + return $this->container['plan_intervals']; + } + + /** + * Sets plan_intervals + * + * @param int|null $plan_intervals 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 self + */ + public function setPlanIntervals($plan_intervals) + { + if (is_null($plan_intervals)) { + throw new \InvalidArgumentException('non-nullable plan_intervals cannot be null'); + } + $this->container['plan_intervals'] = $plan_intervals; + + return $this; + } + + /** + * Gets plan_interval_type + * + * @return string|null + */ + public function getPlanIntervalType() + { + return $this->container['plan_interval_type']; + } + + /** + * Sets plan_interval_type + * + * @param string|null $plan_interval_type 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 self + */ + public function setPlanIntervalType($plan_interval_type) + { + if (is_null($plan_interval_type)) { + throw new \InvalidArgumentException('non-nullable plan_interval_type cannot be null'); + } + $this->container['plan_interval_type'] = $plan_interval_type; + + return $this; + } + + /** + * Gets plan_note + * + * @return string|null + */ + public function getPlanNote() + { + return $this->container['plan_note']; + } + + /** + * Sets plan_note + * + * @param string|null $plan_note Note for the plan. + * + * @return self + */ + public function setPlanNote($plan_note) + { + if (is_null($plan_note)) { + throw new \InvalidArgumentException('non-nullable plan_note cannot be null'); + } + $this->container['plan_note'] = $plan_note; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateSubscriptionRequestSubscriptionMeta.php b/lib/Model/CreateSubscriptionRequestSubscriptionMeta.php new file mode 100644 index 0000000..c1b9a6a --- /dev/null +++ b/lib/Model/CreateSubscriptionRequestSubscriptionMeta.php @@ -0,0 +1,444 @@ + + */ +class CreateSubscriptionRequestSubscriptionMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSubscriptionRequest_subscription_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'return_url' => 'string', + 'notification_channel' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'return_url' => null, + 'notification_channel' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'return_url' => false, + 'notification_channel' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'return_url' => 'return_url', + 'notification_channel' => 'notification_channel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'return_url' => 'setReturnUrl', + 'notification_channel' => 'setNotificationChannel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'return_url' => 'getReturnUrl', + 'notification_channel' => 'getNotificationChannel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('return_url', $data ?? [], null); + $this->setIfExists('notification_channel', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets return_url + * + * @return string|null + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string|null $return_url The url to redirect after checkout. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + + /** + * Gets notification_channel + * + * @return string[]|null + */ + public function getNotificationChannel() + { + return $this->container['notification_channel']; + } + + /** + * Sets notification_channel + * + * @param string[]|null $notification_channel Notification channel for the subscription. SMS, EMAIL are possible values. + * + * @return self + */ + public function setNotificationChannel($notification_channel) + { + if (is_null($notification_channel)) { + throw new \InvalidArgumentException('non-nullable notification_channel cannot be null'); + } + $this->container['notification_channel'] = $notification_channel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateTerminalTransactionRequest.php b/lib/Model/CreateTerminalTransactionRequest.php index bbe9114..97f182f 100644 --- a/lib/Model/CreateTerminalTransactionRequest.php +++ b/lib/Model/CreateTerminalTransactionRequest.php @@ -62,7 +62,8 @@ class CreateTerminalTransactionRequest implements ModelInterface, ArrayAccess, \ 'cf_order_id' => 'string', 'cf_terminal_id' => 'string', 'payment_method' => 'string', - 'terminal_phone_no' => 'string' + 'terminal_phone_no' => 'string', + 'add_invoice' => 'bool' ]; /** @@ -76,7 +77,8 @@ class CreateTerminalTransactionRequest implements ModelInterface, ArrayAccess, \ 'cf_order_id' => null, 'cf_terminal_id' => null, 'payment_method' => null, - 'terminal_phone_no' => null + 'terminal_phone_no' => null, + 'add_invoice' => null ]; /** @@ -88,7 +90,8 @@ class CreateTerminalTransactionRequest implements ModelInterface, ArrayAccess, \ 'cf_order_id' => false, 'cf_terminal_id' => false, 'payment_method' => false, - 'terminal_phone_no' => false + 'terminal_phone_no' => false, + 'add_invoice' => false ]; /** @@ -180,7 +183,8 @@ public function isNullableSetToNull(string $property): bool 'cf_order_id' => 'cf_order_id', 'cf_terminal_id' => 'cf_terminal_id', 'payment_method' => 'payment_method', - 'terminal_phone_no' => 'terminal_phone_no' + 'terminal_phone_no' => 'terminal_phone_no', + 'add_invoice' => 'add_invoice' ]; /** @@ -192,7 +196,8 @@ public function isNullableSetToNull(string $property): bool 'cf_order_id' => 'setCfOrderId', 'cf_terminal_id' => 'setCfTerminalId', 'payment_method' => 'setPaymentMethod', - 'terminal_phone_no' => 'setTerminalPhoneNo' + 'terminal_phone_no' => 'setTerminalPhoneNo', + 'add_invoice' => 'setAddInvoice' ]; /** @@ -204,7 +209,8 @@ public function isNullableSetToNull(string $property): bool 'cf_order_id' => 'getCfOrderId', 'cf_terminal_id' => 'getCfTerminalId', 'payment_method' => 'getPaymentMethod', - 'terminal_phone_no' => 'getTerminalPhoneNo' + 'terminal_phone_no' => 'getTerminalPhoneNo', + 'add_invoice' => 'getAddInvoice' ]; /** @@ -268,6 +274,7 @@ public function __construct(array $data = null) $this->setIfExists('cf_terminal_id', $data ?? [], null); $this->setIfExists('payment_method', $data ?? [], null); $this->setIfExists('terminal_phone_no', $data ?? [], null); + $this->setIfExists('add_invoice', $data ?? [], null); } /** @@ -455,6 +462,33 @@ public function setTerminalPhoneNo($terminal_phone_no) return $this; } + + /** + * Gets add_invoice + * + * @return bool|null + */ + public function getAddInvoice() + { + return $this->container['add_invoice']; + } + + /** + * Sets add_invoice + * + * @param bool|null $add_invoice make it true to have request be sent to create a Dynamic GST QR Code. + * + * @return self + */ + public function setAddInvoice($add_invoice) + { + if (is_null($add_invoice)) { + throw new \InvalidArgumentException('non-nullable add_invoice cannot be null'); + } + $this->container['add_invoice'] = $add_invoice; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CreateVendorRequest.php b/lib/Model/CreateVendorRequest.php index eb8f211..89453a0 100644 --- a/lib/Model/CreateVendorRequest.php +++ b/lib/Model/CreateVendorRequest.php @@ -581,7 +581,7 @@ public function getScheduleOption() /** * Sets schedule_option * - * @param float|null $schedule_option 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. + * @param float|null $schedule_option 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 self */ diff --git a/lib/Model/CustomerDetails.php b/lib/Model/CustomerDetails.php index 241bd1c..d870a27 100644 --- a/lib/Model/CustomerDetails.php +++ b/lib/Model/CustomerDetails.php @@ -36,7 +36,7 @@ * CustomerDetails Class Doc Comment * * @category Class - * @description The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. + * @description The customer details that are necessary. * @package Cashfree * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/lib/Model/CustomerDetailsResponse.php b/lib/Model/CustomerDetailsResponse.php new file mode 100644 index 0000000..8d6feda --- /dev/null +++ b/lib/Model/CustomerDetailsResponse.php @@ -0,0 +1,724 @@ + + */ +class CustomerDetailsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CustomerDetailsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'customer_id' => 'string', + 'customer_email' => 'string', + 'customer_phone' => 'string', + 'customer_name' => 'string', + 'customer_bank_account_number' => 'string', + 'customer_bank_ifsc' => 'string', + 'customer_bank_code' => 'float', + 'customer_uid' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'customer_id' => null, + 'customer_email' => null, + 'customer_phone' => null, + 'customer_name' => null, + 'customer_bank_account_number' => null, + 'customer_bank_ifsc' => null, + 'customer_bank_code' => null, + 'customer_uid' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'customer_id' => false, + 'customer_email' => false, + 'customer_phone' => false, + 'customer_name' => false, + 'customer_bank_account_number' => false, + 'customer_bank_ifsc' => false, + 'customer_bank_code' => false, + 'customer_uid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_id' => 'customer_id', + 'customer_email' => 'customer_email', + 'customer_phone' => 'customer_phone', + 'customer_name' => 'customer_name', + 'customer_bank_account_number' => 'customer_bank_account_number', + 'customer_bank_ifsc' => 'customer_bank_ifsc', + 'customer_bank_code' => 'customer_bank_code', + 'customer_uid' => 'customer_uid' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_id' => 'setCustomerId', + 'customer_email' => 'setCustomerEmail', + 'customer_phone' => 'setCustomerPhone', + 'customer_name' => 'setCustomerName', + 'customer_bank_account_number' => 'setCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'setCustomerBankIfsc', + 'customer_bank_code' => 'setCustomerBankCode', + 'customer_uid' => 'setCustomerUid' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_id' => 'getCustomerId', + 'customer_email' => 'getCustomerEmail', + 'customer_phone' => 'getCustomerPhone', + 'customer_name' => 'getCustomerName', + 'customer_bank_account_number' => 'getCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'getCustomerBankIfsc', + 'customer_bank_code' => 'getCustomerBankCode', + 'customer_uid' => 'getCustomerUid' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('customer_id', $data ?? [], null); + $this->setIfExists('customer_email', $data ?? [], null); + $this->setIfExists('customer_phone', $data ?? [], null); + $this->setIfExists('customer_name', $data ?? [], null); + $this->setIfExists('customer_bank_account_number', $data ?? [], null); + $this->setIfExists('customer_bank_ifsc', $data ?? [], null); + $this->setIfExists('customer_bank_code', $data ?? [], null); + $this->setIfExists('customer_uid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['customer_id']) && (mb_strlen($this->container['customer_id']) > 50)) { + $invalidProperties[] = "invalid value for 'customer_id', the character length must be smaller than or equal to 50."; + } + + if (!is_null($this->container['customer_id']) && (mb_strlen($this->container['customer_id']) < 3)) { + $invalidProperties[] = "invalid value for 'customer_id', the character length must be bigger than or equal to 3."; + } + + if (!is_null($this->container['customer_email']) && (mb_strlen($this->container['customer_email']) > 100)) { + $invalidProperties[] = "invalid value for 'customer_email', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['customer_email']) && (mb_strlen($this->container['customer_email']) < 3)) { + $invalidProperties[] = "invalid value for 'customer_email', the character length must be bigger than or equal to 3."; + } + + if (!is_null($this->container['customer_phone']) && (mb_strlen($this->container['customer_phone']) > 10)) { + $invalidProperties[] = "invalid value for 'customer_phone', the character length must be smaller than or equal to 10."; + } + + if (!is_null($this->container['customer_phone']) && (mb_strlen($this->container['customer_phone']) < 10)) { + $invalidProperties[] = "invalid value for 'customer_phone', the character length must be bigger than or equal to 10."; + } + + if (!is_null($this->container['customer_name']) && (mb_strlen($this->container['customer_name']) > 100)) { + $invalidProperties[] = "invalid value for 'customer_name', the character length must be smaller than or equal to 100."; + } + + if (!is_null($this->container['customer_name']) && (mb_strlen($this->container['customer_name']) < 3)) { + $invalidProperties[] = "invalid value for 'customer_name', the character length must be bigger than or equal to 3."; + } + + if (!is_null($this->container['customer_bank_account_number']) && (mb_strlen($this->container['customer_bank_account_number']) > 20)) { + $invalidProperties[] = "invalid value for 'customer_bank_account_number', the character length must be smaller than or equal to 20."; + } + + if (!is_null($this->container['customer_bank_account_number']) && (mb_strlen($this->container['customer_bank_account_number']) < 3)) { + $invalidProperties[] = "invalid value for 'customer_bank_account_number', the character length must be bigger than or equal to 3."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id A unique identifier for the customer. Use alphanumeric values only. + * + * @return self + */ + public function setCustomerId($customer_id) + { + if (is_null($customer_id)) { + throw new \InvalidArgumentException('non-nullable customer_id cannot be null'); + } + if ((mb_strlen($customer_id) > 50)) { + throw new \InvalidArgumentException('invalid length for $customer_id when calling CustomerDetailsResponse., must be smaller than or equal to 50.'); + } + if ((mb_strlen($customer_id) < 3)) { + throw new \InvalidArgumentException('invalid length for $customer_id when calling CustomerDetailsResponse., must be bigger than or equal to 3.'); + } + + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets customer_email + * + * @return string|null + */ + public function getCustomerEmail() + { + return $this->container['customer_email']; + } + + /** + * Sets customer_email + * + * @param string|null $customer_email Customer email address. + * + * @return self + */ + public function setCustomerEmail($customer_email) + { + if (is_null($customer_email)) { + throw new \InvalidArgumentException('non-nullable customer_email cannot be null'); + } + if ((mb_strlen($customer_email) > 100)) { + throw new \InvalidArgumentException('invalid length for $customer_email when calling CustomerDetailsResponse., must be smaller than or equal to 100.'); + } + if ((mb_strlen($customer_email) < 3)) { + throw new \InvalidArgumentException('invalid length for $customer_email when calling CustomerDetailsResponse., must be bigger than or equal to 3.'); + } + + $this->container['customer_email'] = $customer_email; + + return $this; + } + + /** + * Gets customer_phone + * + * @return string|null + */ + public function getCustomerPhone() + { + return $this->container['customer_phone']; + } + + /** + * Sets customer_phone + * + * @param string|null $customer_phone Customer phone number. + * + * @return self + */ + public function setCustomerPhone($customer_phone) + { + if (is_null($customer_phone)) { + throw new \InvalidArgumentException('non-nullable customer_phone cannot be null'); + } + if ((mb_strlen($customer_phone) > 10)) { + throw new \InvalidArgumentException('invalid length for $customer_phone when calling CustomerDetailsResponse., must be smaller than or equal to 10.'); + } + if ((mb_strlen($customer_phone) < 10)) { + throw new \InvalidArgumentException('invalid length for $customer_phone when calling CustomerDetailsResponse., must be bigger than or equal to 10.'); + } + + $this->container['customer_phone'] = $customer_phone; + + return $this; + } + + /** + * Gets customer_name + * + * @return string|null + */ + public function getCustomerName() + { + return $this->container['customer_name']; + } + + /** + * Sets customer_name + * + * @param string|null $customer_name Name of the customer. + * + * @return self + */ + public function setCustomerName($customer_name) + { + if (is_null($customer_name)) { + throw new \InvalidArgumentException('non-nullable customer_name cannot be null'); + } + if ((mb_strlen($customer_name) > 100)) { + throw new \InvalidArgumentException('invalid length for $customer_name when calling CustomerDetailsResponse., must be smaller than or equal to 100.'); + } + if ((mb_strlen($customer_name) < 3)) { + throw new \InvalidArgumentException('invalid length for $customer_name when calling CustomerDetailsResponse., must be bigger than or equal to 3.'); + } + + $this->container['customer_name'] = $customer_name; + + return $this; + } + + /** + * Gets customer_bank_account_number + * + * @return string|null + */ + public function getCustomerBankAccountNumber() + { + return $this->container['customer_bank_account_number']; + } + + /** + * Sets customer_bank_account_number + * + * @param string|null $customer_bank_account_number Customer bank account. Required if you want to do a bank account check (TPV) + * + * @return self + */ + public function setCustomerBankAccountNumber($customer_bank_account_number) + { + if (is_null($customer_bank_account_number)) { + throw new \InvalidArgumentException('non-nullable customer_bank_account_number cannot be null'); + } + if ((mb_strlen($customer_bank_account_number) > 20)) { + throw new \InvalidArgumentException('invalid length for $customer_bank_account_number when calling CustomerDetailsResponse., must be smaller than or equal to 20.'); + } + if ((mb_strlen($customer_bank_account_number) < 3)) { + throw new \InvalidArgumentException('invalid length for $customer_bank_account_number when calling CustomerDetailsResponse., must be bigger than or equal to 3.'); + } + + $this->container['customer_bank_account_number'] = $customer_bank_account_number; + + return $this; + } + + /** + * Gets customer_bank_ifsc + * + * @return string|null + */ + public function getCustomerBankIfsc() + { + return $this->container['customer_bank_ifsc']; + } + + /** + * Sets customer_bank_ifsc + * + * @param string|null $customer_bank_ifsc Customer bank IFSC. Required if you want to do a bank account check (TPV) + * + * @return self + */ + public function setCustomerBankIfsc($customer_bank_ifsc) + { + if (is_null($customer_bank_ifsc)) { + throw new \InvalidArgumentException('non-nullable customer_bank_ifsc cannot be null'); + } + $this->container['customer_bank_ifsc'] = $customer_bank_ifsc; + + return $this; + } + + /** + * Gets customer_bank_code + * + * @return float|null + */ + public function getCustomerBankCode() + { + return $this->container['customer_bank_code']; + } + + /** + * Sets customer_bank_code + * + * @param float|null $customer_bank_code Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV) + * + * @return self + */ + public function setCustomerBankCode($customer_bank_code) + { + if (is_null($customer_bank_code)) { + throw new \InvalidArgumentException('non-nullable customer_bank_code cannot be null'); + } + $this->container['customer_bank_code'] = $customer_bank_code; + + return $this; + } + + /** + * Gets customer_uid + * + * @return string|null + */ + public function getCustomerUid() + { + return $this->container['customer_uid']; + } + + /** + * Sets customer_uid + * + * @param string|null $customer_uid Customer identifier at Cashfree. You will get this when you create/get customer + * + * @return self + */ + public function setCustomerUid($customer_uid) + { + if (is_null($customer_uid)) { + throw new \InvalidArgumentException('non-nullable customer_uid cannot be null'); + } + $this->container['customer_uid'] = $customer_uid; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EligibilityMethodItem.php b/lib/Model/EligibilityMethodItem.php new file mode 100644 index 0000000..8ea7bde --- /dev/null +++ b/lib/Model/EligibilityMethodItem.php @@ -0,0 +1,513 @@ + + */ +class EligibilityMethodItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EligibilityMethodItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eligibility' => 'bool', + 'entity_type' => 'string', + 'entity_value' => 'string', + 'entity_details' => '\Cashfree\Model\EligibilityMethodItemEntityDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eligibility' => null, + 'entity_type' => null, + 'entity_value' => null, + 'entity_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'eligibility' => false, + 'entity_type' => false, + 'entity_value' => false, + 'entity_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eligibility' => 'eligibility', + 'entity_type' => 'entity_type', + 'entity_value' => 'entity_value', + 'entity_details' => 'entity_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eligibility' => 'setEligibility', + 'entity_type' => 'setEntityType', + 'entity_value' => 'setEntityValue', + 'entity_details' => 'setEntityDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eligibility' => 'getEligibility', + 'entity_type' => 'getEntityType', + 'entity_value' => 'getEntityValue', + 'entity_details' => 'getEntityDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('eligibility', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('entity_value', $data ?? [], null); + $this->setIfExists('entity_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets eligibility + * + * @return bool|null + */ + public function getEligibility() + { + return $this->container['eligibility']; + } + + /** + * Sets eligibility + * + * @param bool|null $eligibility Indicates whether the payment method is eligible. + * + * @return self + */ + public function setEligibility($eligibility) + { + if (is_null($eligibility)) { + throw new \InvalidArgumentException('non-nullable eligibility cannot be null'); + } + $this->container['eligibility'] = $eligibility; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type Type of entity (e.g., \"payment_methods\"). + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + throw new \InvalidArgumentException('non-nullable entity_type cannot be null'); + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets entity_value + * + * @return string|null + */ + public function getEntityValue() + { + return $this->container['entity_value']; + } + + /** + * Sets entity_value + * + * @param string|null $entity_value Payment method (e.g., enach, pnach, upi, card). + * + * @return self + */ + public function setEntityValue($entity_value) + { + if (is_null($entity_value)) { + throw new \InvalidArgumentException('non-nullable entity_value cannot be null'); + } + $this->container['entity_value'] = $entity_value; + + return $this; + } + + /** + * Gets entity_details + * + * @return \Cashfree\Model\EligibilityMethodItemEntityDetails|null + */ + public function getEntityDetails() + { + return $this->container['entity_details']; + } + + /** + * Sets entity_details + * + * @param \Cashfree\Model\EligibilityMethodItemEntityDetails|null $entity_details entity_details + * + * @return self + */ + public function setEntityDetails($entity_details) + { + if (is_null($entity_details)) { + throw new \InvalidArgumentException('non-nullable entity_details cannot be null'); + } + $this->container['entity_details'] = $entity_details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EligibilityMethodItemEntityDetails.php b/lib/Model/EligibilityMethodItemEntityDetails.php new file mode 100644 index 0000000..784bba9 --- /dev/null +++ b/lib/Model/EligibilityMethodItemEntityDetails.php @@ -0,0 +1,546 @@ + + */ +class EligibilityMethodItemEntityDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EligibilityMethodItem_entity_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'account_types' => 'string[]', + 'frequent_bank_details' => '\Cashfree\Model\SubscriptionBankDetails[]', + 'all_bank_details' => '\Cashfree\Model\SubscriptionBankDetails[]', + 'available_handles' => '\Cashfree\Model\EligibilityMethodItemEntityDetailsAvailableHandlesInner[]', + 'allowed_card_types' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'account_types' => null, + 'frequent_bank_details' => null, + 'all_bank_details' => null, + 'available_handles' => null, + 'allowed_card_types' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'account_types' => false, + 'frequent_bank_details' => false, + 'all_bank_details' => false, + 'available_handles' => false, + 'allowed_card_types' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'account_types' => 'account_types', + 'frequent_bank_details' => 'frequent_bank_details', + 'all_bank_details' => 'all_bank_details', + 'available_handles' => 'available_handles', + 'allowed_card_types' => 'allowed_card_types' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'account_types' => 'setAccountTypes', + 'frequent_bank_details' => 'setFrequentBankDetails', + 'all_bank_details' => 'setAllBankDetails', + 'available_handles' => 'setAvailableHandles', + 'allowed_card_types' => 'setAllowedCardTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'account_types' => 'getAccountTypes', + 'frequent_bank_details' => 'getFrequentBankDetails', + 'all_bank_details' => 'getAllBankDetails', + 'available_handles' => 'getAvailableHandles', + 'allowed_card_types' => 'getAllowedCardTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('account_types', $data ?? [], null); + $this->setIfExists('frequent_bank_details', $data ?? [], null); + $this->setIfExists('all_bank_details', $data ?? [], null); + $this->setIfExists('available_handles', $data ?? [], null); + $this->setIfExists('allowed_card_types', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets account_types + * + * @return string[]|null + */ + public function getAccountTypes() + { + return $this->container['account_types']; + } + + /** + * Sets account_types + * + * @param string[]|null $account_types List of account types associated with the payment method. (e.g. SAVINGS or CURRENT) + * + * @return self + */ + public function setAccountTypes($account_types) + { + if (is_null($account_types)) { + throw new \InvalidArgumentException('non-nullable account_types cannot be null'); + } + $this->container['account_types'] = $account_types; + + return $this; + } + + /** + * Gets frequent_bank_details + * + * @return \Cashfree\Model\SubscriptionBankDetails[]|null + */ + public function getFrequentBankDetails() + { + return $this->container['frequent_bank_details']; + } + + /** + * Sets frequent_bank_details + * + * @param \Cashfree\Model\SubscriptionBankDetails[]|null $frequent_bank_details List of the most frequently used banks. + * + * @return self + */ + public function setFrequentBankDetails($frequent_bank_details) + { + if (is_null($frequent_bank_details)) { + throw new \InvalidArgumentException('non-nullable frequent_bank_details cannot be null'); + } + $this->container['frequent_bank_details'] = $frequent_bank_details; + + return $this; + } + + /** + * Gets all_bank_details + * + * @return \Cashfree\Model\SubscriptionBankDetails[]|null + */ + public function getAllBankDetails() + { + return $this->container['all_bank_details']; + } + + /** + * Sets all_bank_details + * + * @param \Cashfree\Model\SubscriptionBankDetails[]|null $all_bank_details Details about all banks associated with the payment method. + * + * @return self + */ + public function setAllBankDetails($all_bank_details) + { + if (is_null($all_bank_details)) { + throw new \InvalidArgumentException('non-nullable all_bank_details cannot be null'); + } + $this->container['all_bank_details'] = $all_bank_details; + + return $this; + } + + /** + * Gets available_handles + * + * @return \Cashfree\Model\EligibilityMethodItemEntityDetailsAvailableHandlesInner[]|null + */ + public function getAvailableHandles() + { + return $this->container['available_handles']; + } + + /** + * Sets available_handles + * + * @param \Cashfree\Model\EligibilityMethodItemEntityDetailsAvailableHandlesInner[]|null $available_handles List of supported VPA handles. + * + * @return self + */ + public function setAvailableHandles($available_handles) + { + if (is_null($available_handles)) { + throw new \InvalidArgumentException('non-nullable available_handles cannot be null'); + } + $this->container['available_handles'] = $available_handles; + + return $this; + } + + /** + * Gets allowed_card_types + * + * @return string[]|null + */ + public function getAllowedCardTypes() + { + return $this->container['allowed_card_types']; + } + + /** + * Sets allowed_card_types + * + * @param string[]|null $allowed_card_types List of allowed card types. (e.g. DEBIT_CARD, CREDIT_CARD) + * + * @return self + */ + public function setAllowedCardTypes($allowed_card_types) + { + if (is_null($allowed_card_types)) { + throw new \InvalidArgumentException('non-nullable allowed_card_types cannot be null'); + } + $this->container['allowed_card_types'] = $allowed_card_types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.php b/lib/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.php new file mode 100644 index 0000000..5b69179 --- /dev/null +++ b/lib/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInner.php @@ -0,0 +1,444 @@ + + */ +class EligibilityMethodItemEntityDetailsAvailableHandlesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EligibilityMethodItem_entity_details_available_handles_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'handle' => 'string', + 'application' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'handle' => null, + 'application' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'handle' => false, + 'application' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'handle' => 'handle', + 'application' => 'application' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'handle' => 'setHandle', + 'application' => 'setApplication' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'handle' => 'getHandle', + 'application' => 'getApplication' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('handle', $data ?? [], null); + $this->setIfExists('application', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets handle + * + * @return string|null + */ + public function getHandle() + { + return $this->container['handle']; + } + + /** + * Sets handle + * + * @param string|null $handle VPA handle + * + * @return self + */ + public function setHandle($handle) + { + if (is_null($handle)) { + throw new \InvalidArgumentException('non-nullable handle cannot be null'); + } + $this->container['handle'] = $handle; + + return $this; + } + + /** + * Gets application + * + * @return string|null + */ + public function getApplication() + { + return $this->container['application']; + } + + /** + * Sets application + * + * @param string|null $application Application or service related to the VPA handle. + * + * @return self + */ + public function setApplication($application) + { + if (is_null($application)) { + throw new \InvalidArgumentException('non-nullable application cannot be null'); + } + $this->container['application'] = $application; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EntitySimulationRequest.php b/lib/Model/EntitySimulationRequest.php new file mode 100644 index 0000000..64359b8 --- /dev/null +++ b/lib/Model/EntitySimulationRequest.php @@ -0,0 +1,488 @@ + + */ +class EntitySimulationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EntitySimulationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_status' => 'string', + 'payment_error_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_status' => null, + 'payment_error_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_status' => false, + 'payment_error_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_status' => 'payment_status', + 'payment_error_code' => 'payment_error_code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_status' => 'setPaymentStatus', + 'payment_error_code' => 'setPaymentErrorCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_status' => 'getPaymentStatus', + 'payment_error_code' => 'getPaymentErrorCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const PAYMENT_STATUS_SUCCESS = 'SUCCESS'; + public const PAYMENT_STATUS_FAILED = 'FAILED'; + public const PAYMENT_STATUS_PENDING = 'PENDING'; + public const PAYMENT_STATUS_USER_DROPPED = 'USER_DROPPED'; + public const PAYMENT_STATUS_UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentStatusAllowableValues() + { + return [ + self::PAYMENT_STATUS_SUCCESS, + self::PAYMENT_STATUS_FAILED, + self::PAYMENT_STATUS_PENDING, + self::PAYMENT_STATUS_USER_DROPPED, + self::PAYMENT_STATUS_UNKNOWN_DEFAULT_OPEN_API, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_error_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payment_status'] === null) { + $invalidProperties[] = "'payment_status' can't be null"; + } + $allowedValues = $this->getPaymentStatusAllowableValues(); + if (!is_null($this->container['payment_status']) && !in_array($this->container['payment_status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'payment_status', must be one of '%s'", + $this->container['payment_status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_status + * + * @return string + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string $payment_status Payment Status + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $allowedValues = $this->getPaymentStatusAllowableValues(); + if (!in_array($payment_status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'payment_status', must be one of '%s'", + $payment_status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_error_code + * + * @return string|null + */ + public function getPaymentErrorCode() + { + return $this->container['payment_error_code']; + } + + /** + * Sets payment_error_code + * + * @param string|null $payment_error_code Payment Error Code + * + * @return self + */ + public function setPaymentErrorCode($payment_error_code) + { + if (is_null($payment_error_code)) { + throw new \InvalidArgumentException('non-nullable payment_error_code cannot be null'); + } + $this->container['payment_error_code'] = $payment_error_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EntitySimulationResponse.php b/lib/Model/EntitySimulationResponse.php new file mode 100644 index 0000000..7f29bf7 --- /dev/null +++ b/lib/Model/EntitySimulationResponse.php @@ -0,0 +1,448 @@ + + */ +class EntitySimulationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EntitySimulationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_status' => 'string', + 'payment_error_code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_status' => null, + 'payment_error_code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_status' => false, + 'payment_error_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_status' => 'payment_status', + 'payment_error_code' => 'payment_error_code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_status' => 'setPaymentStatus', + 'payment_error_code' => 'setPaymentErrorCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_status' => 'getPaymentStatus', + 'payment_error_code' => 'getPaymentErrorCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_error_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payment_status'] === null) { + $invalidProperties[] = "'payment_status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_status + * + * @return string + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string $payment_status Payment Status + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_error_code + * + * @return string|null + */ + public function getPaymentErrorCode() + { + return $this->container['payment_error_code']; + } + + /** + * Sets payment_error_code + * + * @param string|null $payment_error_code Payment Error Code + * + * @return self + */ + public function setPaymentErrorCode($payment_error_code) + { + if (is_null($payment_error_code)) { + throw new \InvalidArgumentException('non-nullable payment_error_code cannot be null'); + } + $this->container['payment_error_code'] = $payment_error_code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LinkCustomerDetailsEntity.php b/lib/Model/LinkCustomerDetailsEntity.php index 7679f88..04fd126 100644 --- a/lib/Model/LinkCustomerDetailsEntity.php +++ b/lib/Model/LinkCustomerDetailsEntity.php @@ -61,7 +61,10 @@ class LinkCustomerDetailsEntity implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPITypes = [ 'customer_phone' => 'string', 'customer_email' => 'string', - 'customer_name' => 'string' + 'customer_name' => 'string', + 'customer_bank_account_number' => 'string', + 'customer_bank_ifsc' => 'string', + 'customer_bank_code' => 'int' ]; /** @@ -74,7 +77,10 @@ class LinkCustomerDetailsEntity implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPIFormats = [ 'customer_phone' => null, 'customer_email' => null, - 'customer_name' => null + 'customer_name' => null, + 'customer_bank_account_number' => null, + 'customer_bank_ifsc' => null, + 'customer_bank_code' => null ]; /** @@ -85,7 +91,10 @@ class LinkCustomerDetailsEntity implements ModelInterface, ArrayAccess, \JsonSer protected static $openAPINullables = [ 'customer_phone' => false, 'customer_email' => false, - 'customer_name' => false + 'customer_name' => false, + 'customer_bank_account_number' => false, + 'customer_bank_ifsc' => false, + 'customer_bank_code' => false ]; /** @@ -176,7 +185,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'customer_phone' => 'customer_phone', 'customer_email' => 'customer_email', - 'customer_name' => 'customer_name' + 'customer_name' => 'customer_name', + 'customer_bank_account_number' => 'customer_bank_account_number', + 'customer_bank_ifsc' => 'customer_bank_ifsc', + 'customer_bank_code' => 'customer_bank_code' ]; /** @@ -187,7 +199,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'customer_phone' => 'setCustomerPhone', 'customer_email' => 'setCustomerEmail', - 'customer_name' => 'setCustomerName' + 'customer_name' => 'setCustomerName', + 'customer_bank_account_number' => 'setCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'setCustomerBankIfsc', + 'customer_bank_code' => 'setCustomerBankCode' ]; /** @@ -198,7 +213,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'customer_phone' => 'getCustomerPhone', 'customer_email' => 'getCustomerEmail', - 'customer_name' => 'getCustomerName' + 'customer_name' => 'getCustomerName', + 'customer_bank_account_number' => 'getCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'getCustomerBankIfsc', + 'customer_bank_code' => 'getCustomerBankCode' ]; /** @@ -242,6 +260,97 @@ public function getModelName() return self::$openAPIModelName; } + public const CUSTOMER_BANK_CODE_3003 = 3003; + public const CUSTOMER_BANK_CODE_3005 = 3005; + public const CUSTOMER_BANK_CODE_3006 = 3006; + public const CUSTOMER_BANK_CODE_3010 = 3010; + public const CUSTOMER_BANK_CODE_3012 = 3012; + public const CUSTOMER_BANK_CODE_3016 = 3016; + public const CUSTOMER_BANK_CODE_3019 = 3019; + public const CUSTOMER_BANK_CODE_3020 = 3020; + public const CUSTOMER_BANK_CODE_3021 = 3021; + public const CUSTOMER_BANK_CODE_3022 = 3022; + public const CUSTOMER_BANK_CODE_3023 = 3023; + public const CUSTOMER_BANK_CODE_3024 = 3024; + public const CUSTOMER_BANK_CODE_3026 = 3026; + public const CUSTOMER_BANK_CODE_3027 = 3027; + public const CUSTOMER_BANK_CODE_3028 = 3028; + public const CUSTOMER_BANK_CODE_3029 = 3029; + public const CUSTOMER_BANK_CODE_3030 = 3030; + public const CUSTOMER_BANK_CODE_3031 = 3031; + public const CUSTOMER_BANK_CODE_3032 = 3032; + public const CUSTOMER_BANK_CODE_3033 = 3033; + public const CUSTOMER_BANK_CODE_3038 = 3038; + public const CUSTOMER_BANK_CODE_3039 = 3039; + public const CUSTOMER_BANK_CODE_3040 = 3040; + public const CUSTOMER_BANK_CODE_3042 = 3042; + public const CUSTOMER_BANK_CODE_3044 = 3044; + public const CUSTOMER_BANK_CODE_3054 = 3054; + public const CUSTOMER_BANK_CODE_3055 = 3055; + public const CUSTOMER_BANK_CODE_3058 = 3058; + public const CUSTOMER_BANK_CODE_3086 = 3086; + public const CUSTOMER_BANK_CODE_3087 = 3087; + public const CUSTOMER_BANK_CODE_3088 = 3088; + public const CUSTOMER_BANK_CODE_3089 = 3089; + public const CUSTOMER_BANK_CODE_3090 = 3090; + public const CUSTOMER_BANK_CODE_3091 = 3091; + public const CUSTOMER_BANK_CODE_3092 = 3092; + public const CUSTOMER_BANK_CODE_3098 = 3098; + public const CUSTOMER_BANK_CODE_3115 = 3115; + public const CUSTOMER_BANK_CODE_3117 = 3117; + public const CUSTOMER_BANK_CODE_7001 = 7001; + public const CUSTOMER_BANK_CODE_unknown_default_open_api = 11184809; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCustomerBankCodeAllowableValues() + { + return [ + self::CUSTOMER_BANK_CODE_3003, + self::CUSTOMER_BANK_CODE_3005, + self::CUSTOMER_BANK_CODE_3006, + self::CUSTOMER_BANK_CODE_3010, + self::CUSTOMER_BANK_CODE_3012, + self::CUSTOMER_BANK_CODE_3016, + self::CUSTOMER_BANK_CODE_3019, + self::CUSTOMER_BANK_CODE_3020, + self::CUSTOMER_BANK_CODE_3021, + self::CUSTOMER_BANK_CODE_3022, + self::CUSTOMER_BANK_CODE_3023, + self::CUSTOMER_BANK_CODE_3024, + self::CUSTOMER_BANK_CODE_3026, + self::CUSTOMER_BANK_CODE_3027, + self::CUSTOMER_BANK_CODE_3028, + self::CUSTOMER_BANK_CODE_3029, + self::CUSTOMER_BANK_CODE_3030, + self::CUSTOMER_BANK_CODE_3031, + self::CUSTOMER_BANK_CODE_3032, + self::CUSTOMER_BANK_CODE_3033, + self::CUSTOMER_BANK_CODE_3038, + self::CUSTOMER_BANK_CODE_3039, + self::CUSTOMER_BANK_CODE_3040, + self::CUSTOMER_BANK_CODE_3042, + self::CUSTOMER_BANK_CODE_3044, + self::CUSTOMER_BANK_CODE_3054, + self::CUSTOMER_BANK_CODE_3055, + self::CUSTOMER_BANK_CODE_3058, + self::CUSTOMER_BANK_CODE_3086, + self::CUSTOMER_BANK_CODE_3087, + self::CUSTOMER_BANK_CODE_3088, + self::CUSTOMER_BANK_CODE_3089, + self::CUSTOMER_BANK_CODE_3090, + self::CUSTOMER_BANK_CODE_3091, + self::CUSTOMER_BANK_CODE_3092, + self::CUSTOMER_BANK_CODE_3098, + self::CUSTOMER_BANK_CODE_3115, + self::CUSTOMER_BANK_CODE_3117, + self::CUSTOMER_BANK_CODE_7001, + self::CUSTOMER_BANK_CODE_unknown_default_open_api, + ]; + } /** * Associative array for storing property values @@ -261,6 +370,9 @@ public function __construct(array $data = null) $this->setIfExists('customer_phone', $data ?? [], null); $this->setIfExists('customer_email', $data ?? [], null); $this->setIfExists('customer_name', $data ?? [], null); + $this->setIfExists('customer_bank_account_number', $data ?? [], null); + $this->setIfExists('customer_bank_ifsc', $data ?? [], null); + $this->setIfExists('customer_bank_code', $data ?? [], null); } /** @@ -293,6 +405,15 @@ public function listInvalidProperties() if ($this->container['customer_phone'] === null) { $invalidProperties[] = "'customer_phone' can't be null"; } + $allowedValues = $this->getCustomerBankCodeAllowableValues(); + if (!is_null($this->container['customer_bank_code']) && !in_array($this->container['customer_bank_code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'customer_bank_code', must be one of '%s'", + $this->container['customer_bank_code'], + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -388,6 +509,97 @@ public function setCustomerName($customer_name) return $this; } + + /** + * Gets customer_bank_account_number + * + * @return string|null + */ + public function getCustomerBankAccountNumber() + { + return $this->container['customer_bank_account_number']; + } + + /** + * Sets customer_bank_account_number + * + * @param string|null $customer_bank_account_number Customer Bank Account Number + * + * @return self + */ + public function setCustomerBankAccountNumber($customer_bank_account_number) + { + if (is_null($customer_bank_account_number)) { + throw new \InvalidArgumentException('non-nullable customer_bank_account_number cannot be null'); + } + $this->container['customer_bank_account_number'] = $customer_bank_account_number; + + return $this; + } + + /** + * Gets customer_bank_ifsc + * + * @return string|null + */ + public function getCustomerBankIfsc() + { + return $this->container['customer_bank_ifsc']; + } + + /** + * Sets customer_bank_ifsc + * + * @param string|null $customer_bank_ifsc Customer Bank Ifsc + * + * @return self + */ + public function setCustomerBankIfsc($customer_bank_ifsc) + { + if (is_null($customer_bank_ifsc)) { + throw new \InvalidArgumentException('non-nullable customer_bank_ifsc cannot be null'); + } + $this->container['customer_bank_ifsc'] = $customer_bank_ifsc; + + return $this; + } + + /** + * Gets customer_bank_code + * + * @return int|null + */ + public function getCustomerBankCode() + { + return $this->container['customer_bank_code']; + } + + /** + * Sets customer_bank_code + * + * @param int|null $customer_bank_code Customer Bank Code + * + * @return self + */ + public function setCustomerBankCode($customer_bank_code) + { + if (is_null($customer_bank_code)) { + throw new \InvalidArgumentException('non-nullable customer_bank_code cannot be null'); + } + $allowedValues = $this->getCustomerBankCodeAllowableValues(); + if (!in_array($customer_bank_code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'customer_bank_code', must be one of '%s'", + $customer_bank_code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['customer_bank_code'] = $customer_bank_code; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ManageSubscriptionPaymentRequest.php b/lib/Model/ManageSubscriptionPaymentRequest.php new file mode 100644 index 0000000..8015c31 --- /dev/null +++ b/lib/Model/ManageSubscriptionPaymentRequest.php @@ -0,0 +1,522 @@ + + */ +class ManageSubscriptionPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ManageSubscriptionPaymentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string', + 'payment_id' => 'string', + 'action' => 'string', + 'action_details' => '\Cashfree\Model\ManageSubscriptionPaymentRequestActionDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null, + 'payment_id' => null, + 'action' => null, + 'action_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false, + 'payment_id' => false, + 'action' => false, + 'action_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id', + 'payment_id' => 'payment_id', + 'action' => 'action', + 'action_details' => 'action_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId', + 'payment_id' => 'setPaymentId', + 'action' => 'setAction', + 'action_details' => 'setActionDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId', + 'payment_id' => 'getPaymentId', + 'action' => 'getAction', + 'action_details' => 'getActionDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('action_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + if ($this->container['payment_id'] === null) { + $invalidProperties[] = "'payment_id' can't be null"; + } + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id The unique ID which was used to create subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets payment_id + * + * @return string + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string $payment_id The unique ID which was used to create payment. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action Action to be performed on the payment. Possible values - CANCEL, RETRY. + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets action_details + * + * @return \Cashfree\Model\ManageSubscriptionPaymentRequestActionDetails|null + */ + public function getActionDetails() + { + return $this->container['action_details']; + } + + /** + * Sets action_details + * + * @param \Cashfree\Model\ManageSubscriptionPaymentRequestActionDetails|null $action_details action_details + * + * @return self + */ + public function setActionDetails($action_details) + { + if (is_null($action_details)) { + throw new \InvalidArgumentException('non-nullable action_details cannot be null'); + } + $this->container['action_details'] = $action_details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ManageSubscriptionPaymentRequestActionDetails.php b/lib/Model/ManageSubscriptionPaymentRequestActionDetails.php new file mode 100644 index 0000000..1943c28 --- /dev/null +++ b/lib/Model/ManageSubscriptionPaymentRequestActionDetails.php @@ -0,0 +1,411 @@ + + */ +class ManageSubscriptionPaymentRequestActionDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ManageSubscriptionPaymentRequest_action_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_scheduled_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_scheduled_time' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'next_scheduled_time' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_scheduled_time' => 'next_scheduled_time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_scheduled_time' => 'setNextScheduledTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_scheduled_time' => 'getNextScheduledTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('next_scheduled_time', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_scheduled_time + * + * @return string|null + */ + public function getNextScheduledTime() + { + return $this->container['next_scheduled_time']; + } + + /** + * Sets next_scheduled_time + * + * @param string|null $next_scheduled_time Next scheduled time for the retry of the FAILED payment. Required for retry action. + * + * @return self + */ + public function setNextScheduledTime($next_scheduled_time) + { + if (is_null($next_scheduled_time)) { + throw new \InvalidArgumentException('non-nullable next_scheduled_time cannot be null'); + } + $this->container['next_scheduled_time'] = $next_scheduled_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ManageSubscriptionRequest.php b/lib/Model/ManageSubscriptionRequest.php new file mode 100644 index 0000000..25b6c04 --- /dev/null +++ b/lib/Model/ManageSubscriptionRequest.php @@ -0,0 +1,485 @@ + + */ +class ManageSubscriptionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ManageSubscriptionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string', + 'action' => 'string', + 'action_details' => '\Cashfree\Model\ManageSubscriptionRequestActionDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null, + 'action' => null, + 'action_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false, + 'action' => false, + 'action_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id', + 'action' => 'action', + 'action_details' => 'action_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId', + 'action' => 'setAction', + 'action_details' => 'setActionDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId', + 'action' => 'getAction', + 'action_details' => 'getActionDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('action_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id The unique ID which was used to create subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action Action to be performed on the subscription. Possible values - CANCEL, PAUSE, ACTIVATE, CHANGE_PLAN. + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets action_details + * + * @return \Cashfree\Model\ManageSubscriptionRequestActionDetails|null + */ + public function getActionDetails() + { + return $this->container['action_details']; + } + + /** + * Sets action_details + * + * @param \Cashfree\Model\ManageSubscriptionRequestActionDetails|null $action_details action_details + * + * @return self + */ + public function setActionDetails($action_details) + { + if (is_null($action_details)) { + throw new \InvalidArgumentException('non-nullable action_details cannot be null'); + } + $this->container['action_details'] = $action_details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ManageSubscriptionRequestActionDetails.php b/lib/Model/ManageSubscriptionRequestActionDetails.php new file mode 100644 index 0000000..296ff1c --- /dev/null +++ b/lib/Model/ManageSubscriptionRequestActionDetails.php @@ -0,0 +1,445 @@ + + */ +class ManageSubscriptionRequestActionDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ManageSubscriptionRequest_action_details'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'next_scheduled_time' => 'string', + 'plan_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'next_scheduled_time' => null, + 'plan_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'next_scheduled_time' => false, + 'plan_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'next_scheduled_time' => 'next_scheduled_time', + 'plan_id' => 'plan_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'next_scheduled_time' => 'setNextScheduledTime', + 'plan_id' => 'setPlanId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'next_scheduled_time' => 'getNextScheduledTime', + 'plan_id' => 'getPlanId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('next_scheduled_time', $data ?? [], null); + $this->setIfExists('plan_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets next_scheduled_time + * + * @return string|null + */ + public function getNextScheduledTime() + { + return $this->container['next_scheduled_time']; + } + + /** + * Sets next_scheduled_time + * + * @param string|null $next_scheduled_time Next scheduled time for the action. Required for ACTIVATE action. + * + * @return self + */ + public function setNextScheduledTime($next_scheduled_time) + { + if (is_null($next_scheduled_time)) { + throw new \InvalidArgumentException('non-nullable next_scheduled_time cannot be null'); + } + $this->container['next_scheduled_time'] = $next_scheduled_time; + + return $this; + } + + /** + * Gets plan_id + * + * @return string|null + */ + public function getPlanId() + { + return $this->container['plan_id']; + } + + /** + * Sets plan_id + * + * @param string|null $plan_id Plan ID to update. Required for CHANGE_PLAN action. + * + * @return self + */ + public function setPlanId($plan_id) + { + if (is_null($plan_id)) { + throw new \InvalidArgumentException('non-nullable plan_id cannot be null'); + } + $this->container['plan_id'] = $plan_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OrderEntity.php b/lib/Model/OrderEntity.php index e0897a8..45b26b4 100644 --- a/lib/Model/OrderEntity.php +++ b/lib/Model/OrderEntity.php @@ -70,7 +70,7 @@ class OrderEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'order_note' => 'string', 'created_at' => '\DateTime', 'order_splits' => '\Cashfree\Model\VendorSplit[]', - 'customer_details' => '\Cashfree\Model\CustomerDetails', + 'customer_details' => '\Cashfree\Model\CustomerDetailsResponse', 'order_meta' => '\Cashfree\Model\OrderMeta', 'order_tags' => 'array' ]; @@ -686,7 +686,7 @@ public function setOrderSplits($order_splits) /** * Gets customer_details * - * @return \Cashfree\Model\CustomerDetails|null + * @return \Cashfree\Model\CustomerDetailsResponse|null */ public function getCustomerDetails() { @@ -696,7 +696,7 @@ public function getCustomerDetails() /** * Sets customer_details * - * @param \Cashfree\Model\CustomerDetails|null $customer_details customer_details + * @param \Cashfree\Model\CustomerDetailsResponse|null $customer_details customer_details * * @return self */ diff --git a/lib/Model/OrderMeta.php b/lib/Model/OrderMeta.php index 8fbb992..e465183 100644 --- a/lib/Model/OrderMeta.php +++ b/lib/Model/OrderMeta.php @@ -318,7 +318,7 @@ public function getReturnUrl() /** * Sets return_url * - * @param string|null $return_url 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 + * @param string|null $return_url 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 self */ diff --git a/lib/Model/PlanEntity.php b/lib/Model/PlanEntity.php new file mode 100644 index 0000000..08a3269 --- /dev/null +++ b/lib/Model/PlanEntity.php @@ -0,0 +1,751 @@ + + */ +class PlanEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PlanEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plan_currency' => 'string', + 'plan_id' => 'string', + 'plan_interval_type' => 'string', + 'plan_intervals' => 'int', + 'plan_max_amount' => 'float', + 'plan_max_cycles' => 'int', + 'plan_name' => 'string', + 'plan_note' => 'string', + 'plan_recurring_amount' => 'float', + 'plan_status' => 'string', + 'plan_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plan_currency' => null, + 'plan_id' => null, + 'plan_interval_type' => null, + 'plan_intervals' => null, + 'plan_max_amount' => 'float64', + 'plan_max_cycles' => null, + 'plan_name' => null, + 'plan_note' => null, + 'plan_recurring_amount' => 'float64', + 'plan_status' => null, + 'plan_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'plan_currency' => false, + 'plan_id' => false, + 'plan_interval_type' => false, + 'plan_intervals' => false, + 'plan_max_amount' => false, + 'plan_max_cycles' => false, + 'plan_name' => false, + 'plan_note' => false, + 'plan_recurring_amount' => false, + 'plan_status' => false, + 'plan_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plan_currency' => 'plan_currency', + 'plan_id' => 'plan_id', + 'plan_interval_type' => 'plan_interval_type', + 'plan_intervals' => 'plan_intervals', + 'plan_max_amount' => 'plan_max_amount', + 'plan_max_cycles' => 'plan_max_cycles', + 'plan_name' => 'plan_name', + 'plan_note' => 'plan_note', + 'plan_recurring_amount' => 'plan_recurring_amount', + 'plan_status' => 'plan_status', + 'plan_type' => 'plan_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plan_currency' => 'setPlanCurrency', + 'plan_id' => 'setPlanId', + 'plan_interval_type' => 'setPlanIntervalType', + 'plan_intervals' => 'setPlanIntervals', + 'plan_max_amount' => 'setPlanMaxAmount', + 'plan_max_cycles' => 'setPlanMaxCycles', + 'plan_name' => 'setPlanName', + 'plan_note' => 'setPlanNote', + 'plan_recurring_amount' => 'setPlanRecurringAmount', + 'plan_status' => 'setPlanStatus', + 'plan_type' => 'setPlanType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plan_currency' => 'getPlanCurrency', + 'plan_id' => 'getPlanId', + 'plan_interval_type' => 'getPlanIntervalType', + 'plan_intervals' => 'getPlanIntervals', + 'plan_max_amount' => 'getPlanMaxAmount', + 'plan_max_cycles' => 'getPlanMaxCycles', + 'plan_name' => 'getPlanName', + 'plan_note' => 'getPlanNote', + 'plan_recurring_amount' => 'getPlanRecurringAmount', + 'plan_status' => 'getPlanStatus', + 'plan_type' => 'getPlanType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plan_currency', $data ?? [], null); + $this->setIfExists('plan_id', $data ?? [], null); + $this->setIfExists('plan_interval_type', $data ?? [], null); + $this->setIfExists('plan_intervals', $data ?? [], null); + $this->setIfExists('plan_max_amount', $data ?? [], null); + $this->setIfExists('plan_max_cycles', $data ?? [], null); + $this->setIfExists('plan_name', $data ?? [], null); + $this->setIfExists('plan_note', $data ?? [], null); + $this->setIfExists('plan_recurring_amount', $data ?? [], null); + $this->setIfExists('plan_status', $data ?? [], null); + $this->setIfExists('plan_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plan_currency + * + * @return string|null + */ + public function getPlanCurrency() + { + return $this->container['plan_currency']; + } + + /** + * Sets plan_currency + * + * @param string|null $plan_currency Currency for the plan. + * + * @return self + */ + public function setPlanCurrency($plan_currency) + { + if (is_null($plan_currency)) { + throw new \InvalidArgumentException('non-nullable plan_currency cannot be null'); + } + $this->container['plan_currency'] = $plan_currency; + + return $this; + } + + /** + * Gets plan_id + * + * @return string|null + */ + public function getPlanId() + { + return $this->container['plan_id']; + } + + /** + * Sets plan_id + * + * @param string|null $plan_id Plan ID provided by merchant. + * + * @return self + */ + public function setPlanId($plan_id) + { + if (is_null($plan_id)) { + throw new \InvalidArgumentException('non-nullable plan_id cannot be null'); + } + $this->container['plan_id'] = $plan_id; + + return $this; + } + + /** + * Gets plan_interval_type + * + * @return string|null + */ + public function getPlanIntervalType() + { + return $this->container['plan_interval_type']; + } + + /** + * Sets plan_interval_type + * + * @param string|null $plan_interval_type Interval type for the plan. + * + * @return self + */ + public function setPlanIntervalType($plan_interval_type) + { + if (is_null($plan_interval_type)) { + throw new \InvalidArgumentException('non-nullable plan_interval_type cannot be null'); + } + $this->container['plan_interval_type'] = $plan_interval_type; + + return $this; + } + + /** + * Gets plan_intervals + * + * @return int|null + */ + public function getPlanIntervals() + { + return $this->container['plan_intervals']; + } + + /** + * Sets plan_intervals + * + * @param int|null $plan_intervals Number of intervals for the plan. + * + * @return self + */ + public function setPlanIntervals($plan_intervals) + { + if (is_null($plan_intervals)) { + throw new \InvalidArgumentException('non-nullable plan_intervals cannot be null'); + } + $this->container['plan_intervals'] = $plan_intervals; + + return $this; + } + + /** + * Gets plan_max_amount + * + * @return float|null + */ + public function getPlanMaxAmount() + { + return $this->container['plan_max_amount']; + } + + /** + * Sets plan_max_amount + * + * @param float|null $plan_max_amount Maximum amount for the plan. + * + * @return self + */ + public function setPlanMaxAmount($plan_max_amount) + { + if (is_null($plan_max_amount)) { + throw new \InvalidArgumentException('non-nullable plan_max_amount cannot be null'); + } + $this->container['plan_max_amount'] = $plan_max_amount; + + return $this; + } + + /** + * Gets plan_max_cycles + * + * @return int|null + */ + public function getPlanMaxCycles() + { + return $this->container['plan_max_cycles']; + } + + /** + * Sets plan_max_cycles + * + * @param int|null $plan_max_cycles Maximum number of payment cycles for the plan. + * + * @return self + */ + public function setPlanMaxCycles($plan_max_cycles) + { + if (is_null($plan_max_cycles)) { + throw new \InvalidArgumentException('non-nullable plan_max_cycles cannot be null'); + } + $this->container['plan_max_cycles'] = $plan_max_cycles; + + return $this; + } + + /** + * Gets plan_name + * + * @return string|null + */ + public function getPlanName() + { + return $this->container['plan_name']; + } + + /** + * Sets plan_name + * + * @param string|null $plan_name Name of the plan. + * + * @return self + */ + public function setPlanName($plan_name) + { + if (is_null($plan_name)) { + throw new \InvalidArgumentException('non-nullable plan_name cannot be null'); + } + $this->container['plan_name'] = $plan_name; + + return $this; + } + + /** + * Gets plan_note + * + * @return string|null + */ + public function getPlanNote() + { + return $this->container['plan_note']; + } + + /** + * Sets plan_note + * + * @param string|null $plan_note Note for the plan. + * + * @return self + */ + public function setPlanNote($plan_note) + { + if (is_null($plan_note)) { + throw new \InvalidArgumentException('non-nullable plan_note cannot be null'); + } + $this->container['plan_note'] = $plan_note; + + return $this; + } + + /** + * Gets plan_recurring_amount + * + * @return float|null + */ + public function getPlanRecurringAmount() + { + return $this->container['plan_recurring_amount']; + } + + /** + * Sets plan_recurring_amount + * + * @param float|null $plan_recurring_amount Recurring amount for the plan. + * + * @return self + */ + public function setPlanRecurringAmount($plan_recurring_amount) + { + if (is_null($plan_recurring_amount)) { + throw new \InvalidArgumentException('non-nullable plan_recurring_amount cannot be null'); + } + $this->container['plan_recurring_amount'] = $plan_recurring_amount; + + return $this; + } + + /** + * Gets plan_status + * + * @return string|null + */ + public function getPlanStatus() + { + return $this->container['plan_status']; + } + + /** + * Sets plan_status + * + * @param string|null $plan_status Status of the plan. + * + * @return self + */ + public function setPlanStatus($plan_status) + { + if (is_null($plan_status)) { + throw new \InvalidArgumentException('non-nullable plan_status cannot be null'); + } + $this->container['plan_status'] = $plan_status; + + return $this; + } + + /** + * Gets plan_type + * + * @return string|null + */ + public function getPlanType() + { + return $this->container['plan_type']; + } + + /** + * Sets plan_type + * + * @param string|null $plan_type Type of the plan. + * + * @return self + */ + public function setPlanType($plan_type) + { + if (is_null($plan_type)) { + throw new \InvalidArgumentException('non-nullable plan_type cannot be null'); + } + $this->container['plan_type'] = $plan_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SimulateRequest.php b/lib/Model/SimulateRequest.php new file mode 100644 index 0000000..1759cfc --- /dev/null +++ b/lib/Model/SimulateRequest.php @@ -0,0 +1,522 @@ + + */ +class SimulateRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SimulateRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity' => 'string', + 'entity_id' => 'string', + 'entity_simulation' => '\Cashfree\Model\EntitySimulationRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity' => null, + 'entity_id' => null, + 'entity_simulation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entity' => false, + 'entity_id' => false, + 'entity_simulation' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity' => 'entity', + 'entity_id' => 'entity_id', + 'entity_simulation' => 'entity_simulation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity' => 'setEntity', + 'entity_id' => 'setEntityId', + 'entity_simulation' => 'setEntitySimulation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity' => 'getEntity', + 'entity_id' => 'getEntityId', + 'entity_simulation' => 'getEntitySimulation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const ENTITY_PAYMENTS = 'PAYMENTS'; + public const ENTITY_UNKNOWN_DEFAULT_OPEN_API = 'unknown_default_open_api'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEntityAllowableValues() + { + return [ + self::ENTITY_PAYMENTS, + self::ENTITY_UNKNOWN_DEFAULT_OPEN_API, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('entity', $data ?? [], null); + $this->setIfExists('entity_id', $data ?? [], null); + $this->setIfExists('entity_simulation', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entity'] === null) { + $invalidProperties[] = "'entity' can't be null"; + } + $allowedValues = $this->getEntityAllowableValues(); + if (!is_null($this->container['entity']) && !in_array($this->container['entity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'entity', must be one of '%s'", + $this->container['entity'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['entity_id'] === null) { + $invalidProperties[] = "'entity_id' can't be null"; + } + if ($this->container['entity_simulation'] === null) { + $invalidProperties[] = "'entity_simulation' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entity + * + * @return string + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param string $entity Entity type should be PAYMENTS only. + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $allowedValues = $this->getEntityAllowableValues(); + if (!in_array($entity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'entity', must be one of '%s'", + $entity, + implode("', '", $allowedValues) + ) + ); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets entity_id + * + * @return string + */ + public function getEntityId() + { + return $this->container['entity_id']; + } + + /** + * Sets entity_id + * + * @param string $entity_id In case of Entity type is PAYMENTS, entity_id will be transactionId + * + * @return self + */ + public function setEntityId($entity_id) + { + if (is_null($entity_id)) { + throw new \InvalidArgumentException('non-nullable entity_id cannot be null'); + } + $this->container['entity_id'] = $entity_id; + + return $this; + } + + /** + * Gets entity_simulation + * + * @return \Cashfree\Model\EntitySimulationRequest + */ + public function getEntitySimulation() + { + return $this->container['entity_simulation']; + } + + /** + * Sets entity_simulation + * + * @param \Cashfree\Model\EntitySimulationRequest $entity_simulation entity_simulation + * + * @return self + */ + public function setEntitySimulation($entity_simulation) + { + if (is_null($entity_simulation)) { + throw new \InvalidArgumentException('non-nullable entity_simulation cannot be null'); + } + $this->container['entity_simulation'] = $entity_simulation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SimulationResponse.php b/lib/Model/SimulationResponse.php new file mode 100644 index 0000000..e666a34 --- /dev/null +++ b/lib/Model/SimulationResponse.php @@ -0,0 +1,513 @@ + + */ +class SimulationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SimulationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'simulation_id' => 'string', + 'entity' => 'string', + 'entity_id' => 'string', + 'entity_simulation' => '\Cashfree\Model\EntitySimulationResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'simulation_id' => null, + 'entity' => null, + 'entity_id' => null, + 'entity_simulation' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'simulation_id' => false, + 'entity' => false, + 'entity_id' => false, + 'entity_simulation' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'simulation_id' => 'simulation_id', + 'entity' => 'entity', + 'entity_id' => 'entity_id', + 'entity_simulation' => 'entity_simulation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'simulation_id' => 'setSimulationId', + 'entity' => 'setEntity', + 'entity_id' => 'setEntityId', + 'entity_simulation' => 'setEntitySimulation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'simulation_id' => 'getSimulationId', + 'entity' => 'getEntity', + 'entity_id' => 'getEntityId', + 'entity_simulation' => 'getEntitySimulation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('simulation_id', $data ?? [], null); + $this->setIfExists('entity', $data ?? [], null); + $this->setIfExists('entity_id', $data ?? [], null); + $this->setIfExists('entity_simulation', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets simulation_id + * + * @return string|null + */ + public function getSimulationId() + { + return $this->container['simulation_id']; + } + + /** + * Sets simulation_id + * + * @param string|null $simulation_id simulation_id + * + * @return self + */ + public function setSimulationId($simulation_id) + { + if (is_null($simulation_id)) { + throw new \InvalidArgumentException('non-nullable simulation_id cannot be null'); + } + $this->container['simulation_id'] = $simulation_id; + + return $this; + } + + /** + * Gets entity + * + * @return string|null + */ + public function getEntity() + { + return $this->container['entity']; + } + + /** + * Sets entity + * + * @param string|null $entity entity + * + * @return self + */ + public function setEntity($entity) + { + if (is_null($entity)) { + throw new \InvalidArgumentException('non-nullable entity cannot be null'); + } + $this->container['entity'] = $entity; + + return $this; + } + + /** + * Gets entity_id + * + * @return string|null + */ + public function getEntityId() + { + return $this->container['entity_id']; + } + + /** + * Sets entity_id + * + * @param string|null $entity_id entity_id + * + * @return self + */ + public function setEntityId($entity_id) + { + if (is_null($entity_id)) { + throw new \InvalidArgumentException('non-nullable entity_id cannot be null'); + } + $this->container['entity_id'] = $entity_id; + + return $this; + } + + /** + * Gets entity_simulation + * + * @return \Cashfree\Model\EntitySimulationResponse|null + */ + public function getEntitySimulation() + { + return $this->container['entity_simulation']; + } + + /** + * Sets entity_simulation + * + * @param \Cashfree\Model\EntitySimulationResponse|null $entity_simulation entity_simulation + * + * @return self + */ + public function setEntitySimulation($entity_simulation) + { + if (is_null($entity_simulation)) { + throw new \InvalidArgumentException('non-nullable entity_simulation cannot be null'); + } + $this->container['entity_simulation'] = $entity_simulation; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubsCreatePayment200Response.php b/lib/Model/SubsCreatePayment200Response.php new file mode 100644 index 0000000..4e47bbe --- /dev/null +++ b/lib/Model/SubsCreatePayment200Response.php @@ -0,0 +1,716 @@ + + */ +class SubsCreatePayment200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubsCreatePayment_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cf_payment_id' => 'string', + 'cf_subscription_id' => 'string', + 'failure_details' => '\Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails', + 'payment_amount' => 'float', + 'payment_id' => 'string', + 'payment_initiated_date' => 'string', + 'payment_status' => 'string', + 'payment_type' => 'string', + 'subscription_id' => 'string', + 'payment_method' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cf_payment_id' => null, + 'cf_subscription_id' => null, + 'failure_details' => null, + 'payment_amount' => 'float64', + 'payment_id' => null, + 'payment_initiated_date' => null, + 'payment_status' => null, + 'payment_type' => null, + 'subscription_id' => null, + 'payment_method' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'cf_payment_id' => false, + 'cf_subscription_id' => false, + 'failure_details' => false, + 'payment_amount' => false, + 'payment_id' => false, + 'payment_initiated_date' => false, + 'payment_status' => false, + 'payment_type' => false, + 'subscription_id' => false, + 'payment_method' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cf_payment_id' => 'cf_payment_id', + 'cf_subscription_id' => 'cf_subscription_id', + 'failure_details' => 'failure_details', + 'payment_amount' => 'payment_amount', + 'payment_id' => 'payment_id', + 'payment_initiated_date' => 'payment_initiated_date', + 'payment_status' => 'payment_status', + 'payment_type' => 'payment_type', + 'subscription_id' => 'subscription_id', + 'payment_method' => 'payment_method' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cf_payment_id' => 'setCfPaymentId', + 'cf_subscription_id' => 'setCfSubscriptionId', + 'failure_details' => 'setFailureDetails', + 'payment_amount' => 'setPaymentAmount', + 'payment_id' => 'setPaymentId', + 'payment_initiated_date' => 'setPaymentInitiatedDate', + 'payment_status' => 'setPaymentStatus', + 'payment_type' => 'setPaymentType', + 'subscription_id' => 'setSubscriptionId', + 'payment_method' => 'setPaymentMethod' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cf_payment_id' => 'getCfPaymentId', + 'cf_subscription_id' => 'getCfSubscriptionId', + 'failure_details' => 'getFailureDetails', + 'payment_amount' => 'getPaymentAmount', + 'payment_id' => 'getPaymentId', + 'payment_initiated_date' => 'getPaymentInitiatedDate', + 'payment_status' => 'getPaymentStatus', + 'payment_type' => 'getPaymentType', + 'subscription_id' => 'getSubscriptionId', + 'payment_method' => 'getPaymentMethod' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('cf_subscription_id', $data ?? [], null); + $this->setIfExists('failure_details', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_initiated_date', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets cf_subscription_id + * + * @return string|null + */ + public function getCfSubscriptionId() + { + return $this->container['cf_subscription_id']; + } + + /** + * Sets cf_subscription_id + * + * @param string|null $cf_subscription_id Cashfree subscription reference number + * + * @return self + */ + public function setCfSubscriptionId($cf_subscription_id) + { + if (is_null($cf_subscription_id)) { + throw new \InvalidArgumentException('non-nullable cf_subscription_id cannot be null'); + } + $this->container['cf_subscription_id'] = $cf_subscription_id; + + return $this; + } + + /** + * Gets failure_details + * + * @return \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null + */ + public function getFailureDetails() + { + return $this->container['failure_details']; + } + + /** + * Sets failure_details + * + * @param \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null $failure_details failure_details + * + * @return self + */ + public function setFailureDetails($failure_details) + { + if (is_null($failure_details)) { + throw new \InvalidArgumentException('non-nullable failure_details cannot be null'); + } + $this->container['failure_details'] = $failure_details; + + return $this; + } + + /** + * Gets payment_amount + * + * @return float|null + */ + public function getPaymentAmount() + { + return $this->container['payment_amount']; + } + + /** + * Sets payment_amount + * + * @param float|null $payment_amount The charge amount of the payment. + * + * @return self + */ + public function setPaymentAmount($payment_amount) + { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } + $this->container['payment_amount'] = $payment_amount; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_initiated_date + * + * @return string|null + */ + public function getPaymentInitiatedDate() + { + return $this->container['payment_initiated_date']; + } + + /** + * Sets payment_initiated_date + * + * @param string|null $payment_initiated_date The date on which the payment was initiated. + * + * @return self + */ + public function setPaymentInitiatedDate($payment_initiated_date) + { + if (is_null($payment_initiated_date)) { + throw new \InvalidArgumentException('non-nullable payment_initiated_date cannot be null'); + } + $this->container['payment_initiated_date'] = $payment_initiated_date; + + return $this; + } + + /** + * Gets payment_status + * + * @return string|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string|null $payment_status Status of the payment. + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_type + * + * @return string|null + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string|null $payment_type Payment type. Can be AUTH or CHARGE. + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets subscription_id + * + * @return string|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string|null $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets payment_method + * + * @return string|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param string|null $payment_method Payment method used for the authorization. + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionBankDetails.php b/lib/Model/SubscriptionBankDetails.php new file mode 100644 index 0000000..6373693 --- /dev/null +++ b/lib/Model/SubscriptionBankDetails.php @@ -0,0 +1,479 @@ + + */ +class SubscriptionBankDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionBankDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bank_id' => 'string', + 'bank_name' => 'string', + 'account_auth_modes' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bank_id' => null, + 'bank_name' => null, + 'account_auth_modes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bank_id' => false, + 'bank_name' => false, + 'account_auth_modes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bank_id' => 'bank_id', + 'bank_name' => 'bank_name', + 'account_auth_modes' => 'account_auth_modes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bank_id' => 'setBankId', + 'bank_name' => 'setBankName', + 'account_auth_modes' => 'setAccountAuthModes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bank_id' => 'getBankId', + 'bank_name' => 'getBankName', + 'account_auth_modes' => 'getAccountAuthModes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bank_id', $data ?? [], null); + $this->setIfExists('bank_name', $data ?? [], null); + $this->setIfExists('account_auth_modes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bank_id + * + * @return string|null + */ + public function getBankId() + { + return $this->container['bank_id']; + } + + /** + * Sets bank_id + * + * @param string|null $bank_id ID of the bank. + * + * @return self + */ + public function setBankId($bank_id) + { + if (is_null($bank_id)) { + throw new \InvalidArgumentException('non-nullable bank_id cannot be null'); + } + $this->container['bank_id'] = $bank_id; + + return $this; + } + + /** + * Gets bank_name + * + * @return string|null + */ + public function getBankName() + { + return $this->container['bank_name']; + } + + /** + * Sets bank_name + * + * @param string|null $bank_name Name of the bank. + * + * @return self + */ + public function setBankName($bank_name) + { + if (is_null($bank_name)) { + throw new \InvalidArgumentException('non-nullable bank_name cannot be null'); + } + $this->container['bank_name'] = $bank_name; + + return $this; + } + + /** + * Gets account_auth_modes + * + * @return string[]|null + */ + public function getAccountAuthModes() + { + return $this->container['account_auth_modes']; + } + + /** + * Sets account_auth_modes + * + * @param string[]|null $account_auth_modes List of account authentication modes supported by the bank. (e.g. DEBIT_CARD, NET_BANKING, AADHAAR) + * + * @return self + */ + public function setAccountAuthModes($account_auth_modes) + { + if (is_null($account_auth_modes)) { + throw new \InvalidArgumentException('non-nullable account_auth_modes cannot be null'); + } + $this->container['account_auth_modes'] = $account_auth_modes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionCustomerDetails.php b/lib/Model/SubscriptionCustomerDetails.php new file mode 100644 index 0000000..2dee884 --- /dev/null +++ b/lib/Model/SubscriptionCustomerDetails.php @@ -0,0 +1,655 @@ + + */ +class SubscriptionCustomerDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionCustomerDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'customer_name' => 'string', + 'customer_email' => 'string', + 'customer_phone' => 'string', + 'customer_bank_account_holder_name' => 'string', + 'customer_bank_account_number' => 'string', + 'customer_bank_ifsc' => 'string', + 'customer_bank_code' => 'string', + 'customer_bank_account_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'customer_name' => null, + 'customer_email' => null, + 'customer_phone' => null, + 'customer_bank_account_holder_name' => null, + 'customer_bank_account_number' => null, + 'customer_bank_ifsc' => null, + 'customer_bank_code' => null, + 'customer_bank_account_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'customer_name' => false, + 'customer_email' => false, + 'customer_phone' => false, + 'customer_bank_account_holder_name' => false, + 'customer_bank_account_number' => false, + 'customer_bank_ifsc' => false, + 'customer_bank_code' => false, + 'customer_bank_account_type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customer_name' => 'customer_name', + 'customer_email' => 'customer_email', + 'customer_phone' => 'customer_phone', + 'customer_bank_account_holder_name' => 'customer_bank_account_holder_name', + 'customer_bank_account_number' => 'customer_bank_account_number', + 'customer_bank_ifsc' => 'customer_bank_ifsc', + 'customer_bank_code' => 'customer_bank_code', + 'customer_bank_account_type' => 'customer_bank_account_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customer_name' => 'setCustomerName', + 'customer_email' => 'setCustomerEmail', + 'customer_phone' => 'setCustomerPhone', + 'customer_bank_account_holder_name' => 'setCustomerBankAccountHolderName', + 'customer_bank_account_number' => 'setCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'setCustomerBankIfsc', + 'customer_bank_code' => 'setCustomerBankCode', + 'customer_bank_account_type' => 'setCustomerBankAccountType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customer_name' => 'getCustomerName', + 'customer_email' => 'getCustomerEmail', + 'customer_phone' => 'getCustomerPhone', + 'customer_bank_account_holder_name' => 'getCustomerBankAccountHolderName', + 'customer_bank_account_number' => 'getCustomerBankAccountNumber', + 'customer_bank_ifsc' => 'getCustomerBankIfsc', + 'customer_bank_code' => 'getCustomerBankCode', + 'customer_bank_account_type' => 'getCustomerBankAccountType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('customer_name', $data ?? [], null); + $this->setIfExists('customer_email', $data ?? [], null); + $this->setIfExists('customer_phone', $data ?? [], null); + $this->setIfExists('customer_bank_account_holder_name', $data ?? [], null); + $this->setIfExists('customer_bank_account_number', $data ?? [], null); + $this->setIfExists('customer_bank_ifsc', $data ?? [], null); + $this->setIfExists('customer_bank_code', $data ?? [], null); + $this->setIfExists('customer_bank_account_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['customer_email'] === null) { + $invalidProperties[] = "'customer_email' can't be null"; + } + if ($this->container['customer_phone'] === null) { + $invalidProperties[] = "'customer_phone' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets customer_name + * + * @return string|null + */ + public function getCustomerName() + { + return $this->container['customer_name']; + } + + /** + * Sets customer_name + * + * @param string|null $customer_name Name of the customer. + * + * @return self + */ + public function setCustomerName($customer_name) + { + if (is_null($customer_name)) { + throw new \InvalidArgumentException('non-nullable customer_name cannot be null'); + } + $this->container['customer_name'] = $customer_name; + + return $this; + } + + /** + * Gets customer_email + * + * @return string + */ + public function getCustomerEmail() + { + return $this->container['customer_email']; + } + + /** + * Sets customer_email + * + * @param string $customer_email Email of the customer. + * + * @return self + */ + public function setCustomerEmail($customer_email) + { + if (is_null($customer_email)) { + throw new \InvalidArgumentException('non-nullable customer_email cannot be null'); + } + $this->container['customer_email'] = $customer_email; + + return $this; + } + + /** + * Gets customer_phone + * + * @return string + */ + public function getCustomerPhone() + { + return $this->container['customer_phone']; + } + + /** + * Sets customer_phone + * + * @param string $customer_phone Phone number of the customer. + * + * @return self + */ + public function setCustomerPhone($customer_phone) + { + if (is_null($customer_phone)) { + throw new \InvalidArgumentException('non-nullable customer_phone cannot be null'); + } + $this->container['customer_phone'] = $customer_phone; + + return $this; + } + + /** + * Gets customer_bank_account_holder_name + * + * @return string|null + */ + public function getCustomerBankAccountHolderName() + { + return $this->container['customer_bank_account_holder_name']; + } + + /** + * Sets customer_bank_account_holder_name + * + * @param string|null $customer_bank_account_holder_name Bank holder name of the customer. + * + * @return self + */ + public function setCustomerBankAccountHolderName($customer_bank_account_holder_name) + { + if (is_null($customer_bank_account_holder_name)) { + throw new \InvalidArgumentException('non-nullable customer_bank_account_holder_name cannot be null'); + } + $this->container['customer_bank_account_holder_name'] = $customer_bank_account_holder_name; + + return $this; + } + + /** + * Gets customer_bank_account_number + * + * @return string|null + */ + public function getCustomerBankAccountNumber() + { + return $this->container['customer_bank_account_number']; + } + + /** + * Sets customer_bank_account_number + * + * @param string|null $customer_bank_account_number Bank account number of the customer. + * + * @return self + */ + public function setCustomerBankAccountNumber($customer_bank_account_number) + { + if (is_null($customer_bank_account_number)) { + throw new \InvalidArgumentException('non-nullable customer_bank_account_number cannot be null'); + } + $this->container['customer_bank_account_number'] = $customer_bank_account_number; + + return $this; + } + + /** + * Gets customer_bank_ifsc + * + * @return string|null + */ + public function getCustomerBankIfsc() + { + return $this->container['customer_bank_ifsc']; + } + + /** + * Sets customer_bank_ifsc + * + * @param string|null $customer_bank_ifsc IFSC code of the customer. + * + * @return self + */ + public function setCustomerBankIfsc($customer_bank_ifsc) + { + if (is_null($customer_bank_ifsc)) { + throw new \InvalidArgumentException('non-nullable customer_bank_ifsc cannot be null'); + } + $this->container['customer_bank_ifsc'] = $customer_bank_ifsc; + + return $this; + } + + /** + * Gets customer_bank_code + * + * @return string|null + */ + public function getCustomerBankCode() + { + return $this->container['customer_bank_code']; + } + + /** + * Sets customer_bank_code + * + * @param string|null $customer_bank_code Bank code of the customer. + * + * @return self + */ + public function setCustomerBankCode($customer_bank_code) + { + if (is_null($customer_bank_code)) { + throw new \InvalidArgumentException('non-nullable customer_bank_code cannot be null'); + } + $this->container['customer_bank_code'] = $customer_bank_code; + + return $this; + } + + /** + * Gets customer_bank_account_type + * + * @return string|null + */ + public function getCustomerBankAccountType() + { + return $this->container['customer_bank_account_type']; + } + + /** + * Sets customer_bank_account_type + * + * @param string|null $customer_bank_account_type Bank account type of the customer. + * + * @return self + */ + public function setCustomerBankAccountType($customer_bank_account_type) + { + if (is_null($customer_bank_account_type)) { + throw new \InvalidArgumentException('non-nullable customer_bank_account_type cannot be null'); + } + $this->container['customer_bank_account_type'] = $customer_bank_account_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEligibilityRequest.php b/lib/Model/SubscriptionEligibilityRequest.php new file mode 100644 index 0000000..67233b4 --- /dev/null +++ b/lib/Model/SubscriptionEligibilityRequest.php @@ -0,0 +1,448 @@ + + */ +class SubscriptionEligibilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEligibilityRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'queries' => '\Cashfree\Model\SubscriptionEligibilityRequestQueries', + 'filters' => '\Cashfree\Model\SubscriptionEligibilityRequestFilters' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'queries' => null, + 'filters' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'queries' => false, + 'filters' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'queries' => 'queries', + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'queries' => 'setQueries', + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'queries' => 'getQueries', + 'filters' => 'getFilters' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('queries', $data ?? [], null); + $this->setIfExists('filters', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['queries'] === null) { + $invalidProperties[] = "'queries' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets queries + * + * @return \Cashfree\Model\SubscriptionEligibilityRequestQueries + */ + public function getQueries() + { + return $this->container['queries']; + } + + /** + * Sets queries + * + * @param \Cashfree\Model\SubscriptionEligibilityRequestQueries $queries queries + * + * @return self + */ + public function setQueries($queries) + { + if (is_null($queries)) { + throw new \InvalidArgumentException('non-nullable queries cannot be null'); + } + $this->container['queries'] = $queries; + + return $this; + } + + /** + * Gets filters + * + * @return \Cashfree\Model\SubscriptionEligibilityRequestFilters|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \Cashfree\Model\SubscriptionEligibilityRequestFilters|null $filters filters + * + * @return self + */ + public function setFilters($filters) + { + if (is_null($filters)) { + throw new \InvalidArgumentException('non-nullable filters cannot be null'); + } + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEligibilityRequestFilters.php b/lib/Model/SubscriptionEligibilityRequestFilters.php new file mode 100644 index 0000000..0f5b0cc --- /dev/null +++ b/lib/Model/SubscriptionEligibilityRequestFilters.php @@ -0,0 +1,411 @@ + + */ +class SubscriptionEligibilityRequestFilters implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEligibilityRequest_filters'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_methods' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_methods' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_methods' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_methods' => 'payment_methods' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_methods' => 'setPaymentMethods' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_methods' => 'getPaymentMethods' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_methods', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_methods + * + * @return string[]|null + */ + public function getPaymentMethods() + { + return $this->container['payment_methods']; + } + + /** + * Sets payment_methods + * + * @param string[]|null $payment_methods Possbile values in array - enach, pnach, upi, card. + * + * @return self + */ + public function setPaymentMethods($payment_methods) + { + if (is_null($payment_methods)) { + throw new \InvalidArgumentException('non-nullable payment_methods cannot be null'); + } + $this->container['payment_methods'] = $payment_methods; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEligibilityRequestQueries.php b/lib/Model/SubscriptionEligibilityRequestQueries.php new file mode 100644 index 0000000..b042fad --- /dev/null +++ b/lib/Model/SubscriptionEligibilityRequestQueries.php @@ -0,0 +1,414 @@ + + */ +class SubscriptionEligibilityRequestQueries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEligibilityRequest_queries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscription_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscription_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'subscription_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscription_id' => 'subscription_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscription_id' => 'setSubscriptionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscription_id' => 'getSubscriptionId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('subscription_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['subscription_id'] === null) { + $invalidProperties[] = "'subscription_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subscription_id + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string $subscription_id A unique ID passed by merchant for identifying the subscription + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEligibilityResponse.php b/lib/Model/SubscriptionEligibilityResponse.php new file mode 100644 index 0000000..e057b15 --- /dev/null +++ b/lib/Model/SubscriptionEligibilityResponse.php @@ -0,0 +1,411 @@ + + */ +class SubscriptionEligibilityResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEligibilityResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Cashfree\Model\EligibilityMethodItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Cashfree\Model\EligibilityMethodItem[]|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cashfree\Model\EligibilityMethodItem[]|null $type List of eligibile payment methods for the subscription. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEntity.php b/lib/Model/SubscriptionEntity.php new file mode 100644 index 0000000..481b1c8 --- /dev/null +++ b/lib/Model/SubscriptionEntity.php @@ -0,0 +1,785 @@ + + */ +class SubscriptionEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorisation_details' => '\Cashfree\Model\AuthorizationDetails', + 'cf_subscription_id' => 'string', + 'customer_details' => '\Cashfree\Model\SubscriptionCustomerDetails', + 'plan_details' => '\Cashfree\Model\PlanEntity', + 'subscription_expiry_time' => 'string', + 'subscription_first_charge_time' => 'string', + 'subscription_id' => 'string', + 'subscription_meta' => '\Cashfree\Model\SubscriptionEntitySubscriptionMeta', + 'subscription_note' => 'string', + 'subscription_payment_splits' => '\Cashfree\Model\SubscriptionPaymentSplitItem[]', + 'subscription_status' => 'string', + 'subscription_tags' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorisation_details' => null, + 'cf_subscription_id' => null, + 'customer_details' => null, + 'plan_details' => null, + 'subscription_expiry_time' => null, + 'subscription_first_charge_time' => null, + 'subscription_id' => null, + 'subscription_meta' => null, + 'subscription_note' => null, + 'subscription_payment_splits' => null, + 'subscription_status' => null, + 'subscription_tags' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorisation_details' => false, + 'cf_subscription_id' => false, + 'customer_details' => false, + 'plan_details' => false, + 'subscription_expiry_time' => false, + 'subscription_first_charge_time' => false, + 'subscription_id' => false, + 'subscription_meta' => false, + 'subscription_note' => false, + 'subscription_payment_splits' => false, + 'subscription_status' => false, + 'subscription_tags' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authorisation_details' => 'authorisation_details', + 'cf_subscription_id' => 'cf_subscription_id', + 'customer_details' => 'customer_details', + 'plan_details' => 'plan_details', + 'subscription_expiry_time' => 'subscription_expiry_time', + 'subscription_first_charge_time' => 'subscription_first_charge_time', + 'subscription_id' => 'subscription_id', + 'subscription_meta' => 'subscription_meta', + 'subscription_note' => 'subscription_note', + 'subscription_payment_splits' => 'subscription_payment_splits', + 'subscription_status' => 'subscription_status', + 'subscription_tags' => 'subscription_tags' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorisation_details' => 'setAuthorisationDetails', + 'cf_subscription_id' => 'setCfSubscriptionId', + 'customer_details' => 'setCustomerDetails', + 'plan_details' => 'setPlanDetails', + 'subscription_expiry_time' => 'setSubscriptionExpiryTime', + 'subscription_first_charge_time' => 'setSubscriptionFirstChargeTime', + 'subscription_id' => 'setSubscriptionId', + 'subscription_meta' => 'setSubscriptionMeta', + 'subscription_note' => 'setSubscriptionNote', + 'subscription_payment_splits' => 'setSubscriptionPaymentSplits', + 'subscription_status' => 'setSubscriptionStatus', + 'subscription_tags' => 'setSubscriptionTags' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorisation_details' => 'getAuthorisationDetails', + 'cf_subscription_id' => 'getCfSubscriptionId', + 'customer_details' => 'getCustomerDetails', + 'plan_details' => 'getPlanDetails', + 'subscription_expiry_time' => 'getSubscriptionExpiryTime', + 'subscription_first_charge_time' => 'getSubscriptionFirstChargeTime', + 'subscription_id' => 'getSubscriptionId', + 'subscription_meta' => 'getSubscriptionMeta', + 'subscription_note' => 'getSubscriptionNote', + 'subscription_payment_splits' => 'getSubscriptionPaymentSplits', + 'subscription_status' => 'getSubscriptionStatus', + 'subscription_tags' => 'getSubscriptionTags' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authorisation_details', $data ?? [], null); + $this->setIfExists('cf_subscription_id', $data ?? [], null); + $this->setIfExists('customer_details', $data ?? [], null); + $this->setIfExists('plan_details', $data ?? [], null); + $this->setIfExists('subscription_expiry_time', $data ?? [], null); + $this->setIfExists('subscription_first_charge_time', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('subscription_meta', $data ?? [], null); + $this->setIfExists('subscription_note', $data ?? [], null); + $this->setIfExists('subscription_payment_splits', $data ?? [], null); + $this->setIfExists('subscription_status', $data ?? [], null); + $this->setIfExists('subscription_tags', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorisation_details + * + * @return \Cashfree\Model\AuthorizationDetails|null + */ + public function getAuthorisationDetails() + { + return $this->container['authorisation_details']; + } + + /** + * Sets authorisation_details + * + * @param \Cashfree\Model\AuthorizationDetails|null $authorisation_details authorisation_details + * + * @return self + */ + public function setAuthorisationDetails($authorisation_details) + { + if (is_null($authorisation_details)) { + throw new \InvalidArgumentException('non-nullable authorisation_details cannot be null'); + } + $this->container['authorisation_details'] = $authorisation_details; + + return $this; + } + + /** + * Gets cf_subscription_id + * + * @return string|null + */ + public function getCfSubscriptionId() + { + return $this->container['cf_subscription_id']; + } + + /** + * Sets cf_subscription_id + * + * @param string|null $cf_subscription_id Cashfree subscription reference number + * + * @return self + */ + public function setCfSubscriptionId($cf_subscription_id) + { + if (is_null($cf_subscription_id)) { + throw new \InvalidArgumentException('non-nullable cf_subscription_id cannot be null'); + } + $this->container['cf_subscription_id'] = $cf_subscription_id; + + return $this; + } + + /** + * Gets customer_details + * + * @return \Cashfree\Model\SubscriptionCustomerDetails|null + */ + public function getCustomerDetails() + { + return $this->container['customer_details']; + } + + /** + * Sets customer_details + * + * @param \Cashfree\Model\SubscriptionCustomerDetails|null $customer_details customer_details + * + * @return self + */ + public function setCustomerDetails($customer_details) + { + if (is_null($customer_details)) { + throw new \InvalidArgumentException('non-nullable customer_details cannot be null'); + } + $this->container['customer_details'] = $customer_details; + + return $this; + } + + /** + * Gets plan_details + * + * @return \Cashfree\Model\PlanEntity|null + */ + public function getPlanDetails() + { + return $this->container['plan_details']; + } + + /** + * Sets plan_details + * + * @param \Cashfree\Model\PlanEntity|null $plan_details plan_details + * + * @return self + */ + public function setPlanDetails($plan_details) + { + if (is_null($plan_details)) { + throw new \InvalidArgumentException('non-nullable plan_details cannot be null'); + } + $this->container['plan_details'] = $plan_details; + + return $this; + } + + /** + * Gets subscription_expiry_time + * + * @return string|null + */ + public function getSubscriptionExpiryTime() + { + return $this->container['subscription_expiry_time']; + } + + /** + * Sets subscription_expiry_time + * + * @param string|null $subscription_expiry_time Time at which the subscription will expire. + * + * @return self + */ + public function setSubscriptionExpiryTime($subscription_expiry_time) + { + if (is_null($subscription_expiry_time)) { + throw new \InvalidArgumentException('non-nullable subscription_expiry_time cannot be null'); + } + $this->container['subscription_expiry_time'] = $subscription_expiry_time; + + return $this; + } + + /** + * Gets subscription_first_charge_time + * + * @return string|null + */ + public function getSubscriptionFirstChargeTime() + { + return $this->container['subscription_first_charge_time']; + } + + /** + * Sets subscription_first_charge_time + * + * @param string|null $subscription_first_charge_time Time at which the first charge will be made for the subscription. Applicable only for PERIODIC plans. + * + * @return self + */ + public function setSubscriptionFirstChargeTime($subscription_first_charge_time) + { + if (is_null($subscription_first_charge_time)) { + throw new \InvalidArgumentException('non-nullable subscription_first_charge_time cannot be null'); + } + $this->container['subscription_first_charge_time'] = $subscription_first_charge_time; + + return $this; + } + + /** + * Gets subscription_id + * + * @return string|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string|null $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + + /** + * Gets subscription_meta + * + * @return \Cashfree\Model\SubscriptionEntitySubscriptionMeta|null + */ + public function getSubscriptionMeta() + { + return $this->container['subscription_meta']; + } + + /** + * Sets subscription_meta + * + * @param \Cashfree\Model\SubscriptionEntitySubscriptionMeta|null $subscription_meta subscription_meta + * + * @return self + */ + public function setSubscriptionMeta($subscription_meta) + { + if (is_null($subscription_meta)) { + throw new \InvalidArgumentException('non-nullable subscription_meta cannot be null'); + } + $this->container['subscription_meta'] = $subscription_meta; + + return $this; + } + + /** + * Gets subscription_note + * + * @return string|null + */ + public function getSubscriptionNote() + { + return $this->container['subscription_note']; + } + + /** + * Sets subscription_note + * + * @param string|null $subscription_note Note for the subscription. + * + * @return self + */ + public function setSubscriptionNote($subscription_note) + { + if (is_null($subscription_note)) { + throw new \InvalidArgumentException('non-nullable subscription_note cannot be null'); + } + $this->container['subscription_note'] = $subscription_note; + + return $this; + } + + /** + * Gets subscription_payment_splits + * + * @return \Cashfree\Model\SubscriptionPaymentSplitItem[]|null + */ + public function getSubscriptionPaymentSplits() + { + return $this->container['subscription_payment_splits']; + } + + /** + * Sets subscription_payment_splits + * + * @param \Cashfree\Model\SubscriptionPaymentSplitItem[]|null $subscription_payment_splits Payment splits for the subscription. + * + * @return self + */ + public function setSubscriptionPaymentSplits($subscription_payment_splits) + { + if (is_null($subscription_payment_splits)) { + throw new \InvalidArgumentException('non-nullable subscription_payment_splits cannot be null'); + } + $this->container['subscription_payment_splits'] = $subscription_payment_splits; + + return $this; + } + + /** + * Gets subscription_status + * + * @return string|null + */ + public function getSubscriptionStatus() + { + return $this->container['subscription_status']; + } + + /** + * Sets subscription_status + * + * @param string|null $subscription_status Status of the subscription. + * + * @return self + */ + public function setSubscriptionStatus($subscription_status) + { + if (is_null($subscription_status)) { + throw new \InvalidArgumentException('non-nullable subscription_status cannot be null'); + } + $this->container['subscription_status'] = $subscription_status; + + return $this; + } + + /** + * Gets subscription_tags + * + * @return object|null + */ + public function getSubscriptionTags() + { + return $this->container['subscription_tags']; + } + + /** + * Sets subscription_tags + * + * @param object|null $subscription_tags Tags for the subscription. + * + * @return self + */ + public function setSubscriptionTags($subscription_tags) + { + if (is_null($subscription_tags)) { + throw new \InvalidArgumentException('non-nullable subscription_tags cannot be null'); + } + $this->container['subscription_tags'] = $subscription_tags; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionEntitySubscriptionMeta.php b/lib/Model/SubscriptionEntitySubscriptionMeta.php new file mode 100644 index 0000000..66fbd38 --- /dev/null +++ b/lib/Model/SubscriptionEntitySubscriptionMeta.php @@ -0,0 +1,411 @@ + + */ +class SubscriptionEntitySubscriptionMeta implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionEntity_subscription_meta'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'return_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'return_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'return_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'return_url' => 'return_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'return_url' => 'setReturnUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'return_url' => 'getReturnUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('return_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets return_url + * + * @return string|null + */ + public function getReturnUrl() + { + return $this->container['return_url']; + } + + /** + * Sets return_url + * + * @param string|null $return_url Return URL for the subscription. + * + * @return self + */ + public function setReturnUrl($return_url) + { + if (is_null($return_url)) { + throw new \InvalidArgumentException('non-nullable return_url cannot be null'); + } + $this->container['return_url'] = $return_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionPaymentEntity.php b/lib/Model/SubscriptionPaymentEntity.php new file mode 100644 index 0000000..fc63310 --- /dev/null +++ b/lib/Model/SubscriptionPaymentEntity.php @@ -0,0 +1,887 @@ + + */ +class SubscriptionPaymentEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionPaymentEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'authorization_details' => '\Cashfree\Model\AuthorizationDetails', + 'cf_payment_id' => 'string', + 'cf_subscription_id' => 'string', + 'cf_txn_id' => 'string', + 'cf_order_id' => 'string', + 'failure_details' => '\Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails', + 'payment_amount' => 'float', + 'payment_id' => 'string', + 'payment_initiated_date' => 'string', + 'payment_remarks' => 'string', + 'payment_schedule_date' => 'string', + 'payment_status' => 'string', + 'payment_type' => 'string', + 'retry_attempts' => 'int', + 'subscription_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'authorization_details' => null, + 'cf_payment_id' => null, + 'cf_subscription_id' => null, + 'cf_txn_id' => null, + 'cf_order_id' => null, + 'failure_details' => null, + 'payment_amount' => 'float64', + 'payment_id' => null, + 'payment_initiated_date' => null, + 'payment_remarks' => null, + 'payment_schedule_date' => null, + 'payment_status' => null, + 'payment_type' => null, + 'retry_attempts' => null, + 'subscription_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'authorization_details' => false, + 'cf_payment_id' => false, + 'cf_subscription_id' => false, + 'cf_txn_id' => false, + 'cf_order_id' => false, + 'failure_details' => false, + 'payment_amount' => false, + 'payment_id' => false, + 'payment_initiated_date' => false, + 'payment_remarks' => false, + 'payment_schedule_date' => false, + 'payment_status' => false, + 'payment_type' => false, + 'retry_attempts' => false, + 'subscription_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'authorization_details' => 'authorization_details', + 'cf_payment_id' => 'cf_payment_id', + 'cf_subscription_id' => 'cf_subscription_id', + 'cf_txn_id' => 'cf_txn_id', + 'cf_order_id' => 'cf_order_id', + 'failure_details' => 'failure_details', + 'payment_amount' => 'payment_amount', + 'payment_id' => 'payment_id', + 'payment_initiated_date' => 'payment_initiated_date', + 'payment_remarks' => 'payment_remarks', + 'payment_schedule_date' => 'payment_schedule_date', + 'payment_status' => 'payment_status', + 'payment_type' => 'payment_type', + 'retry_attempts' => 'retry_attempts', + 'subscription_id' => 'subscription_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'authorization_details' => 'setAuthorizationDetails', + 'cf_payment_id' => 'setCfPaymentId', + 'cf_subscription_id' => 'setCfSubscriptionId', + 'cf_txn_id' => 'setCfTxnId', + 'cf_order_id' => 'setCfOrderId', + 'failure_details' => 'setFailureDetails', + 'payment_amount' => 'setPaymentAmount', + 'payment_id' => 'setPaymentId', + 'payment_initiated_date' => 'setPaymentInitiatedDate', + 'payment_remarks' => 'setPaymentRemarks', + 'payment_schedule_date' => 'setPaymentScheduleDate', + 'payment_status' => 'setPaymentStatus', + 'payment_type' => 'setPaymentType', + 'retry_attempts' => 'setRetryAttempts', + 'subscription_id' => 'setSubscriptionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'authorization_details' => 'getAuthorizationDetails', + 'cf_payment_id' => 'getCfPaymentId', + 'cf_subscription_id' => 'getCfSubscriptionId', + 'cf_txn_id' => 'getCfTxnId', + 'cf_order_id' => 'getCfOrderId', + 'failure_details' => 'getFailureDetails', + 'payment_amount' => 'getPaymentAmount', + 'payment_id' => 'getPaymentId', + 'payment_initiated_date' => 'getPaymentInitiatedDate', + 'payment_remarks' => 'getPaymentRemarks', + 'payment_schedule_date' => 'getPaymentScheduleDate', + 'payment_status' => 'getPaymentStatus', + 'payment_type' => 'getPaymentType', + 'retry_attempts' => 'getRetryAttempts', + 'subscription_id' => 'getSubscriptionId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('authorization_details', $data ?? [], null); + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('cf_subscription_id', $data ?? [], null); + $this->setIfExists('cf_txn_id', $data ?? [], null); + $this->setIfExists('cf_order_id', $data ?? [], null); + $this->setIfExists('failure_details', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('payment_initiated_date', $data ?? [], null); + $this->setIfExists('payment_remarks', $data ?? [], null); + $this->setIfExists('payment_schedule_date', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_type', $data ?? [], null); + $this->setIfExists('retry_attempts', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets authorization_details + * + * @return \Cashfree\Model\AuthorizationDetails|null + */ + public function getAuthorizationDetails() + { + return $this->container['authorization_details']; + } + + /** + * Sets authorization_details + * + * @param \Cashfree\Model\AuthorizationDetails|null $authorization_details authorization_details + * + * @return self + */ + public function setAuthorizationDetails($authorization_details) + { + if (is_null($authorization_details)) { + throw new \InvalidArgumentException('non-nullable authorization_details cannot be null'); + } + $this->container['authorization_details'] = $authorization_details; + + return $this; + } + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets cf_subscription_id + * + * @return string|null + */ + public function getCfSubscriptionId() + { + return $this->container['cf_subscription_id']; + } + + /** + * Sets cf_subscription_id + * + * @param string|null $cf_subscription_id Cashfree subscription reference number + * + * @return self + */ + public function setCfSubscriptionId($cf_subscription_id) + { + if (is_null($cf_subscription_id)) { + throw new \InvalidArgumentException('non-nullable cf_subscription_id cannot be null'); + } + $this->container['cf_subscription_id'] = $cf_subscription_id; + + return $this; + } + + /** + * Gets cf_txn_id + * + * @return string|null + */ + public function getCfTxnId() + { + return $this->container['cf_txn_id']; + } + + /** + * Sets cf_txn_id + * + * @param string|null $cf_txn_id Cashfree subscription payment transaction ID + * + * @return self + */ + public function setCfTxnId($cf_txn_id) + { + if (is_null($cf_txn_id)) { + throw new \InvalidArgumentException('non-nullable cf_txn_id cannot be null'); + } + $this->container['cf_txn_id'] = $cf_txn_id; + + return $this; + } + + /** + * Gets cf_order_id + * + * @return string|null + */ + public function getCfOrderId() + { + return $this->container['cf_order_id']; + } + + /** + * Sets cf_order_id + * + * @param string|null $cf_order_id Cashfree subscription payment order ID + * + * @return self + */ + public function setCfOrderId($cf_order_id) + { + if (is_null($cf_order_id)) { + throw new \InvalidArgumentException('non-nullable cf_order_id cannot be null'); + } + $this->container['cf_order_id'] = $cf_order_id; + + return $this; + } + + /** + * Gets failure_details + * + * @return \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null + */ + public function getFailureDetails() + { + return $this->container['failure_details']; + } + + /** + * Sets failure_details + * + * @param \Cashfree\Model\CreateSubscriptionPaymentAuthResponseFailureDetails|null $failure_details failure_details + * + * @return self + */ + public function setFailureDetails($failure_details) + { + if (is_null($failure_details)) { + throw new \InvalidArgumentException('non-nullable failure_details cannot be null'); + } + $this->container['failure_details'] = $failure_details; + + return $this; + } + + /** + * Gets payment_amount + * + * @return float|null + */ + public function getPaymentAmount() + { + return $this->container['payment_amount']; + } + + /** + * Sets payment_amount + * + * @param float|null $payment_amount The charge amount of the payment. + * + * @return self + */ + public function setPaymentAmount($payment_amount) + { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } + $this->container['payment_amount'] = $payment_amount; + + return $this; + } + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets payment_initiated_date + * + * @return string|null + */ + public function getPaymentInitiatedDate() + { + return $this->container['payment_initiated_date']; + } + + /** + * Sets payment_initiated_date + * + * @param string|null $payment_initiated_date The date on which the payment was initiated. + * + * @return self + */ + public function setPaymentInitiatedDate($payment_initiated_date) + { + if (is_null($payment_initiated_date)) { + throw new \InvalidArgumentException('non-nullable payment_initiated_date cannot be null'); + } + $this->container['payment_initiated_date'] = $payment_initiated_date; + + return $this; + } + + /** + * Gets payment_remarks + * + * @return string|null + */ + public function getPaymentRemarks() + { + return $this->container['payment_remarks']; + } + + /** + * Sets payment_remarks + * + * @param string|null $payment_remarks Payment remarks. + * + * @return self + */ + public function setPaymentRemarks($payment_remarks) + { + if (is_null($payment_remarks)) { + throw new \InvalidArgumentException('non-nullable payment_remarks cannot be null'); + } + $this->container['payment_remarks'] = $payment_remarks; + + return $this; + } + + /** + * Gets payment_schedule_date + * + * @return string|null + */ + public function getPaymentScheduleDate() + { + return $this->container['payment_schedule_date']; + } + + /** + * Sets payment_schedule_date + * + * @param string|null $payment_schedule_date The date on which the payment is scheduled to be processed. + * + * @return self + */ + public function setPaymentScheduleDate($payment_schedule_date) + { + if (is_null($payment_schedule_date)) { + throw new \InvalidArgumentException('non-nullable payment_schedule_date cannot be null'); + } + $this->container['payment_schedule_date'] = $payment_schedule_date; + + return $this; + } + + /** + * Gets payment_status + * + * @return string|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param string|null $payment_status Status of the payment. + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_type + * + * @return string|null + */ + public function getPaymentType() + { + return $this->container['payment_type']; + } + + /** + * Sets payment_type + * + * @param string|null $payment_type Payment type. Can be AUTH or CHARGE. + * + * @return self + */ + public function setPaymentType($payment_type) + { + if (is_null($payment_type)) { + throw new \InvalidArgumentException('non-nullable payment_type cannot be null'); + } + $this->container['payment_type'] = $payment_type; + + return $this; + } + + /** + * Gets retry_attempts + * + * @return int|null + */ + public function getRetryAttempts() + { + return $this->container['retry_attempts']; + } + + /** + * Sets retry_attempts + * + * @param int|null $retry_attempts Retry attempts. + * + * @return self + */ + public function setRetryAttempts($retry_attempts) + { + if (is_null($retry_attempts)) { + throw new \InvalidArgumentException('non-nullable retry_attempts cannot be null'); + } + $this->container['retry_attempts'] = $retry_attempts; + + return $this; + } + + /** + * Gets subscription_id + * + * @return string|null + */ + public function getSubscriptionId() + { + return $this->container['subscription_id']; + } + + /** + * Sets subscription_id + * + * @param string|null $subscription_id A unique ID passed by merchant for identifying the subscription. + * + * @return self + */ + public function setSubscriptionId($subscription_id) + { + if (is_null($subscription_id)) { + throw new \InvalidArgumentException('non-nullable subscription_id cannot be null'); + } + $this->container['subscription_id'] = $subscription_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionPaymentRefundEntity.php b/lib/Model/SubscriptionPaymentRefundEntity.php new file mode 100644 index 0000000..e41f14e --- /dev/null +++ b/lib/Model/SubscriptionPaymentRefundEntity.php @@ -0,0 +1,649 @@ + + */ +class SubscriptionPaymentRefundEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionPaymentRefundEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_id' => 'string', + 'cf_payment_id' => 'string', + 'refund_id' => 'string', + 'cf_refund_id' => 'string', + 'refund_amount' => 'float', + 'refund_note' => 'string', + 'refund_speed' => 'string', + 'refund_status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_id' => null, + 'cf_payment_id' => null, + 'refund_id' => null, + 'cf_refund_id' => null, + 'refund_amount' => 'float64', + 'refund_note' => null, + 'refund_speed' => null, + 'refund_status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_id' => false, + 'cf_payment_id' => false, + 'refund_id' => false, + 'cf_refund_id' => false, + 'refund_amount' => false, + 'refund_note' => false, + 'refund_speed' => false, + 'refund_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_id' => 'payment_id', + 'cf_payment_id' => 'cf_payment_id', + 'refund_id' => 'refund_id', + 'cf_refund_id' => 'cf_refund_id', + 'refund_amount' => 'refund_amount', + 'refund_note' => 'refund_note', + 'refund_speed' => 'refund_speed', + 'refund_status' => 'refund_status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_id' => 'setPaymentId', + 'cf_payment_id' => 'setCfPaymentId', + 'refund_id' => 'setRefundId', + 'cf_refund_id' => 'setCfRefundId', + 'refund_amount' => 'setRefundAmount', + 'refund_note' => 'setRefundNote', + 'refund_speed' => 'setRefundSpeed', + 'refund_status' => 'setRefundStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_id' => 'getPaymentId', + 'cf_payment_id' => 'getCfPaymentId', + 'refund_id' => 'getRefundId', + 'cf_refund_id' => 'getCfRefundId', + 'refund_amount' => 'getRefundAmount', + 'refund_note' => 'getRefundNote', + 'refund_speed' => 'getRefundSpeed', + 'refund_status' => 'getRefundStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('cf_payment_id', $data ?? [], null); + $this->setIfExists('refund_id', $data ?? [], null); + $this->setIfExists('cf_refund_id', $data ?? [], null); + $this->setIfExists('refund_amount', $data ?? [], null); + $this->setIfExists('refund_note', $data ?? [], null); + $this->setIfExists('refund_speed', $data ?? [], null); + $this->setIfExists('refund_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id A unique ID passed by merchant for identifying the transaction. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets cf_payment_id + * + * @return string|null + */ + public function getCfPaymentId() + { + return $this->container['cf_payment_id']; + } + + /** + * Sets cf_payment_id + * + * @param string|null $cf_payment_id Cashfree subscription payment reference number. + * + * @return self + */ + public function setCfPaymentId($cf_payment_id) + { + if (is_null($cf_payment_id)) { + throw new \InvalidArgumentException('non-nullable cf_payment_id cannot be null'); + } + $this->container['cf_payment_id'] = $cf_payment_id; + + return $this; + } + + /** + * Gets refund_id + * + * @return string|null + */ + public function getRefundId() + { + return $this->container['refund_id']; + } + + /** + * Sets refund_id + * + * @param string|null $refund_id A unique ID passed by merchant for identifying the refund. + * + * @return self + */ + public function setRefundId($refund_id) + { + if (is_null($refund_id)) { + throw new \InvalidArgumentException('non-nullable refund_id cannot be null'); + } + $this->container['refund_id'] = $refund_id; + + return $this; + } + + /** + * Gets cf_refund_id + * + * @return string|null + */ + public function getCfRefundId() + { + return $this->container['cf_refund_id']; + } + + /** + * Sets cf_refund_id + * + * @param string|null $cf_refund_id Cashfree subscription payment refund reference number. + * + * @return self + */ + public function setCfRefundId($cf_refund_id) + { + if (is_null($cf_refund_id)) { + throw new \InvalidArgumentException('non-nullable cf_refund_id cannot be null'); + } + $this->container['cf_refund_id'] = $cf_refund_id; + + return $this; + } + + /** + * Gets refund_amount + * + * @return float|null + */ + public function getRefundAmount() + { + return $this->container['refund_amount']; + } + + /** + * Sets refund_amount + * + * @param float|null $refund_amount The refund amount. + * + * @return self + */ + public function setRefundAmount($refund_amount) + { + if (is_null($refund_amount)) { + throw new \InvalidArgumentException('non-nullable refund_amount cannot be null'); + } + $this->container['refund_amount'] = $refund_amount; + + return $this; + } + + /** + * Gets refund_note + * + * @return string|null + */ + public function getRefundNote() + { + return $this->container['refund_note']; + } + + /** + * Sets refund_note + * + * @param string|null $refund_note Refund note. + * + * @return self + */ + public function setRefundNote($refund_note) + { + if (is_null($refund_note)) { + throw new \InvalidArgumentException('non-nullable refund_note cannot be null'); + } + $this->container['refund_note'] = $refund_note; + + return $this; + } + + /** + * Gets refund_speed + * + * @return string|null + */ + public function getRefundSpeed() + { + return $this->container['refund_speed']; + } + + /** + * Sets refund_speed + * + * @param string|null $refund_speed Refund speed. Can be INSTANT or NORMAL. + * + * @return self + */ + public function setRefundSpeed($refund_speed) + { + if (is_null($refund_speed)) { + throw new \InvalidArgumentException('non-nullable refund_speed cannot be null'); + } + $this->container['refund_speed'] = $refund_speed; + + return $this; + } + + /** + * Gets refund_status + * + * @return string|null + */ + public function getRefundStatus() + { + return $this->container['refund_status']; + } + + /** + * Sets refund_status + * + * @param string|null $refund_status Status of the refund. + * + * @return self + */ + public function setRefundStatus($refund_status) + { + if (is_null($refund_status)) { + throw new \InvalidArgumentException('non-nullable refund_status cannot be null'); + } + $this->container['refund_status'] = $refund_status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionPaymentSplitItem.php b/lib/Model/SubscriptionPaymentSplitItem.php new file mode 100644 index 0000000..6cddfa3 --- /dev/null +++ b/lib/Model/SubscriptionPaymentSplitItem.php @@ -0,0 +1,445 @@ + + */ +class SubscriptionPaymentSplitItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionPaymentSplitItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'vendor_id' => 'string', + 'percentage' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'vendor_id' => null, + 'percentage' => 'float64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'vendor_id' => false, + 'percentage' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'vendor_id' => 'vendor_id', + 'percentage' => 'percentage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'vendor_id' => 'setVendorId', + 'percentage' => 'setPercentage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'vendor_id' => 'getVendorId', + 'percentage' => 'getPercentage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vendor_id', $data ?? [], null); + $this->setIfExists('percentage', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vendor_id + * + * @return string|null + */ + public function getVendorId() + { + return $this->container['vendor_id']; + } + + /** + * Sets vendor_id + * + * @param string|null $vendor_id Vendor ID + * + * @return self + */ + public function setVendorId($vendor_id) + { + if (is_null($vendor_id)) { + throw new \InvalidArgumentException('non-nullable vendor_id cannot be null'); + } + $this->container['vendor_id'] = $vendor_id; + + return $this; + } + + /** + * Gets percentage + * + * @return float|null + */ + public function getPercentage() + { + return $this->container['percentage']; + } + + /** + * Sets percentage + * + * @param float|null $percentage Percentage of the payment to be split to vendor + * + * @return self + */ + public function setPercentage($percentage) + { + if (is_null($percentage)) { + throw new \InvalidArgumentException('non-nullable percentage cannot be null'); + } + $this->container['percentage'] = $percentage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TerminalDetails.php b/lib/Model/TerminalDetails.php index 9f64643..d783d98 100644 --- a/lib/Model/TerminalDetails.php +++ b/lib/Model/TerminalDetails.php @@ -339,14 +339,11 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['terminal_id'] === null) { - $invalidProperties[] = "'terminal_id' can't be null"; - } - if ((mb_strlen($this->container['terminal_id']) > 100)) { + if (!is_null($this->container['terminal_id']) && (mb_strlen($this->container['terminal_id']) > 100)) { $invalidProperties[] = "invalid value for 'terminal_id', the character length must be smaller than or equal to 100."; } - if ((mb_strlen($this->container['terminal_id']) < 3)) { + if (!is_null($this->container['terminal_id']) && (mb_strlen($this->container['terminal_id']) < 3)) { $invalidProperties[] = "invalid value for 'terminal_id', the character length must be bigger than or equal to 3."; } @@ -490,7 +487,7 @@ public function setTerminalAddress($terminal_address) /** * Gets terminal_id * - * @return string + * @return string|null */ public function getTerminalId() { @@ -500,7 +497,7 @@ public function getTerminalId() /** * Sets terminal_id * - * @param string $terminal_id terminal id for merchant reference + * @param string|null $terminal_id terminal id for merchant reference * * @return self */ diff --git a/lib/Model/TerminateOrderRequest.php b/lib/Model/TerminateOrderRequest.php index b4135d1..b1c0f49 100644 --- a/lib/Model/TerminateOrderRequest.php +++ b/lib/Model/TerminateOrderRequest.php @@ -307,7 +307,7 @@ public function getOrderStatus() /** * Sets order_status * - * @param string $order_status 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. + * @param string $order_status 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 self */ diff --git a/lib/Model/UpdateVendorRequest.php b/lib/Model/UpdateVendorRequest.php index dd34efb..b6fdb7a 100644 --- a/lib/Model/UpdateVendorRequest.php +++ b/lib/Model/UpdateVendorRequest.php @@ -547,7 +547,7 @@ public function getScheduleOption() /** * Sets schedule_option * - * @param float $schedule_option 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. + * @param float $schedule_option 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 self */ diff --git a/lib/Model/UpdateVendorResponse.php b/lib/Model/UpdateVendorResponse.php index 9cd18c5..88d86eb 100644 --- a/lib/Model/UpdateVendorResponse.php +++ b/lib/Model/UpdateVendorResponse.php @@ -75,7 +75,7 @@ class UpdateVendorResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'kyc_details' => '\Cashfree\Model\KycDetails[]', 'dashboard_access' => 'bool', 'bank_details' => 'string', - 'related_docs' => '\Cashfree\Model\VendorEntityRelatedDocsInner[]' + 'related_docs' => '\Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]' ]; /** @@ -838,7 +838,7 @@ public function setBankDetails($bank_details) /** * Gets related_docs * - * @return \Cashfree\Model\VendorEntityRelatedDocsInner[]|null + * @return \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null */ public function getRelatedDocs() { @@ -848,7 +848,7 @@ public function getRelatedDocs() /** * Sets related_docs * - * @param \Cashfree\Model\VendorEntityRelatedDocsInner[]|null $related_docs related_docs + * @param \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null $related_docs related_docs * * @return self */ diff --git a/lib/Model/UpdateVendorResponseRelatedDocsInner.php b/lib/Model/UpdateVendorResponseRelatedDocsInner.php new file mode 100644 index 0000000..cfd9006 --- /dev/null +++ b/lib/Model/UpdateVendorResponseRelatedDocsInner.php @@ -0,0 +1,546 @@ + + */ +class UpdateVendorResponseRelatedDocsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateVendorResponse_related_docs_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'vendor_id' => 'string', + 'doc_type' => 'string', + 'doc_value' => 'string', + 'status' => 'string', + 'remarks' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'vendor_id' => null, + 'doc_type' => null, + 'doc_value' => null, + 'status' => null, + 'remarks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'vendor_id' => false, + 'doc_type' => false, + 'doc_value' => false, + 'status' => false, + 'remarks' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'vendor_id' => 'vendor_id', + 'doc_type' => 'doc_type', + 'doc_value' => 'doc_value', + 'status' => 'status', + 'remarks' => 'remarks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'vendor_id' => 'setVendorId', + 'doc_type' => 'setDocType', + 'doc_value' => 'setDocValue', + 'status' => 'setStatus', + 'remarks' => 'setRemarks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'vendor_id' => 'getVendorId', + 'doc_type' => 'getDocType', + 'doc_value' => 'getDocValue', + 'status' => 'getStatus', + 'remarks' => 'getRemarks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vendor_id', $data ?? [], null); + $this->setIfExists('doc_type', $data ?? [], null); + $this->setIfExists('doc_value', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('remarks', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vendor_id + * + * @return string|null + */ + public function getVendorId() + { + return $this->container['vendor_id']; + } + + /** + * Sets vendor_id + * + * @param string|null $vendor_id vendor_id + * + * @return self + */ + public function setVendorId($vendor_id) + { + if (is_null($vendor_id)) { + throw new \InvalidArgumentException('non-nullable vendor_id cannot be null'); + } + $this->container['vendor_id'] = $vendor_id; + + return $this; + } + + /** + * Gets doc_type + * + * @return string|null + */ + public function getDocType() + { + return $this->container['doc_type']; + } + + /** + * Sets doc_type + * + * @param string|null $doc_type doc_type + * + * @return self + */ + public function setDocType($doc_type) + { + if (is_null($doc_type)) { + throw new \InvalidArgumentException('non-nullable doc_type cannot be null'); + } + $this->container['doc_type'] = $doc_type; + + return $this; + } + + /** + * Gets doc_value + * + * @return string|null + */ + public function getDocValue() + { + return $this->container['doc_value']; + } + + /** + * Sets doc_value + * + * @param string|null $doc_value doc_value + * + * @return self + */ + public function setDocValue($doc_value) + { + if (is_null($doc_value)) { + throw new \InvalidArgumentException('non-nullable doc_value cannot be null'); + } + $this->container['doc_value'] = $doc_value; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets remarks + * + * @return string|null + */ + public function getRemarks() + { + return $this->container['remarks']; + } + + /** + * Sets remarks + * + * @param string|null $remarks remarks + * + * @return self + */ + public function setRemarks($remarks) + { + if (is_null($remarks)) { + throw new \InvalidArgumentException('non-nullable remarks cannot be null'); + } + $this->container['remarks'] = $remarks; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UploadPnachImageResponse.php b/lib/Model/UploadPnachImageResponse.php new file mode 100644 index 0000000..814cae0 --- /dev/null +++ b/lib/Model/UploadPnachImageResponse.php @@ -0,0 +1,513 @@ + + */ +class UploadPnachImageResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UploadPnachImageResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_id' => 'string', + 'authorization_status' => 'string', + 'action' => 'string', + 'payment_message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_id' => null, + 'authorization_status' => null, + 'action' => null, + 'payment_message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payment_id' => false, + 'authorization_status' => false, + 'action' => false, + 'payment_message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_id' => 'payment_id', + 'authorization_status' => 'authorization_status', + 'action' => 'action', + 'payment_message' => 'payment_message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_id' => 'setPaymentId', + 'authorization_status' => 'setAuthorizationStatus', + 'action' => 'setAction', + 'payment_message' => 'setPaymentMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_id' => 'getPaymentId', + 'authorization_status' => 'getAuthorizationStatus', + 'action' => 'getAction', + 'payment_message' => 'getPaymentMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_id', $data ?? [], null); + $this->setIfExists('authorization_status', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('payment_message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_id + * + * @return string|null + */ + public function getPaymentId() + { + return $this->container['payment_id']; + } + + /** + * Sets payment_id + * + * @param string|null $payment_id The payment_id against which the pnach image is uploaded. + * + * @return self + */ + public function setPaymentId($payment_id) + { + if (is_null($payment_id)) { + throw new \InvalidArgumentException('non-nullable payment_id cannot be null'); + } + $this->container['payment_id'] = $payment_id; + + return $this; + } + + /** + * Gets authorization_status + * + * @return string|null + */ + public function getAuthorizationStatus() + { + return $this->container['authorization_status']; + } + + /** + * Sets authorization_status + * + * @param string|null $authorization_status Authorization status of the subscription. + * + * @return self + */ + public function setAuthorizationStatus($authorization_status) + { + if (is_null($authorization_status)) { + throw new \InvalidArgumentException('non-nullable authorization_status cannot be null'); + } + $this->container['authorization_status'] = $authorization_status; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action Action performed on the file. + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets payment_message + * + * @return string|null + */ + public function getPaymentMessage() + { + return $this->container['payment_message']; + } + + /** + * Sets payment_message + * + * @param string|null $payment_message Message of the API. + * + * @return self + */ + public function setPaymentMessage($payment_message) + { + if (is_null($payment_message)) { + throw new \InvalidArgumentException('non-nullable payment_message cannot be null'); + } + $this->container['payment_message'] = $payment_message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/VendorDocumentsResponse.php b/lib/Model/VendorDocumentsResponse.php index f207ae6..59d6542 100644 --- a/lib/Model/VendorDocumentsResponse.php +++ b/lib/Model/VendorDocumentsResponse.php @@ -59,7 +59,7 @@ class VendorDocumentsResponse implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'documents' => '\Cashfree\Model\VendorEntityRelatedDocsInner[]' + 'documents' => '\Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]' ]; /** @@ -294,7 +294,7 @@ public function valid() /** * Gets documents * - * @return \Cashfree\Model\VendorEntityRelatedDocsInner[]|null + * @return \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null */ public function getDocuments() { @@ -304,7 +304,7 @@ public function getDocuments() /** * Sets documents * - * @param \Cashfree\Model\VendorEntityRelatedDocsInner[]|null $documents documents + * @param \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null $documents documents * * @return self */ diff --git a/lib/Model/VendorEntity.php b/lib/Model/VendorEntity.php index a2c34f5..2e24f8a 100644 --- a/lib/Model/VendorEntity.php +++ b/lib/Model/VendorEntity.php @@ -72,7 +72,8 @@ class VendorEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'vendor_type' => 'string', 'account_type' => 'string', 'business_type' => 'string', - 'related_docs' => '\Cashfree\Model\VendorEntityRelatedDocsInner[]' + 'remarks' => 'string', + 'related_docs' => '\Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]' ]; /** @@ -96,6 +97,7 @@ class VendorEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'vendor_type' => null, 'account_type' => null, 'business_type' => null, + 'remarks' => null, 'related_docs' => null ]; @@ -118,6 +120,7 @@ class VendorEntity implements ModelInterface, ArrayAccess, \JsonSerializable 'vendor_type' => false, 'account_type' => false, 'business_type' => false, + 'remarks' => false, 'related_docs' => false ]; @@ -220,6 +223,7 @@ public function isNullableSetToNull(string $property): bool 'vendor_type' => 'vendor_type', 'account_type' => 'account_type', 'business_type' => 'business_type', + 'remarks' => 'remarks', 'related_docs' => 'related_docs' ]; @@ -242,6 +246,7 @@ public function isNullableSetToNull(string $property): bool 'vendor_type' => 'setVendorType', 'account_type' => 'setAccountType', 'business_type' => 'setBusinessType', + 'remarks' => 'setRemarks', 'related_docs' => 'setRelatedDocs' ]; @@ -264,6 +269,7 @@ public function isNullableSetToNull(string $property): bool 'vendor_type' => 'getVendorType', 'account_type' => 'getAccountType', 'business_type' => 'getBusinessType', + 'remarks' => 'getRemarks', 'related_docs' => 'getRelatedDocs' ]; @@ -337,6 +343,7 @@ public function __construct(array $data = null) $this->setIfExists('vendor_type', $data ?? [], null); $this->setIfExists('account_type', $data ?? [], null); $this->setIfExists('business_type', $data ?? [], null); + $this->setIfExists('remarks', $data ?? [], null); $this->setIfExists('related_docs', $data ?? [], null); } @@ -733,10 +740,37 @@ public function setBusinessType($business_type) return $this; } + /** + * Gets remarks + * + * @return string|null + */ + public function getRemarks() + { + return $this->container['remarks']; + } + + /** + * Sets remarks + * + * @param string|null $remarks remarks + * + * @return self + */ + public function setRemarks($remarks) + { + if (is_null($remarks)) { + throw new \InvalidArgumentException('non-nullable remarks cannot be null'); + } + $this->container['remarks'] = $remarks; + + return $this; + } + /** * Gets related_docs * - * @return \Cashfree\Model\VendorEntityRelatedDocsInner[]|null + * @return \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null */ public function getRelatedDocs() { @@ -746,7 +780,7 @@ public function getRelatedDocs() /** * Sets related_docs * - * @param \Cashfree\Model\VendorEntityRelatedDocsInner[]|null $related_docs related_docs + * @param \Cashfree\Model\UpdateVendorResponseRelatedDocsInner[]|null $related_docs related_docs * * @return self */ diff --git a/test/Api/OrdersApiTest.php b/test/Api/OrdersApiTest.php index b257fae..8655946 100644 --- a/test/Api/OrdersApiTest.php +++ b/test/Api/OrdersApiTest.php @@ -28,10 +28,9 @@ namespace Cashfree\Test\Api; -use Cashfree\Cashfree; use \Cashfree\Configuration; -use Cashfree\Model\CreateOrderRequest; -use Cashfree\Model\CustomerDetails; +use \Cashfree\ApiException; +use \Cashfree\ObjectSerializer; use PHPUnit\Framework\TestCase; /** @@ -41,8 +40,6 @@ * @package Cashfree * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @method assertTrue(array $result) - * @method assertArrayHasKey(string $string, $toArray) */ class OrdersApiTest extends TestCase { @@ -83,21 +80,8 @@ public static function tearDownAfterClass(): void */ public function testPGCreateOrder() { - $cashfree = new Cashfree(); - $x_api_version = "2022-09-01"; - $create_orders_request = new CreateOrderRequest(); - $customer_details = new CustomerDetails(); - $customer_details->setCustomerId("walterwNrcMi"); - $customer_details->setCustomerPhone("9999999999"); - $create_orders_request->setCustomerDetails($customer_details); - $create_orders_request->setOrderAmount(1.0); - $create_orders_request->setOrderCurrency("INR"); - - $result = $cashfree->PGCreateOrder($x_api_version, $create_orders_request, null, null, null); - - $this->assertTrue($result); - - $this->assertArrayHasKey('payment_session_id',$result->toArray()); + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** @@ -108,52 +92,19 @@ public function testPGCreateOrder() */ public function testPGFetchOrder() { - $cashfree = new Cashfree(); - $x_api_version = "2022-09-01"; - $order_id = "order_306362cJ3scxkcQxn0F38Q5HxF7j5UoP"; - - $result = $cashfree->PGFetchOrder($x_api_version, $order_id, null, null, null); - - $this->assertTrue($result); - - $this->assertArrayHasKey('payment_session_id',$result->toArray()); - + // TODO: implement + $this->markTestIncomplete('Not implemented'); } /** - * Test case for PGOrderFetchPayment + * Test case for pGTerminateOrder * * Terminate Order. * */ - public function testPGOrderFetchPayment() + public function testPGTerminateOrder() { - $cashfree = new Cashfree(); - $x_api_version = "2022-09-01"; - $order_id = "order_id"; - $cf_payment_id = "cf_payment_id"; - $result = $cashfree->PGOrderFetchPayment($x_api_version, $order_id, $cf_payment_id, null, null, null); - $this->assertTrue($result); - - $this->assertArrayHasKey('cf_payment_id',$result->toArray()); - - } - - /** - * Test case for PGOrderFetchPayment - * - * Terminate Order. - * - */ - public function testPGOrderFetchPayments() - { - $cashfree = new Cashfree(); - $x_api_version = "2022-09-01"; - $order_id = "order00002"; - $result = $cashfree->PGOrderFetchPayments($x_api_version, $order_id, null, null, null); - $this->assertTrue($result); - - $this->assertArrayHasKey('cf_payment_id',$result->toArray()); - + // TODO: implement + $this->markTestIncomplete('Not implemented'); } } diff --git a/test/Api/SettlementsApiTest.php b/test/Api/SettlementsApiTest.php index 104bb77..4137843 100644 --- a/test/Api/SettlementsApiTest.php +++ b/test/Api/SettlementsApiTest.php @@ -72,6 +72,18 @@ public static function tearDownAfterClass(): void { } + /** + * Test case for markForSettlement + * + * Mark Order For Settlement. + * + */ + public function testMarkForSettlement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test case for pGOrderFetchSettlement * diff --git a/test/Api/SimulationApiTest.php b/test/Api/SimulationApiTest.php new file mode 100644 index 0000000..ad2595a --- /dev/null +++ b/test/Api/SimulationApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for pGSimulatePayment + * + * Simulate Payment. + * + */ + public function testPGSimulatePayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/SubscriptionApiTest.php b/test/Api/SubscriptionApiTest.php new file mode 100644 index 0000000..06224ac --- /dev/null +++ b/test/Api/SubscriptionApiTest.php @@ -0,0 +1,230 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsCreatePlan + * + * Create a plan.. + * + */ + public function testSubsCreatePlan() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsCreateRefund + * + * Create a refund.. + * + */ + public function testSubsCreateRefund() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsCreateSubscription + * + * Create Subscription. + * + */ + public function testSubsCreateSubscription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsFetchPlan + * + * Fetch Plan. + * + */ + public function testSubsFetchPlan() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsFetchSubscription + * + * Fetch Subscription. + * + */ + public function testSubsFetchSubscription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsFetchSubscriptionPayment + * + * Fetch details of a single payment.. + * + */ + public function testSubsFetchSubscriptionPayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsFetchSubscriptionPayments + * + * Fetch details of all payments of a subscription.. + * + */ + public function testSubsFetchSubscriptionPayments() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsFetchSubscriptionRefund + * + * Fetch details of a refund.. + * + */ + public function testSubsFetchSubscriptionRefund() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsManageSubscription + * + * Manage a subscription.. + * + */ + public function testSubsManageSubscription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subsManageSubscriptionPayment + * + * Manage a single payment.. + * + */ + public function testSubsManageSubscriptionPayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subscriptionDocumentUpload + * + * Upload Physical Nach for Physical Nach Authorization.. + * + */ + public function testSubscriptionDocumentUpload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for subscriptionEligibility + * + * Get Eligible payment methods available for a subscription. + * + */ + public function testSubscriptionEligibility() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AuthorizationDetailsTest.php b/test/Model/AuthorizationDetailsTest.php new file mode 100644 index 0000000..97528d9 --- /dev/null +++ b/test/Model/AuthorizationDetailsTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_amount" + */ + public function testPropertyAuthorizationAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_amount_refund" + */ + public function testPropertyAuthorizationAmountRefund() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_reference" + */ + public function testPropertyAuthorizationReference() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_time" + */ + public function testPropertyAuthorizationTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_status" + */ + public function testPropertyAuthorizationStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateOrderSettlementRequestBodyMetaDataTest.php b/test/Model/CreateOrderSettlementRequestBodyMetaDataTest.php new file mode 100644 index 0000000..952f817 --- /dev/null +++ b/test/Model/CreateOrderSettlementRequestBodyMetaDataTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cbriks_id" + */ + public function testPropertyCbriksId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "settlement_date" + */ + public function testPropertySettlementDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateOrderSettlementRequestBodyTest.php b/test/Model/CreateOrderSettlementRequestBodyTest.php new file mode 100644 index 0000000..54301bc --- /dev/null +++ b/test/Model/CreateOrderSettlementRequestBodyTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "order_id" + */ + public function testPropertyOrderId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "meta_data" + */ + public function testPropertyMetaData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreatePlanRequestTest.php b/test/Model/CreatePlanRequestTest.php new file mode 100644 index 0000000..1a17806 --- /dev/null +++ b/test/Model/CreatePlanRequestTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_id" + */ + public function testPropertyPlanId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_name" + */ + public function testPropertyPlanName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_type" + */ + public function testPropertyPlanType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_currency" + */ + public function testPropertyPlanCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_recurring_amount" + */ + public function testPropertyPlanRecurringAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_amount" + */ + public function testPropertyPlanMaxAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_cycles" + */ + public function testPropertyPlanMaxCycles() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_intervals" + */ + public function testPropertyPlanIntervals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_interval_type" + */ + public function testPropertyPlanIntervalType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_note" + */ + public function testPropertyPlanNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionPaymentAuthResponseFailureDetailsTest.php b/test/Model/CreateSubscriptionPaymentAuthResponseFailureDetailsTest.php new file mode 100644 index 0000000..6d2d110 --- /dev/null +++ b/test/Model/CreateSubscriptionPaymentAuthResponseFailureDetailsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "failure_reason" + */ + public function testPropertyFailureReason() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionPaymentAuthResponseTest.php b/test/Model/CreateSubscriptionPaymentAuthResponseTest.php new file mode 100644 index 0000000..75d7141 --- /dev/null +++ b/test/Model/CreateSubscriptionPaymentAuthResponseTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_subscription_id" + */ + public function testPropertyCfSubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "failure_details" + */ + public function testPropertyFailureDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_amount" + */ + public function testPropertyPaymentAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_initiated_date" + */ + public function testPropertyPaymentInitiatedDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_type" + */ + public function testPropertyPaymentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionPaymentChargeResponseTest.php b/test/Model/CreateSubscriptionPaymentChargeResponseTest.php new file mode 100644 index 0000000..b0368ec --- /dev/null +++ b/test/Model/CreateSubscriptionPaymentChargeResponseTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_subscription_id" + */ + public function testPropertyCfSubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "failure_details" + */ + public function testPropertyFailureDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_amount" + */ + public function testPropertyPaymentAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_initiated_date" + */ + public function testPropertyPaymentInitiatedDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_type" + */ + public function testPropertyPaymentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionPaymentRequestTest.php b/test/Model/CreateSubscriptionPaymentRequestTest.php new file mode 100644 index 0000000..a4c20e8 --- /dev/null +++ b/test/Model/CreateSubscriptionPaymentRequestTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_session_id" + */ + public function testPropertySubscriptionSessionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_amount" + */ + public function testPropertyPaymentAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_schedule_date" + */ + public function testPropertyPaymentScheduleDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_remarks" + */ + public function testPropertyPaymentRemarks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_type" + */ + public function testPropertyPaymentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionRefundRequestTest.php b/test/Model/CreateSubscriptionRefundRequestTest.php new file mode 100644 index 0000000..aa1d64e --- /dev/null +++ b/test/Model/CreateSubscriptionRefundRequestTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_id" + */ + public function testPropertyRefundId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_amount" + */ + public function testPropertyRefundAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_note" + */ + public function testPropertyRefundNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_speed" + */ + public function testPropertyRefundSpeed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionRequestAuthorizationDetailsTest.php b/test/Model/CreateSubscriptionRequestAuthorizationDetailsTest.php new file mode 100644 index 0000000..4a477e6 --- /dev/null +++ b/test/Model/CreateSubscriptionRequestAuthorizationDetailsTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_amount" + */ + public function testPropertyAuthorizationAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_amount_refund" + */ + public function testPropertyAuthorizationAmountRefund() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionRequestPlanDetailsTest.php b/test/Model/CreateSubscriptionRequestPlanDetailsTest.php new file mode 100644 index 0000000..5f85478 --- /dev/null +++ b/test/Model/CreateSubscriptionRequestPlanDetailsTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_id" + */ + public function testPropertyPlanId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_name" + */ + public function testPropertyPlanName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_type" + */ + public function testPropertyPlanType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_currency" + */ + public function testPropertyPlanCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_amount" + */ + public function testPropertyPlanAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_amount" + */ + public function testPropertyPlanMaxAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_cycles" + */ + public function testPropertyPlanMaxCycles() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_intervals" + */ + public function testPropertyPlanIntervals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_interval_type" + */ + public function testPropertyPlanIntervalType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_note" + */ + public function testPropertyPlanNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionRequestSubscriptionMetaTest.php b/test/Model/CreateSubscriptionRequestSubscriptionMetaTest.php new file mode 100644 index 0000000..f3473df --- /dev/null +++ b/test/Model/CreateSubscriptionRequestSubscriptionMetaTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_url" + */ + public function testPropertyReturnUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "notification_channel" + */ + public function testPropertyNotificationChannel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateSubscriptionRequestTest.php b/test/Model/CreateSubscriptionRequestTest.php new file mode 100644 index 0000000..b5f97c5 --- /dev/null +++ b/test/Model/CreateSubscriptionRequestTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_details" + */ + public function testPropertyCustomerDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_details" + */ + public function testPropertyPlanDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_details" + */ + public function testPropertyAuthorizationDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_meta" + */ + public function testPropertySubscriptionMeta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_expiry_time" + */ + public function testPropertySubscriptionExpiryTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_first_charge_time" + */ + public function testPropertySubscriptionFirstChargeTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_note" + */ + public function testPropertySubscriptionNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_tags" + */ + public function testPropertySubscriptionTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_payment_splits" + */ + public function testPropertySubscriptionPaymentSplits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateTerminalTransactionRequestTest.php b/test/Model/CreateTerminalTransactionRequestTest.php index 4b66458..61a2f94 100644 --- a/test/Model/CreateTerminalTransactionRequestTest.php +++ b/test/Model/CreateTerminalTransactionRequestTest.php @@ -115,4 +115,13 @@ public function testPropertyTerminalPhoneNo() // TODO: implement $this->markTestIncomplete('Not implemented'); } + + /** + * Test attribute "add_invoice" + */ + public function testPropertyAddInvoice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } } diff --git a/test/Model/CustomerDetailsResponseTest.php b/test/Model/CustomerDetailsResponseTest.php new file mode 100644 index 0000000..2ecffd1 --- /dev/null +++ b/test/Model/CustomerDetailsResponseTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_id" + */ + public function testPropertyCustomerId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_email" + */ + public function testPropertyCustomerEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_phone" + */ + public function testPropertyCustomerPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_name" + */ + public function testPropertyCustomerName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_account_number" + */ + public function testPropertyCustomerBankAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_ifsc" + */ + public function testPropertyCustomerBankIfsc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_code" + */ + public function testPropertyCustomerBankCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_uid" + */ + public function testPropertyCustomerUid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CustomerDetailsTest.php b/test/Model/CustomerDetailsTest.php index a40f4b1..213e339 100644 --- a/test/Model/CustomerDetailsTest.php +++ b/test/Model/CustomerDetailsTest.php @@ -35,7 +35,7 @@ * CustomerDetailsTest Class Doc Comment * * @category Class - * @description The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details. + * @description The customer details that are necessary. * @package Cashfree * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/test/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInnerTest.php b/test/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInnerTest.php new file mode 100644 index 0000000..e99f4db --- /dev/null +++ b/test/Model/EligibilityMethodItemEntityDetailsAvailableHandlesInnerTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "handle" + */ + public function testPropertyHandle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "application" + */ + public function testPropertyApplication() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EligibilityMethodItemEntityDetailsTest.php b/test/Model/EligibilityMethodItemEntityDetailsTest.php new file mode 100644 index 0000000..97bd3cf --- /dev/null +++ b/test/Model/EligibilityMethodItemEntityDetailsTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_types" + */ + public function testPropertyAccountTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "frequent_bank_details" + */ + public function testPropertyFrequentBankDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "all_bank_details" + */ + public function testPropertyAllBankDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "available_handles" + */ + public function testPropertyAvailableHandles() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowed_card_types" + */ + public function testPropertyAllowedCardTypes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EligibilityMethodItemTest.php b/test/Model/EligibilityMethodItemTest.php new file mode 100644 index 0000000..5025309 --- /dev/null +++ b/test/Model/EligibilityMethodItemTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "eligibility" + */ + public function testPropertyEligibility() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_type" + */ + public function testPropertyEntityType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_value" + */ + public function testPropertyEntityValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_details" + */ + public function testPropertyEntityDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EntitySimulationRequestTest.php b/test/Model/EntitySimulationRequestTest.php new file mode 100644 index 0000000..3e68ad9 --- /dev/null +++ b/test/Model/EntitySimulationRequestTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_error_code" + */ + public function testPropertyPaymentErrorCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EntitySimulationResponseTest.php b/test/Model/EntitySimulationResponseTest.php new file mode 100644 index 0000000..ba5e37a --- /dev/null +++ b/test/Model/EntitySimulationResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_error_code" + */ + public function testPropertyPaymentErrorCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LinkCustomerDetailsEntityTest.php b/test/Model/LinkCustomerDetailsEntityTest.php index b2bfb54..2c35d22 100644 --- a/test/Model/LinkCustomerDetailsEntityTest.php +++ b/test/Model/LinkCustomerDetailsEntityTest.php @@ -106,4 +106,31 @@ public function testPropertyCustomerName() // TODO: implement $this->markTestIncomplete('Not implemented'); } + + /** + * Test attribute "customer_bank_account_number" + */ + public function testPropertyCustomerBankAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_ifsc" + */ + public function testPropertyCustomerBankIfsc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_code" + */ + public function testPropertyCustomerBankCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } } diff --git a/test/Model/ManageSubscriptionPaymentRequestActionDetailsTest.php b/test/Model/ManageSubscriptionPaymentRequestActionDetailsTest.php new file mode 100644 index 0000000..119975b --- /dev/null +++ b/test/Model/ManageSubscriptionPaymentRequestActionDetailsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_scheduled_time" + */ + public function testPropertyNextScheduledTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ManageSubscriptionPaymentRequestTest.php b/test/Model/ManageSubscriptionPaymentRequestTest.php new file mode 100644 index 0000000..6cfdb8f --- /dev/null +++ b/test/Model/ManageSubscriptionPaymentRequestTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action_details" + */ + public function testPropertyActionDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ManageSubscriptionRequestActionDetailsTest.php b/test/Model/ManageSubscriptionRequestActionDetailsTest.php new file mode 100644 index 0000000..31874ff --- /dev/null +++ b/test/Model/ManageSubscriptionRequestActionDetailsTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_scheduled_time" + */ + public function testPropertyNextScheduledTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_id" + */ + public function testPropertyPlanId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ManageSubscriptionRequestTest.php b/test/Model/ManageSubscriptionRequestTest.php new file mode 100644 index 0000000..6f7d07e --- /dev/null +++ b/test/Model/ManageSubscriptionRequestTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action_details" + */ + public function testPropertyActionDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PlanEntityTest.php b/test/Model/PlanEntityTest.php new file mode 100644 index 0000000..bfdbac2 --- /dev/null +++ b/test/Model/PlanEntityTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_currency" + */ + public function testPropertyPlanCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_id" + */ + public function testPropertyPlanId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_interval_type" + */ + public function testPropertyPlanIntervalType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_intervals" + */ + public function testPropertyPlanIntervals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_amount" + */ + public function testPropertyPlanMaxAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_max_cycles" + */ + public function testPropertyPlanMaxCycles() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_name" + */ + public function testPropertyPlanName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_note" + */ + public function testPropertyPlanNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_recurring_amount" + */ + public function testPropertyPlanRecurringAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_status" + */ + public function testPropertyPlanStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_type" + */ + public function testPropertyPlanType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SimulateRequestTest.php b/test/Model/SimulateRequestTest.php new file mode 100644 index 0000000..c0bedda --- /dev/null +++ b/test/Model/SimulateRequestTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity" + */ + public function testPropertyEntity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_id" + */ + public function testPropertyEntityId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_simulation" + */ + public function testPropertyEntitySimulation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SimulationResponseTest.php b/test/Model/SimulationResponseTest.php new file mode 100644 index 0000000..9400a1a --- /dev/null +++ b/test/Model/SimulationResponseTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "simulation_id" + */ + public function testPropertySimulationId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity" + */ + public function testPropertyEntity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_id" + */ + public function testPropertyEntityId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entity_simulation" + */ + public function testPropertyEntitySimulation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubsCreatePayment200ResponseTest.php b/test/Model/SubsCreatePayment200ResponseTest.php new file mode 100644 index 0000000..fde1a26 --- /dev/null +++ b/test/Model/SubsCreatePayment200ResponseTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_subscription_id" + */ + public function testPropertyCfSubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "failure_details" + */ + public function testPropertyFailureDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_amount" + */ + public function testPropertyPaymentAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_initiated_date" + */ + public function testPropertyPaymentInitiatedDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_type" + */ + public function testPropertyPaymentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionBankDetailsTest.php b/test/Model/SubscriptionBankDetailsTest.php new file mode 100644 index 0000000..1c0a92c --- /dev/null +++ b/test/Model/SubscriptionBankDetailsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bank_id" + */ + public function testPropertyBankId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bank_name" + */ + public function testPropertyBankName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_auth_modes" + */ + public function testPropertyAccountAuthModes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionCustomerDetailsTest.php b/test/Model/SubscriptionCustomerDetailsTest.php new file mode 100644 index 0000000..d932c28 --- /dev/null +++ b/test/Model/SubscriptionCustomerDetailsTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_name" + */ + public function testPropertyCustomerName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_email" + */ + public function testPropertyCustomerEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_phone" + */ + public function testPropertyCustomerPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_account_holder_name" + */ + public function testPropertyCustomerBankAccountHolderName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_account_number" + */ + public function testPropertyCustomerBankAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_ifsc" + */ + public function testPropertyCustomerBankIfsc() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_code" + */ + public function testPropertyCustomerBankCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_bank_account_type" + */ + public function testPropertyCustomerBankAccountType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEligibilityRequestFiltersTest.php b/test/Model/SubscriptionEligibilityRequestFiltersTest.php new file mode 100644 index 0000000..d9d8c4e --- /dev/null +++ b/test/Model/SubscriptionEligibilityRequestFiltersTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_methods" + */ + public function testPropertyPaymentMethods() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEligibilityRequestQueriesTest.php b/test/Model/SubscriptionEligibilityRequestQueriesTest.php new file mode 100644 index 0000000..6e1c9a2 --- /dev/null +++ b/test/Model/SubscriptionEligibilityRequestQueriesTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEligibilityRequestTest.php b/test/Model/SubscriptionEligibilityRequestTest.php new file mode 100644 index 0000000..ae21b73 --- /dev/null +++ b/test/Model/SubscriptionEligibilityRequestTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queries" + */ + public function testPropertyQueries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEligibilityResponseTest.php b/test/Model/SubscriptionEligibilityResponseTest.php new file mode 100644 index 0000000..e5508b9 --- /dev/null +++ b/test/Model/SubscriptionEligibilityResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEntitySubscriptionMetaTest.php b/test/Model/SubscriptionEntitySubscriptionMetaTest.php new file mode 100644 index 0000000..3324dd3 --- /dev/null +++ b/test/Model/SubscriptionEntitySubscriptionMetaTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "return_url" + */ + public function testPropertyReturnUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionEntityTest.php b/test/Model/SubscriptionEntityTest.php new file mode 100644 index 0000000..8812d67 --- /dev/null +++ b/test/Model/SubscriptionEntityTest.php @@ -0,0 +1,190 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorisation_details" + */ + public function testPropertyAuthorisationDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_subscription_id" + */ + public function testPropertyCfSubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customer_details" + */ + public function testPropertyCustomerDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plan_details" + */ + public function testPropertyPlanDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_expiry_time" + */ + public function testPropertySubscriptionExpiryTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_first_charge_time" + */ + public function testPropertySubscriptionFirstChargeTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_meta" + */ + public function testPropertySubscriptionMeta() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_note" + */ + public function testPropertySubscriptionNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_payment_splits" + */ + public function testPropertySubscriptionPaymentSplits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_status" + */ + public function testPropertySubscriptionStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_tags" + */ + public function testPropertySubscriptionTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionPaymentEntityTest.php b/test/Model/SubscriptionPaymentEntityTest.php new file mode 100644 index 0000000..a905754 --- /dev/null +++ b/test/Model/SubscriptionPaymentEntityTest.php @@ -0,0 +1,217 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_details" + */ + public function testPropertyAuthorizationDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_subscription_id" + */ + public function testPropertyCfSubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_txn_id" + */ + public function testPropertyCfTxnId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_order_id" + */ + public function testPropertyCfOrderId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "failure_details" + */ + public function testPropertyFailureDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_amount" + */ + public function testPropertyPaymentAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_initiated_date" + */ + public function testPropertyPaymentInitiatedDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_remarks" + */ + public function testPropertyPaymentRemarks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_schedule_date" + */ + public function testPropertyPaymentScheduleDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_type" + */ + public function testPropertyPaymentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "retry_attempts" + */ + public function testPropertyRetryAttempts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription_id" + */ + public function testPropertySubscriptionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionPaymentRefundEntityTest.php b/test/Model/SubscriptionPaymentRefundEntityTest.php new file mode 100644 index 0000000..3e67872 --- /dev/null +++ b/test/Model/SubscriptionPaymentRefundEntityTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_payment_id" + */ + public function testPropertyCfPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_id" + */ + public function testPropertyRefundId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cf_refund_id" + */ + public function testPropertyCfRefundId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_amount" + */ + public function testPropertyRefundAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_note" + */ + public function testPropertyRefundNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_speed" + */ + public function testPropertyRefundSpeed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "refund_status" + */ + public function testPropertyRefundStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionPaymentSplitItemTest.php b/test/Model/SubscriptionPaymentSplitItemTest.php new file mode 100644 index 0000000..fbb65e1 --- /dev/null +++ b/test/Model/SubscriptionPaymentSplitItemTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vendor_id" + */ + public function testPropertyVendorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentage" + */ + public function testPropertyPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UpdateVendorResponseRelatedDocsInnerTest.php b/test/Model/UpdateVendorResponseRelatedDocsInnerTest.php new file mode 100644 index 0000000..7fb35a5 --- /dev/null +++ b/test/Model/UpdateVendorResponseRelatedDocsInnerTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vendor_id" + */ + public function testPropertyVendorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "doc_type" + */ + public function testPropertyDocType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "doc_value" + */ + public function testPropertyDocValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "remarks" + */ + public function testPropertyRemarks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UploadPnachImageResponseTest.php b/test/Model/UploadPnachImageResponseTest.php new file mode 100644 index 0000000..7bddf35 --- /dev/null +++ b/test/Model/UploadPnachImageResponseTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_id" + */ + public function testPropertyPaymentId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "authorization_status" + */ + public function testPropertyAuthorizationStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_message" + */ + public function testPropertyPaymentMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/VendorEntityTest.php b/test/Model/VendorEntityTest.php index b2af785..8f828e9 100644 --- a/test/Model/VendorEntityTest.php +++ b/test/Model/VendorEntityTest.php @@ -197,6 +197,15 @@ public function testPropertyBusinessType() $this->markTestIncomplete('Not implemented'); } + /** + * Test attribute "remarks" + */ + public function testPropertyRemarks() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + /** * Test attribute "related_docs" */