From 15b9b8182bb3764ef3f1fec158d892ef1c28f245 Mon Sep 17 00:00:00 2001 From: xendit-devx-bot Date: Wed, 20 Sep 2023 08:09:29 +0000 Subject: [PATCH] Generated Xendit go SDK --- .editorconfig | 12 - .env.example | 1 - .github/dependabot.yml | 6 + .github/workflows/coverage.yml | 41 - .github/workflows/generate-release-tag.yml | 27 + .github/workflows/lint.yml | 25 - .github/workflows/test.yml | 28 - .gitignore | 39 +- .openapi-generator-ignore | 23 + .openapi-generator/FILES | 38 + .openapi-generator/VERSION | 1 + .pre-commit-config.yaml | 26 - LICENSE | 4 +- Makefile | 14 - README.md | 220 +- account.go | 32 - account/account.go | 44 - account/account_test.go | 141 - account/client.go | 76 - account/params.go | 13 - apirequester.go | 82 - balance.go | 23 - balance/balance.go | 29 - balance/balance_test.go | 70 - balance/client.go | 51 - balance/example_test.go | 24 - balance/params.go | 24 - balance_and_transaction/api_balance.go | 159 + balance_and_transaction/api_transaction.go | 405 +++ balance_and_transaction/model_balance.go | 121 + .../model_channels_categories.go | 139 + balance_and_transaction/model_currency.go | 435 +++ .../model_date_range_filter.go | 169 ++ balance_and_transaction/model_fee_response.go | 260 ++ balance_and_transaction/model_link_item.go | 178 ++ balance_and_transaction/model_server_error.go | 175 ++ .../model_transaction_response.go | 608 ++++ .../model_transaction_response_type.go | 106 + .../model_transaction_statuses.go | 121 + .../model_transaction_types.go | 137 + .../model_transactions_response.go | 186 ++ .../model_validation_error.go | 212 ++ balance_and_transaction/nullable.go | 301 ++ card.go | 61 - card/card.go | 93 - card/card_test.go | 428 --- card/client.go | 171 -- card/example_test.go | 93 - card/params.go | 50 - cardlesscredit.go | 31 - cardlesscredit/cardlesscredit.go | 29 - cardlesscredit/cardlesscredit_test.go | 149 - cardlesscredit/client.go | 46 - cardlesscredit/example_test.go | 56 - cardlesscredit/params.go | 45 - client.go | 486 ++++ client/api.go | 108 - client/api_test.go | 26 - client/example_test.go | 25 - common/common.go | 143 + configuration.go | 213 ++ customer.go | 35 - customer/client.go | 87 - customer/customer.go | 44 - customer/customer_test.go | 248 -- customer/example_test.go | 59 - customer/params.go | 39 - directdebit.go | 140 - directdebit/directdebitpayment/client.go | 198 -- .../directdebitpayment/directdebitpayment.go | 74 - .../directdebitpayment_test.go | 715 ----- .../directdebitpayment/example_test.go | 105 - directdebit/directdebitpayment/params.go | 53 - directdebit/linkedaccount/client.go | 147 - directdebit/linkedaccount/example_test.go | 84 - directdebit/linkedaccount/linkedaccount.go | 74 - .../linkedaccount/linkedaccount_test.go | 315 -- directdebit/linkedaccount/params.go | 31 - directdebit/paymentmethod/client.go | 84 - directdebit/paymentmethod/example_test.go | 50 - directdebit/paymentmethod/params.go | 31 - directdebit/paymentmethod/paymentmethod.go | 44 - .../paymentmethod/paymentmethod_test.go | 230 -- disbursement.go | 101 - disbursement/client.go | 181 -- disbursement/disbursement.go | 89 - disbursement/disbursement_test.go | 434 --- disbursement/event.go | 16 - disbursement/event_test.go | 83 - disbursement/example_test.go | 103 - disbursement/params.go | 62 - disbursementph/client.go | 185 -- disbursementph/disbursement.go | 104 - disbursementph/disbursement_test.go | 561 ---- disbursementph/example_test.go | 127 - disbursementph/params.go | 69 - docs/BalanceApi.md | 91 + docs/InvoiceApi.md | 337 +++ docs/PaymentMethodApi.md | 755 +++++ docs/PaymentRequestApi.md | 550 ++++ docs/PayoutApi.md | 391 +++ docs/RefundApi.md | 287 ++ docs/TransactionApi.md | 228 ++ docs/balance_and_transaction.yaml | 1054 +++++++ docs/balance_and_transaction/Balance.md | 51 + .../ChannelsCategories.md | 37 + docs/balance_and_transaction/Currency.md | 333 +++ .../DateRangeFilter.md | 82 + docs/balance_and_transaction/FeeResponse.md | 150 + docs/balance_and_transaction/LinkItem.md | 93 + docs/balance_and_transaction/ServerError.md | 93 + .../TransactionResponse.md | 437 +++ .../TransactionResponseType.md | 30 + .../TransactionStatuses.md | 19 + .../TransactionTypes.md | 35 + .../TransactionsResponse.md | 98 + .../ValidationError.md | 129 + docs/header.jpg | Bin 0 -> 112861 bytes docs/invoice.yaml | 1405 +++++++++ docs/invoice/AddressObject.md | 282 ++ docs/invoice/AlternativeDisplayItem.md | 82 + docs/invoice/BadRequestError.md | 72 + docs/invoice/Bank.md | 197 ++ docs/invoice/BankCode.md | 23 + docs/invoice/CreateInvoiceRequest.md | 540 ++++ docs/invoice/CustomerObject.md | 318 ++ docs/invoice/DirectDebit.md | 51 + docs/invoice/DirectDebitType.md | 37 + docs/invoice/Ewallet.md | 51 + docs/invoice/EwalletType.md | 23 + docs/invoice/ForbiddenError.md | 72 + docs/invoice/Invoice.md | 803 ++++++ docs/invoice/InvoiceClientType.md | 21 + docs/invoice/InvoiceCurrency.md | 15 + .../InvoiceError404ResponseDefinition.md | 72 + docs/invoice/InvoiceFee.md | 72 + docs/invoice/InvoiceItem.md | 171 ++ docs/invoice/InvoiceNotFoundError.md | 72 + docs/invoice/InvoicePaymentMethod.md | 29 + docs/invoice/InvoiceStatus.md | 17 + docs/invoice/NotificationChannel.md | 17 + docs/invoice/NotificationPreference.md | 134 + docs/invoice/Paylater.md | 77 + docs/invoice/PaylaterType.md | 21 + docs/invoice/QrCode.md | 51 + docs/invoice/QrCodeType.md | 13 + docs/invoice/RetailOutlet.md | 129 + docs/invoice/RetailOutletName.md | 27 + docs/invoice/ServerError.md | 72 + docs/invoice/UnauthorizedError.md | 72 + docs/payment_method.yaml | 2408 ++++++++++++++++ docs/payment_method/BillingInformation.md | 231 ++ docs/payment_method/Card.md | 154 + docs/payment_method/CardChannelProperties.md | 174 ++ docs/payment_method/CardParameters.md | 113 + .../CardParametersCardInformation.md | 165 ++ .../payment_method/CardVerificationResults.md | 133 + .../CardVerificationResultsThreeDSecure.md | 210 ++ docs/payment_method/ChannelAmountLimits.md | 108 + .../ChannelAmountLimitsAllOf.md | 108 + docs/payment_method/ChannelProperty.md | 108 + docs/payment_method/ChannelPropertyAllOf.md | 108 + .../CreatePaymentMethod409Response.md | 82 + .../CreatePaymentMethod503Response.md | 82 + docs/payment_method/DirectDebit.md | 175 ++ docs/payment_method/DirectDebitAllOf.md | 123 + docs/payment_method/DirectDebitBankAccount.md | 174 ++ docs/payment_method/DirectDebitChannelCode.md | 135 + .../DirectDebitChannelProperties.md | 308 ++ docs/payment_method/DirectDebitDebitCard.md | 174 ++ docs/payment_method/DirectDebitParameters.md | 82 + docs/payment_method/DirectDebitType.md | 15 + docs/payment_method/EWallet.md | 103 + docs/payment_method/EWalletAccount.md | 174 ++ docs/payment_method/EWalletChannelCode.md | 49 + .../EWalletChannelProperties.md | 186 ++ docs/payment_method/EWalletParameters.md | 103 + .../GetAllPaymentMethods400Response.md | 82 + .../GetAllPaymentMethods403Response.md | 82 + .../GetAllPaymentMethods404Response.md | 82 + .../GetAllPaymentMethodsDefaultResponse.md | 82 + docs/payment_method/OverTheCounter.md | 134 + .../OverTheCounterChannelCode.md | 41 + .../OverTheCounterChannelProperties.md | 103 + .../OverTheCounterChannelPropertiesUpdate.md | 82 + .../OverTheCounterParameters.md | 134 + .../OverTheCounterUpdateParameters.md | 92 + docs/payment_method/PaymentChannel.md | 212 ++ docs/payment_method/PaymentChannelAllOf.md | 212 ++ docs/payment_method/PaymentChannelList.md | 108 + .../PaymentChannelListLinksInner.md | 108 + .../PaymentChannelListLinksInnerAllOf.md | 108 + docs/payment_method/PaymentMethod.md | 717 +++++ docs/payment_method/PaymentMethodAction.md | 134 + .../PaymentMethodAuthParameters.md | 51 + docs/payment_method/PaymentMethodCountry.md | 19 + .../PaymentMethodExpireParameters.md | 102 + docs/payment_method/PaymentMethodList.md | 77 + .../payment_method/PaymentMethodParameters.md | 434 +++ .../PaymentMethodReusability.md | 13 + docs/payment_method/PaymentMethodStatus.md | 21 + docs/payment_method/PaymentMethodType.md | 25 + .../PaymentMethodUpdateParameters.md | 186 ++ docs/payment_method/QRCode.md | 164 ++ docs/payment_method/QRCodeChannelCode.md | 19 + .../payment_method/QRCodeChannelProperties.md | 82 + docs/payment_method/QRCodeParameters.md | 164 ++ docs/payment_method/SimulatePaymentRequest.md | 56 + .../TokenizedCardInformation.md | 255 ++ docs/payment_method/VirtualAccount.md | 258 ++ docs/payment_method/VirtualAccountAllOf.md | 56 + .../VirtualAccountAlternativeDisplay.md | 82 + .../VirtualAccountChannelCode.md | 39 + .../VirtualAccountChannelProperties.md | 134 + .../VirtualAccountChannelPropertiesPatch.md | 82 + .../VirtualAccountParameters.md | 232 ++ .../VirtualAccountUpdateParameters.md | 190 ++ docs/payment_request.yaml | 2560 +++++++++++++++++ docs/payment_request/Capture.md | 385 +++ docs/payment_request/CaptureListResponse.md | 72 + docs/payment_request/CaptureParameters.md | 87 + docs/payment_request/Card.md | 129 + docs/payment_request/CardChannelProperties.md | 200 ++ docs/payment_request/CardInformation.md | 280 ++ .../CardVerificationResults.md | 128 + .../CardVerificationResultsThreeDSecure.md | 210 ++ docs/payment_request/DirectDebit.md | 175 ++ docs/payment_request/DirectDebitAllOf.md | 123 + .../payment_request/DirectDebitBankAccount.md | 102 + .../payment_request/DirectDebitChannelCode.md | 135 + .../DirectDebitChannelProperties.md | 238 ++ ...DirectDebitChannelPropertiesBankAccount.md | 134 + ...irectDebitChannelPropertiesBankRedirect.md | 108 + .../DirectDebitChannelPropertiesDebitCard.md | 160 ++ docs/payment_request/DirectDebitDebitCard.md | 200 ++ docs/payment_request/DirectDebitParameters.md | 108 + docs/payment_request/DirectDebitType.md | 15 + docs/payment_request/EWallet.md | 108 + docs/payment_request/EWalletAccount.md | 174 ++ docs/payment_request/EWalletAllOf.md | 56 + docs/payment_request/EWalletChannelCode.md | 47 + .../EWalletChannelProperties.md | 186 ++ docs/payment_request/EWalletParameters.md | 82 + docs/payment_request/Error.md | 102 + docs/payment_request/OverTheCounter.md | 134 + .../OverTheCounterChannelCode.md | 41 + .../OverTheCounterChannelProperties.md | 103 + .../OverTheCounterParameters.md | 134 + docs/payment_request/PaymentMethod.md | 480 ++++ .../PaymentMethodParameters.md | 314 ++ .../PaymentMethodReusability.md | 13 + docs/payment_request/PaymentMethodStatus.md | 19 + docs/payment_request/PaymentMethodType.md | 21 + docs/payment_request/PaymentRequest.md | 708 +++++ docs/payment_request/PaymentRequestAction.md | 165 ++ .../PaymentRequestAuthParameters.md | 51 + .../PaymentRequestBasketItem.md | 343 +++ .../PaymentRequestCaptureMethod.md | 13 + .../PaymentRequestCardVerificationResults.md | 133 + ...stCardVerificationResultsThreeDeeSecure.md | 170 ++ .../PaymentRequestChannelProperties.md | 222 ++ docs/payment_request/PaymentRequestCountry.md | 19 + .../payment_request/PaymentRequestCurrency.md | 19 + .../PaymentRequestInitiator.md | 13 + .../PaymentRequestListResponse.md | 72 + .../PaymentRequestParameters.md | 469 +++ ...ymentRequestParametersChannelProperties.md | 248 ++ ...RequestParametersChannelPropertiesAllOf.md | 56 + .../PaymentRequestShippingInformation.md | 181 ++ docs/payment_request/PaymentRequestStatus.md | 25 + docs/payment_request/QRCode.md | 92 + docs/payment_request/QRCodeChannelCode.md | 17 + .../QRCodeChannelProperties.md | 82 + docs/payment_request/QRCodeParameters.md | 92 + docs/payment_request/VirtualAccount.md | 258 ++ docs/payment_request/VirtualAccountAllOf.md | 56 + .../VirtualAccountAlternativeDisplay.md | 82 + .../VirtualAccountChannelCode.md | 39 + .../VirtualAccountChannelProperties.md | 129 + .../VirtualAccountParameters.md | 232 ++ docs/payout.yaml | 837 ++++++ docs/payout/Channel.md | 135 + docs/payout/ChannelAccountType.md | 19 + docs/payout/ChannelAmountLimits.md | 93 + docs/payout/ChannelCategory.md | 15 + docs/payout/CreatePayoutRequest.md | 213 ++ docs/payout/DigitalPayoutChannelProperties.md | 113 + docs/payout/Error.md | 98 + docs/payout/ErrorErrorsInner.md | 72 + docs/payout/GetPayouts200Response.md | 108 + docs/payout/GetPayouts200ResponseDataInner.md | 370 +++ docs/payout/GetPayouts200ResponseLinks.md | 108 + docs/payout/Payout.md | 370 +++ docs/payout/PayoutAllOf.md | 187 ++ docs/payout/ReceiptNotification.md | 138 + docs/refund.yaml | 479 +++ docs/refund/CreateRefund.md | 222 ++ docs/refund/CreateRefund400Response.md | 82 + docs/refund/CreateRefund403Response.md | 82 + docs/refund/CreateRefund404Response.md | 82 + docs/refund/CreateRefund409Response.md | 82 + docs/refund/CreateRefund503Response.md | 82 + docs/refund/CreateRefundDefaultResponse.md | 82 + docs/refund/Refund.md | 382 +++ docs/refund/RefundList.md | 77 + error.go | 57 - ewallet.go | 121 - ewallet/client.go | 184 -- ewallet/ewallet.go | 74 - ewallet/ewallet_test.go | 514 ---- ewallet/example_test.go | 100 - ewallet/params.go | 71 - example/balance/main.go | 29 - example/card/main.go | 87 - example/cardlesscredit/main.go | 60 - example/customer/main.go | 59 - example/directdebit/main.go | 178 -- example/disbursement/main.go | 88 - example/ewallet/main.go | 91 - example/invoice/main.go | 56 - example/payout/main.go | 49 - example/qrcode/main.go | 44 - example/recurringpayment/main.go | 86 - example/report/main.go | 44 - example/retailoutlet/main.go | 68 - example/transaction/main.go | 41 - example/virtualaccount/main.go | 73 - example_test.go | 63 - go.mod | 13 +- go.sum | 34 +- integration_test/account.go | 43 - integration_test/balance.go | 20 - integration_test/card.go | 18 - integration_test/cardlesscredit.go | 52 - integration_test/customer.go | 51 - integration_test/directdebit.go | 181 -- integration_test/disbursement.go | 73 - integration_test/ewallet.go | 119 - integration_test/invoice.go | 40 - integration_test/main.go | 46 - integration_test/paymentmethod.go | 30 - integration_test/payout.go | 38 - integration_test/promotion.go | 64 - integration_test/qrcode.go | 33 - integration_test/recurringpayment.go | 95 - integration_test/report.go | 28 - integration_test/retailoutlet.go | 48 - integration_test/transaction.go | 26 - integration_test/virtualaccount.go | 47 - invoice.go | 123 - invoice/api_invoice.go | 581 ++++ invoice/client.go | 156 - invoice/event.go | 44 - invoice/event_test.go | 203 -- invoice/example_test.go | 77 - invoice/invoice.go | 74 - invoice/invoice_test.go | 291 -- invoice/model_address_object.go | 423 +++ invoice/model_alternative_display_item.go | 168 ++ invoice/model_bad_request_error.go | 150 + invoice/model_bank.go | 324 +++ invoice/model_bank_code.go | 125 + invoice/model_create_invoice_request.go | 814 ++++++ invoice/model_customer_object.go | 461 +++ invoice/model_direct_debit.go | 121 + invoice/model_direct_debit_type.go | 139 + invoice/model_ewallet.go | 121 + invoice/model_ewallet_type.go | 125 + invoice/model_forbidden_error.go | 150 + invoice/model_invoice.go | 1158 ++++++++ invoice/model_invoice_client_type.go | 123 + invoice/model_invoice_currency.go | 117 + ...el_invoice_error404_response_definition.go | 150 + invoice/model_invoice_fee.go | 150 + invoice/model_invoice_item.go | 289 ++ invoice/model_invoice_not_found_error.go | 150 + invoice/model_invoice_payment_method.go | 131 + invoice/model_invoice_status.go | 119 + invoice/model_notification_channel.go | 119 + invoice/model_notification_preference.go | 242 ++ invoice/model_paylater.go | 158 + invoice/model_paylater_type.go | 123 + invoice/model_qr_code.go | 121 + invoice/model_qr_code_type.go | 115 + invoice/model_retail_outlet.go | 232 ++ invoice/model_retail_outlet_name.go | 129 + invoice/model_server_error.go | 148 + invoice/model_unauthorized_error.go | 150 + invoice/nullable.go | 301 ++ invoice/params.go | 94 - newhttprequest_113.go | 18 - newhttprequest_pre113.go | 22 - payment_method.go | 113 - payment_method/api_payment_method.go | 1288 +++++++++ payment_method/model_billing_information.go | 351 +++ payment_method/model_card.go | 234 ++ .../model_card_channel_properties.go | 282 ++ payment_method/model_card_parameters.go | 203 ++ .../model_card_parameters_card_information.go | 270 ++ .../model_card_verification_results.go | 215 ++ ...ard_verification_results_three_d_secure.go | 324 +++ payment_method/model_channel_amount_limits.go | 205 ++ .../model_channel_amount_limits_all_of.go | 205 ++ payment_method/model_channel_property.go | 205 ++ .../model_channel_property_all_of.go | 205 ++ ...odel_create_payment_method_409_response.go | 166 ++ ...odel_create_payment_method_503_response.go | 166 ++ payment_method/model_direct_debit.go | 269 ++ payment_method/model_direct_debit_all_of.go | 213 ++ .../model_direct_debit_bank_account.go | 280 ++ .../model_direct_debit_channel_code.go | 237 ++ .../model_direct_debit_channel_properties.go | 457 +++ .../model_direct_debit_debit_card.go | 282 ++ .../model_direct_debit_parameters.go | 150 + payment_method/model_direct_debit_type.go | 117 + payment_method/model_e_wallet.go | 193 ++ payment_method/model_e_wallet_account.go | 282 ++ payment_method/model_e_wallet_channel_code.go | 151 + .../model_e_wallet_channel_properties.go | 316 ++ payment_method/model_e_wallet_parameters.go | 193 ++ ...el_get_all_payment_methods_400_response.go | 166 ++ ...el_get_all_payment_methods_403_response.go | 166 ++ ...el_get_all_payment_methods_404_response.go | 166 ++ ...et_all_payment_methods_default_response.go | 166 ++ payment_method/model_over_the_counter.go | 230 ++ .../model_over_the_counter_channel_code.go | 143 + ...del_over_the_counter_channel_properties.go | 197 ++ ...r_the_counter_channel_properties_update.go | 169 ++ .../model_over_the_counter_parameters.go | 230 ++ ...odel_over_the_counter_update_parameters.go | 176 ++ payment_method/model_payment_channel.go | 351 +++ .../model_payment_channel_all_of.go | 351 +++ payment_method/model_payment_channel_list.go | 205 ++ .../model_payment_channel_list_links_inner.go | 205 ++ ...payment_channel_list_links_inner_all_of.go | 205 ++ payment_method/model_payment_method.go | 980 +++++++ payment_method/model_payment_method_action.go | 238 ++ .../model_payment_method_auth_parameters.go | 121 + .../model_payment_method_country.go | 121 + .../model_payment_method_expire_parameters.go | 188 ++ payment_method/model_payment_method_list.go | 157 + .../model_payment_method_parameters.go | 621 ++++ .../model_payment_method_reusability.go | 115 + payment_method/model_payment_method_status.go | 123 + payment_method/model_payment_method_type.go | 127 + .../model_payment_method_update_parameters.go | 310 ++ payment_method/model_qr_code.go | 268 ++ payment_method/model_qr_code_channel_code.go | 121 + .../model_qr_code_channel_properties.go | 168 ++ payment_method/model_qr_code_parameters.go | 268 ++ .../model_simulate_payment_request.go | 130 + .../model_tokenized_card_information.go | 392 +++ payment_method/model_virtual_account.go | 395 +++ .../model_virtual_account_all_of.go | 130 + ...del_virtual_account_alternative_display.go | 168 ++ .../model_virtual_account_channel_code.go | 141 + ...odel_virtual_account_channel_properties.go | 243 ++ ...irtual_account_channel_properties_patch.go | 169 ++ .../model_virtual_account_parameters.go | 359 +++ ...model_virtual_account_update_parameters.go | 305 ++ payment_method/nullable.go | 301 ++ payment_request/api_payment_request.go | 882 ++++++ payment_request/model_capture.go | 511 ++++ .../model_capture_list_response.go | 148 + payment_request/model_capture_parameters.go | 167 ++ payment_request/model_card.go | 221 ++ .../model_card_channel_properties.go | 319 ++ payment_request/model_card_information.go | 432 +++ .../model_card_verification_results.go | 222 ++ ...ard_verification_results_three_d_secure.go | 324 +++ payment_request/model_direct_debit.go | 269 ++ payment_request/model_direct_debit_all_of.go | 213 ++ .../model_direct_debit_bank_account.go | 186 ++ .../model_direct_debit_channel_code.go | 237 ++ .../model_direct_debit_channel_properties.go | 129 + ...t_debit_channel_properties_bank_account.go | 238 ++ ..._debit_channel_properties_bank_redirect.go | 203 ++ ...ect_debit_channel_properties_debit_card.go | 278 ++ .../model_direct_debit_debit_card.go | 318 ++ .../model_direct_debit_parameters.go | 186 ++ payment_request/model_direct_debit_type.go | 117 + payment_request/model_e_wallet.go | 202 ++ payment_request/model_e_wallet_account.go | 282 ++ payment_request/model_e_wallet_all_of.go | 130 + .../model_e_wallet_channel_code.go | 149 + .../model_e_wallet_channel_properties.go | 314 ++ payment_request/model_e_wallet_parameters.go | 166 ++ payment_request/model_error.go | 186 ++ payment_request/model_over_the_counter.go | 230 ++ .../model_over_the_counter_channel_code.go | 143 + ...del_over_the_counter_channel_properties.go | 197 ++ .../model_over_the_counter_parameters.go | 230 ++ payment_request/model_payment_method.go | 669 +++++ .../model_payment_method_parameters.go | 460 +++ .../model_payment_method_reusability.go | 115 + .../model_payment_method_status.go | 121 + payment_request/model_payment_method_type.go | 123 + payment_request/model_payment_request.go | 943 ++++++ .../model_payment_request_action.go | 235 ++ .../model_payment_request_auth_parameters.go | 121 + .../model_payment_request_basket_item.go | 517 ++++ .../model_payment_request_capture_method.go | 115 + ...yment_request_card_verification_results.go | 215 ++ ...d_verification_results_three_dee_secure.go | 284 ++ ...odel_payment_request_channel_properties.go | 363 +++ .../model_payment_request_country.go | 121 + .../model_payment_request_currency.go | 121 + .../model_payment_request_initiator.go | 115 + .../model_payment_request_list_response.go | 148 + .../model_payment_request_parameters.go | 642 +++++ ...t_request_parameters_channel_properties.go | 400 +++ ...st_parameters_channel_properties_all_of.go | 131 + ...el_payment_request_shipping_information.go | 301 ++ .../model_payment_request_status.go | 127 + payment_request/model_qr_code.go | 176 ++ payment_request/model_qr_code_channel_code.go | 119 + .../model_qr_code_channel_properties.go | 167 ++ payment_request/model_qr_code_parameters.go | 176 ++ payment_request/model_virtual_account.go | 395 +++ .../model_virtual_account_all_of.go | 130 + ...del_virtual_account_alternative_display.go | 168 ++ .../model_virtual_account_channel_code.go | 141 + ...odel_virtual_account_channel_properties.go | 234 ++ .../model_virtual_account_parameters.go | 359 +++ payment_request/nullable.go | 301 ++ payout.go | 26 - payout/api_payout.go | 612 ++++ payout/client.go | 107 - payout/example_test.go | 52 - payout/model_channel.go | 232 ++ payout/model_channel_account_type.go | 121 + payout/model_channel_amount_limits.go | 178 ++ payout/model_channel_category.go | 117 + payout/model_create_payout_request.go | 343 +++ ...model_digital_payout_channel_properties.go | 205 ++ payout/model_error.go | 186 ++ payout/model_error_errors_inner.go | 150 + payout/model_get_payouts_200_response.go | 202 ++ ...del_get_payouts_200_response_data_inner.go | 88 + .../model_get_payouts_200_response_links.go | 202 ++ payout/model_payout.go | 558 ++++ payout/model_payout_all_of.go | 309 ++ payout/model_receipt_notification.go | 208 ++ payout/nullable.go | 301 ++ payout/params.go | 19 - payout/payout.go | 59 - payout/payout_test.go | 220 -- pmsv2/card/params.go | 42 - pmsv2/client.go | 300 -- pmsv2/constant/params.go | 41 - pmsv2/directdebit/params.go | 46 - pmsv2/ewallet/params.go | 31 - pmsv2/example_test.go | 100 - pmsv2/overthecounter/params.go | 55 - pmsv2/params.go | 108 - pmsv2/payment_method.go | 105 - pmsv2/payment_method_test.go | 443 --- pmsv2/qrcode/params.go | 33 - pmsv2/virtualaccount/params.go | 49 - promotion.go | 30 - promotion/client.go | 131 - promotion/example_test.go | 91 - promotion/params.go | 75 - promotion/promotion.go | 74 - promotion/promotion_test.go | 401 --- qrcode.go | 45 - qrcode/client.go | 113 - qrcode/example_test.go | 56 - qrcode/params.go | 51 - qrcode/qrcode.go | 59 - qrcode/qrcode_test.go | 251 -- recurringpayment.go | 91 - recurringpayment/client.go | 195 -- recurringpayment/example_test.go | 107 - recurringpayment/params.go | 63 - recurringpayment/recurringpayment.go | 104 - recurringpayment/recurringpayment_test.go | 475 --- refund/api_refund.go | 453 +++ refund/model_create_refund.go | 347 +++ refund/model_create_refund_400_response.go | 166 ++ refund/model_create_refund_403_response.go | 166 ++ refund/model_create_refund_404_response.go | 166 ++ refund/model_create_refund_409_response.go | 166 ++ refund/model_create_refund_503_response.go | 166 ++ .../model_create_refund_default_response.go | 166 ++ refund/model_refund.go | 557 ++++ refund/model_refund_list.go | 157 + refund/nullable.go | 301 ++ report.go | 21 - report/client.go | 82 - report/example_test.go | 40 - report/params.go | 20 - report/report.go | 43 - report/report_test.go | 171 -- response.go | 38 + retailoutlet.go | 66 - retailoutlet/client.go | 148 - retailoutlet/example_test.go | 77 - retailoutlet/params.go | 40 - retailoutlet/retailoutlet.go | 74 - retailoutlet/retailoutlet_test.go | 351 --- test/api_balance_test.go | 42 + test/api_invoice_test.go | 76 + test/api_payment_method_test.go | 133 + test/api_payment_request_test.go | 112 + test/api_payout_test.go | 86 + test/api_refund_test.go | 76 + test/api_transaction_test.go | 54 + transaction.go | 48 - transaction/client.go | 89 - transaction/example_test.go | 39 - transaction/params.go | 27 - transaction/transaction.go | 44 - transaction/transaction_test.go | 285 -- utils/helpers.go | 184 ++ utils/urlvalues/urlvalues.go | 25 - utils/urlvalues/urlvalues_test.go | 76 - utils/utils.go | 49 + utils/validator/validator.go | 47 - utils/validator/validator_test.go | 55 - virtualaccount.go | 50 - virtualaccount/client.go | 177 -- virtualaccount/example_test.go | 86 - virtualaccount/params.go | 41 - virtualaccount/virtualaccount.go | 89 - virtualaccount/virtualaccount_test.go | 414 --- xendit.go | 52 - 627 files changed, 91774 insertions(+), 18943 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .env.example create mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/generate-release-tag.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION delete mode 100644 .pre-commit-config.yaml delete mode 100644 Makefile delete mode 100644 account.go delete mode 100644 account/account.go delete mode 100644 account/account_test.go delete mode 100644 account/client.go delete mode 100644 account/params.go delete mode 100644 apirequester.go delete mode 100644 balance.go delete mode 100644 balance/balance.go delete mode 100644 balance/balance_test.go delete mode 100644 balance/client.go delete mode 100644 balance/example_test.go delete mode 100644 balance/params.go create mode 100644 balance_and_transaction/api_balance.go create mode 100644 balance_and_transaction/api_transaction.go create mode 100644 balance_and_transaction/model_balance.go create mode 100644 balance_and_transaction/model_channels_categories.go create mode 100644 balance_and_transaction/model_currency.go create mode 100644 balance_and_transaction/model_date_range_filter.go create mode 100644 balance_and_transaction/model_fee_response.go create mode 100644 balance_and_transaction/model_link_item.go create mode 100644 balance_and_transaction/model_server_error.go create mode 100644 balance_and_transaction/model_transaction_response.go create mode 100644 balance_and_transaction/model_transaction_response_type.go create mode 100644 balance_and_transaction/model_transaction_statuses.go create mode 100644 balance_and_transaction/model_transaction_types.go create mode 100644 balance_and_transaction/model_transactions_response.go create mode 100644 balance_and_transaction/model_validation_error.go create mode 100644 balance_and_transaction/nullable.go delete mode 100644 card.go delete mode 100644 card/card.go delete mode 100644 card/card_test.go delete mode 100644 card/client.go delete mode 100644 card/example_test.go delete mode 100644 card/params.go delete mode 100644 cardlesscredit.go delete mode 100644 cardlesscredit/cardlesscredit.go delete mode 100644 cardlesscredit/cardlesscredit_test.go delete mode 100644 cardlesscredit/client.go delete mode 100644 cardlesscredit/example_test.go delete mode 100644 cardlesscredit/params.go create mode 100644 client.go delete mode 100644 client/api.go delete mode 100644 client/api_test.go delete mode 100644 client/example_test.go create mode 100644 common/common.go create mode 100644 configuration.go delete mode 100644 customer.go delete mode 100644 customer/client.go delete mode 100644 customer/customer.go delete mode 100644 customer/customer_test.go delete mode 100644 customer/example_test.go delete mode 100644 customer/params.go delete mode 100644 directdebit.go delete mode 100644 directdebit/directdebitpayment/client.go delete mode 100644 directdebit/directdebitpayment/directdebitpayment.go delete mode 100644 directdebit/directdebitpayment/directdebitpayment_test.go delete mode 100644 directdebit/directdebitpayment/example_test.go delete mode 100644 directdebit/directdebitpayment/params.go delete mode 100644 directdebit/linkedaccount/client.go delete mode 100644 directdebit/linkedaccount/example_test.go delete mode 100644 directdebit/linkedaccount/linkedaccount.go delete mode 100644 directdebit/linkedaccount/linkedaccount_test.go delete mode 100644 directdebit/linkedaccount/params.go delete mode 100644 directdebit/paymentmethod/client.go delete mode 100644 directdebit/paymentmethod/example_test.go delete mode 100644 directdebit/paymentmethod/params.go delete mode 100644 directdebit/paymentmethod/paymentmethod.go delete mode 100644 directdebit/paymentmethod/paymentmethod_test.go delete mode 100644 disbursement.go delete mode 100644 disbursement/client.go delete mode 100644 disbursement/disbursement.go delete mode 100644 disbursement/disbursement_test.go delete mode 100644 disbursement/event.go delete mode 100644 disbursement/event_test.go delete mode 100644 disbursement/example_test.go delete mode 100644 disbursement/params.go delete mode 100644 disbursementph/client.go delete mode 100644 disbursementph/disbursement.go delete mode 100644 disbursementph/disbursement_test.go delete mode 100644 disbursementph/example_test.go delete mode 100644 disbursementph/params.go create mode 100644 docs/BalanceApi.md create mode 100644 docs/InvoiceApi.md create mode 100644 docs/PaymentMethodApi.md create mode 100644 docs/PaymentRequestApi.md create mode 100644 docs/PayoutApi.md create mode 100644 docs/RefundApi.md create mode 100644 docs/TransactionApi.md create mode 100644 docs/balance_and_transaction.yaml create mode 100644 docs/balance_and_transaction/Balance.md create mode 100644 docs/balance_and_transaction/ChannelsCategories.md create mode 100644 docs/balance_and_transaction/Currency.md create mode 100644 docs/balance_and_transaction/DateRangeFilter.md create mode 100644 docs/balance_and_transaction/FeeResponse.md create mode 100644 docs/balance_and_transaction/LinkItem.md create mode 100644 docs/balance_and_transaction/ServerError.md create mode 100644 docs/balance_and_transaction/TransactionResponse.md create mode 100644 docs/balance_and_transaction/TransactionResponseType.md create mode 100644 docs/balance_and_transaction/TransactionStatuses.md create mode 100644 docs/balance_and_transaction/TransactionTypes.md create mode 100644 docs/balance_and_transaction/TransactionsResponse.md create mode 100644 docs/balance_and_transaction/ValidationError.md create mode 100644 docs/header.jpg create mode 100644 docs/invoice.yaml create mode 100644 docs/invoice/AddressObject.md create mode 100644 docs/invoice/AlternativeDisplayItem.md create mode 100644 docs/invoice/BadRequestError.md create mode 100644 docs/invoice/Bank.md create mode 100644 docs/invoice/BankCode.md create mode 100644 docs/invoice/CreateInvoiceRequest.md create mode 100644 docs/invoice/CustomerObject.md create mode 100644 docs/invoice/DirectDebit.md create mode 100644 docs/invoice/DirectDebitType.md create mode 100644 docs/invoice/Ewallet.md create mode 100644 docs/invoice/EwalletType.md create mode 100644 docs/invoice/ForbiddenError.md create mode 100644 docs/invoice/Invoice.md create mode 100644 docs/invoice/InvoiceClientType.md create mode 100644 docs/invoice/InvoiceCurrency.md create mode 100644 docs/invoice/InvoiceError404ResponseDefinition.md create mode 100644 docs/invoice/InvoiceFee.md create mode 100644 docs/invoice/InvoiceItem.md create mode 100644 docs/invoice/InvoiceNotFoundError.md create mode 100644 docs/invoice/InvoicePaymentMethod.md create mode 100644 docs/invoice/InvoiceStatus.md create mode 100644 docs/invoice/NotificationChannel.md create mode 100644 docs/invoice/NotificationPreference.md create mode 100644 docs/invoice/Paylater.md create mode 100644 docs/invoice/PaylaterType.md create mode 100644 docs/invoice/QrCode.md create mode 100644 docs/invoice/QrCodeType.md create mode 100644 docs/invoice/RetailOutlet.md create mode 100644 docs/invoice/RetailOutletName.md create mode 100644 docs/invoice/ServerError.md create mode 100644 docs/invoice/UnauthorizedError.md create mode 100644 docs/payment_method.yaml create mode 100644 docs/payment_method/BillingInformation.md create mode 100644 docs/payment_method/Card.md create mode 100644 docs/payment_method/CardChannelProperties.md create mode 100644 docs/payment_method/CardParameters.md create mode 100644 docs/payment_method/CardParametersCardInformation.md create mode 100644 docs/payment_method/CardVerificationResults.md create mode 100644 docs/payment_method/CardVerificationResultsThreeDSecure.md create mode 100644 docs/payment_method/ChannelAmountLimits.md create mode 100644 docs/payment_method/ChannelAmountLimitsAllOf.md create mode 100644 docs/payment_method/ChannelProperty.md create mode 100644 docs/payment_method/ChannelPropertyAllOf.md create mode 100644 docs/payment_method/CreatePaymentMethod409Response.md create mode 100644 docs/payment_method/CreatePaymentMethod503Response.md create mode 100644 docs/payment_method/DirectDebit.md create mode 100644 docs/payment_method/DirectDebitAllOf.md create mode 100644 docs/payment_method/DirectDebitBankAccount.md create mode 100644 docs/payment_method/DirectDebitChannelCode.md create mode 100644 docs/payment_method/DirectDebitChannelProperties.md create mode 100644 docs/payment_method/DirectDebitDebitCard.md create mode 100644 docs/payment_method/DirectDebitParameters.md create mode 100644 docs/payment_method/DirectDebitType.md create mode 100644 docs/payment_method/EWallet.md create mode 100644 docs/payment_method/EWalletAccount.md create mode 100644 docs/payment_method/EWalletChannelCode.md create mode 100644 docs/payment_method/EWalletChannelProperties.md create mode 100644 docs/payment_method/EWalletParameters.md create mode 100644 docs/payment_method/GetAllPaymentMethods400Response.md create mode 100644 docs/payment_method/GetAllPaymentMethods403Response.md create mode 100644 docs/payment_method/GetAllPaymentMethods404Response.md create mode 100644 docs/payment_method/GetAllPaymentMethodsDefaultResponse.md create mode 100644 docs/payment_method/OverTheCounter.md create mode 100644 docs/payment_method/OverTheCounterChannelCode.md create mode 100644 docs/payment_method/OverTheCounterChannelProperties.md create mode 100644 docs/payment_method/OverTheCounterChannelPropertiesUpdate.md create mode 100644 docs/payment_method/OverTheCounterParameters.md create mode 100644 docs/payment_method/OverTheCounterUpdateParameters.md create mode 100644 docs/payment_method/PaymentChannel.md create mode 100644 docs/payment_method/PaymentChannelAllOf.md create mode 100644 docs/payment_method/PaymentChannelList.md create mode 100644 docs/payment_method/PaymentChannelListLinksInner.md create mode 100644 docs/payment_method/PaymentChannelListLinksInnerAllOf.md create mode 100644 docs/payment_method/PaymentMethod.md create mode 100644 docs/payment_method/PaymentMethodAction.md create mode 100644 docs/payment_method/PaymentMethodAuthParameters.md create mode 100644 docs/payment_method/PaymentMethodCountry.md create mode 100644 docs/payment_method/PaymentMethodExpireParameters.md create mode 100644 docs/payment_method/PaymentMethodList.md create mode 100644 docs/payment_method/PaymentMethodParameters.md create mode 100644 docs/payment_method/PaymentMethodReusability.md create mode 100644 docs/payment_method/PaymentMethodStatus.md create mode 100644 docs/payment_method/PaymentMethodType.md create mode 100644 docs/payment_method/PaymentMethodUpdateParameters.md create mode 100644 docs/payment_method/QRCode.md create mode 100644 docs/payment_method/QRCodeChannelCode.md create mode 100644 docs/payment_method/QRCodeChannelProperties.md create mode 100644 docs/payment_method/QRCodeParameters.md create mode 100644 docs/payment_method/SimulatePaymentRequest.md create mode 100644 docs/payment_method/TokenizedCardInformation.md create mode 100644 docs/payment_method/VirtualAccount.md create mode 100644 docs/payment_method/VirtualAccountAllOf.md create mode 100644 docs/payment_method/VirtualAccountAlternativeDisplay.md create mode 100644 docs/payment_method/VirtualAccountChannelCode.md create mode 100644 docs/payment_method/VirtualAccountChannelProperties.md create mode 100644 docs/payment_method/VirtualAccountChannelPropertiesPatch.md create mode 100644 docs/payment_method/VirtualAccountParameters.md create mode 100644 docs/payment_method/VirtualAccountUpdateParameters.md create mode 100644 docs/payment_request.yaml create mode 100644 docs/payment_request/Capture.md create mode 100644 docs/payment_request/CaptureListResponse.md create mode 100644 docs/payment_request/CaptureParameters.md create mode 100644 docs/payment_request/Card.md create mode 100644 docs/payment_request/CardChannelProperties.md create mode 100644 docs/payment_request/CardInformation.md create mode 100644 docs/payment_request/CardVerificationResults.md create mode 100644 docs/payment_request/CardVerificationResultsThreeDSecure.md create mode 100644 docs/payment_request/DirectDebit.md create mode 100644 docs/payment_request/DirectDebitAllOf.md create mode 100644 docs/payment_request/DirectDebitBankAccount.md create mode 100644 docs/payment_request/DirectDebitChannelCode.md create mode 100644 docs/payment_request/DirectDebitChannelProperties.md create mode 100644 docs/payment_request/DirectDebitChannelPropertiesBankAccount.md create mode 100644 docs/payment_request/DirectDebitChannelPropertiesBankRedirect.md create mode 100644 docs/payment_request/DirectDebitChannelPropertiesDebitCard.md create mode 100644 docs/payment_request/DirectDebitDebitCard.md create mode 100644 docs/payment_request/DirectDebitParameters.md create mode 100644 docs/payment_request/DirectDebitType.md create mode 100644 docs/payment_request/EWallet.md create mode 100644 docs/payment_request/EWalletAccount.md create mode 100644 docs/payment_request/EWalletAllOf.md create mode 100644 docs/payment_request/EWalletChannelCode.md create mode 100644 docs/payment_request/EWalletChannelProperties.md create mode 100644 docs/payment_request/EWalletParameters.md create mode 100644 docs/payment_request/Error.md create mode 100644 docs/payment_request/OverTheCounter.md create mode 100644 docs/payment_request/OverTheCounterChannelCode.md create mode 100644 docs/payment_request/OverTheCounterChannelProperties.md create mode 100644 docs/payment_request/OverTheCounterParameters.md create mode 100644 docs/payment_request/PaymentMethod.md create mode 100644 docs/payment_request/PaymentMethodParameters.md create mode 100644 docs/payment_request/PaymentMethodReusability.md create mode 100644 docs/payment_request/PaymentMethodStatus.md create mode 100644 docs/payment_request/PaymentMethodType.md create mode 100644 docs/payment_request/PaymentRequest.md create mode 100644 docs/payment_request/PaymentRequestAction.md create mode 100644 docs/payment_request/PaymentRequestAuthParameters.md create mode 100644 docs/payment_request/PaymentRequestBasketItem.md create mode 100644 docs/payment_request/PaymentRequestCaptureMethod.md create mode 100644 docs/payment_request/PaymentRequestCardVerificationResults.md create mode 100644 docs/payment_request/PaymentRequestCardVerificationResultsThreeDeeSecure.md create mode 100644 docs/payment_request/PaymentRequestChannelProperties.md create mode 100644 docs/payment_request/PaymentRequestCountry.md create mode 100644 docs/payment_request/PaymentRequestCurrency.md create mode 100644 docs/payment_request/PaymentRequestInitiator.md create mode 100644 docs/payment_request/PaymentRequestListResponse.md create mode 100644 docs/payment_request/PaymentRequestParameters.md create mode 100644 docs/payment_request/PaymentRequestParametersChannelProperties.md create mode 100644 docs/payment_request/PaymentRequestParametersChannelPropertiesAllOf.md create mode 100644 docs/payment_request/PaymentRequestShippingInformation.md create mode 100644 docs/payment_request/PaymentRequestStatus.md create mode 100644 docs/payment_request/QRCode.md create mode 100644 docs/payment_request/QRCodeChannelCode.md create mode 100644 docs/payment_request/QRCodeChannelProperties.md create mode 100644 docs/payment_request/QRCodeParameters.md create mode 100644 docs/payment_request/VirtualAccount.md create mode 100644 docs/payment_request/VirtualAccountAllOf.md create mode 100644 docs/payment_request/VirtualAccountAlternativeDisplay.md create mode 100644 docs/payment_request/VirtualAccountChannelCode.md create mode 100644 docs/payment_request/VirtualAccountChannelProperties.md create mode 100644 docs/payment_request/VirtualAccountParameters.md create mode 100644 docs/payout.yaml create mode 100644 docs/payout/Channel.md create mode 100644 docs/payout/ChannelAccountType.md create mode 100644 docs/payout/ChannelAmountLimits.md create mode 100644 docs/payout/ChannelCategory.md create mode 100644 docs/payout/CreatePayoutRequest.md create mode 100644 docs/payout/DigitalPayoutChannelProperties.md create mode 100644 docs/payout/Error.md create mode 100644 docs/payout/ErrorErrorsInner.md create mode 100644 docs/payout/GetPayouts200Response.md create mode 100644 docs/payout/GetPayouts200ResponseDataInner.md create mode 100644 docs/payout/GetPayouts200ResponseLinks.md create mode 100644 docs/payout/Payout.md create mode 100644 docs/payout/PayoutAllOf.md create mode 100644 docs/payout/ReceiptNotification.md create mode 100644 docs/refund.yaml create mode 100644 docs/refund/CreateRefund.md create mode 100644 docs/refund/CreateRefund400Response.md create mode 100644 docs/refund/CreateRefund403Response.md create mode 100644 docs/refund/CreateRefund404Response.md create mode 100644 docs/refund/CreateRefund409Response.md create mode 100644 docs/refund/CreateRefund503Response.md create mode 100644 docs/refund/CreateRefundDefaultResponse.md create mode 100644 docs/refund/Refund.md create mode 100644 docs/refund/RefundList.md delete mode 100644 error.go delete mode 100644 ewallet.go delete mode 100644 ewallet/client.go delete mode 100644 ewallet/ewallet.go delete mode 100644 ewallet/ewallet_test.go delete mode 100644 ewallet/example_test.go delete mode 100644 ewallet/params.go delete mode 100644 example/balance/main.go delete mode 100644 example/card/main.go delete mode 100644 example/cardlesscredit/main.go delete mode 100644 example/customer/main.go delete mode 100644 example/directdebit/main.go delete mode 100644 example/disbursement/main.go delete mode 100644 example/ewallet/main.go delete mode 100644 example/invoice/main.go delete mode 100644 example/payout/main.go delete mode 100644 example/qrcode/main.go delete mode 100644 example/recurringpayment/main.go delete mode 100644 example/report/main.go delete mode 100644 example/retailoutlet/main.go delete mode 100644 example/transaction/main.go delete mode 100644 example/virtualaccount/main.go delete mode 100644 example_test.go delete mode 100644 integration_test/account.go delete mode 100644 integration_test/balance.go delete mode 100644 integration_test/card.go delete mode 100644 integration_test/cardlesscredit.go delete mode 100644 integration_test/customer.go delete mode 100644 integration_test/directdebit.go delete mode 100644 integration_test/disbursement.go delete mode 100644 integration_test/ewallet.go delete mode 100644 integration_test/invoice.go delete mode 100644 integration_test/main.go delete mode 100644 integration_test/paymentmethod.go delete mode 100644 integration_test/payout.go delete mode 100644 integration_test/promotion.go delete mode 100644 integration_test/qrcode.go delete mode 100644 integration_test/recurringpayment.go delete mode 100644 integration_test/report.go delete mode 100644 integration_test/retailoutlet.go delete mode 100644 integration_test/transaction.go delete mode 100644 integration_test/virtualaccount.go delete mode 100644 invoice.go create mode 100644 invoice/api_invoice.go delete mode 100644 invoice/client.go delete mode 100644 invoice/event.go delete mode 100644 invoice/event_test.go delete mode 100644 invoice/example_test.go delete mode 100644 invoice/invoice.go delete mode 100644 invoice/invoice_test.go create mode 100644 invoice/model_address_object.go create mode 100644 invoice/model_alternative_display_item.go create mode 100644 invoice/model_bad_request_error.go create mode 100644 invoice/model_bank.go create mode 100644 invoice/model_bank_code.go create mode 100644 invoice/model_create_invoice_request.go create mode 100644 invoice/model_customer_object.go create mode 100644 invoice/model_direct_debit.go create mode 100644 invoice/model_direct_debit_type.go create mode 100644 invoice/model_ewallet.go create mode 100644 invoice/model_ewallet_type.go create mode 100644 invoice/model_forbidden_error.go create mode 100644 invoice/model_invoice.go create mode 100644 invoice/model_invoice_client_type.go create mode 100644 invoice/model_invoice_currency.go create mode 100644 invoice/model_invoice_error404_response_definition.go create mode 100644 invoice/model_invoice_fee.go create mode 100644 invoice/model_invoice_item.go create mode 100644 invoice/model_invoice_not_found_error.go create mode 100644 invoice/model_invoice_payment_method.go create mode 100644 invoice/model_invoice_status.go create mode 100644 invoice/model_notification_channel.go create mode 100644 invoice/model_notification_preference.go create mode 100644 invoice/model_paylater.go create mode 100644 invoice/model_paylater_type.go create mode 100644 invoice/model_qr_code.go create mode 100644 invoice/model_qr_code_type.go create mode 100644 invoice/model_retail_outlet.go create mode 100644 invoice/model_retail_outlet_name.go create mode 100644 invoice/model_server_error.go create mode 100644 invoice/model_unauthorized_error.go create mode 100644 invoice/nullable.go delete mode 100644 invoice/params.go delete mode 100644 newhttprequest_113.go delete mode 100644 newhttprequest_pre113.go delete mode 100644 payment_method.go create mode 100644 payment_method/api_payment_method.go create mode 100644 payment_method/model_billing_information.go create mode 100644 payment_method/model_card.go create mode 100644 payment_method/model_card_channel_properties.go create mode 100644 payment_method/model_card_parameters.go create mode 100644 payment_method/model_card_parameters_card_information.go create mode 100644 payment_method/model_card_verification_results.go create mode 100644 payment_method/model_card_verification_results_three_d_secure.go create mode 100644 payment_method/model_channel_amount_limits.go create mode 100644 payment_method/model_channel_amount_limits_all_of.go create mode 100644 payment_method/model_channel_property.go create mode 100644 payment_method/model_channel_property_all_of.go create mode 100644 payment_method/model_create_payment_method_409_response.go create mode 100644 payment_method/model_create_payment_method_503_response.go create mode 100644 payment_method/model_direct_debit.go create mode 100644 payment_method/model_direct_debit_all_of.go create mode 100644 payment_method/model_direct_debit_bank_account.go create mode 100644 payment_method/model_direct_debit_channel_code.go create mode 100644 payment_method/model_direct_debit_channel_properties.go create mode 100644 payment_method/model_direct_debit_debit_card.go create mode 100644 payment_method/model_direct_debit_parameters.go create mode 100644 payment_method/model_direct_debit_type.go create mode 100644 payment_method/model_e_wallet.go create mode 100644 payment_method/model_e_wallet_account.go create mode 100644 payment_method/model_e_wallet_channel_code.go create mode 100644 payment_method/model_e_wallet_channel_properties.go create mode 100644 payment_method/model_e_wallet_parameters.go create mode 100644 payment_method/model_get_all_payment_methods_400_response.go create mode 100644 payment_method/model_get_all_payment_methods_403_response.go create mode 100644 payment_method/model_get_all_payment_methods_404_response.go create mode 100644 payment_method/model_get_all_payment_methods_default_response.go create mode 100644 payment_method/model_over_the_counter.go create mode 100644 payment_method/model_over_the_counter_channel_code.go create mode 100644 payment_method/model_over_the_counter_channel_properties.go create mode 100644 payment_method/model_over_the_counter_channel_properties_update.go create mode 100644 payment_method/model_over_the_counter_parameters.go create mode 100644 payment_method/model_over_the_counter_update_parameters.go create mode 100644 payment_method/model_payment_channel.go create mode 100644 payment_method/model_payment_channel_all_of.go create mode 100644 payment_method/model_payment_channel_list.go create mode 100644 payment_method/model_payment_channel_list_links_inner.go create mode 100644 payment_method/model_payment_channel_list_links_inner_all_of.go create mode 100644 payment_method/model_payment_method.go create mode 100644 payment_method/model_payment_method_action.go create mode 100644 payment_method/model_payment_method_auth_parameters.go create mode 100644 payment_method/model_payment_method_country.go create mode 100644 payment_method/model_payment_method_expire_parameters.go create mode 100644 payment_method/model_payment_method_list.go create mode 100644 payment_method/model_payment_method_parameters.go create mode 100644 payment_method/model_payment_method_reusability.go create mode 100644 payment_method/model_payment_method_status.go create mode 100644 payment_method/model_payment_method_type.go create mode 100644 payment_method/model_payment_method_update_parameters.go create mode 100644 payment_method/model_qr_code.go create mode 100644 payment_method/model_qr_code_channel_code.go create mode 100644 payment_method/model_qr_code_channel_properties.go create mode 100644 payment_method/model_qr_code_parameters.go create mode 100644 payment_method/model_simulate_payment_request.go create mode 100644 payment_method/model_tokenized_card_information.go create mode 100644 payment_method/model_virtual_account.go create mode 100644 payment_method/model_virtual_account_all_of.go create mode 100644 payment_method/model_virtual_account_alternative_display.go create mode 100644 payment_method/model_virtual_account_channel_code.go create mode 100644 payment_method/model_virtual_account_channel_properties.go create mode 100644 payment_method/model_virtual_account_channel_properties_patch.go create mode 100644 payment_method/model_virtual_account_parameters.go create mode 100644 payment_method/model_virtual_account_update_parameters.go create mode 100644 payment_method/nullable.go create mode 100644 payment_request/api_payment_request.go create mode 100644 payment_request/model_capture.go create mode 100644 payment_request/model_capture_list_response.go create mode 100644 payment_request/model_capture_parameters.go create mode 100644 payment_request/model_card.go create mode 100644 payment_request/model_card_channel_properties.go create mode 100644 payment_request/model_card_information.go create mode 100644 payment_request/model_card_verification_results.go create mode 100644 payment_request/model_card_verification_results_three_d_secure.go create mode 100644 payment_request/model_direct_debit.go create mode 100644 payment_request/model_direct_debit_all_of.go create mode 100644 payment_request/model_direct_debit_bank_account.go create mode 100644 payment_request/model_direct_debit_channel_code.go create mode 100644 payment_request/model_direct_debit_channel_properties.go create mode 100644 payment_request/model_direct_debit_channel_properties_bank_account.go create mode 100644 payment_request/model_direct_debit_channel_properties_bank_redirect.go create mode 100644 payment_request/model_direct_debit_channel_properties_debit_card.go create mode 100644 payment_request/model_direct_debit_debit_card.go create mode 100644 payment_request/model_direct_debit_parameters.go create mode 100644 payment_request/model_direct_debit_type.go create mode 100644 payment_request/model_e_wallet.go create mode 100644 payment_request/model_e_wallet_account.go create mode 100644 payment_request/model_e_wallet_all_of.go create mode 100644 payment_request/model_e_wallet_channel_code.go create mode 100644 payment_request/model_e_wallet_channel_properties.go create mode 100644 payment_request/model_e_wallet_parameters.go create mode 100644 payment_request/model_error.go create mode 100644 payment_request/model_over_the_counter.go create mode 100644 payment_request/model_over_the_counter_channel_code.go create mode 100644 payment_request/model_over_the_counter_channel_properties.go create mode 100644 payment_request/model_over_the_counter_parameters.go create mode 100644 payment_request/model_payment_method.go create mode 100644 payment_request/model_payment_method_parameters.go create mode 100644 payment_request/model_payment_method_reusability.go create mode 100644 payment_request/model_payment_method_status.go create mode 100644 payment_request/model_payment_method_type.go create mode 100644 payment_request/model_payment_request.go create mode 100644 payment_request/model_payment_request_action.go create mode 100644 payment_request/model_payment_request_auth_parameters.go create mode 100644 payment_request/model_payment_request_basket_item.go create mode 100644 payment_request/model_payment_request_capture_method.go create mode 100644 payment_request/model_payment_request_card_verification_results.go create mode 100644 payment_request/model_payment_request_card_verification_results_three_dee_secure.go create mode 100644 payment_request/model_payment_request_channel_properties.go create mode 100644 payment_request/model_payment_request_country.go create mode 100644 payment_request/model_payment_request_currency.go create mode 100644 payment_request/model_payment_request_initiator.go create mode 100644 payment_request/model_payment_request_list_response.go create mode 100644 payment_request/model_payment_request_parameters.go create mode 100644 payment_request/model_payment_request_parameters_channel_properties.go create mode 100644 payment_request/model_payment_request_parameters_channel_properties_all_of.go create mode 100644 payment_request/model_payment_request_shipping_information.go create mode 100644 payment_request/model_payment_request_status.go create mode 100644 payment_request/model_qr_code.go create mode 100644 payment_request/model_qr_code_channel_code.go create mode 100644 payment_request/model_qr_code_channel_properties.go create mode 100644 payment_request/model_qr_code_parameters.go create mode 100644 payment_request/model_virtual_account.go create mode 100644 payment_request/model_virtual_account_all_of.go create mode 100644 payment_request/model_virtual_account_alternative_display.go create mode 100644 payment_request/model_virtual_account_channel_code.go create mode 100644 payment_request/model_virtual_account_channel_properties.go create mode 100644 payment_request/model_virtual_account_parameters.go create mode 100644 payment_request/nullable.go delete mode 100644 payout.go create mode 100644 payout/api_payout.go delete mode 100644 payout/client.go delete mode 100644 payout/example_test.go create mode 100644 payout/model_channel.go create mode 100644 payout/model_channel_account_type.go create mode 100644 payout/model_channel_amount_limits.go create mode 100644 payout/model_channel_category.go create mode 100644 payout/model_create_payout_request.go create mode 100644 payout/model_digital_payout_channel_properties.go create mode 100644 payout/model_error.go create mode 100644 payout/model_error_errors_inner.go create mode 100644 payout/model_get_payouts_200_response.go create mode 100644 payout/model_get_payouts_200_response_data_inner.go create mode 100644 payout/model_get_payouts_200_response_links.go create mode 100644 payout/model_payout.go create mode 100644 payout/model_payout_all_of.go create mode 100644 payout/model_receipt_notification.go create mode 100644 payout/nullable.go delete mode 100644 payout/params.go delete mode 100644 payout/payout.go delete mode 100644 payout/payout_test.go delete mode 100644 pmsv2/card/params.go delete mode 100644 pmsv2/client.go delete mode 100644 pmsv2/constant/params.go delete mode 100644 pmsv2/directdebit/params.go delete mode 100644 pmsv2/ewallet/params.go delete mode 100644 pmsv2/example_test.go delete mode 100644 pmsv2/overthecounter/params.go delete mode 100644 pmsv2/params.go delete mode 100644 pmsv2/payment_method.go delete mode 100644 pmsv2/payment_method_test.go delete mode 100644 pmsv2/qrcode/params.go delete mode 100644 pmsv2/virtualaccount/params.go delete mode 100644 promotion.go delete mode 100644 promotion/client.go delete mode 100644 promotion/example_test.go delete mode 100644 promotion/params.go delete mode 100644 promotion/promotion.go delete mode 100644 promotion/promotion_test.go delete mode 100644 qrcode.go delete mode 100644 qrcode/client.go delete mode 100644 qrcode/example_test.go delete mode 100644 qrcode/params.go delete mode 100644 qrcode/qrcode.go delete mode 100644 qrcode/qrcode_test.go delete mode 100644 recurringpayment.go delete mode 100644 recurringpayment/client.go delete mode 100644 recurringpayment/example_test.go delete mode 100644 recurringpayment/params.go delete mode 100644 recurringpayment/recurringpayment.go delete mode 100644 recurringpayment/recurringpayment_test.go create mode 100644 refund/api_refund.go create mode 100644 refund/model_create_refund.go create mode 100644 refund/model_create_refund_400_response.go create mode 100644 refund/model_create_refund_403_response.go create mode 100644 refund/model_create_refund_404_response.go create mode 100644 refund/model_create_refund_409_response.go create mode 100644 refund/model_create_refund_503_response.go create mode 100644 refund/model_create_refund_default_response.go create mode 100644 refund/model_refund.go create mode 100644 refund/model_refund_list.go create mode 100644 refund/nullable.go delete mode 100644 report.go delete mode 100644 report/client.go delete mode 100644 report/example_test.go delete mode 100644 report/params.go delete mode 100644 report/report.go delete mode 100644 report/report_test.go create mode 100644 response.go delete mode 100644 retailoutlet.go delete mode 100644 retailoutlet/client.go delete mode 100644 retailoutlet/example_test.go delete mode 100644 retailoutlet/params.go delete mode 100644 retailoutlet/retailoutlet.go delete mode 100644 retailoutlet/retailoutlet_test.go create mode 100644 test/api_balance_test.go create mode 100644 test/api_invoice_test.go create mode 100644 test/api_payment_method_test.go create mode 100644 test/api_payment_request_test.go create mode 100644 test/api_payout_test.go create mode 100644 test/api_refund_test.go create mode 100644 test/api_transaction_test.go delete mode 100644 transaction.go delete mode 100644 transaction/client.go delete mode 100644 transaction/example_test.go delete mode 100644 transaction/params.go delete mode 100644 transaction/transaction.go delete mode 100644 transaction/transaction_test.go create mode 100644 utils/helpers.go delete mode 100644 utils/urlvalues/urlvalues.go delete mode 100644 utils/urlvalues/urlvalues_test.go create mode 100644 utils/utils.go delete mode 100644 utils/validator/validator.go delete mode 100644 utils/validator/validator_test.go delete mode 100644 virtualaccount.go delete mode 100644 virtualaccount/client.go delete mode 100644 virtualaccount/example_test.go delete mode 100644 virtualaccount/params.go delete mode 100644 virtualaccount/virtualaccount.go delete mode 100644 virtualaccount/virtualaccount_test.go diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d3853ab0..00000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -insert_final_newline = true -charset = utf-8 -trim_trailing_whitespace = true -indent_style = space -indent_size = 2 - -[{Makefile,go.mod,go.sum,*.go}] -indent_style = tab -indent_size = 4 diff --git a/.env.example b/.env.example deleted file mode 100644 index 66b7a160..00000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -SECRET_KEY=xnd_development_P4qDfOss0OCpl8RtKrROHjaQYNCk9dN5lSfk+R1l9Wbe+rSiCwZ3jw== diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6f049342 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index a45a3f06..00000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "coveralls" - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - name: Send coverage to coveralls - steps: - - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v1 - with: - go-version: "1.14" - - run: go mod download - - run: > - go test -race -covermode atomic -coverprofile=profile.cov \ - . \ - ./account/... \ - ./balance/... \ - ./card/... \ - ./cardlesscredit/... \ - ./client/... \ - ./disbursement/... \ - ./ewallet/... \ - ./invoice/... \ - ./payout/... \ - ./recurringpayment/... \ - ./retailoutlet/... \ - ./utils/... \ - ./virtualaccount/... \ - ./pmsv2/... \ - - name: Send coverage - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - go get github.com/mattn/goveralls - $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github diff --git a/.github/workflows/generate-release-tag.yml b/.github/workflows/generate-release-tag.yml new file mode 100644 index 00000000..344dada4 --- /dev/null +++ b/.github/workflows/generate-release-tag.yml @@ -0,0 +1,27 @@ +name: Generate Release Tag +on: + repository_dispatch: + types: [create-release-tag] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set the value in bash + id: parse-changelog + run: | + echo "changelog<> "$GITHUB_OUTPUT" + echo "${{ github.event.client_payload.changelog }}" | tr -s '%0A' '\n' >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + - name: Create Release + id: create-release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} + with: + tag_name: v${{ github.event.client_payload.version }} + release_name: v${{ github.event.client_payload.version }} + body: ${{ steps.parse-changelog.outputs.changelog }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 6001e74f..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "lint" - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - name: Lint codebase - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup node - uses: actions/setup-go@v1 - with: - go-version: "1.14" - - run: go mod download - - run: go vet ./... - - run: make lint-prepare - - run: ./bin/golangci-lint run diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index be44fafc..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "integration-test" - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - go-version: [ 1.15.x, 1.14.x, 1.13.x ] - name: Test with Go version ${{ matrix.go-version }} - steps: - - name: Setup go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout - uses: actions/checkout@v2 - - run: go test ./... - - run: go run ./integration_test - env: - SECRET_KEY: xnd_development_chBDpzjQZEI8nncBLrWtwau5r7rgiuunCJ4JCqsd68rXemDd74BnRpdO0bIZAMK diff --git a/.gitignore b/.gitignore index 97d869b9..daf913b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,24 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a *.so -*.dylib - -# Test binary, built with `go test -c` -*.test -# Output of the go coverage tool, specifically when used with LiteIDE -*.out +# Folders +_obj +_test -# Dependency directories (remove the comment below to include it) -# vendor/ -bin/ +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out -# IDE configuration files -.idea +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* -# Environment files -.env +_testmain.go -*.coverprofile -*.cov -*.vscode -DS_Store \ No newline at end of file +*.exe +*.test +*.prof diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..2f20549c --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.github/dependabot.yml +.github/workflows/generate-release-tag.yml +.gitignore +LICENSE +README.md +client.go +common/common.go +configuration.go +docs/RefundApi.md +docs/header.jpg +docs/refund.yaml +docs/refund/CreateRefund.md +docs/refund/CreateRefund400Response.md +docs/refund/CreateRefund403Response.md +docs/refund/CreateRefund404Response.md +docs/refund/CreateRefund409Response.md +docs/refund/CreateRefund503Response.md +docs/refund/CreateRefundDefaultResponse.md +docs/refund/Refund.md +docs/refund/RefundList.md +go.mod +go.sum +refund/api_refund.go +refund/model_create_refund.go +refund/model_create_refund_400_response.go +refund/model_create_refund_403_response.go +refund/model_create_refund_404_response.go +refund/model_create_refund_409_response.go +refund/model_create_refund_503_response.go +refund/model_create_refund_default_response.go +refund/model_refund.go +refund/model_refund_list.go +refund/nullable.go +response.go +test/api_refund_test.go +utils/helpers.go +utils/utils.go +xendit.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..cd802a1e --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index bf42a1b3..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 - hooks: - - id: mixed-line-ending - args: [--fix=lf] - - repo: https://github.com/thlorenz/doctoc - rev: v1.4.0 - hooks: - - id: doctoc - - repo: local - hooks: - - id: go-fmt - name: go-fmt - description: Runs gofmt - entry: gofmt -s -w - types: [go] - language: golang - pass_filenames: true - - id: go-imports - name: go-imports - description: Runs goimport - entry: goimports -w - types: [go] - language: golang - pass_filenames: true diff --git a/LICENSE b/LICENSE index c0aee369..0d37b6c5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Xendit +Copyright (c) 2017-2023 Xendit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index cb594b43..00000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# Install all the tools for development -.PHONY: init -init: lint-prepare goimports-prepare - -.PHONY: lint-prepare -lint-prepare: - @echo "Preparing Linter" - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest - -.PHONY: goimports-prepare -goimports-prepare: - @echo "Preparing goimports" - go get golang.org/x/tools/cmd/goimports - go mod tidy diff --git a/README.md b/README.md index 67af6d58..8690f8f7 100644 --- a/README.md +++ b/README.md @@ -1,214 +1,58 @@ -# Xendit API Go Client +![Xendit PHP SDK](docs/header.jpg "Xendit Go SDK") -[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/xendit/xendit-go) -![](https://github.com/xendit/xendit-go/workflows/integration-test/badge.svg) -![](https://github.com/xendit/xendit-go/workflows/lint/badge.svg) -[![Coverage Status](https://coveralls.io/repos/github/xendit/xendit-go/badge.svg)](https://coveralls.io/github/xendit/xendit-go) -[![Go Report Card](https://goreportcard.com/badge/github.com/xendit/xendit-go)](https://goreportcard.com/report/github.com/xendit/xendit-go) +# Xendit Go SDK -This library is the abstraction of Xendit API for access from applications written with Go. +The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API +in applications written in Go. - - +* Package version: 3.0.0 - -- [Documentation](#documentation) -- [Installation](#installation) - - [Go Module Support](#go-module-support) - - [Using xendit-go with \$GOPATH](#using-xendit-go-with-%5Cgopath) -- [Usage](#usage) - - [Without Client](#without-client) - - [With Client](#with-client) - - [Sub-Packages Documentations](#sub-packages-documentations) -- [Contribute](#contribute) - - [Test](#test) - - [Run all tests](#run-all-tests) - - [Run tests for a package](#run-tests-for-a-package) - - [Run a single test](#run-a-single-test) - - [Run integration tests](#run-integration-tests) - - [Pre-commit](#pre-commit) - - - -## Documentation - -For the API documentation, check [Xendit API Reference](https://xendit.github.io/apireference). - -For the details of this library, see the [GoDoc](https://pkg.go.dev/github.com/xendit/xendit-go). +# Getting Started ## Installation Install xendit-go with: -```sh -go get -u github.com/xendit/xendit-go -``` - -Then, import it using: - -```go -import ( - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/$product$" -) -``` - -with `$product$` is the product of Xendit such as `invoice` and `balance`. - -### Go Module Support - -This library supports Go modules by default. Simply require xendit-go in `go.mod` with a version like so: - -```go -module github.com/my/package - -go 1.13 - -require ( - github.com/xendit/xendit-go v1.0.0 -) -``` - -And use the same style of import paths as above: - -```go -import ( - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/$product$" -) -``` - -with `$product$` is the product of Xendit such as `invoice` and `balance`. - -### Using xendit-go with \$GOPATH - -If you are still using `$GOPATH` and not planning to [migrate to go mod](https://blog.golang.org/migrating-to-go-modules), -installing `xendit-go` would require installing its (only) dependency [validator](https://github.com/go-playground/validator) -via - -```bash -go get -u github.com/go-playground/validator -``` - -Please note that this means you are using `master` of [validator](https://github.com/go-playground/validator) -and effectively miss out on its versioning that's gomod-based. - -After installing [validator](https://github.com/go-playground/validator), [xendit-go](https://github.com/xendit/xendit-go) -can be [installed normally](#installation). - -## Usage - -The following pattern is applied throughout the library for a given `$product$`: - -### Without Client - -If you're only dealing with a single `secret key`, you can simply import the packages required for the products you're interacting with without the need to create a client. - -```go -import ( - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/$product$" -) - -// Setup -xendit.Opt.SecretKey = "examplesecretkey" - -xendit.SetAPIRequester(apiRequester) // optional, useful for mocking - -// Create -resp, err := $product$.Create($product$.CreateParams) - -// Get -resp, err := $product$.Get($product$.GetParams) - -// GetAll -resp, err := $product$.GetAll($product$.GetAllParams) +```shell +go get github.com/xendit/xendit-go/v3 ``` -### With Client - -If you're dealing with multiple `secret key`s, it is recommended you use `client.API`. This allows you to create as many clients as needed, each with their own individual key. - -```go -import ( - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/client" -) - -// Basic setup -xenCli := client.New("examplesecretkey") - -// or with optional, useful-for-mocking `exampleAPIRequester` -xenCli := client.New("examplesecretkey").WithAPIRequester(exampleAPIRequester) - -// Create -resp, err := xenCli.$product$.Create($product$.CreateParams) +Put the package under your project folder and add the following in import: -// Get -resp, err := xenCli.$product$.Get($product$.GetParams) - -// GetAll -resp, err := xenCli.$product$.GetAll($product$.GetAllParams) +```golang +import xendit "github.com/xendit/xendit-go/v3" ``` -### Sub-Packages Documentations - -The following is a list of pointers to documentations for sub-packages of [xendit-go](https://github.com/xendit/xendit-go). - -- [Invoice](https://pkg.go.dev/github.com/xendit/xendit-go/invoice) -- [E-Wallet](https://pkg.go.dev/github.com/xendit/xendit-go/ewallet) -- [Balance](https://pkg.go.dev/github.com/xendit/xendit-go/balance) -- [Virtual Account](https://pkg.go.dev/github.com/xendit/xendit-go/virtualaccount) -- [Retail Outlet](https://pkg.go.dev/github.com/xendit/xendit-go/retailoutlet) -- [Disbursement](https://pkg.go.dev/github.com/xendit/xendit-go/disbursement) -- [Card](https://pkg.go.dev/github.com/xendit/xendit-go/card) -- [Payout](https://pkg.go.dev/github.com/xendit/xendit-go/payout) -- [Recurring Payment](https://pkg.go.dev/github.com/xendit/xendit-go/recurringpayment) -- [Cardless Credit](https://pkg.go.dev/github.com/xendit/xendit-go/cardlesscredit) -- [Payment Method Service V2](https://pkg.go.dev/github.com/xendit/xendit-go/pmsv2) -- [Customer](https://pkg.go.dev/github.com/xendit/xendit-go/customer) - -## Contribute - -For any requests, bugs, or comments, please [open an issue](https://github.com/xendit/xendit-go/issues/new) or submit a pull request. - -### Test - -After modifying the code, please make sure that the code passes all test cases. +To use a proxy, set the environment variable `HTTP_PROXY`: -#### Run all tests - -```sh -go test ./... +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` -#### Run tests for a package - -```sh -go test ./invoice -``` +## Authorization -#### Run a single test +The SDK needs to be instantiated using your secret API key obtained from the [Xendit Dashboard](https://dashboard.xendit.co/settings/developers#api-keys). +You can sign up for a free Dashboard account [here](https://dashboard.xendit.co/register). -```sh -go test ./invoice -run TestCreateInvoice +```golang +xnd := xendit.NewClient("API-KEY") ``` -#### Run integration tests +# Documentation -```sh -SECRET_KEY= go run -race ./integration_test -``` - -### Pre-commit +Find detailed API infomration and examples for each of our product's by clicking the links below, -Before making any commits, please install pre-commit. -To install pre-commit, follow the [installation steps](https://pre-commit.com/#install). +* [Balance](docs/BalanceApi.md) +* [Invoice](docs/InvoiceApi.md) +* [PaymentMethod](docs/PaymentMethodApi.md) +* [PaymentRequest](docs/PaymentRequestApi.md) +* [Payout](docs/PayoutApi.md) +* [Refund](docs/RefundApi.md) +* [Transaction](docs/TransactionApi.md) -After installing the pre-commit, please install the needed dependencies: +All URIs are relative to *https://api.xendit.co*. For more information about our API, please refer to *https://developers.xendit.co/*. -```sh -make init -``` +Further Reading -After the code passes everything, please [submit a pull request](https://github.com/xendit/xendit-go/pulls). +* [Xendit Docs](https://docs.xendit.co/) +* [Xendit API Reference](https://developers.xendit.co/) \ No newline at end of file diff --git a/account.go b/account.go deleted file mode 100644 index 72b651a0..00000000 --- a/account.go +++ /dev/null @@ -1,32 +0,0 @@ -package xendit - -import "time" - -type AccountType string -type Status string - -const ( - OWNED AccountType = "OWNED" - MANAGED AccountType = "MANAGED" -) -const ( - LIVE Status = "LIVE" - AWAITING_DOCS Status = "AWAITING_DOCS" - REGISTERED Status = "REGISTERED" - INVITED Status = "INVITED" -) - -type PublicProfile struct { - BusinessName string `json:"business_name,omitempty"` -} - -type Account struct { - ID string `json:"id,omitempty"` - Created *time.Time `json:"created,omitempty"` - Updated *time.Time `json:"updated,omitempty"` - Type AccountType `json:"type,omitempty"` - Email string `json:"email,omitempty"` - PublicProfile PublicProfile `json:"public_profile,omitempty"` - Country string `json:"country,omitempty"` - Status Status `json:"status,omitempty"` -} diff --git a/account/account.go b/account/account.go deleted file mode 100644 index ad5bda02..00000000 --- a/account/account.go +++ /dev/null @@ -1,44 +0,0 @@ -package account - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new account -func Create(data *CreateParams) (*xendit.Account, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new account with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Account, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// Get gets one account -func Get(data *GetParams) (*xendit.Account, *xendit.Error) { - return GetWithContext(context.Background(), data) -} - -// GetWithContext gets one account with context -func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Account, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/account/account_test.go b/account/account_test.go deleted file mode 100644 index 645d7814..00000000 --- a/account/account_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package account_test - -import ( - "context" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - - "github.com/xendit/xendit-go/account" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, - header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.Account).ID = "123" - result.(*xendit.Account).Type = xendit.OWNED - result.(*xendit.Account).Email = "customer@customer.com" - - return nil -} - -func TestCreate(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *account.CreateParams - expectedRes *xendit.Account - expectedErr *xendit.Error - }{ - { - desc: "should create an account", - data: &account.CreateParams{ - Email: "customer@customer.com", - Type: xendit.OWNED, - }, - expectedRes: &xendit.Account{ - ID: "123", - Email: "customer@customer.com", - Type: xendit.OWNED, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &account.CreateParams{ - Type: xendit.OWNED, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Email'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/v2/accounts", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.Account{}, - ).Return(nil) - - resp, err := account.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGet(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *account.GetParams - expectedRes *xendit.Account - expectedErr *xendit.Error - }{ - { - desc: "should get an account", - data: &account.GetParams{ - ID: "123", - }, - expectedRes: &xendit.Account{ - ID: "123", - Email: "customer@customer.com", - Type: xendit.OWNED, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &account.GetParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/accounts/123", - xendit.Opt.SecretKey, - http.Header{}, - nil, - &xendit.Account{}, - ).Return(nil) - - resp, err := account.Get(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/account/client.go b/account/client.go deleted file mode 100644 index a643f399..00000000 --- a/account/client.go +++ /dev/null @@ -1,76 +0,0 @@ -package account - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke account API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new invoice -func (c *Client) Create(data *CreateParams) (*xendit.Account, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new account with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Account, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Account{} - header := http.Header{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/v2/accounts", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Get gets one account -func (c *Client) Get(data *GetParams) (*xendit.Account, *xendit.Error) { - return c.GetWithContext(context.Background(), data) -} - -// GetWithContext gets one account with context -func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Account, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Account{} - header := http.Header{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/accounts/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/account/params.go b/account/params.go deleted file mode 100644 index 8026a506..00000000 --- a/account/params.go +++ /dev/null @@ -1,13 +0,0 @@ -package account - -import "github.com/xendit/xendit-go" - -type CreateParams struct { - Email string `json:"email" validate:"required"` - Type xendit.AccountType `json:"type" validate:"required"` - PublicProfile xendit.PublicProfile `json:"public_profile"` -} - -type GetParams struct { - ID string `json:"id" validate:"required"` -} diff --git a/apirequester.go b/apirequester.go deleted file mode 100644 index c54676c3..00000000 --- a/apirequester.go +++ /dev/null @@ -1,82 +0,0 @@ -package xendit - -import ( - "bytes" - "context" - "encoding/json" - "io/ioutil" - "net/http" - "reflect" -) - -// APIRequester abstraction of HTTP Client that will make API calls to Xendit backend. -// `body` is POST-requests' bodies if applicable. -// `result` pointer to value which response string will be unmarshalled to. -type APIRequester interface { - Call(ctx context.Context, method string, url string, secretKey string, header http.Header, body interface{}, result interface{}) *Error -} - -// APIRequesterImplementation is the default implementation of APIRequester -type APIRequesterImplementation struct { - HTTPClient *http.Client -} - -// Call makes HTTP requests with JSON-format body. -// `body` is POST-requests' bodies if applicable. -// `result` pointer to value which response string will be unmarshalled to. -func (a *APIRequesterImplementation) Call(ctx context.Context, method string, url string, secretKey string, header http.Header, body interface{}, result interface{}) *Error { - reqBody := []byte("") - var req *http.Request - var err error - - isParamsNil := body == nil || (reflect.ValueOf(body).Kind() == reflect.Ptr && reflect.ValueOf(body).IsNil()) - - if !isParamsNil { - reqBody, err = json.Marshal(body) - if err != nil { - return FromGoErr(err) - } - } - - req, err = newHTTPRequestWithContext( - ctx, - method, - url, - bytes.NewBuffer(reqBody), - ) - if err != nil { - return FromGoErr(err) - } - - if header != nil { - req.Header = header - } - req.SetBasicAuth(secretKey, "") - req.Header.Set("Content-Type", "application/json") - req.Header.Set("xendit-lib", "go") - req.Header.Set("xendit-lib-ver", "v0") - - return a.doRequest(req, result) -} - -func (a *APIRequesterImplementation) doRequest(req *http.Request, result interface{}) *Error { - resp, err := a.HTTPClient.Do(req) - if err != nil { - return FromGoErr(err) - } - defer resp.Body.Close() - respBody, err := ioutil.ReadAll(resp.Body) - if err != nil { - return FromGoErr(err) - } - - if resp.StatusCode < 200 || resp.StatusCode > 299 { - return FromHTTPErr(resp.StatusCode, respBody) - } - - if err := json.Unmarshal(respBody, &result); err != nil { - return FromGoErr(err) - } - - return nil -} diff --git a/balance.go b/balance.go deleted file mode 100644 index 6867f12e..00000000 --- a/balance.go +++ /dev/null @@ -1,23 +0,0 @@ -package xendit - -// BalanceAccountTypeEnum constants are the available balance account type -type BalanceAccountTypeEnum string - -// This consists the values that BalanceAccountType can take -const ( - BalanceAccountTypeCash BalanceAccountTypeEnum = "CASH" - BalanceAccountTypeHolding BalanceAccountTypeEnum = "HOLDING" - BalanceAccountTypeTax BalanceAccountTypeEnum = "TAX" -) - -// String returns the BalanceAccountTypeEnum in type string -func (b *BalanceAccountTypeEnum) String() string { - return string(*b) -} - -// Balance contains data from Xendit's API response of balance related request. -// For more details see https://xendit.github.io/apireference/?bash#balances. -// For documentation of subpackage balance, checkout https://pkg.go.dev/github.com/xendit/xendit-go/balance -type Balance struct { - Balance float64 `json:"balance"` -} diff --git a/balance/balance.go b/balance/balance.go deleted file mode 100644 index 8857f4a6..00000000 --- a/balance/balance.go +++ /dev/null @@ -1,29 +0,0 @@ -package balance - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Get gets balance -func Get(data *GetParams) (*xendit.Balance, *xendit.Error) { - return GetWithContext(context.Background(), data) -} - -// GetWithContext gets balance with context -func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Balance, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/balance/balance_test.go b/balance/balance_test.go deleted file mode 100644 index 1ac7c3a2..00000000 --- a/balance/balance_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package balance_test - -import ( - "context" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/balance" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.Balance).Balance = 200000 - - return nil -} - -func TestGet(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *balance.GetParams - expectedRes *xendit.Balance - expectedErr *xendit.Error - }{ - { - desc: "should get balance", - data: &balance.GetParams{}, - expectedRes: &xendit.Balance{ - Balance: 200000, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/balance?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - http.Header{}, - nil, - &xendit.Balance{}, - ).Return(nil) - - resp, err := balance.Get(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/balance/client.go b/balance/client.go deleted file mode 100644 index ac7da315..00000000 --- a/balance/client.go +++ /dev/null @@ -1,51 +0,0 @@ -package balance - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" -) - -// Client is the client used to invoke balance API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Get gets balance -func (c *Client) Get(data *GetParams) (*xendit.Balance, *xendit.Error) { - return c.GetWithContext(context.Background(), data) -} - -// GetWithContext gets balance with context -func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Balance, *xendit.Error) { - var queryString string - - if data != nil { - queryString = data.QueryString() - } - - response := &xendit.Balance{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/balance?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/balance/example_test.go b/balance/example_test.go deleted file mode 100644 index 45dad2fc..00000000 --- a/balance/example_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package balance_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/balance" -) - -func ExampleGet() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := balance.GetParams{ - AccountType: "CASH", - } - - resp, err := balance.Get(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("balance: %+v\n", resp) -} diff --git a/balance/params.go b/balance/params.go deleted file mode 100644 index 57492568..00000000 --- a/balance/params.go +++ /dev/null @@ -1,24 +0,0 @@ -package balance - -import ( - "net/url" - - "github.com/xendit/xendit-go" -) - -// GetParams contains parameters for Get -type GetParams struct { - ForUserID string `json:"-"` - AccountType xendit.BalanceAccountTypeEnum `json:"account_type"` -} - -// QueryString creates query string from GetParams, ignores nil values -func (p *GetParams) QueryString() string { - urlValues := &url.Values{} - - if p.AccountType != "" { - urlValues.Add("account_type", p.AccountType.String()) - } - - return urlValues.Encode() -} diff --git a/balance_and_transaction/api_balance.go b/balance_and_transaction/api_balance.go new file mode 100644 index 00000000..100eac47 --- /dev/null +++ b/balance_and_transaction/api_balance.go @@ -0,0 +1,159 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package balance_and_transaction + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" +) + + +type BalanceApi interface { + + /* + GetBalance Retrieves balances for a business, default to CASH type + + Retrieves balance for your business, defaults to CASH type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceRequest + */ + GetBalance(ctx context.Context) ApiGetBalanceRequest + + // GetBalanceExecute executes the request + // @return Balance + GetBalanceExecute(r ApiGetBalanceRequest) (*Balance, *http.Response, *common.XenditSdkError) +} + +// BalanceApiService BalanceApi service +type BalanceApiService struct { + client common.IClient +} + +// NewBalanceApi Create a new BalanceApi service +func NewBalanceApi (client common.IClient) BalanceApi { + return &BalanceApiService{ + client: client, + } +} + + +type ApiGetBalanceRequest struct { + ctx context.Context + ApiService BalanceApi + accountType *string + currency *string + forUserId *string +} + +// The selected balance type +func (r ApiGetBalanceRequest) AccountType(accountType string) ApiGetBalanceRequest { + r.accountType = &accountType + return r +} + +// Currency for filter for customers with multi currency accounts +func (r ApiGetBalanceRequest) Currency(currency string) ApiGetBalanceRequest { + r.currency = ¤cy + return r +} + +// The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information +func (r ApiGetBalanceRequest) ForUserId(forUserId string) ApiGetBalanceRequest { + r.forUserId = &forUserId + return r +} + +func (r ApiGetBalanceRequest) Execute() (*Balance, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetBalanceExecute(r) +} + +/* +GetBalance Retrieves balances for a business, default to CASH type + +Retrieves balance for your business, defaults to CASH type + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceRequest +*/ +func (a *BalanceApiService) GetBalance(ctx context.Context) ApiGetBalanceRequest { + return ApiGetBalanceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Balance +func (a *BalanceApiService) GetBalanceExecute(r ApiGetBalanceRequest) (*Balance, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Balance + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "BalanceApiService.GetBalance") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: BalanceApiService.GetBalanceExecute") + } + + localVarPath := localBasePath + "/balance" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.accountType != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "account_type", r.accountType, "") + } + if r.currency != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "currency", r.currency, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.forUserId != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "for-user-id", r.forUserId, "") + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: BalanceApiService.GetBalanceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/balance_and_transaction/api_transaction.go b/balance_and_transaction/api_transaction.go new file mode 100644 index 00000000..16217ca5 --- /dev/null +++ b/balance_and_transaction/api_transaction.go @@ -0,0 +1,405 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package balance_and_transaction + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" + "reflect" +) + + +type TransactionApi interface { + + /* + GetAllTransactions Get a list of transactions + + Get a list of all transactions based on filter and search parameters. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllTransactionsRequest + */ + GetAllTransactions(ctx context.Context) ApiGetAllTransactionsRequest + + // GetAllTransactionsExecute executes the request + // @return TransactionsResponse + GetAllTransactionsExecute(r ApiGetAllTransactionsRequest) (*TransactionsResponse, *http.Response, *common.XenditSdkError) + + /* + GetTransactionByID Get a transaction based on its id + + Get single specific transaction by transaction id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiGetTransactionByIDRequest + */ + GetTransactionByID(ctx context.Context, id string) ApiGetTransactionByIDRequest + + // GetTransactionByIDExecute executes the request + // @return TransactionResponse + GetTransactionByIDExecute(r ApiGetTransactionByIDRequest) (*TransactionResponse, *http.Response, *common.XenditSdkError) +} + +// TransactionApiService TransactionApi service +type TransactionApiService struct { + client common.IClient +} + +// NewTransactionApi Create a new TransactionApi service +func NewTransactionApi (client common.IClient) TransactionApi { + return &TransactionApiService{ + client: client, + } +} + + +type ApiGetAllTransactionsRequest struct { + ctx context.Context + ApiService TransactionApi + forUserId *string + types *[]TransactionTypes + statuses *[]TransactionStatuses + channelCategories *[]ChannelsCategories + referenceId *string + productId *string + accountIdentifier *string + amount *float32 + currency *Currency + created *DateRangeFilter + updated *DateRangeFilter + limit *float32 + afterId *string + beforeId *string +} + +// The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information +func (r ApiGetAllTransactionsRequest) ForUserId(forUserId string) ApiGetAllTransactionsRequest { + r.forUserId = &forUserId + return r +} + +// Transaction types that will be included in the result. Default is to include all transaction types +func (r ApiGetAllTransactionsRequest) Types(types []TransactionTypes) ApiGetAllTransactionsRequest { + r.types = &types + return r +} + +// Status of the transaction. Default is to include all status. +func (r ApiGetAllTransactionsRequest) Statuses(statuses []TransactionStatuses) ApiGetAllTransactionsRequest { + r.statuses = &statuses + return r +} + +// Payment channels in which the transaction is carried out. Default is to include all channels. +func (r ApiGetAllTransactionsRequest) ChannelCategories(channelCategories []ChannelsCategories) ApiGetAllTransactionsRequest { + r.channelCategories = &channelCategories + return r +} + +// To filter the result for transactions with matching reference given (case sensitive) +func (r ApiGetAllTransactionsRequest) ReferenceId(referenceId string) ApiGetAllTransactionsRequest { + r.referenceId = &referenceId + return r +} + +// To filter the result for transactions with matching product_id (a.k.a payment_id) given (case sensitive) +func (r ApiGetAllTransactionsRequest) ProductId(productId string) ApiGetAllTransactionsRequest { + r.productId = &productId + return r +} + +// Account identifier of transaction. The format will be different from each channel. For example, on `BANK` channel it will be account number and on `CARD` it will be masked card number. +func (r ApiGetAllTransactionsRequest) AccountIdentifier(accountIdentifier string) ApiGetAllTransactionsRequest { + r.accountIdentifier = &accountIdentifier + return r +} + +// Specific transaction amount to search for +func (r ApiGetAllTransactionsRequest) Amount(amount float32) ApiGetAllTransactionsRequest { + r.amount = &amount + return r +} + +func (r ApiGetAllTransactionsRequest) Currency(currency Currency) ApiGetAllTransactionsRequest { + r.currency = ¤cy + return r +} + +// Filter time of transaction by created date. If not specified will list all dates. +func (r ApiGetAllTransactionsRequest) Created(created DateRangeFilter) ApiGetAllTransactionsRequest { + r.created = &created + return r +} + +// Filter time of transaction by updated date. If not specified will list all dates. +func (r ApiGetAllTransactionsRequest) Updated(updated DateRangeFilter) ApiGetAllTransactionsRequest { + r.updated = &updated + return r +} + +// number of items in the result per page. Another name for \"results_per_page\" +func (r ApiGetAllTransactionsRequest) Limit(limit float32) ApiGetAllTransactionsRequest { + r.limit = &limit + return r +} + +func (r ApiGetAllTransactionsRequest) AfterId(afterId string) ApiGetAllTransactionsRequest { + r.afterId = &afterId + return r +} + +func (r ApiGetAllTransactionsRequest) BeforeId(beforeId string) ApiGetAllTransactionsRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetAllTransactionsRequest) Execute() (*TransactionsResponse, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetAllTransactionsExecute(r) +} + +/* +GetAllTransactions Get a list of transactions + +Get a list of all transactions based on filter and search parameters. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllTransactionsRequest +*/ +func (a *TransactionApiService) GetAllTransactions(ctx context.Context) ApiGetAllTransactionsRequest { + return ApiGetAllTransactionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TransactionsResponse +func (a *TransactionApiService) GetAllTransactionsExecute(r ApiGetAllTransactionsRequest) (*TransactionsResponse, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *TransactionsResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "TransactionApiService.GetAllTransactions") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: TransactionApiService.GetAllTransactionsExecute") + } + + localVarPath := localBasePath + "/transactions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.types != nil { + t := *r.types + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "types", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "types", t, "multi") + } + } + if r.statuses != nil { + t := *r.statuses + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", t, "multi") + } + } + if r.channelCategories != nil { + t := *r.channelCategories + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_categories", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_categories", t, "multi") + } + } + if r.referenceId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", r.referenceId, "") + } + if r.productId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "product_id", r.productId, "") + } + if r.accountIdentifier != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "account_identifier", r.accountIdentifier, "") + } + if r.amount != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "amount", r.amount, "") + } + if r.currency != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "currency", r.currency, "") + } + if r.created != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "") + } + if r.updated != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "updated", r.updated, "") + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.forUserId != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "for-user-id", r.forUserId, "") + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: TransactionApiService.GetAllTransactionsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTransactionByIDRequest struct { + ctx context.Context + ApiService TransactionApi + id string + forUserId *string +} + +// The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information +func (r ApiGetTransactionByIDRequest) ForUserId(forUserId string) ApiGetTransactionByIDRequest { + r.forUserId = &forUserId + return r +} + +func (r ApiGetTransactionByIDRequest) Execute() (*TransactionResponse, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetTransactionByIDExecute(r) +} + +/* +GetTransactionByID Get a transaction based on its id + +Get single specific transaction by transaction id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id + @return ApiGetTransactionByIDRequest +*/ +func (a *TransactionApiService) GetTransactionByID(ctx context.Context, id string) ApiGetTransactionByIDRequest { + return ApiGetTransactionByIDRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return TransactionResponse +func (a *TransactionApiService) GetTransactionByIDExecute(r ApiGetTransactionByIDRequest) (*TransactionResponse, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *TransactionResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "TransactionApiService.GetTransactionByID") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: TransactionApiService.GetTransactionByIDExecute") + } + + localVarPath := localBasePath + "/transactions/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(utils.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.forUserId != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "for-user-id", r.forUserId, "") + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: TransactionApiService.GetTransactionByIDExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/balance_and_transaction/model_balance.go b/balance_and_transaction/model_balance.go new file mode 100644 index 00000000..09232bb9 --- /dev/null +++ b/balance_and_transaction/model_balance.go @@ -0,0 +1,121 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Balance type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Balance{} + +// Balance The balance remaining in your account +type Balance struct { + Balance float32 `json:"balance"` +} + +// NewBalance instantiates a new Balance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBalance(balance float32) *Balance { + this := Balance{} + this.Balance = balance + return &this +} + +// NewBalanceWithDefaults instantiates a new Balance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBalanceWithDefaults() *Balance { + this := Balance{} + return &this +} + +// GetBalance returns the Balance field value +func (o *Balance) GetBalance() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value +// and a boolean to check if the value has been set. +func (o *Balance) GetBalanceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Balance, true +} + +// SetBalance sets field value +func (o *Balance) SetBalance(v float32) { + o.Balance = v +} + +func (o Balance) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Balance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["balance"] = o.Balance + return toSerialize, nil +} + +type NullableBalance struct { + value *Balance + isSet bool +} + +func (v NullableBalance) Get() *Balance { + return v.value +} + +func (v *NullableBalance) Set(val *Balance) { + v.value = val + v.isSet = true +} + +func (v NullableBalance) IsSet() bool { + return v.isSet +} + +func (v *NullableBalance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBalance(val *Balance) *NullableBalance { + return &NullableBalance{value: val, isSet: true} +} + +func (v NullableBalance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBalance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_channels_categories.go b/balance_and_transaction/model_channels_categories.go new file mode 100644 index 00000000..8369fb5f --- /dev/null +++ b/balance_and_transaction/model_channels_categories.go @@ -0,0 +1,139 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + "fmt" +) + +// ChannelsCategories the model 'ChannelsCategories' +type ChannelsCategories string + +// List of ChannelsCategories +const ( + CHANNELSCATEGORIES_BANK ChannelsCategories = "BANK" + CHANNELSCATEGORIES_CARDLESS_CREDIT ChannelsCategories = "CARDLESS_CREDIT" + CHANNELSCATEGORIES_PAYLATER ChannelsCategories = "PAYLATER" + CHANNELSCATEGORIES_CARDS ChannelsCategories = "CARDS" + CHANNELSCATEGORIES_CASH ChannelsCategories = "CASH" + CHANNELSCATEGORIES_DIRECT_DEBIT ChannelsCategories = "DIRECT_DEBIT" + CHANNELSCATEGORIES_EWALLET ChannelsCategories = "EWALLET" + CHANNELSCATEGORIES_INVOICE ChannelsCategories = "INVOICE" + CHANNELSCATEGORIES_QR_CODE ChannelsCategories = "QR_CODE" + CHANNELSCATEGORIES_RETAIL_OUTLET ChannelsCategories = "RETAIL_OUTLET" + CHANNELSCATEGORIES_VIRTUAL_ACCOUNT ChannelsCategories = "VIRTUAL_ACCOUNT" + CHANNELSCATEGORIES_XENPLATFORM ChannelsCategories = "XENPLATFORM" + CHANNELSCATEGORIES_DIRECT_BANK_TRANSFER ChannelsCategories = "DIRECT_BANK_TRANSFER" + CHANNELSCATEGORIES_OTHER ChannelsCategories = "OTHER" +) + +// All allowed values of ChannelsCategories enum +var AllowedChannelsCategoriesEnumValues = []ChannelsCategories{ + "BANK", + "CARDLESS_CREDIT", + "PAYLATER", + "CARDS", + "CASH", + "DIRECT_DEBIT", + "EWALLET", + "INVOICE", + "QR_CODE", + "RETAIL_OUTLET", + "VIRTUAL_ACCOUNT", + "XENPLATFORM", + "DIRECT_BANK_TRANSFER", + "OTHER", +} + +func (v *ChannelsCategories) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChannelsCategories(value) + for _, existing := range AllowedChannelsCategoriesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChannelsCategories", value) +} + +// NewChannelsCategoriesFromValue returns a pointer to a valid ChannelsCategories +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChannelsCategoriesFromValue(v string) (*ChannelsCategories, error) { + ev := ChannelsCategories(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChannelsCategories: valid values are %v", v, AllowedChannelsCategoriesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChannelsCategories) IsValid() bool { + for _, existing := range AllowedChannelsCategoriesEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v ChannelsCategories) String() string { + return string(v) +} + +// Ptr returns reference to ChannelsCategories value +func (v ChannelsCategories) Ptr() *ChannelsCategories { + return &v +} + +type NullableChannelsCategories struct { + value *ChannelsCategories + isSet bool +} + +func (v NullableChannelsCategories) Get() *ChannelsCategories { + return v.value +} + +func (v *NullableChannelsCategories) Set(val *ChannelsCategories) { + v.value = val + v.isSet = true +} + +func (v NullableChannelsCategories) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelsCategories) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelsCategories(val *ChannelsCategories) *NullableChannelsCategories { + return &NullableChannelsCategories{value: val, isSet: true} +} + +func (v NullableChannelsCategories) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelsCategories) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance_and_transaction/model_currency.go b/balance_and_transaction/model_currency.go new file mode 100644 index 00000000..55850ac9 --- /dev/null +++ b/balance_and_transaction/model_currency.go @@ -0,0 +1,435 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + "fmt" +) + +// Currency the model 'Currency' +type Currency string + +// List of Currency +const ( + CURRENCY_IDR Currency = "IDR" + CURRENCY_PHP Currency = "PHP" + CURRENCY_USD Currency = "USD" + CURRENCY_JPY Currency = "JPY" + CURRENCY_VND Currency = "VND" + CURRENCY_SGD Currency = "SGD" + CURRENCY_AED Currency = "AED" + CURRENCY_AFN Currency = "AFN" + CURRENCY_ALL Currency = "ALL" + CURRENCY_AMD Currency = "AMD" + CURRENCY_ANG Currency = "ANG" + CURRENCY_AOA Currency = "AOA" + CURRENCY_ARS Currency = "ARS" + CURRENCY_AUD Currency = "AUD" + CURRENCY_AWG Currency = "AWG" + CURRENCY_AZN Currency = "AZN" + CURRENCY_BAM Currency = "BAM" + CURRENCY_BBD Currency = "BBD" + CURRENCY_BDT Currency = "BDT" + CURRENCY_BGN Currency = "BGN" + CURRENCY_BHD Currency = "BHD" + CURRENCY_BIF Currency = "BIF" + CURRENCY_BMD Currency = "BMD" + CURRENCY_BND Currency = "BND" + CURRENCY_BOB Currency = "BOB" + CURRENCY_BRL Currency = "BRL" + CURRENCY_BSD Currency = "BSD" + CURRENCY_BTN Currency = "BTN" + CURRENCY_BWP Currency = "BWP" + CURRENCY_BYN Currency = "BYN" + CURRENCY_BZD Currency = "BZD" + CURRENCY_CAD Currency = "CAD" + CURRENCY_CDF Currency = "CDF" + CURRENCY_CHF Currency = "CHF" + CURRENCY_CLP Currency = "CLP" + CURRENCY_CNY Currency = "CNY" + CURRENCY_COP Currency = "COP" + CURRENCY_CRC Currency = "CRC" + CURRENCY_CUC Currency = "CUC" + CURRENCY_CUP Currency = "CUP" + CURRENCY_CVE Currency = "CVE" + CURRENCY_CZK Currency = "CZK" + CURRENCY_DJF Currency = "DJF" + CURRENCY_DKK Currency = "DKK" + CURRENCY_DOP Currency = "DOP" + CURRENCY_DZD Currency = "DZD" + CURRENCY_EGP Currency = "EGP" + CURRENCY_ERN Currency = "ERN" + CURRENCY_ETB Currency = "ETB" + CURRENCY_EUR Currency = "EUR" + CURRENCY_FJD Currency = "FJD" + CURRENCY_FKP Currency = "FKP" + CURRENCY_GBP Currency = "GBP" + CURRENCY_GEL Currency = "GEL" + CURRENCY_GGP Currency = "GGP" + CURRENCY_GHS Currency = "GHS" + CURRENCY_GIP Currency = "GIP" + CURRENCY_GMD Currency = "GMD" + CURRENCY_GNF Currency = "GNF" + CURRENCY_GTQ Currency = "GTQ" + CURRENCY_GYD Currency = "GYD" + CURRENCY_HKD Currency = "HKD" + CURRENCY_HNL Currency = "HNL" + CURRENCY_HRK Currency = "HRK" + CURRENCY_HTG Currency = "HTG" + CURRENCY_HUF Currency = "HUF" + CURRENCY_ILS Currency = "ILS" + CURRENCY_IMP Currency = "IMP" + CURRENCY_INR Currency = "INR" + CURRENCY_IQD Currency = "IQD" + CURRENCY_IRR Currency = "IRR" + CURRENCY_ISK Currency = "ISK" + CURRENCY_JEP Currency = "JEP" + CURRENCY_JMD Currency = "JMD" + CURRENCY_JOD Currency = "JOD" + CURRENCY_KES Currency = "KES" + CURRENCY_KGS Currency = "KGS" + CURRENCY_KHR Currency = "KHR" + CURRENCY_KMF Currency = "KMF" + CURRENCY_KPW Currency = "KPW" + CURRENCY_KRW Currency = "KRW" + CURRENCY_KWD Currency = "KWD" + CURRENCY_KYD Currency = "KYD" + CURRENCY_KZT Currency = "KZT" + CURRENCY_LAK Currency = "LAK" + CURRENCY_LBP Currency = "LBP" + CURRENCY_LKR Currency = "LKR" + CURRENCY_LRD Currency = "LRD" + CURRENCY_LSL Currency = "LSL" + CURRENCY_LYD Currency = "LYD" + CURRENCY_MAD Currency = "MAD" + CURRENCY_MDL Currency = "MDL" + CURRENCY_MGA Currency = "MGA" + CURRENCY_MKD Currency = "MKD" + CURRENCY_MMK Currency = "MMK" + CURRENCY_MNT Currency = "MNT" + CURRENCY_MOP Currency = "MOP" + CURRENCY_MRU Currency = "MRU" + CURRENCY_MUR Currency = "MUR" + CURRENCY_MVR Currency = "MVR" + CURRENCY_MWK Currency = "MWK" + CURRENCY_MXN Currency = "MXN" + CURRENCY_MYR Currency = "MYR" + CURRENCY_MZN Currency = "MZN" + CURRENCY_NAD Currency = "NAD" + CURRENCY_NGN Currency = "NGN" + CURRENCY_NIO Currency = "NIO" + CURRENCY_NOK Currency = "NOK" + CURRENCY_NPR Currency = "NPR" + CURRENCY_NZD Currency = "NZD" + CURRENCY_OMR Currency = "OMR" + CURRENCY_PAB Currency = "PAB" + CURRENCY_PEN Currency = "PEN" + CURRENCY_PGK Currency = "PGK" + CURRENCY_PKR Currency = "PKR" + CURRENCY_PLN Currency = "PLN" + CURRENCY_PYG Currency = "PYG" + CURRENCY_QAR Currency = "QAR" + CURRENCY_RON Currency = "RON" + CURRENCY_RSD Currency = "RSD" + CURRENCY_RUB Currency = "RUB" + CURRENCY_RWF Currency = "RWF" + CURRENCY_SAR Currency = "SAR" + CURRENCY_SBD Currency = "SBD" + CURRENCY_SCR Currency = "SCR" + CURRENCY_SDG Currency = "SDG" + CURRENCY_SEK Currency = "SEK" + CURRENCY_SHP Currency = "SHP" + CURRENCY_SLL Currency = "SLL" + CURRENCY_SOS Currency = "SOS" + CURRENCY_SPL Currency = "SPL" + CURRENCY_SRD Currency = "SRD" + CURRENCY_STN Currency = "STN" + CURRENCY_SVC Currency = "SVC" + CURRENCY_SYP Currency = "SYP" + CURRENCY_SZL Currency = "SZL" + CURRENCY_THB Currency = "THB" + CURRENCY_TJS Currency = "TJS" + CURRENCY_TMT Currency = "TMT" + CURRENCY_TND Currency = "TND" + CURRENCY_TOP Currency = "TOP" + CURRENCY_TRY Currency = "TRY" + CURRENCY_TTD Currency = "TTD" + CURRENCY_TVD Currency = "TVD" + CURRENCY_TWD Currency = "TWD" + CURRENCY_TZS Currency = "TZS" + CURRENCY_UAH Currency = "UAH" + CURRENCY_UGX Currency = "UGX" + CURRENCY_UYU Currency = "UYU" + CURRENCY_UZS Currency = "UZS" + CURRENCY_VEF Currency = "VEF" + CURRENCY_VUV Currency = "VUV" + CURRENCY_WST Currency = "WST" + CURRENCY_XAF Currency = "XAF" + CURRENCY_XCD Currency = "XCD" + CURRENCY_XDR Currency = "XDR" + CURRENCY_XOF Currency = "XOF" + CURRENCY_XPF Currency = "XPF" + CURRENCY_YER Currency = "YER" + CURRENCY_ZAR Currency = "ZAR" + CURRENCY_ZMW Currency = "ZMW" + CURRENCY_ZWD Currency = "ZWD" +) + +// All allowed values of Currency enum +var AllowedCurrencyEnumValues = []Currency{ + "IDR", + "PHP", + "USD", + "JPY", + "VND", + "SGD", + "AED", + "AFN", + "ALL", + "AMD", + "ANG", + "AOA", + "ARS", + "AUD", + "AWG", + "AZN", + "BAM", + "BBD", + "BDT", + "BGN", + "BHD", + "BIF", + "BMD", + "BND", + "BOB", + "BRL", + "BSD", + "BTN", + "BWP", + "BYN", + "BZD", + "CAD", + "CDF", + "CHF", + "CLP", + "CNY", + "COP", + "CRC", + "CUC", + "CUP", + "CVE", + "CZK", + "DJF", + "DKK", + "DOP", + "DZD", + "EGP", + "ERN", + "ETB", + "EUR", + "FJD", + "FKP", + "GBP", + "GEL", + "GGP", + "GHS", + "GIP", + "GMD", + "GNF", + "GTQ", + "GYD", + "HKD", + "HNL", + "HRK", + "HTG", + "HUF", + "ILS", + "IMP", + "INR", + "IQD", + "IRR", + "ISK", + "JEP", + "JMD", + "JOD", + "KES", + "KGS", + "KHR", + "KMF", + "KPW", + "KRW", + "KWD", + "KYD", + "KZT", + "LAK", + "LBP", + "LKR", + "LRD", + "LSL", + "LYD", + "MAD", + "MDL", + "MGA", + "MKD", + "MMK", + "MNT", + "MOP", + "MRU", + "MUR", + "MVR", + "MWK", + "MXN", + "MYR", + "MZN", + "NAD", + "NGN", + "NIO", + "NOK", + "NPR", + "NZD", + "OMR", + "PAB", + "PEN", + "PGK", + "PKR", + "PLN", + "PYG", + "QAR", + "RON", + "RSD", + "RUB", + "RWF", + "SAR", + "SBD", + "SCR", + "SDG", + "SEK", + "SHP", + "SLL", + "SOS", + "SPL", + "SRD", + "STN", + "SVC", + "SYP", + "SZL", + "THB", + "TJS", + "TMT", + "TND", + "TOP", + "TRY", + "TTD", + "TVD", + "TWD", + "TZS", + "UAH", + "UGX", + "UYU", + "UZS", + "VEF", + "VUV", + "WST", + "XAF", + "XCD", + "XDR", + "XOF", + "XPF", + "YER", + "ZAR", + "ZMW", + "ZWD", +} + +func (v *Currency) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Currency(value) + for _, existing := range AllowedCurrencyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Currency", value) +} + +// NewCurrencyFromValue returns a pointer to a valid Currency +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCurrencyFromValue(v string) (*Currency, error) { + ev := Currency(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Currency: valid values are %v", v, AllowedCurrencyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Currency) IsValid() bool { + for _, existing := range AllowedCurrencyEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v Currency) String() string { + return string(v) +} + +// Ptr returns reference to Currency value +func (v Currency) Ptr() *Currency { + return &v +} + +type NullableCurrency struct { + value *Currency + isSet bool +} + +func (v NullableCurrency) Get() *Currency { + return v.value +} + +func (v *NullableCurrency) Set(val *Currency) { + v.value = val + v.isSet = true +} + +func (v NullableCurrency) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrency) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrency(val *Currency) *NullableCurrency { + return &NullableCurrency{value: val, isSet: true} +} + +func (v NullableCurrency) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrency) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance_and_transaction/model_date_range_filter.go b/balance_and_transaction/model_date_range_filter.go new file mode 100644 index 00000000..accaa580 --- /dev/null +++ b/balance_and_transaction/model_date_range_filter.go @@ -0,0 +1,169 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the DateRangeFilter type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DateRangeFilter{} + +// DateRangeFilter struct for DateRangeFilter +type DateRangeFilter struct { + // Start time of transaction. If not specified will list all dates. + Gte *time.Time `json:"gte,omitempty"` + // End time of transaction. If not specified will list all dates. + Lte *time.Time `json:"lte,omitempty"` +} + +// NewDateRangeFilter instantiates a new DateRangeFilter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDateRangeFilter() *DateRangeFilter { + this := DateRangeFilter{} + return &this +} + +// NewDateRangeFilterWithDefaults instantiates a new DateRangeFilter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDateRangeFilterWithDefaults() *DateRangeFilter { + this := DateRangeFilter{} + return &this +} + +// GetGte returns the Gte field value if set, zero value otherwise. +func (o *DateRangeFilter) GetGte() time.Time { + if o == nil || utils.IsNil(o.Gte) { + var ret time.Time + return ret + } + return *o.Gte +} + +// GetGteOk returns a tuple with the Gte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DateRangeFilter) GetGteOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.Gte) { + return nil, false + } + return o.Gte, true +} + +// HasGte returns a boolean if a field has been set. +func (o *DateRangeFilter) HasGte() bool { + if o != nil && !utils.IsNil(o.Gte) { + return true + } + + return false +} + +// SetGte gets a reference to the given time.Time and assigns it to the Gte field. +func (o *DateRangeFilter) SetGte(v time.Time) { + o.Gte = &v +} + +// GetLte returns the Lte field value if set, zero value otherwise. +func (o *DateRangeFilter) GetLte() time.Time { + if o == nil || utils.IsNil(o.Lte) { + var ret time.Time + return ret + } + return *o.Lte +} + +// GetLteOk returns a tuple with the Lte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DateRangeFilter) GetLteOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.Lte) { + return nil, false + } + return o.Lte, true +} + +// HasLte returns a boolean if a field has been set. +func (o *DateRangeFilter) HasLte() bool { + if o != nil && !utils.IsNil(o.Lte) { + return true + } + + return false +} + +// SetLte gets a reference to the given time.Time and assigns it to the Lte field. +func (o *DateRangeFilter) SetLte(v time.Time) { + o.Lte = &v +} + +func (o DateRangeFilter) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DateRangeFilter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Gte) { + toSerialize["gte"] = o.Gte + } + if !utils.IsNil(o.Lte) { + toSerialize["lte"] = o.Lte + } + return toSerialize, nil +} + +type NullableDateRangeFilter struct { + value *DateRangeFilter + isSet bool +} + +func (v NullableDateRangeFilter) Get() *DateRangeFilter { + return v.value +} + +func (v *NullableDateRangeFilter) Set(val *DateRangeFilter) { + v.value = val + v.isSet = true +} + +func (v NullableDateRangeFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableDateRangeFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDateRangeFilter(val *DateRangeFilter) *NullableDateRangeFilter { + return &NullableDateRangeFilter{value: val, isSet: true} +} + +func (v NullableDateRangeFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDateRangeFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_fee_response.go b/balance_and_transaction/model_fee_response.go new file mode 100644 index 00000000..a604c823 --- /dev/null +++ b/balance_and_transaction/model_fee_response.go @@ -0,0 +1,260 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the FeeResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &FeeResponse{} + +// FeeResponse struct for FeeResponse +type FeeResponse struct { + // Amount of the Xendit fee for this transaction. + XenditFee float32 `json:"xendit_fee"` + // Amount of the VAT for this transaction. + ValueAddedTax float32 `json:"value_added_tax"` + // Amount of the Xendit Withholding Tax for this transaction if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat) for more information. + XenditWithholdingTax *float32 `json:"xendit_withholding_tax,omitempty"` + // Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank + ThirdPartyWithholdingTax *float32 `json:"third_party_withholding_tax,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewFeeResponse instantiates a new FeeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFeeResponse(xenditFee float32, valueAddedTax float32) *FeeResponse { + this := FeeResponse{} + this.XenditFee = xenditFee + this.ValueAddedTax = valueAddedTax + return &this +} + +// NewFeeResponseWithDefaults instantiates a new FeeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFeeResponseWithDefaults() *FeeResponse { + this := FeeResponse{} + return &this +} + +// GetXenditFee returns the XenditFee field value +func (o *FeeResponse) GetXenditFee() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.XenditFee +} + +// GetXenditFeeOk returns a tuple with the XenditFee field value +// and a boolean to check if the value has been set. +func (o *FeeResponse) GetXenditFeeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.XenditFee, true +} + +// SetXenditFee sets field value +func (o *FeeResponse) SetXenditFee(v float32) { + o.XenditFee = v +} + +// GetValueAddedTax returns the ValueAddedTax field value +func (o *FeeResponse) GetValueAddedTax() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ValueAddedTax +} + +// GetValueAddedTaxOk returns a tuple with the ValueAddedTax field value +// and a boolean to check if the value has been set. +func (o *FeeResponse) GetValueAddedTaxOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ValueAddedTax, true +} + +// SetValueAddedTax sets field value +func (o *FeeResponse) SetValueAddedTax(v float32) { + o.ValueAddedTax = v +} + +// GetXenditWithholdingTax returns the XenditWithholdingTax field value if set, zero value otherwise. +func (o *FeeResponse) GetXenditWithholdingTax() float32 { + if o == nil || utils.IsNil(o.XenditWithholdingTax) { + var ret float32 + return ret + } + return *o.XenditWithholdingTax +} + +// GetXenditWithholdingTaxOk returns a tuple with the XenditWithholdingTax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeeResponse) GetXenditWithholdingTaxOk() (*float32, bool) { + if o == nil || utils.IsNil(o.XenditWithholdingTax) { + return nil, false + } + return o.XenditWithholdingTax, true +} + +// HasXenditWithholdingTax returns a boolean if a field has been set. +func (o *FeeResponse) HasXenditWithholdingTax() bool { + if o != nil && !utils.IsNil(o.XenditWithholdingTax) { + return true + } + + return false +} + +// SetXenditWithholdingTax gets a reference to the given float32 and assigns it to the XenditWithholdingTax field. +func (o *FeeResponse) SetXenditWithholdingTax(v float32) { + o.XenditWithholdingTax = &v +} + +// GetThirdPartyWithholdingTax returns the ThirdPartyWithholdingTax field value if set, zero value otherwise. +func (o *FeeResponse) GetThirdPartyWithholdingTax() float32 { + if o == nil || utils.IsNil(o.ThirdPartyWithholdingTax) { + var ret float32 + return ret + } + return *o.ThirdPartyWithholdingTax +} + +// GetThirdPartyWithholdingTaxOk returns a tuple with the ThirdPartyWithholdingTax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeeResponse) GetThirdPartyWithholdingTaxOk() (*float32, bool) { + if o == nil || utils.IsNil(o.ThirdPartyWithholdingTax) { + return nil, false + } + return o.ThirdPartyWithholdingTax, true +} + +// HasThirdPartyWithholdingTax returns a boolean if a field has been set. +func (o *FeeResponse) HasThirdPartyWithholdingTax() bool { + if o != nil && !utils.IsNil(o.ThirdPartyWithholdingTax) { + return true + } + + return false +} + +// SetThirdPartyWithholdingTax gets a reference to the given float32 and assigns it to the ThirdPartyWithholdingTax field. +func (o *FeeResponse) SetThirdPartyWithholdingTax(v float32) { + o.ThirdPartyWithholdingTax = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *FeeResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FeeResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *FeeResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *FeeResponse) SetStatus(v string) { + o.Status = &v +} + +func (o FeeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FeeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["xendit_fee"] = o.XenditFee + toSerialize["value_added_tax"] = o.ValueAddedTax + if !utils.IsNil(o.XenditWithholdingTax) { + toSerialize["xendit_withholding_tax"] = o.XenditWithholdingTax + } + if !utils.IsNil(o.ThirdPartyWithholdingTax) { + toSerialize["third_party_withholding_tax"] = o.ThirdPartyWithholdingTax + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableFeeResponse struct { + value *FeeResponse + isSet bool +} + +func (v NullableFeeResponse) Get() *FeeResponse { + return v.value +} + +func (v *NullableFeeResponse) Set(val *FeeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFeeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFeeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeeResponse(val *FeeResponse) *NullableFeeResponse { + return &NullableFeeResponse{value: val, isSet: true} +} + +func (v NullableFeeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_link_item.go b/balance_and_transaction/model_link_item.go new file mode 100644 index 00000000..02506281 --- /dev/null +++ b/balance_and_transaction/model_link_item.go @@ -0,0 +1,178 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the LinkItem type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &LinkItem{} + +// LinkItem struct for LinkItem +type LinkItem struct { + // URI of target, this will be to the next link. + Href string `json:"href"` + // The relationship between source and target. The value will be `next`. + Rel string `json:"rel"` + // The HTTP method, the value will be `GET`. + Method string `json:"method"` +} + +// NewLinkItem instantiates a new LinkItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLinkItem(href string, rel string, method string) *LinkItem { + this := LinkItem{} + this.Href = href + this.Rel = rel + this.Method = method + return &this +} + +// NewLinkItemWithDefaults instantiates a new LinkItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLinkItemWithDefaults() *LinkItem { + this := LinkItem{} + return &this +} + +// GetHref returns the Href field value +func (o *LinkItem) GetHref() string { + if o == nil { + var ret string + return ret + } + + return o.Href +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +func (o *LinkItem) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Href, true +} + +// SetHref sets field value +func (o *LinkItem) SetHref(v string) { + o.Href = v +} + +// GetRel returns the Rel field value +func (o *LinkItem) GetRel() string { + if o == nil { + var ret string + return ret + } + + return o.Rel +} + +// GetRelOk returns a tuple with the Rel field value +// and a boolean to check if the value has been set. +func (o *LinkItem) GetRelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Rel, true +} + +// SetRel sets field value +func (o *LinkItem) SetRel(v string) { + o.Rel = v +} + +// GetMethod returns the Method field value +func (o *LinkItem) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *LinkItem) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *LinkItem) SetMethod(v string) { + o.Method = v +} + +func (o LinkItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LinkItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["href"] = o.Href + toSerialize["rel"] = o.Rel + toSerialize["method"] = o.Method + return toSerialize, nil +} + +type NullableLinkItem struct { + value *LinkItem + isSet bool +} + +func (v NullableLinkItem) Get() *LinkItem { + return v.value +} + +func (v *NullableLinkItem) Set(val *LinkItem) { + v.value = val + v.isSet = true +} + +func (v NullableLinkItem) IsSet() bool { + return v.isSet +} + +func (v *NullableLinkItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLinkItem(val *LinkItem) *NullableLinkItem { + return &NullableLinkItem{value: val, isSet: true} +} + +func (v NullableLinkItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLinkItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_server_error.go b/balance_and_transaction/model_server_error.go new file mode 100644 index 00000000..da191e60 --- /dev/null +++ b/balance_and_transaction/model_server_error.go @@ -0,0 +1,175 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ServerError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ServerError{} + +// ServerError struct for ServerError +type ServerError struct { + StatusCode float32 `json:"status_code"` + Error string `json:"error"` + Message string `json:"message"` +} + +// NewServerError instantiates a new ServerError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerError(statusCode float32, error_ string, message string) *ServerError { + this := ServerError{} + this.StatusCode = statusCode + this.Error = error_ + this.Message = message + return &this +} + +// NewServerErrorWithDefaults instantiates a new ServerError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerErrorWithDefaults() *ServerError { + this := ServerError{} + return &this +} + +// GetStatusCode returns the StatusCode field value +func (o *ServerError) GetStatusCode() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *ServerError) GetStatusCodeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *ServerError) SetStatusCode(v float32) { + o.StatusCode = v +} + +// GetError returns the Error field value +func (o *ServerError) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ServerError) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ServerError) SetError(v string) { + o.Error = v +} + +// GetMessage returns the Message field value +func (o *ServerError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ServerError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ServerError) SetMessage(v string) { + o.Message = v +} + +func (o ServerError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status_code"] = o.StatusCode + toSerialize["error"] = o.Error + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableServerError struct { + value *ServerError + isSet bool +} + +func (v NullableServerError) Get() *ServerError { + return v.value +} + +func (v *NullableServerError) Set(val *ServerError) { + v.value = val + v.isSet = true +} + +func (v NullableServerError) IsSet() bool { + return v.isSet +} + +func (v *NullableServerError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerError(val *ServerError) *NullableServerError { + return &NullableServerError{value: val, isSet: true} +} + +func (v NullableServerError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_transaction_response.go b/balance_and_transaction/model_transaction_response.go new file mode 100644 index 00000000..56571dc5 --- /dev/null +++ b/balance_and_transaction/model_transaction_response.go @@ -0,0 +1,608 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the TransactionResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &TransactionResponse{} + +// TransactionResponse struct for TransactionResponse +type TransactionResponse struct { + // The unique id of a transaction. It will have `txn_` as prefix + Id string `json:"id"` + // The product_id of the transaction. Product id will have a different prefix for each product. You can use this id to match the transaction from this API to each product API. + ProductId string `json:"product_id"` + Type TransactionResponseType `json:"type"` + Status TransactionStatuses `json:"status"` + ChannelCategory ChannelsCategories `json:"channel_category"` + // The channel of the transaction that is used. See [channel codes](https://docs.xendit.co/xendisburse/channel-codes) for the list of available per channel categories. + ChannelCode NullableString `json:"channel_code"` + // Account identifier of transaction. The format will be different from each channel. + AccountIdentifier NullableString `json:"account_identifier"` + // customer supplied reference/external_id + ReferenceId string `json:"reference_id"` + Currency Currency `json:"currency"` + // The transaction amount. The number of decimal places will be different for each currency according to ISO 4217. + Amount float32 `json:"amount"` + // Representing whether the transaction is money in or money out For transfer, the transfer out side it will shows up as money out and on transfer in side in will shows up as money-in. Available values are `MONEY_IN` for money in and `MONEY_OUT` for money out. + Cashflow string `json:"cashflow"` + // The settlement status of the transaction. `PENDING` - Transaction amount has not been settled to merchant's balance. `SETTLED` - Transaction has been settled to merchant's balance + SettlementStatus NullableString `json:"settlement_status,omitempty"` + // Estimated settlement time will only apply to money-in transactions. For money-out transaction, the value will be `NULL`. Estimated settlement time in which transaction amount will be settled to merchant's balance. + EstimatedSettlementTime NullableTime `json:"estimated_settlement_time,omitempty"` + // The id of business where this transaction belong to + BusinessId string `json:"business_id"` + Fee FeeResponse `json:"fee"` + // Transaction created timestamp (UTC+0) + Created time.Time `json:"created"` + // Transaction updated timestamp (UTC+0) + Updated time.Time `json:"updated"` +} + +// NewTransactionResponse instantiates a new TransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionResponse(id string, productId string, type_ TransactionResponseType, status TransactionStatuses, channelCategory ChannelsCategories, channelCode NullableString, accountIdentifier NullableString, referenceId string, currency Currency, amount float32, cashflow string, businessId string, fee FeeResponse, created time.Time, updated time.Time) *TransactionResponse { + this := TransactionResponse{} + this.Id = id + this.ProductId = productId + this.Type = type_ + this.Status = status + this.ChannelCategory = channelCategory + this.ChannelCode = channelCode + this.AccountIdentifier = accountIdentifier + this.ReferenceId = referenceId + this.Currency = currency + this.Amount = amount + this.Cashflow = cashflow + this.BusinessId = businessId + this.Fee = fee + this.Created = created + this.Updated = updated + return &this +} + +// NewTransactionResponseWithDefaults instantiates a new TransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionResponseWithDefaults() *TransactionResponse { + this := TransactionResponse{} + return &this +} + +// GetId returns the Id field value +func (o *TransactionResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TransactionResponse) SetId(v string) { + o.Id = v +} + +// GetProductId returns the ProductId field value +func (o *TransactionResponse) GetProductId() string { + if o == nil { + var ret string + return ret + } + + return o.ProductId +} + +// GetProductIdOk returns a tuple with the ProductId field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetProductIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProductId, true +} + +// SetProductId sets field value +func (o *TransactionResponse) SetProductId(v string) { + o.ProductId = v +} + +// GetType returns the Type field value +func (o *TransactionResponse) GetType() TransactionResponseType { + if o == nil { + var ret TransactionResponseType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetTypeOk() (*TransactionResponseType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *TransactionResponse) SetType(v TransactionResponseType) { + o.Type = v +} + +// GetStatus returns the Status field value +func (o *TransactionResponse) GetStatus() TransactionStatuses { + if o == nil { + var ret TransactionStatuses + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetStatusOk() (*TransactionStatuses, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *TransactionResponse) SetStatus(v TransactionStatuses) { + o.Status = v +} + +// GetChannelCategory returns the ChannelCategory field value +func (o *TransactionResponse) GetChannelCategory() ChannelsCategories { + if o == nil { + var ret ChannelsCategories + return ret + } + + return o.ChannelCategory +} + +// GetChannelCategoryOk returns a tuple with the ChannelCategory field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetChannelCategoryOk() (*ChannelsCategories, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCategory, true +} + +// SetChannelCategory sets field value +func (o *TransactionResponse) SetChannelCategory(v ChannelsCategories) { + o.ChannelCategory = v +} + +// GetChannelCode returns the ChannelCode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TransactionResponse) GetChannelCode() string { + if o == nil || o.ChannelCode.Get() == nil { + var ret string + return ret + } + + return *o.ChannelCode.Get() +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionResponse) GetChannelCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChannelCode.Get(), o.ChannelCode.IsSet() +} + +// SetChannelCode sets field value +func (o *TransactionResponse) SetChannelCode(v string) { + o.ChannelCode.Set(&v) +} + +// GetAccountIdentifier returns the AccountIdentifier field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TransactionResponse) GetAccountIdentifier() string { + if o == nil || o.AccountIdentifier.Get() == nil { + var ret string + return ret + } + + return *o.AccountIdentifier.Get() +} + +// GetAccountIdentifierOk returns a tuple with the AccountIdentifier field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionResponse) GetAccountIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccountIdentifier.Get(), o.AccountIdentifier.IsSet() +} + +// SetAccountIdentifier sets field value +func (o *TransactionResponse) SetAccountIdentifier(v string) { + o.AccountIdentifier.Set(&v) +} + +// GetReferenceId returns the ReferenceId field value +func (o *TransactionResponse) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *TransactionResponse) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetCurrency returns the Currency field value +func (o *TransactionResponse) GetCurrency() Currency { + if o == nil { + var ret Currency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetCurrencyOk() (*Currency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *TransactionResponse) SetCurrency(v Currency) { + o.Currency = v +} + +// GetAmount returns the Amount field value +func (o *TransactionResponse) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *TransactionResponse) SetAmount(v float32) { + o.Amount = v +} + +// GetCashflow returns the Cashflow field value +func (o *TransactionResponse) GetCashflow() string { + if o == nil { + var ret string + return ret + } + + return o.Cashflow +} + +// GetCashflowOk returns a tuple with the Cashflow field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetCashflowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cashflow, true +} + +// SetCashflow sets field value +func (o *TransactionResponse) SetCashflow(v string) { + o.Cashflow = v +} + +// GetSettlementStatus returns the SettlementStatus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransactionResponse) GetSettlementStatus() string { + if o == nil || utils.IsNil(o.SettlementStatus.Get()) { + var ret string + return ret + } + return *o.SettlementStatus.Get() +} + +// GetSettlementStatusOk returns a tuple with the SettlementStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionResponse) GetSettlementStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SettlementStatus.Get(), o.SettlementStatus.IsSet() +} + +// HasSettlementStatus returns a boolean if a field has been set. +func (o *TransactionResponse) HasSettlementStatus() bool { + if o != nil && o.SettlementStatus.IsSet() { + return true + } + + return false +} + +// SetSettlementStatus gets a reference to the given NullableString and assigns it to the SettlementStatus field. +func (o *TransactionResponse) SetSettlementStatus(v string) { + o.SettlementStatus.Set(&v) +} +// SetSettlementStatusNil sets the value for SettlementStatus to be an explicit nil +func (o *TransactionResponse) SetSettlementStatusNil() { + o.SettlementStatus.Set(nil) +} + +// UnsetSettlementStatus ensures that no value is present for SettlementStatus, not even an explicit nil +func (o *TransactionResponse) UnsetSettlementStatus() { + o.SettlementStatus.Unset() +} + +// GetEstimatedSettlementTime returns the EstimatedSettlementTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransactionResponse) GetEstimatedSettlementTime() time.Time { + if o == nil || utils.IsNil(o.EstimatedSettlementTime.Get()) { + var ret time.Time + return ret + } + return *o.EstimatedSettlementTime.Get() +} + +// GetEstimatedSettlementTimeOk returns a tuple with the EstimatedSettlementTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionResponse) GetEstimatedSettlementTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.EstimatedSettlementTime.Get(), o.EstimatedSettlementTime.IsSet() +} + +// HasEstimatedSettlementTime returns a boolean if a field has been set. +func (o *TransactionResponse) HasEstimatedSettlementTime() bool { + if o != nil && o.EstimatedSettlementTime.IsSet() { + return true + } + + return false +} + +// SetEstimatedSettlementTime gets a reference to the given NullableTime and assigns it to the EstimatedSettlementTime field. +func (o *TransactionResponse) SetEstimatedSettlementTime(v time.Time) { + o.EstimatedSettlementTime.Set(&v) +} +// SetEstimatedSettlementTimeNil sets the value for EstimatedSettlementTime to be an explicit nil +func (o *TransactionResponse) SetEstimatedSettlementTimeNil() { + o.EstimatedSettlementTime.Set(nil) +} + +// UnsetEstimatedSettlementTime ensures that no value is present for EstimatedSettlementTime, not even an explicit nil +func (o *TransactionResponse) UnsetEstimatedSettlementTime() { + o.EstimatedSettlementTime.Unset() +} + +// GetBusinessId returns the BusinessId field value +func (o *TransactionResponse) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *TransactionResponse) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetFee returns the Fee field value +func (o *TransactionResponse) GetFee() FeeResponse { + if o == nil { + var ret FeeResponse + return ret + } + + return o.Fee +} + +// GetFeeOk returns a tuple with the Fee field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetFeeOk() (*FeeResponse, bool) { + if o == nil { + return nil, false + } + return &o.Fee, true +} + +// SetFee sets field value +func (o *TransactionResponse) SetFee(v FeeResponse) { + o.Fee = v +} + +// GetCreated returns the Created field value +func (o *TransactionResponse) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *TransactionResponse) SetCreated(v time.Time) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *TransactionResponse) GetUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *TransactionResponse) GetUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *TransactionResponse) SetUpdated(v time.Time) { + o.Updated = v +} + +func (o TransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["product_id"] = o.ProductId + toSerialize["type"] = o.Type + toSerialize["status"] = o.Status + toSerialize["channel_category"] = o.ChannelCategory + toSerialize["channel_code"] = o.ChannelCode.Get() + toSerialize["account_identifier"] = o.AccountIdentifier.Get() + toSerialize["reference_id"] = o.ReferenceId + toSerialize["currency"] = o.Currency + toSerialize["amount"] = o.Amount + toSerialize["cashflow"] = o.Cashflow + if o.SettlementStatus.IsSet() { + toSerialize["settlement_status"] = o.SettlementStatus.Get() + } + if o.EstimatedSettlementTime.IsSet() { + toSerialize["estimated_settlement_time"] = o.EstimatedSettlementTime.Get() + } + toSerialize["business_id"] = o.BusinessId + toSerialize["fee"] = o.Fee + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + return toSerialize, nil +} + +type NullableTransactionResponse struct { + value *TransactionResponse + isSet bool +} + +func (v NullableTransactionResponse) Get() *TransactionResponse { + return v.value +} + +func (v *NullableTransactionResponse) Set(val *TransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionResponse(val *TransactionResponse) *NullableTransactionResponse { + return &NullableTransactionResponse{value: val, isSet: true} +} + +func (v NullableTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_transaction_response_type.go b/balance_and_transaction/model_transaction_response_type.go new file mode 100644 index 00000000..b9b79bae --- /dev/null +++ b/balance_and_transaction/model_transaction_response_type.go @@ -0,0 +1,106 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + "fmt" +) + +// TransactionResponseType The type of the transactions. +type TransactionResponseType struct { + TransactionTypes *TransactionTypes + string *string +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *TransactionResponseType) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into TransactionTypes + err = json.Unmarshal(data, &dst.TransactionTypes); + if err == nil { + jsonTransactionTypes, _ := json.Marshal(dst.TransactionTypes) + if string(jsonTransactionTypes) == "{}" { // empty struct + dst.TransactionTypes = nil + } else { + return nil // data stored in dst.TransactionTypes, return on the first match + } + } else { + dst.TransactionTypes = nil + } + + // try to unmarshal JSON data into string + err = json.Unmarshal(data, &dst.string); + if err == nil { + jsonstring, _ := json.Marshal(dst.string) + if string(jsonstring) == "{}" { // empty struct + dst.string = nil + } else { + return nil // data stored in dst.string, return on the first match + } + } else { + dst.string = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(TransactionResponseType)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *TransactionResponseType) MarshalJSON() ([]byte, error) { + if src.TransactionTypes != nil { + return json.Marshal(&src.TransactionTypes) + } + + if src.string != nil { + return json.Marshal(&src.string) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableTransactionResponseType struct { + value *TransactionResponseType + isSet bool +} + +func (v NullableTransactionResponseType) Get() *TransactionResponseType { + return v.value +} + +func (v *NullableTransactionResponseType) Set(val *TransactionResponseType) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionResponseType) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionResponseType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionResponseType(val *TransactionResponseType) *NullableTransactionResponseType { + return &NullableTransactionResponseType{value: val, isSet: true} +} + +func (v NullableTransactionResponseType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionResponseType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_transaction_statuses.go b/balance_and_transaction/model_transaction_statuses.go new file mode 100644 index 00000000..52cb7636 --- /dev/null +++ b/balance_and_transaction/model_transaction_statuses.go @@ -0,0 +1,121 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + "fmt" +) + +// TransactionStatuses the model 'TransactionStatuses' +type TransactionStatuses string + +// List of TransactionStatuses +const ( + TRANSACTIONSTATUSES_SUCCESS TransactionStatuses = "SUCCESS" + TRANSACTIONSTATUSES_PENDING TransactionStatuses = "PENDING" + TRANSACTIONSTATUSES_FAILED TransactionStatuses = "FAILED" + TRANSACTIONSTATUSES_REVERSED TransactionStatuses = "REVERSED" + TRANSACTIONSTATUSES_VOIDED TransactionStatuses = "VOIDED" +) + +// All allowed values of TransactionStatuses enum +var AllowedTransactionStatusesEnumValues = []TransactionStatuses{ + "SUCCESS", + "PENDING", + "FAILED", + "REVERSED", + "VOIDED", +} + +func (v *TransactionStatuses) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TransactionStatuses(value) + for _, existing := range AllowedTransactionStatusesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TransactionStatuses", value) +} + +// NewTransactionStatusesFromValue returns a pointer to a valid TransactionStatuses +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTransactionStatusesFromValue(v string) (*TransactionStatuses, error) { + ev := TransactionStatuses(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TransactionStatuses: valid values are %v", v, AllowedTransactionStatusesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TransactionStatuses) IsValid() bool { + for _, existing := range AllowedTransactionStatusesEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v TransactionStatuses) String() string { + return string(v) +} + +// Ptr returns reference to TransactionStatuses value +func (v TransactionStatuses) Ptr() *TransactionStatuses { + return &v +} + +type NullableTransactionStatuses struct { + value *TransactionStatuses + isSet bool +} + +func (v NullableTransactionStatuses) Get() *TransactionStatuses { + return v.value +} + +func (v *NullableTransactionStatuses) Set(val *TransactionStatuses) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionStatuses) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionStatuses) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionStatuses(val *TransactionStatuses) *NullableTransactionStatuses { + return &NullableTransactionStatuses{value: val, isSet: true} +} + +func (v NullableTransactionStatuses) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionStatuses) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance_and_transaction/model_transaction_types.go b/balance_and_transaction/model_transaction_types.go new file mode 100644 index 00000000..02efdee4 --- /dev/null +++ b/balance_and_transaction/model_transaction_types.go @@ -0,0 +1,137 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + "fmt" +) + +// TransactionTypes the model 'TransactionTypes' +type TransactionTypes string + +// List of TransactionTypes +const ( + TRANSACTIONTYPES_BATCH_DISBURSEMENT TransactionTypes = "BATCH_DISBURSEMENT" + TRANSACTIONTYPES_DISBURSEMENT TransactionTypes = "DISBURSEMENT" + TRANSACTIONTYPES_PAYMENT TransactionTypes = "PAYMENT" + TRANSACTIONTYPES_REMITTANCE TransactionTypes = "REMITTANCE" + TRANSACTIONTYPES_REMITTANCE_PAYOUT TransactionTypes = "REMITTANCE_PAYOUT" + TRANSACTIONTYPES_REMITTANCE_COLLECTION TransactionTypes = "REMITTANCE_COLLECTION" + TRANSACTIONTYPES_TRANSFER TransactionTypes = "TRANSFER" + TRANSACTIONTYPES_PLATFORM_FEE TransactionTypes = "PLATFORM_FEE" + TRANSACTIONTYPES_REFUND TransactionTypes = "REFUND" + TRANSACTIONTYPES_CASHBACK TransactionTypes = "CASHBACK" + TRANSACTIONTYPES_TOPUP TransactionTypes = "TOPUP" + TRANSACTIONTYPES_WITHDRAWAL TransactionTypes = "WITHDRAWAL" + TRANSACTIONTYPES_OTHER TransactionTypes = "OTHER" +) + +// All allowed values of TransactionTypes enum +var AllowedTransactionTypesEnumValues = []TransactionTypes{ + "BATCH_DISBURSEMENT", + "DISBURSEMENT", + "PAYMENT", + "REMITTANCE", + "REMITTANCE_PAYOUT", + "REMITTANCE_COLLECTION", + "TRANSFER", + "PLATFORM_FEE", + "REFUND", + "CASHBACK", + "TOPUP", + "WITHDRAWAL", + "OTHER", +} + +func (v *TransactionTypes) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TransactionTypes(value) + for _, existing := range AllowedTransactionTypesEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TransactionTypes", value) +} + +// NewTransactionTypesFromValue returns a pointer to a valid TransactionTypes +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTransactionTypesFromValue(v string) (*TransactionTypes, error) { + ev := TransactionTypes(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TransactionTypes: valid values are %v", v, AllowedTransactionTypesEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TransactionTypes) IsValid() bool { + for _, existing := range AllowedTransactionTypesEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v TransactionTypes) String() string { + return string(v) +} + +// Ptr returns reference to TransactionTypes value +func (v TransactionTypes) Ptr() *TransactionTypes { + return &v +} + +type NullableTransactionTypes struct { + value *TransactionTypes + isSet bool +} + +func (v NullableTransactionTypes) Get() *TransactionTypes { + return v.value +} + +func (v *NullableTransactionTypes) Set(val *TransactionTypes) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionTypes) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionTypes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionTypes(val *TransactionTypes) *NullableTransactionTypes { + return &NullableTransactionTypes{value: val, isSet: true} +} + +func (v NullableTransactionTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance_and_transaction/model_transactions_response.go b/balance_and_transaction/model_transactions_response.go new file mode 100644 index 00000000..3d91428d --- /dev/null +++ b/balance_and_transaction/model_transactions_response.go @@ -0,0 +1,186 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the TransactionsResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &TransactionsResponse{} + +// TransactionsResponse Returns an array of Transaction Objects. Returns empty array when there is no result. +type TransactionsResponse struct { + // Indicates whether there are more items to be queried with `after_id` of the last item from the current result. Use the `links` to follow to the next result. + HasMore bool `json:"has_more"` + // The links to the next page based on LinkItem if there is next result. + Links []LinkItem `json:"links,omitempty"` + Data []TransactionResponse `json:"data"` +} + +// NewTransactionsResponse instantiates a new TransactionsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionsResponse(hasMore bool, data []TransactionResponse) *TransactionsResponse { + this := TransactionsResponse{} + this.HasMore = hasMore + this.Data = data + return &this +} + +// NewTransactionsResponseWithDefaults instantiates a new TransactionsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionsResponseWithDefaults() *TransactionsResponse { + this := TransactionsResponse{} + return &this +} + +// GetHasMore returns the HasMore field value +func (o *TransactionsResponse) GetHasMore() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value +// and a boolean to check if the value has been set. +func (o *TransactionsResponse) GetHasMoreOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasMore, true +} + +// SetHasMore sets field value +func (o *TransactionsResponse) SetHasMore(v bool) { + o.HasMore = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *TransactionsResponse) GetLinks() []LinkItem { + if o == nil || utils.IsNil(o.Links) { + var ret []LinkItem + return ret + } + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionsResponse) GetLinksOk() ([]LinkItem, bool) { + if o == nil || utils.IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *TransactionsResponse) HasLinks() bool { + if o != nil && !utils.IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []LinkItem and assigns it to the Links field. +func (o *TransactionsResponse) SetLinks(v []LinkItem) { + o.Links = v +} + +// GetData returns the Data field value +func (o *TransactionsResponse) GetData() []TransactionResponse { + if o == nil { + var ret []TransactionResponse + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *TransactionsResponse) GetDataOk() ([]TransactionResponse, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *TransactionsResponse) SetData(v []TransactionResponse) { + o.Data = v +} + +func (o TransactionsResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["has_more"] = o.HasMore + if !utils.IsNil(o.Links) { + toSerialize["links"] = o.Links + } + toSerialize["data"] = o.Data + return toSerialize, nil +} + +type NullableTransactionsResponse struct { + value *TransactionsResponse + isSet bool +} + +func (v NullableTransactionsResponse) Get() *TransactionsResponse { + return v.value +} + +func (v *NullableTransactionsResponse) Set(val *TransactionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionsResponse(val *TransactionsResponse) *NullableTransactionsResponse { + return &NullableTransactionsResponse{value: val, isSet: true} +} + +func (v NullableTransactionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/model_validation_error.go b/balance_and_transaction/model_validation_error.go new file mode 100644 index 00000000..ab999220 --- /dev/null +++ b/balance_and_transaction/model_validation_error.go @@ -0,0 +1,212 @@ +/* +Transaction Service V4 API + +# Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint + +API version: 3.4.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package balance_and_transaction + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ValidationError{} + +// ValidationError struct for ValidationError +type ValidationError struct { + StatusCode float32 `json:"status_code"` + Error string `json:"error"` + Message string `json:"message"` + Validation map[string]interface{} `json:"validation,omitempty"` +} + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError(statusCode float32, error_ string, message string) *ValidationError { + this := ValidationError{} + this.StatusCode = statusCode + this.Error = error_ + this.Message = message + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetStatusCode returns the StatusCode field value +func (o *ValidationError) GetStatusCode() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetStatusCodeOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *ValidationError) SetStatusCode(v float32) { + o.StatusCode = v +} + +// GetError returns the Error field value +func (o *ValidationError) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ValidationError) SetError(v string) { + o.Error = v +} + +// GetMessage returns the Message field value +func (o *ValidationError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ValidationError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ValidationError) SetMessage(v string) { + o.Message = v +} + +// GetValidation returns the Validation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ValidationError) GetValidation() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Validation +} + +// GetValidationOk returns a tuple with the Validation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ValidationError) GetValidationOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Validation) { + return map[string]interface{}{}, false + } + return o.Validation, true +} + +// HasValidation returns a boolean if a field has been set. +func (o *ValidationError) HasValidation() bool { + if o != nil && utils.IsNil(o.Validation) { + return true + } + + return false +} + +// SetValidation gets a reference to the given map[string]interface{} and assigns it to the Validation field. +func (o *ValidationError) SetValidation(v map[string]interface{}) { + o.Validation = v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["status_code"] = o.StatusCode + toSerialize["error"] = o.Error + toSerialize["message"] = o.Message + if o.Validation != nil { + toSerialize["validation"] = o.Validation + } + return toSerialize, nil +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/balance_and_transaction/nullable.go b/balance_and_transaction/nullable.go new file mode 100644 index 00000000..815854b4 --- /dev/null +++ b/balance_and_transaction/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package balance_and_transaction + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/card.go b/card.go deleted file mode 100644 index 73db5df9..00000000 --- a/card.go +++ /dev/null @@ -1,61 +0,0 @@ -package xendit - -import "time" - -// CardCharge contains data from Xendit's API response of card's charge related requests -// and Create Authorization request. -// For more details see https://xendit.github.io/apireference/?bash#create-charge -// and https://xendit.github.io/apireference/?bash#create-authorization. -// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card -type CardCharge struct { - ID string `json:"id"` - Status string `json:"status"` - MerchantID string `json:"merchant_id"` - Created *time.Time `json:"created"` - BusinessID string `json:"business_id"` - AuthorizedAmount float64 `json:"authorized_amount"` - ExternalID string `json:"external_id"` - MerchantReferenceCode string `json:"merchant_reference_code"` - ChargeType string `json:"charge_type"` - CardBrand string `json:"card_brand"` - MaskedCardNumber string `json:"masked_card_number"` - CaptureAmount float64 `json:"capture_amount,omitempty"` - ECI string `json:"eci,omitempty"` - FailureReason string `json:"failure_reason,omitempty"` - CardType string `json:"card_type,omitempty"` - BankReconciliationID string `json:"bank_reconciliation_id,omitempty"` - Descriptor string `json:"descriptor,omitempty"` - MidLabel string `json:"mid_label,omitempty"` - Currency string `json:"currency,omitempty"` -} - -// CardRefund contains data from Xendit's API response of card's Create Refund request. -// For more details see https://xendit.github.io/apireference/?bash#CreateRefund. -// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card -type CardRefund struct { - ID string `json:"id"` - Updated *time.Time `json:"updated"` - Created *time.Time `json:"created"` - CreditCardChargeID string `json:"credit_card_charge_id"` - UserID string `json:"user_id"` - Amount float64 `json:"amount"` - ExternalID string `json:"external_id"` - Currency string `json:"currency"` - Status string `json:"status"` - FeeRefundAmount float64 `json:"fee_refund_amount"` - FailureReason string `json:"failure_reason"` -} - -// CardReverseAuthorization contains data from Xendit's API response of card's Reverse Authorization request. -// For more details see https://xendit.github.io/apireference/?bash#reverse-authorization. -// For documentation of subpackage card, checkout https://pkg.go.dev/github.com/xendit/xendit-go/card -type CardReverseAuthorization struct { - ID string `json:"id"` - ExternalID string `json:"external_id"` - CreditCardChargeID string `json:"credit_card_charge_id"` - BusinessID string `json:"business_id"` - Amount float64 `json:"amount"` - Status string `json:"status"` - Created *time.Time `json:"created"` - Currency string `json:"currency,omitempty"` -} diff --git a/card/card.go b/card/card.go deleted file mode 100644 index c07cd622..00000000 --- a/card/card.go +++ /dev/null @@ -1,93 +0,0 @@ -package card - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -/* Charge */ - -// CreateCharge creates new card charge -func CreateCharge(data *CreateChargeParams) (*xendit.CardCharge, *xendit.Error) { - return CreateChargeWithContext(context.Background(), data) -} - -// CreateChargeWithContext creates new card charge with context -func CreateChargeWithContext(ctx context.Context, data *CreateChargeParams) (*xendit.CardCharge, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateChargeWithContext(ctx, data) -} - -// CaptureCharge captures a card charge -func CaptureCharge(data *CaptureChargeParams) (*xendit.CardCharge, *xendit.Error) { - return CaptureChargeWithContext(context.Background(), data) -} - -// CaptureChargeWithContext captures a card charge with context -func CaptureChargeWithContext(ctx context.Context, data *CaptureChargeParams) (*xendit.CardCharge, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CaptureChargeWithContext(ctx, data) -} - -// GetCharge gets a card charge -func GetCharge(data *GetChargeParams) (*xendit.CardCharge, *xendit.Error) { - return GetChargeWithContext(context.Background(), data) -} - -// GetChargeWithContext gets a card charge with context -func GetChargeWithContext(ctx context.Context, data *GetChargeParams) (*xendit.CardCharge, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetChargeWithContext(ctx, data) -} - -// CreateRefund gets a card charge -func CreateRefund(data *CreateRefundParams) (*xendit.CardRefund, *xendit.Error) { - return CreateRefundWithContext(context.Background(), data) -} - -// CreateRefundWithContext gets a card charge with context -func CreateRefundWithContext(ctx context.Context, data *CreateRefundParams) (*xendit.CardRefund, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateRefundWithContext(ctx, data) -} - -/* Authorization */ - -// ReverseAuthorization reverses a card authorization -func ReverseAuthorization(data *ReverseAuthorizationParams) (*xendit.CardReverseAuthorization, *xendit.Error) { - return ReverseAuthorizationWithContext(context.Background(), data) -} - -// ReverseAuthorizationWithContext reverses a card authorization with context -func ReverseAuthorizationWithContext(ctx context.Context, data *ReverseAuthorizationParams) (*xendit.CardReverseAuthorization, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ReverseAuthorizationWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/card/card_test.go b/card/card_test.go deleted file mode 100644 index 55c74742..00000000 --- a/card/card_test.go +++ /dev/null @@ -1,428 +0,0 @@ -package card_test - -import ( - "context" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/card" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -/* Charge */ - -type apiRequesterChargeMock struct { - mock.Mock -} - -func (m *apiRequesterChargeMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - result.(*xendit.CardCharge).ID = "123" - result.(*xendit.CardCharge).Status = "AUTHORIZED" - result.(*xendit.CardCharge).MerchantID = "example-merchant-id" - result.(*xendit.CardCharge).Created = &created - result.(*xendit.CardCharge).BusinessID = "example-business-id" - result.(*xendit.CardCharge).AuthorizedAmount = 200000 - result.(*xendit.CardCharge).ExternalID = "example-external-id" - result.(*xendit.CardCharge).MerchantReferenceCode = "123123" - result.(*xendit.CardCharge).ChargeType = "SINGLE_USE_TOKEN" - result.(*xendit.CardCharge).CardBrand = "VISA" - result.(*xendit.CardCharge).MaskedCardNumber = "400000XXXXXX0002" - result.(*xendit.CardCharge).ECI = "05" - result.(*xendit.CardCharge).CardType = "CREDIT" - result.(*xendit.CardCharge).BankReconciliationID = "123123123" - result.(*xendit.CardCharge).Currency = "IDR" - - return nil -} - -func TestCreateCharge(t *testing.T) { - apiRequesterMockObj := new(apiRequesterChargeMock) - initTesting(apiRequesterMockObj) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *card.CreateChargeParams - expectedRes *xendit.CardCharge - expectedErr *xendit.Error - }{ - { - desc: "should create a charge", - data: &card.CreateChargeParams{ - TokenID: "charge-token-id", - ExternalID: "charge-external-id", - Amount: 200000, - }, - expectedRes: &xendit.CardCharge{ - ID: "123", - Status: "AUTHORIZED", - MerchantID: "example-merchant-id", - Created: &created, - BusinessID: "example-business-id", - AuthorizedAmount: 200000, - ExternalID: "example-external-id", - MerchantReferenceCode: "123123", - ChargeType: "SINGLE_USE_TOKEN", - CardBrand: "VISA", - MaskedCardNumber: "400000XXXXXX0002", - ECI: "05", - CardType: "CREDIT", - BankReconciliationID: "123123123", - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &card.CreateChargeParams{ - ExternalID: "example-external-id", - Amount: 200000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'TokenID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/credit_card_charges", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.CardCharge{}, - ).Return(nil) - - resp, err := card.CreateCharge(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetCharge(t *testing.T) { - apiRequesterMockObj := new(apiRequesterChargeMock) - initTesting(apiRequesterMockObj) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *card.GetChargeParams - expectedRes *xendit.CardCharge - expectedErr *xendit.Error - }{ - { - desc: "should get a charge", - data: &card.GetChargeParams{ - ChargeID: "123", - }, - expectedRes: &xendit.CardCharge{ - ID: "123", - Status: "AUTHORIZED", - MerchantID: "example-merchant-id", - Created: &created, - BusinessID: "example-business-id", - AuthorizedAmount: 200000, - ExternalID: "example-external-id", - MerchantReferenceCode: "123123", - ChargeType: "SINGLE_USE_TOKEN", - CardBrand: "VISA", - MaskedCardNumber: "400000XXXXXX0002", - ECI: "05", - CardType: "CREDIT", - BankReconciliationID: "123123123", - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &card.GetChargeParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ChargeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/credit_card_charges/"+tC.data.ChargeID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.CardCharge{}, - ).Return(nil) - - resp, err := card.GetCharge(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestCaptureCharge(t *testing.T) { - apiRequesterMockObj := new(apiRequesterChargeMock) - initTesting(apiRequesterMockObj) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *card.CaptureChargeParams - expectedRes *xendit.CardCharge - expectedErr *xendit.Error - }{ - { - desc: "should capture a charge", - data: &card.CaptureChargeParams{ - ChargeID: "123", - Amount: 200000, - }, - expectedRes: &xendit.CardCharge{ - ID: "123", - Status: "AUTHORIZED", - MerchantID: "example-merchant-id", - Created: &created, - BusinessID: "example-business-id", - AuthorizedAmount: 200000, - ExternalID: "example-external-id", - MerchantReferenceCode: "123123", - ChargeType: "SINGLE_USE_TOKEN", - CardBrand: "VISA", - MaskedCardNumber: "400000XXXXXX0002", - ECI: "05", - CardType: "CREDIT", - BankReconciliationID: "123123123", - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &card.CaptureChargeParams{ - Amount: 200000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ChargeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/credit_card_charges/"+tC.data.ChargeID+"/capture", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.CardCharge{}, - ).Return(nil) - - resp, err := card.CaptureCharge(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -/* Refund */ - -type apiRequesterRefundMock struct { - mock.Mock -} - -func (m *apiRequesterRefundMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - result.(*xendit.CardRefund).ID = "1234" - result.(*xendit.CardRefund).Updated = &created - result.(*xendit.CardRefund).Created = &created - result.(*xendit.CardRefund).CreditCardChargeID = "123" - result.(*xendit.CardRefund).UserID = "123123123" - result.(*xendit.CardRefund).Amount = 10000 - result.(*xendit.CardRefund).ExternalID = "example-external-id" - result.(*xendit.CardRefund).Currency = "IDR" - result.(*xendit.CardRefund).Status = "AUTHORIZED" - result.(*xendit.CardRefund).FeeRefundAmount = 100 - - return nil -} - -func TestCreateRefund(t *testing.T) { - apiRequesterMockObj := new(apiRequesterRefundMock) - initTesting(apiRequesterMockObj) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *card.CreateRefundParams - expectedRes *xendit.CardRefund - expectedErr *xendit.Error - }{ - { - desc: "should create a refund", - data: &card.CreateRefundParams{ - IdempotencyKey: "unique-idempotency-key", - ChargeID: "123", - Amount: 10000, - ExternalID: "example-external-id", - }, - expectedRes: &xendit.CardRefund{ - ID: "1234", - Updated: &created, - Created: &created, - CreditCardChargeID: "123", - UserID: "123123123", - Amount: 10000, - ExternalID: "example-external-id", - Currency: "IDR", - Status: "AUTHORIZED", - FeeRefundAmount: 100, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &card.CreateRefundParams{ - Amount: 10000, - ExternalID: "example-external-id", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ChargeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/credit_card_charges/"+tC.data.ChargeID+"/refunds", - xendit.Opt.SecretKey, - mock.Anything, - tC.data, - &xendit.CardRefund{}, - ).Return(nil) - - resp, err := card.CreateRefund(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -/* Authorization */ - -type apiRequesterReverseAuthorizationMock struct { - mock.Mock -} - -func (m *apiRequesterReverseAuthorizationMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - result.(*xendit.CardReverseAuthorization).ID = "123123" - result.(*xendit.CardReverseAuthorization).ExternalID = "example-external-id" - result.(*xendit.CardReverseAuthorization).CreditCardChargeID = "123" - result.(*xendit.CardReverseAuthorization).BusinessID = "123123123" - result.(*xendit.CardReverseAuthorization).Amount = 10000 - result.(*xendit.CardReverseAuthorization).Status = "PENDING" - result.(*xendit.CardReverseAuthorization).Created = &created - result.(*xendit.CardReverseAuthorization).Currency = "IDR" - - return nil -} - -func TestReverseAuthorization(t *testing.T) { - apiRequesterMockObj := new(apiRequesterReverseAuthorizationMock) - initTesting(apiRequesterMockObj) - - created, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *card.ReverseAuthorizationParams - expectedRes *xendit.CardReverseAuthorization - expectedErr *xendit.Error - }{ - { - desc: "should reverse authorization", - data: &card.ReverseAuthorizationParams{ - ChargeID: "123", - ExternalID: "example-external-id", - }, - expectedRes: &xendit.CardReverseAuthorization{ - ID: "123123", - ExternalID: "example-external-id", - CreditCardChargeID: "123", - BusinessID: "123123123", - Amount: 10000, - Status: "PENDING", - Created: &created, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &card.ReverseAuthorizationParams{ - ExternalID: "example-external-id", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ChargeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/credit_card_charges/"+tC.data.ChargeID+"/auth_reversal", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.CardReverseAuthorization{}, - ).Return(nil) - - resp, err := card.ReverseAuthorization(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/card/client.go b/card/client.go deleted file mode 100644 index 78709874..00000000 --- a/card/client.go +++ /dev/null @@ -1,171 +0,0 @@ -package card - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke ewallet API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreateCharge creates new card charge -func (c *Client) CreateCharge(data *CreateChargeParams) (*xendit.CardCharge, *xendit.Error) { - return c.CreateChargeWithContext(context.Background(), data) -} - -// CreateChargeWithContext creates new card charge with context -func (c *Client) CreateChargeWithContext(ctx context.Context, data *CreateChargeParams) (*xendit.CardCharge, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardCharge{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/credit_card_charges", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// CaptureCharge captures a card charge -func (c *Client) CaptureCharge(data *CaptureChargeParams) (*xendit.CardCharge, *xendit.Error) { - return c.CaptureChargeWithContext(context.Background(), data) -} - -// CaptureChargeWithContext captures a card charge with context -func (c *Client) CaptureChargeWithContext(ctx context.Context, data *CaptureChargeParams) (*xendit.CardCharge, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardCharge{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/credit_card_charges/%s/capture", c.Opt.XenditURL, data.ChargeID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetCharge gets a card charge -func (c *Client) GetCharge(data *GetChargeParams) (*xendit.CardCharge, *xendit.Error) { - return c.GetChargeWithContext(context.Background(), data) -} - -// GetChargeWithContext gets a card charge with context -func (c *Client) GetChargeWithContext(ctx context.Context, data *GetChargeParams) (*xendit.CardCharge, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardCharge{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/credit_card_charges/%s", c.Opt.XenditURL, data.ChargeID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// CreateRefund creates a refund -func (c *Client) CreateRefund(data *CreateRefundParams) (*xendit.CardRefund, *xendit.Error) { - return c.CreateRefundWithContext(context.Background(), data) -} - -// CreateRefundWithContext creates a refund with context -func (c *Client) CreateRefundWithContext(ctx context.Context, data *CreateRefundParams) (*xendit.CardRefund, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardRefund{} - header := http.Header{} - - if data.IdempotencyKey != "" { - header.Add("X-IDEMPOTENCY-KEY", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/credit_card_charges/%s/refunds", c.Opt.XenditURL, data.ChargeID), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// ReverseAuthorization reverses a card authorization -func (c *Client) ReverseAuthorization(data *ReverseAuthorizationParams) (*xendit.CardReverseAuthorization, *xendit.Error) { - return c.ReverseAuthorizationWithContext(context.Background(), data) -} - -// ReverseAuthorizationWithContext reverses a card authorization with context -func (c *Client) ReverseAuthorizationWithContext(ctx context.Context, data *ReverseAuthorizationParams) (*xendit.CardReverseAuthorization, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardReverseAuthorization{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/credit_card_charges/%s/auth_reversal", c.Opt.XenditURL, data.ChargeID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/card/example_test.go b/card/example_test.go deleted file mode 100644 index e9bb7e78..00000000 --- a/card/example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -package card_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/card" -) - -func ExampleCreateCharge() { - xendit.Opt.SecretKey = "examplesecretkey" - - createChargeData := card.CreateChargeParams{ - TokenID: "example-token-id", - AuthenticationID: "example-authentication-id", - ExternalID: "cardAuth-1", - Amount: 10000, - Capture: new(bool), // false - } - - chargeResp, err := card.CreateCharge(&createChargeData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created charge: %+v\n", chargeResp) -} - -func ExampleGetCharge() { - xendit.Opt.SecretKey = "examplesecretkey" - - getChargeData := card.GetChargeParams{ - ChargeID: "123", - } - - chargeResp, err := card.GetCharge(&getChargeData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved charge: %+v\n", chargeResp) -} - -func ExampleCaptureCharge() { - xendit.Opt.SecretKey = "examplesecretkey" - - captureChargeData := card.CaptureChargeParams{ - ChargeID: "123", - Amount: 10000, - } - - chargeResp, err := card.CaptureCharge(&captureChargeData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("captured charge: %+v\n", chargeResp) -} - -func ExampleCreateRefund() { - xendit.Opt.SecretKey = "examplesecretkey" - - createRefundData := card.CreateRefundParams{ - IdempotencyKey: "unique-idempotency-key", - ChargeID: "123", - Amount: 10000, - ExternalID: "example-external-id", - } - - refundResp, err := card.CreateRefund(&createRefundData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("refunded charge: %+v\n", refundResp) -} - -func ExampleReverseAuthorization() { - xendit.Opt.SecretKey = "examplesecretkey" - - reverseAuthorizationData := card.ReverseAuthorizationParams{ - ChargeID: "123", - ExternalID: "reverseAuth-id", - } - - reverseAuthorizationResp, err := card.ReverseAuthorization(&reverseAuthorizationData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("reversed authorization: %+v\n", reverseAuthorizationResp) -} diff --git a/card/params.go b/card/params.go deleted file mode 100644 index b620702b..00000000 --- a/card/params.go +++ /dev/null @@ -1,50 +0,0 @@ -package card - -// Data is credit card data and used in CardData -type Data struct { - AccountNumber string `json:"account_number"` - ExpMonth string `json:"exp_month"` - ExpYear string `json:"exp_year"` - CVN string `json:"cvn,omitempty"` -} - -// CreateChargeParams contains parameters for CreateCharge -type CreateChargeParams struct { - ForUserID string `json:"-"` - TokenID string `json:"token_id" validate:"required"` - ExternalID string `json:"external_id" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - AuthenticationID string `json:"authentication_id,omitempty"` - CardCVN string `json:"card_cvn,omitempty"` - Capture *bool `json:"capture,omitempty"` - CardData *Data `json:"card_data,omitempty"` - Descriptor string `json:"descriptor,omitempty"` - MidLabel string `json:"mid_label,omitempty"` - Currency string `json:"currency,omitempty"` - IsRecurring *bool `json:"is_recurring,omitempty"` -} - -// CaptureChargeParams contains parameters for CaptureCharge -type CaptureChargeParams struct { - ChargeID string `json:"-" validate:"required"` - Amount float64 `json:"amount" validate:"required"` -} - -// GetChargeParams contains parameters for GetCharge -type GetChargeParams struct { - ChargeID string `json:"credit_card_charge_id" validate:"required"` -} - -// CreateRefundParams contains parameters for CreateRefund -type CreateRefundParams struct { - IdempotencyKey string `json:"-"` - ChargeID string `json:"-" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - ExternalID string `json:"external_id" validate:"required"` -} - -// ReverseAuthorizationParams contains parameters for ReverseAuthorization -type ReverseAuthorizationParams struct { - ChargeID string `json:"-" validate:"required"` - ExternalID string `json:"external_id" validate:"required"` -} diff --git a/cardlesscredit.go b/cardlesscredit.go deleted file mode 100644 index 4c469df7..00000000 --- a/cardlesscredit.go +++ /dev/null @@ -1,31 +0,0 @@ -package xendit - -// CardlessCreditTypeEnum constants are the available cardless credit types -type CardlessCreditTypeEnum string - -// This consists the values that CardlessCreditTypeEnum can take -const ( - CardlessCreditTypeEnumKREDIVO CardlessCreditTypeEnum = "KREDIVO" -) - -// PaymentTypeEnum constants are the available payment types -type PaymentTypeEnum string - -// This consists the values that PaymentTypeEnum can take -const ( - PaymentTypeEnum30Days PaymentTypeEnum = "30_days" - PaymentTypeEnum3Months PaymentTypeEnum = "3_months" - PaymentTypeEnum6Months PaymentTypeEnum = "6_months" - PaymentTypeEnum12Months PaymentTypeEnum = "12_months" -) - -// CardlessCredit contains data from Xendit's API response of cardless credit related requests. -// For more details see https://xendit.github.io/apireference/?bash#cardless-credit. -// For documentation of subpackage cardlesscredit, checkout https://pkg.go.dev/github.com/xendit/xendit-go/cardlesscredit -type CardlessCredit struct { - RedirectURL string `json:"redirect_url"` - TransactionID string `json:"transaction_id"` - OrderID string `json:"order_id"` - ExternalID string `json:"external_id"` - CardlessCreditType CardlessCreditTypeEnum `json:"cardless_credit_type"` -} diff --git a/cardlesscredit/cardlesscredit.go b/cardlesscredit/cardlesscredit.go deleted file mode 100644 index db5e8ea3..00000000 --- a/cardlesscredit/cardlesscredit.go +++ /dev/null @@ -1,29 +0,0 @@ -package cardlesscredit - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreatePayment creates new payment -func CreatePayment(data *CreatePaymentParams) (*xendit.CardlessCredit, *xendit.Error) { - return CreatePaymentWithContext(context.Background(), data) -} - -// CreatePaymentWithContext creates new payment -func CreatePaymentWithContext(ctx context.Context, data *CreatePaymentParams) (*xendit.CardlessCredit, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreatePaymentWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/cardlesscredit/cardlesscredit_test.go b/cardlesscredit/cardlesscredit_test.go deleted file mode 100644 index 648fbd98..00000000 --- a/cardlesscredit/cardlesscredit_test.go +++ /dev/null @@ -1,149 +0,0 @@ -package cardlesscredit_test - -import ( - "context" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/cardlesscredit" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.CardlessCredit).RedirectURL = "https://google.com" - result.(*xendit.CardlessCredit).TransactionID = "trx1" - result.(*xendit.CardlessCredit).OrderID = "ord1" - result.(*xendit.CardlessCredit).ExternalID = "cardless-credit-1" - result.(*xendit.CardlessCredit).CardlessCreditType = xendit.CardlessCreditTypeEnumKREDIVO - - return nil -} - -func TestCreatePayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *cardlesscredit.CreatePaymentParams - expectedRes *xendit.CardlessCredit - expectedErr *xendit.Error - }{ - { - desc: "should create a payment", - data: &cardlesscredit.CreatePaymentParams{ - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - ExternalID: "cardless-credit-1", - Amount: 200000, - PaymentType: xendit.PaymentTypeEnum3Months, - Items: []cardlesscredit.Item{ - { - ID: "123", - Name: "Laptop Asus Ila", - Price: 200000, - Type: "Laptop", - URL: "http://asus-ila.com", - Quantity: 1, - }, - }, - CustomerDetails: cardlesscredit.CustomerDetails{ - FirstName: "Michael", - LastName: "Belajarrock", - Email: "michaelbelajarrock@mail.com", - Phone: "08123123123", - }, - ShippingAddress: cardlesscredit.ShippingAddress{ - FirstName: "Michael", - LastName: "Belajarjazz", - Address: "Jalan Teknologi No. 12", - City: "Jakarta", - PostalCode: "40000", - Phone: "08123123123", - CountryCode: "IDN", - }, - RedirectURL: "https://google.com", - CallbackURL: "https://google.com", - }, - expectedRes: &xendit.CardlessCredit{ - RedirectURL: "https://google.com", - TransactionID: "trx1", - OrderID: "ord1", - ExternalID: "cardless-credit-1", - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &cardlesscredit.CreatePaymentParams{ - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - ExternalID: "cardless-credit-1", - PaymentType: xendit.PaymentTypeEnum3Months, - Items: []cardlesscredit.Item{ - { - ID: "123", - Name: "Laptop Asus Ila", - Price: 200000, - Type: "Laptop", - URL: "http://asus-ila.com", - Quantity: 1, - }, - }, - CustomerDetails: cardlesscredit.CustomerDetails{ - FirstName: "Michael", - LastName: "Belajarrock", - Email: "michaelbelajarrock@mail.com", - Phone: "08123123123", - }, - ShippingAddress: cardlesscredit.ShippingAddress{ - FirstName: "Michael", - LastName: "Belajarjazz", - Address: "Jalan Teknologi No. 12", - City: "Jakarta", - PostalCode: "40000", - Phone: "08123123123", - CountryCode: "IDN", - }, - RedirectURL: "https://google.com", - CallbackURL: "https://google.com", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Amount'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/cardless-credit", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.CardlessCredit{}, - ).Return(nil) - - resp, err := cardlesscredit.CreatePayment(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/cardlesscredit/client.go b/cardlesscredit/client.go deleted file mode 100644 index 4a44c7f0..00000000 --- a/cardlesscredit/client.go +++ /dev/null @@ -1,46 +0,0 @@ -package cardlesscredit - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreatePayment creates new cardless credit payment -func (c *Client) CreatePayment(data *CreatePaymentParams) (*xendit.CardlessCredit, *xendit.Error) { - return c.CreatePaymentWithContext(context.Background(), data) -} - -// CreatePaymentWithContext creates new cardless credit payment with context -func (c *Client) CreatePaymentWithContext(ctx context.Context, data *CreatePaymentParams) (*xendit.CardlessCredit, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.CardlessCredit{} - header := http.Header{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/cardless-credit", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/cardlesscredit/example_test.go b/cardlesscredit/example_test.go deleted file mode 100644 index 2685e018..00000000 --- a/cardlesscredit/example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package cardlesscredit_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/cardlesscredit" - - "github.com/xendit/xendit-go" -) - -func ExampleCreatePayment() { - xendit.Opt.SecretKey = "examplesecretkey" - - createPaymentData := cardlesscredit.CreatePaymentParams{ - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - ExternalID: "cardless-credit-" + time.Now().String(), - Amount: 200000, - PaymentType: xendit.PaymentTypeEnum3Months, - Items: []cardlesscredit.Item{ - { - ID: "123", - Name: "Laptop Asus Ila", - Price: 200000, - Type: "Laptop", - URL: "http://asus-ila.com", - Quantity: 1, - }, - }, - CustomerDetails: cardlesscredit.CustomerDetails{ - FirstName: "Michael", - LastName: "Belajarrock", - Email: "michaelbelajarrock@mail.com", - Phone: "08123123123", - }, - ShippingAddress: cardlesscredit.ShippingAddress{ - FirstName: "Michael", - LastName: "Belajarjazz", - Address: "Jalan Teknologi No. 12", - City: "Jakarta", - PostalCode: "40000", - Phone: "08123123123", - CountryCode: "IDN", - }, - RedirectURL: "https://google.com", - CallbackURL: "https://google.com", - } - - resp, err := cardlesscredit.CreatePayment(&createPaymentData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} diff --git a/cardlesscredit/params.go b/cardlesscredit/params.go deleted file mode 100644 index 7ca68fcc..00000000 --- a/cardlesscredit/params.go +++ /dev/null @@ -1,45 +0,0 @@ -package cardlesscredit - -import "github.com/xendit/xendit-go" - -// CreatePaymentParams contains parameters for CreatePayment -type CreatePaymentParams struct { - CardlessCreditType xendit.CardlessCreditTypeEnum `json:"cardless_credit_type" validate:"required"` - ExternalID string `json:"external_id" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - PaymentType xendit.PaymentTypeEnum `json:"payment_type" validate:"required"` - Items []Item `json:"items" validate:"required"` - CustomerDetails CustomerDetails `json:"customer_details" validate:"required"` - ShippingAddress ShippingAddress `json:"shipping_address" validate:"required"` - RedirectURL string `json:"redirect_url" validate:"required"` - CallbackURL string `json:"callback_url" validate:"required"` -} - -// Item is data that contained in CreatePaymentParams at Items -type Item struct { - ID string `json:"id" validate:"required"` - Name string `json:"name" validate:"required"` - Price float64 `json:"price" validate:"required"` - Type string `json:"type" validate:"required"` - URL string `json:"url" validate:"required"` - Quantity int `json:"quantity" validate:"required"` -} - -// CustomerDetails is data that contained in CreatePaymentParams at CustomerDetails -type CustomerDetails struct { - FirstName string `json:"first_name" validate:"required"` - LastName string `json:"last_name" validate:"required"` - Email string `json:"email" validate:"required"` - Phone string `json:"phone" validate:"required"` -} - -// ShippingAddress is data that contained in CreatePaymentParams at ShippingAddress -type ShippingAddress struct { - FirstName string `json:"first_name" validate:"required"` - LastName string `json:"last_name" validate:"required"` - Address string `json:"address" validate:"required"` - City string `json:"city" validate:"required"` - PostalCode string `json:"postal_code" validate:"required"` - Phone string `json:"phone" validate:"required"` - CountryCode string `json:"country_code" validate:"required"` -} diff --git a/client.go b/client.go new file mode 100644 index 00000000..90327f5a --- /dev/null +++ b/client.go @@ -0,0 +1,486 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package xendit + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strings" + "time" + "unicode/utf8" + + common "github.com/xendit/xendit-go/v3/common" + + balance "github.com/xendit/xendit-go/v3/balance_and_transaction" + invoice "github.com/xendit/xendit-go/v3/invoice" + paymentmethod "github.com/xendit/xendit-go/v3/payment_method" + paymentrequest "github.com/xendit/xendit-go/v3/payment_request" + payout "github.com/xendit/xendit-go/v3/payout" + refund "github.com/xendit/xendit-go/v3/refund" + transaction "github.com/xendit/xendit-go/v3/balance_and_transaction" + +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with XENDIT API +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + apiKey string + + // API Services + BalanceApi balance.BalanceApi + InvoiceApi invoice.InvoiceApi + PaymentMethodApi paymentmethod.PaymentMethodApi + PaymentRequestApi paymentrequest.PaymentRequestApi + PayoutApi payout.PayoutApi + RefundApi refund.RefundApi + TransactionApi transaction.TransactionApi +} + +type service struct { + client *APIClient +} + +// NewClient creates a new Xendit SDK Client. The SDK needs to be instantiated using your +// secret API key obtained from the https://dashboard.xendit.co/settings/developers#api-keys. +// You can sign up for a free Dashboard account from https://dashboard.xendit.co/register. +func NewClient(apiKey string) *APIClient { + cfg := NewConfiguration() + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.apiKey = apiKey + + c.BalanceApi = balance.NewBalanceApi(c) + c.InvoiceApi = invoice.NewInvoiceApi(c) + c.PaymentMethodApi = paymentmethod.NewPaymentMethodApi(c) + c.PaymentRequestApi = paymentrequest.NewPaymentRequestApi(c) + c.PayoutApi = payout.NewPayoutApi(c) + c.RefundApi = refund.NewRefundApi(c) + c.TransactionApi = transaction.NewTransactionApi(c) + + return c +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() common.IConfiguration { + return c.cfg +} + +// PrepareRequest build the request +func (c *APIClient) PrepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []common.FormFile) (localVarRequest *http.Request, err error) { + + // XENDIT headers + headerParams["xendit-lib"] = "go" + + // TODO: overwrite this line from buddy pipeline + headerParams["xendit-lib-ver"] = "3.0.0" + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.FileBytes) > 0 && formFile.FileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.FormFileName, filepath.Base(formFile.FileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.FileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + if c.apiKey != "" { + localVarRequest.SetBasicAuth(c.apiKey, "") + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) Decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + + + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} diff --git a/client/api.go b/client/api.go deleted file mode 100644 index 32e22713..00000000 --- a/client/api.go +++ /dev/null @@ -1,108 +0,0 @@ -// Package client provides a Xendit client for invoking APIs across all products -package client - -import ( - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/account" - "github.com/xendit/xendit-go/balance" - "github.com/xendit/xendit-go/card" - "github.com/xendit/xendit-go/cardlesscredit" - "github.com/xendit/xendit-go/customer" - "github.com/xendit/xendit-go/disbursement" - "github.com/xendit/xendit-go/ewallet" - "github.com/xendit/xendit-go/invoice" - "github.com/xendit/xendit-go/payout" - "github.com/xendit/xendit-go/qrcode" - "github.com/xendit/xendit-go/recurringpayment" - "github.com/xendit/xendit-go/report" - "github.com/xendit/xendit-go/retailoutlet" - "github.com/xendit/xendit-go/transaction" - "github.com/xendit/xendit-go/virtualaccount" -) - -// API is the Xendit client which contains all products -type API struct { - opt xendit.Option - apiRequester xendit.APIRequester - Invoice *invoice.Client - EWallet *ewallet.Client - Balance *balance.Client - RetailOutlet *retailoutlet.Client - VirtualAccount *virtualaccount.Client - Card *card.Client - Payout *payout.Client - RecurringPayment *recurringpayment.Client - CardlessCredit *cardlesscredit.Client - Disbursement *disbursement.Client - QRCode *qrcode.Client - Customer *customer.Client - Transaction *transaction.Client - Report *report.Client - Account *account.Client -} - -func (a *API) init() { - a.Invoice = &invoice.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.EWallet = &ewallet.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Balance = &balance.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.RetailOutlet = &retailoutlet.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.VirtualAccount = &virtualaccount.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Card = &card.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Payout = &payout.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.RecurringPayment = &recurringpayment.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.CardlessCredit = &cardlesscredit.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Disbursement = &disbursement.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.QRCode = &qrcode.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Customer = &customer.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Transaction = &transaction.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Report = &report.Client{Opt: &a.opt, APIRequester: a.apiRequester} - a.Account = &account.Client{Opt: &a.opt, APIRequester: a.apiRequester} -} - -// New creates a new Xendit API client -func New(secretKey string) *API { - api := API{ - opt: xendit.Option{ - SecretKey: secretKey, - XenditURL: "https://api.xendit.co", - }, - apiRequester: xendit.GetAPIRequester(), - } - api.init() - - return &api -} - -// WithAPIRequester set custom APIRequester for Xendit Client -// Can be chained with constructor like below: -// -// client.New(yourSecretKey).WithAPIRequester(yourCustomRequester) -func (a *API) WithAPIRequester(apiRequester xendit.APIRequester) *API { - a.apiRequester = apiRequester - a.init() - return a -} - -// WithCustomURL set custom xendit URL for Xendit Client -// Can be chained with constructor like below: -// -// client.New(yourSecretKey).WithCustomURL(yourCustomURL) -func (a *API) WithCustomURL(xenditURL string) *API { - a.opt.XenditURL = xenditURL - a.init() - return a -} - -// WithCustomHTTPClient set custom HTTP Client for default API Requester -// Can be chained with constructor like below: -// -// client.New(yourSecretKey).WithCustomHTTPClient(yourCustomHTTPClient) -func (a *API) WithCustomHTTPClient(client *http.Client) *API { - a.apiRequester = &xendit.APIRequesterImplementation{ - HTTPClient: client, - } - a.init() - return a -} diff --git a/client/api_test.go b/client/api_test.go deleted file mode 100644 index 3f0e9372..00000000 --- a/client/api_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xendit/xendit-go" -) - -func TestAPIInit(t *testing.T) { - api := API{ - opt: xendit.Option{ - SecretKey: "sk_123", - }, - } - api.init() - - assert.Equal(t, *api.Invoice.Opt, api.opt) -} - -func TestAPINew(t *testing.T) { - api := New("sk_123") - - assert.Equal(t, "sk_123", api.opt.SecretKey) - assert.Equal(t, "https://api.xendit.co", api.opt.XenditURL) -} diff --git a/client/example_test.go b/client/example_test.go deleted file mode 100644 index 6f43aa91..00000000 --- a/client/example_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package client_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go/client" - "github.com/xendit/xendit-go/invoice" -) - -// This example shows the usage of Xendit's API client -func Example() { - api := client.New("examplesecretkey") - - data := invoice.GetParams{ - ID: "invoice-id", - } - - resp, err := api.Invoice.Get(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved invoice: %+v\n", resp) -} diff --git a/common/common.go b/common/common.go new file mode 100644 index 00000000..a9c79154 --- /dev/null +++ b/common/common.go @@ -0,0 +1,143 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package common + +import ( + "context" + "encoding/json" + "net/http" + "net/url" + "fmt" +) + +type IConfiguration interface { + AddDefaultHeader(key string, value string) + ServerURL(index int, variables map[string]string) (string, error) + ServerURLWithContext(ctx context.Context, endpoint string) (string, error) +} + +type IClient interface { + GetConfig() IConfiguration + PrepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []FormFile) (localVarRequest *http.Request, err error) + CallAPI(request *http.Request) (*http.Response, error) + Decode(v interface{}, b []byte, contentType string) (err error) +} + +type FormFile struct { + FileBytes []byte + FileName string + FormFileName string +} + +type XenditSdkError struct { + rawResponse map[string]interface{} + status string + errorCode string + errorMessage string +} + +func NewXenditSdkError(response *[]byte, paramStatus string, paramStatusText string) *XenditSdkError { + var _rawResponse map[string]interface{}; + + err := json.Unmarshal(*response,&_rawResponse) + if err != nil { + _rawResponse = map[string]interface{}{} + } + + _status := "" + + if _status == "" { + if val, ok := _rawResponse["status"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + if _status == "" { + if val, ok := _rawResponse["status_code"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + if _status == "" { + if val, ok := _rawResponse["statusCode"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + if _status == "" { + _status = paramStatus + } + + _errorCode := "" + if _errorCode == "" { + if val, ok := _rawResponse["error"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + if _errorCode == "" { + if val, ok := _rawResponse["error_code"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + if _errorCode == "" { + if val, ok := _rawResponse["errorCode"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + + _errorMessage := "" + if _errorMessage == "" { + if val, ok := _rawResponse["message"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + if val, ok := _rawResponse["error_message"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + if val, ok := _rawResponse["errorMessage"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + _errorMessage = paramStatusText + } + + + return &XenditSdkError{ + rawResponse: _rawResponse, + status: _status, + errorCode: _errorCode, + errorMessage: _errorMessage, + } +} + +func (e XenditSdkError) Error() string { + return e.errorMessage +} + +func (e XenditSdkError) ErrorCode() string { + return e.errorCode +} + +func (e XenditSdkError) RawResponse() map[string]interface{} { + return e.rawResponse +} + +func (e XenditSdkError) Status() string { + return e.status +} + +func (e XenditSdkError) FullError() map[string]interface{} { + return map[string]interface{}{ + "rawResponse": e.rawResponse, + "status": e.status, + "errorCode": e.errorCode, + "errorMessage": e.errorMessage, + } +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 00000000..cfd2ef4e --- /dev/null +++ b/configuration.go @@ -0,0 +1,213 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package xendit + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +var Default Configuration = *NewConfiguration() + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/3.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://api.xendit.co", + Description: "Xendit API Server", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/customer.go b/customer.go deleted file mode 100644 index 33464a40..00000000 --- a/customer.go +++ /dev/null @@ -1,35 +0,0 @@ -package xendit - -// CustomerAddress contains data from Xendit's API response of customer's Customer Addres requests. -// For more details see https://xendit.github.io/apireference/?bash#customers. -// For documentation of subpackage customer, checkout https://pkg.go.dev/github.com/xendit/xendit-go/customer/ -type CustomerAddress struct { - Country string `json:"country" validate:"required"` - StreetLine1 string `json:"street_line1,omitempty"` - StreetLine2 string `json:"street_line2,omitempty"` - City string `json:"city,omitempty"` - Province string `json:"province,omitempty"` - State string `json:"state,omitempty"` - PostalCode string `json:"postal_code,omitempty"` - Category string `json:"category,omitempty"` - IsPreferred bool `json:"is_preferred,omitempty"` -} - -// Customer contains data from Xendit's API response of customer related requests. -// For more details see https://xendit.github.io/apireference/?bash#customers. -// For documentation of subpackage customer, checkout https://pkg.go.dev/github.com/xendit/xendit-go/customer/ -type Customer struct { - ID string `json:"id"` - ReferenceID string `json:"reference_id"` - MobileNumber string `json:"mobile_number,omitempty"` - Email string `json:"email,omitempty"` - GivenNames string `json:"given_names"` - MiddleName string `json:"middle_name"` - Surname string `json:"surname"` - Description string `json:"description,omitempty"` - PhoneNumber string `json:"phone_number"` - Nationality string `json:"nationality"` - Addresses []CustomerAddress `json:"addresses"` - DateOfBirth string `json:"date_of_birth"` - Metadata map[string]interface{} `json:"metadata"` -} diff --git a/customer/client.go b/customer/client.go deleted file mode 100644 index 10d193ba..00000000 --- a/customer/client.go +++ /dev/null @@ -1,87 +0,0 @@ -package customer - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke customer API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreateCustomer creates new customer -func (c *Client) CreateCustomer(data *CreateCustomerParams) (*xendit.Customer, *xendit.Error) { - return c.CreateCustomerWithContext(context.Background(), data) -} - -// CreateCustomerWithContext creates new customer -func (c *Client) CreateCustomerWithContext(ctx context.Context, data *CreateCustomerParams) (*xendit.Customer, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Customer{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - if data.APIVersion != "" { - header.Add("api-version", data.APIVersion) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/customers", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetCustomerByReferenceID gets customer by reference ID -func (c *Client) GetCustomerByReferenceID(data *GetCustomerByReferenceIDParams) ([]xendit.Customer, *xendit.Error) { - return c.GetCustomerByReferenceIDWithContext(context.Background(), data) -} - -// GetCustomerByReferenceIDWithContext gets customer by reference ID -func (c *Client) GetCustomerByReferenceIDWithContext(ctx context.Context, data *GetCustomerByReferenceIDParams) ([]xendit.Customer, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.Customer{} - var queryString string - - if data != nil { - queryString = data.QueryString() - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/customers?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/customer/customer.go b/customer/customer.go deleted file mode 100644 index 96d9c64e..00000000 --- a/customer/customer.go +++ /dev/null @@ -1,44 +0,0 @@ -package customer - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreateCustomer creates new customer -func CreateCustomer(data *CreateCustomerParams) (*xendit.Customer, *xendit.Error) { - return CreateCustomerWithContext(context.Background(), data) -} - -// CreateCustomerWithContext creates new payment -func CreateCustomerWithContext(ctx context.Context, data *CreateCustomerParams) (*xendit.Customer, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateCustomerWithContext(ctx, data) -} - -// GetCustomerByReferenceID gets customer by reference ID -func GetCustomerByReferenceID(data *GetCustomerByReferenceIDParams) ([]xendit.Customer, *xendit.Error) { - return GetCustomerByReferenceIDWithContext(context.Background(), data) -} - -// GetCustomerByReferenceIDWithContext gets customer by reference ID -func GetCustomerByReferenceIDWithContext(ctx context.Context, data *GetCustomerByReferenceIDParams) ([]xendit.Customer, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetCustomerByReferenceIDWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/customer/customer_test.go b/customer/customer_test.go deleted file mode 100644 index 26ea0639..00000000 --- a/customer/customer_test.go +++ /dev/null @@ -1,248 +0,0 @@ -package customer - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.Customer).ID = "791ac956-397a-400f-9fda-4958894e61b5" - result.(*xendit.Customer).ReferenceID = "test-reference-id" - result.(*xendit.Customer).Email = "tes@tes.com" - result.(*xendit.Customer).MobileNumber = "+6281234567890" - result.(*xendit.Customer).GivenNames = "Given Names" - result.(*xendit.Customer).Nationality = "ID" - result.(*xendit.Customer).DateOfBirth = "1995-12-30" - - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - result.(*xendit.Customer).Addresses = []xendit.CustomerAddress{customerAddress} - result.(*xendit.Customer).Metadata = map[string]interface{}{ - "meta": "data", - } - - return nil -} - -func TestCreateCustomer(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - testCases := []struct { - desc string - data *CreateCustomerParams - expectedRes *xendit.Customer - expectedErr *xendit.Error - }{ - { - desc: "should create a customer", - data: &CreateCustomerParams{ - ReferenceID: "test-reference-id", - Email: "tes@tes.com", - GivenNames: "Given Names", - Nationality: "ID", - DateOfBirth: "1995-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - }, - expectedRes: &xendit.Customer{ - ID: "791ac956-397a-400f-9fda-4958894e61b5", - ReferenceID: "test-reference-id", - GivenNames: "Given Names", - Email: "tes@tes.com", - MobileNumber: "+6281234567890", - Nationality: "ID", - DateOfBirth: "1995-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &CreateCustomerParams{ - ReferenceID: "test-reference-id", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'GivenNames'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/customers", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.Customer{}, - ).Return(nil) - - resp, err := CreateCustomer(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGet struct { - mock.Mock -} - -func (m *apiRequesterMockGet) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "ID": "791ac956-397a-400f-9fda-4958894e61b5", - "reference_id": "test-reference-id", - "given_names": "Given Names", - "email": "tes@tes.com", - "mobile_number": "+6281234567890", - "description": null, - "middle_name": null, - "surname": null, - "phone_number": null, - "nationality": "ID", - "date_of_birth": "1995-12-30", - "metadata": { - "meta": "data" - }, - "employment": null, - "addresses": [ - { - "category": "", - "country": "ID", - "state": "-", - "province": "DKI Jakarta", - "city": "Jakarta Selatan", - "postal_code": "12345", - "street_line1": "Jl. 123", - "street_line2": "Jl. 456", - "is_preferred": false - } - ], - "source_of_wealth": null - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetCustomerByReferenceID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGet) - initTesting(apiRequesterMockObj) - - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - testCases := []struct { - desc string - data *GetCustomerByReferenceIDParams - expectedRes []xendit.Customer - expectedErr *xendit.Error - }{ - { - desc: "should get customer by reference ID", - data: &GetCustomerByReferenceIDParams{ - ReferenceID: "test-reference-id", - }, - expectedRes: []xendit.Customer{ - { - ID: "791ac956-397a-400f-9fda-4958894e61b5", - ReferenceID: "test-reference-id", - GivenNames: "Given Names", - Email: "tes@tes.com", - MobileNumber: "+6281234567890", - Nationality: "ID", - DateOfBirth: "1995-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetCustomerByReferenceIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/customers?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.Customer{}, - ).Return(nil) - - resp, err := GetCustomerByReferenceID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/customer/example_test.go b/customer/example_test.go deleted file mode 100644 index added17a..00000000 --- a/customer/example_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package customer_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/customer" -) - -func ExampleCreateCustomer() { - xendit.Opt.SecretKey = "examplesecretkey" - - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - data := customer.CreateCustomerParams{ - ReferenceID: "test-reference-id-002", - Email: "tes@tes.com", - GivenNames: "Given Names", - Nationality: "ID", - DateOfBirth: "1992-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - } - - resp, err := customer.CreateCustomer(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created customer: %+v\n", resp) -} - -func ExampleGetCustomerByReferenceID() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := customer.GetCustomerByReferenceIDParams{ - ReferenceID: "test-reference-id-002", - } - - resp, err := customer.GetCustomerByReferenceID(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved customer: %+v\n", resp) -} diff --git a/customer/params.go b/customer/params.go deleted file mode 100644 index 81fdb02f..00000000 --- a/customer/params.go +++ /dev/null @@ -1,39 +0,0 @@ -package customer - -import ( - "net/url" - - "github.com/xendit/xendit-go" -) - -// CreateCustomerParams contains parameters for CreateCustomer -type CreateCustomerParams struct { - ForUserID string `json:"-"` - APIVersion string `json:"-"` - ReferenceID string `json:"reference_id" validate:"required"` - MobileNumber string `json:"mobile_number,omitempty"` - Email string `json:"email,omitempty"` - GivenNames string `json:"given_names" validate:"required"` - MiddleName string `json:"middle_name,omitempty"` - Surname string `json:"surname,omitempty"` - Description string `json:"description,omitempty"` - PhoneNumber string `json:"phone_number,omitempty"` - Nationality string `json:"nationality,omitempty"` - Addresses []xendit.CustomerAddress `json:"addresses,omitempty"` - DateOfBirth string `json:"date_of_birth,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// GetCustomerByReferenceIDParams contains parameters for GetCustomerByReferenceID -type GetCustomerByReferenceIDParams struct { - ReferenceID string `json:"reference_id" validate:"required"` -} - -// QueryString creates query string from GetCustomerByReferenceIDParams, ignores nil values -func (p *GetCustomerByReferenceIDParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("reference_id", p.ReferenceID) - - return urlValues.Encode() -} diff --git a/directdebit.go b/directdebit.go deleted file mode 100644 index d333b1da..00000000 --- a/directdebit.go +++ /dev/null @@ -1,140 +0,0 @@ -package xendit - -// ChannelCodeEnum constants are the available channel code -type ChannelCodeEnum string - -// AccountType constants are the available account type -type AccountTypeEnum string - -// This consists the values that ChannelCodeEnum can take -const ( - DC_BRI ChannelCodeEnum = "DC_BRI" - BA_BPI ChannelCodeEnum = "BA_BPI" - BA_UBP ChannelCodeEnum = "BA_UBP" -) - -// This consists the values that AccountTypeEnum can take -const ( - DEBIT_CARD AccountTypeEnum = "DEBIT_CARD" - BANK_ACCOUNT AccountTypeEnum = "BANK_ACCOUNT" -) - -// InitializedLinkedAccount contains data from Xendit's API response of initialize linked account related requests. -// For more details see https://xendit.github.io/apireference/?bash#initialize-linked-account-tokenization. -// For documentation of subpackage linked account, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebit/linkedaccount/ -type InitializedLinkedAccount struct { - ID string `json:"id"` - CustomerID string `json:"customer_id"` - ChannelCode ChannelCodeEnum `json:"channel_code"` - AuthorizerURL string `json:"authorizer_url,omitempty"` - Status string `json:"status,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// ValidatedLinkedAccount contains data from Xendit's API response of validate linked account related requests. -// For more details see https://xendit.github.io/apireference/?bash#validate-otp-for-linked-account-token. -// For documentation of subpackage linked account, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebit/linkedaccount/ -type ValidatedLinkedAccount struct { - ID string `json:"id"` - CustomerID string `json:"customer_id"` - ChannelCode ChannelCodeEnum `json:"channel_code"` - Status string `json:"status"` -} - -// AccessibleLinkedAccount contains data from Xendit's API response of get accessible linked account related requests. -// For more details see https://xendit.github.io/apireference/?bash#retrieve-accessible-accounts-by-linked-account-token. -// For documentation of subpackage linked account, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebit/linkedaccount/ -type AccessibleLinkedAccount struct { - ID string `json:"id"` - ChannelCode ChannelCodeEnum `json:"channel_code"` - AccountType AccountTypeEnum `json:"type"` - Properties map[string]interface{} `json:"properties"` -} - -// UnbindedLinkedAccount contains data from Xendit's API response of unbind linked account token related requests. -// For more details see https://xendit.github.io/apireference/?bash#unbind-a-linked-account-token. -// For documentation of subpackage linked account, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebit/linkedaccount/ -type UnbindedLinkedAccount struct { - ID string `json:"id"` - IsDeleted bool `json:"is_deleted"` -} - -// PaymentMethod contains data from Xendit's API response of payment method related requests. -// For more details see https://xendit.github.io/apireference/?bash#create-payment-method. -// For documentation of subpackage payment method, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebit/paymentmethod/ -type PaymentMethod struct { - ID string `json:"id"` - Type AccountTypeEnum `json:"type"` - Properties map[string]interface{} `json:"properties"` - CustomerID string `json:"customer_id"` - Status string `json:"status"` - Created string `json:"created"` - Updated string `json:"updated"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// DirectDebitBasketItem contains data from Xendit's API response of direct debit's basket requests. -// For more details see https://xendit.github.io/apireference/?bash#create-direct-debit-payment. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebitpayment/ -type DirectDebitBasketItem struct { - ReferenceID string `json:"reference_id"` - Name string `json:"name"` - Market string `json:"market"` - Type string `json:"type"` - Description string `json:"description,omitempty"` - Category string `json:"category,omitempty"` - SubCategory string `json:"sub_category,omitempty"` - Price float64 `json:"price,omitempty"` - URL string `json:"url,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Quantity int `json:"quantity,omitempty"` -} - -// DirectDebitDevice contains data from Xendit's API response of direct debit's device requests. -// For more details see https://xendit.github.io/apireference/?bash#create-direct-debit-payment. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebitpayment/ -type DirectDebitDevice struct { - ID string `json:"id"` - IPAddress string `json:"ip_address"` - UserAgent string `json:"user_agent"` - ADID string `json:"ad_id,omitempty"` - Imei string `json:"imei,omitempty"` -} - -// DirectDebitRefunds contains data from Xendit's API response of direct debit's refunds requests. -// For more details see https://xendit.github.io/apireference/?bash#create-direct-debit-payment. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebitpayment/ -type DirectDebitRefunds struct { - Data []string `json:"data"` - HasMore bool `json:"has_more"` - URL string `json:"url"` -} - -// DirectDebitPayment contains data from Xendit's API response of direct debit payment requests. -// For more details see https://xendit.github.io/apireference/?bash#create-direct-debit-payment. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/directdebitpayment/ -type DirectDebitPayment struct { - ID string `json:"id"` - ReferenceID string `json:"reference_id"` - ChannelCode ChannelCodeEnum `json:"channel_code"` - PaymentMethodID string `json:"payment_method_id"` - Currency string `json:"currency"` - Amount float64 `json:"amount"` - Description string `json:"description"` - Status string `json:"status"` - FailureCode string `json:"failure_code"` - IsOTPRequired bool `json:"is_otp_required"` - OTPMobileNumber string `json:"otp_mobile_number"` - OTPExpirationTimestamp string `json:"otp_expiration_timestamp"` - Created string `json:"created"` - Updated string `json:"updated"` - Basket []DirectDebitBasketItem `json:"basket"` - Metadata map[string]interface{} `json:"metadata"` - Device DirectDebitDevice `json:"device"` - RefundedAmount float64 `json:"refunded_amount"` - Refunds DirectDebitRefunds `json:"refunds"` - SuccessRedirectURL string `json:"success_redirect_url"` - CheckoutURL string `json:"checkout_url"` - FailureRedirectURL string `json:"failure_redirect_url"` - RequiredAction string `json:"required_action"` -} diff --git a/directdebit/directdebitpayment/client.go b/directdebit/directdebitpayment/client.go deleted file mode 100644 index a414e6df..00000000 --- a/directdebit/directdebitpayment/client.go +++ /dev/null @@ -1,198 +0,0 @@ -package directdebitpayment - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke direct debit (linked account) API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -type DirectDebitPaymentResponse struct { - ID string `json:"id"` - ReferenceID string `json:"reference_id"` - ChannelCode xendit.ChannelCodeEnum `json:"channel_code"` - PaymentMethodID string `json:"payment_method_id"` - Currency string `json:"currency"` - Amount float64 `json:"amount"` - Description string `json:"description"` - Status string `json:"status"` - FailureCode string `json:"failure_code"` - IsOTPRequired bool `json:"is_otp_required"` - OTPMobileNumber string `json:"otp_mobile_number"` - OTPExpirationTimestamp string `json:"otp_expiration_timestamp"` - Created string `json:"created"` - Updated string `json:"updated"` - Basket []xendit.DirectDebitBasketItem `json:"basket"` - Metadata map[string]interface{} `json:"metadata"` - Device xendit.DirectDebitDevice `json:"device"` - RefundedAmount float64 `json:"refunded_amount"` - Refunds xendit.DirectDebitRefunds `json:"refunds"` - SuccessRedirectURL string `json:"success_redirect_url"` - CheckoutURL string `json:"checkout_url"` - FailureRedirectURL string `json:"failure_redirect_url"` - RequiredAction string `json:"required_action"` -} - -func (r *DirectDebitPaymentResponse) toDirectDebitPaymentResponse() *xendit.DirectDebitPayment { - return &xendit.DirectDebitPayment{ - ID: r.ID, - ReferenceID: r.ReferenceID, - ChannelCode: r.ChannelCode, - PaymentMethodID: r.PaymentMethodID, - Currency: r.Currency, - Amount: r.Amount, - Description: r.Description, - Status: r.Status, - FailureCode: r.FailureCode, - IsOTPRequired: r.IsOTPRequired, - OTPMobileNumber: r.OTPMobileNumber, - OTPExpirationTimestamp: r.OTPExpirationTimestamp, - Created: r.Created, - Updated: r.Updated, - Basket: r.Basket, - Metadata: r.Metadata, - Device: r.Device, - RefundedAmount: r.RefundedAmount, - Refunds: r.Refunds, - SuccessRedirectURL: r.SuccessRedirectURL, - CheckoutURL: r.CheckoutURL, - FailureRedirectURL: r.FailureRedirectURL, - RequiredAction: r.RequiredAction, - } -} - -// CreateDirectDebitPayment created new direct debit payment -func (c *Client) CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return c.CreateDirectDebitPaymentWithContext(context.Background(), data) -} - -// CreateDirectDebitPaymentWithContext created new direct debit payment -func (c *Client) CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.DirectDebitPayment{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - header.Add("Idempotency-key", data.IdempotencyKey) - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/direct_debits", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// ValidateOTPForDirectDebitPayment validate OTP for direct debit payment -func (c *Client) ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return c.ValidateOTPForDirectDebitPaymentWithContext(context.Background(), data) -} - -// ValidateOTPForDirectDebitPayment validate OTP for direct debit payment -func (c *Client) ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.DirectDebitPayment{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/direct_debits/%s/validate_otp/", c.Opt.XenditURL, data.DirectDebitID), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetDirectDebitPaymentStatusByID gets direct debit payment status by ID -func (c *Client) GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return c.GetDirectDebitPaymentStatusByIDWithContext(context.Background(), data) -} - -// GetDirectDebitPaymentStatusByIDWithContext gets direct debit payment status by ID -func (c *Client) GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - tempResponse := &DirectDebitPaymentResponse{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/direct_debits/%s/", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - tempResponse, - ) - if err != nil { - return nil, err - } - - response := tempResponse.toDirectDebitPaymentResponse() - - return response, nil -} - -// GetDirectDebitPaymentStatusByReferenceID gets direct debit payment status by reference ID -func (c *Client) GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error) { - return c.GetDirectDebitPaymentStatusByReferenceIDWithContext(context.Background(), data) -} - -// GetDirectDebitPaymentStatusByReferenceIDWithContext gets direct debit payment status by reference ID -func (c *Client) GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - response := []xendit.DirectDebitPayment{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/direct_debits?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/directdebit/directdebitpayment/directdebitpayment.go b/directdebit/directdebitpayment/directdebitpayment.go deleted file mode 100644 index e3ef28a9..00000000 --- a/directdebit/directdebitpayment/directdebitpayment.go +++ /dev/null @@ -1,74 +0,0 @@ -package directdebitpayment - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreateDirectDebitPayment created new direct debit payment -func CreateDirectDebitPayment(data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return CreateDirectDebitPaymentWithContext(context.Background(), data) -} - -// CreateDirectDebitPaymentWithContext created new direct debit payment -func CreateDirectDebitPaymentWithContext(ctx context.Context, data *CreateDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateDirectDebitPaymentWithContext(ctx, data) -} - -// ValidateOTPForDirectDebitPayment validate OTP for direct debit payment -func ValidateOTPForDirectDebitPayment(data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return ValidateOTPForDirectDebitPaymentWithContext(context.Background(), data) -} - -// ValidateOTPForDirectDebitPaymentWithContext validate OTP for direct debit payment -func ValidateOTPForDirectDebitPaymentWithContext(ctx context.Context, data *ValidateOTPForDirectDebitPaymentParams) (*xendit.DirectDebitPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ValidateOTPForDirectDebitPaymentWithContext(ctx, data) -} - -// GetDirectDebitPaymentStatusByID gets direct debit payment status by ID -func GetDirectDebitPaymentStatusByID(data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error) { - return GetDirectDebitPaymentStatusByIDWithContext(context.Background(), data) -} - -// GetDirectDebitPaymentStatusByIDWithContext gets direct debit payment status by ID -func GetDirectDebitPaymentStatusByIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByIDParams) (*xendit.DirectDebitPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetDirectDebitPaymentStatusByIDWithContext(ctx, data) -} - -// GetDirectDebitPaymentStatusByReferenceID gets direct debit payment status by reference ID -func GetDirectDebitPaymentStatusByReferenceID(data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error) { - return GetDirectDebitPaymentStatusByReferenceIDWithContext(context.Background(), data) -} - -// GetDirectDebitPaymentStatusByReferenceIDWithContext gets direct debit payment status by reference ID -func GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx context.Context, data *GetDirectDebitPaymentStatusByReferenceIDParams) ([]xendit.DirectDebitPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetDirectDebitPaymentStatusByReferenceIDWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/directdebit/directdebitpayment/directdebitpayment_test.go b/directdebit/directdebitpayment/directdebitpayment_test.go deleted file mode 100644 index 81f842b9..00000000 --- a/directdebit/directdebitpayment/directdebitpayment_test.go +++ /dev/null @@ -1,715 +0,0 @@ -package directdebitpayment - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.DirectDebitPayment).ID = "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c" - result.(*xendit.DirectDebitPayment).ReferenceID = "direct-debit-ref-id" - result.(*xendit.DirectDebitPayment).PaymentMethodID = "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef" - result.(*xendit.DirectDebitPayment).ChannelCode = xendit.DC_BRI - result.(*xendit.DirectDebitPayment).Currency = "IDR" - result.(*xendit.DirectDebitPayment).Amount = 15000 - result.(*xendit.DirectDebitPayment).IsOTPRequired = true - result.(*xendit.DirectDebitPayment).Basket = []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - } - result.(*xendit.DirectDebitPayment).Description = "test description" - result.(*xendit.DirectDebitPayment).Status = "PENDING" - result.(*xendit.DirectDebitPayment).Metadata = map[string]interface{}{ - "meta": "data", - } - result.(*xendit.DirectDebitPayment).Created = "2021-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).Updated = "2021-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).Device = xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - } - result.(*xendit.DirectDebitPayment).RefundedAmount = 0 - result.(*xendit.DirectDebitPayment).Refunds = xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - } - result.(*xendit.DirectDebitPayment).FailureCode = "failure-code" - result.(*xendit.DirectDebitPayment).OTPMobileNumber = "+6281234567890" - result.(*xendit.DirectDebitPayment).OTPExpirationTimestamp = "2100-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).SuccessRedirectURL = "https://success-redirect.url" - result.(*xendit.DirectDebitPayment).CheckoutURL = "https://checkout.url" - result.(*xendit.DirectDebitPayment).FailureRedirectURL = "https://failure-redirect.url" - result.(*xendit.DirectDebitPayment).RequiredAction = "VALIDATE_OTP" - - return nil -} - -func TestCreateDirectDebitPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *CreateDirectDebitPaymentParams - expectedRes *xendit.DirectDebitPayment - expectedErr *xendit.Error - }{ - { - desc: "should create direct debit payment", - data: &CreateDirectDebitPaymentParams{ - IdempotencyKey: "idem-key", - ReferenceID: "test-ref-id", - PaymentMethodID: "test-pm-id", - Currency: "IDR", - Amount: 15000, - CallbackURL: "http://webhook.site", - EnableOTP: true, - Description: "Test description", - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - SuccessRedirectURL: "https://success-redirect.url", - FailureRedirectURL: "https://failure-redirect.url", - Metadata: map[string]interface{}{ - "meta": "data", - }, - }, - expectedRes: &xendit.DirectDebitPayment{ - ID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - ReferenceID: "direct-debit-ref-id", - PaymentMethodID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - ChannelCode: xendit.DC_BRI, - Currency: "IDR", - Amount: 15000, - IsOTPRequired: true, - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Description: "test description", - Status: "PENDING", - Metadata: map[string]interface{}{ - "meta": "data", - }, - Created: "2021-07-16T02:19:07.277466Z", - Updated: "2021-07-16T02:19:07.277466Z", - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - RefundedAmount: 0, - Refunds: xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - }, - FailureCode: "failure-code", - OTPMobileNumber: "+6281234567890", - OTPExpirationTimestamp: "2100-07-16T02:19:07.277466Z", - SuccessRedirectURL: "https://success-redirect.url", - CheckoutURL: "https://checkout.url", - FailureRedirectURL: "https://failure-redirect.url", - RequiredAction: "VALIDATE_OTP", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &CreateDirectDebitPaymentParams{ - IdempotencyKey: "idem-key-2", - PaymentMethodID: "test-pm-id", - Currency: "IDR", - Amount: 15000, - CallbackURL: "http://webhook.site", - EnableOTP: true, - Description: "Test description", - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - SuccessRedirectURL: "https://success-redirect.url", - FailureRedirectURL: "https://failure-redirect.url", - Metadata: map[string]interface{}{ - "meta": "data", - }, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/direct_debits", - xendit.Opt.SecretKey, - http.Header{"Idempotency-Key": []string{tC.data.IdempotencyKey}}, - tC.data, - &xendit.DirectDebitPayment{}, - ).Return(nil) - - resp, err := CreateDirectDebitPayment(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockValidate struct { - mock.Mock -} - -func (m *apiRequesterMockValidate) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.DirectDebitPayment).ID = "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c" - result.(*xendit.DirectDebitPayment).ReferenceID = "direct-debit-ref-id" - result.(*xendit.DirectDebitPayment).PaymentMethodID = "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef" - result.(*xendit.DirectDebitPayment).ChannelCode = xendit.DC_BRI - result.(*xendit.DirectDebitPayment).Currency = "IDR" - result.(*xendit.DirectDebitPayment).Amount = 15000 - result.(*xendit.DirectDebitPayment).IsOTPRequired = true - result.(*xendit.DirectDebitPayment).Basket = []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - } - result.(*xendit.DirectDebitPayment).Description = "test description" - result.(*xendit.DirectDebitPayment).Status = "COMPLETED" - result.(*xendit.DirectDebitPayment).Metadata = map[string]interface{}{ - "meta": "data", - } - result.(*xendit.DirectDebitPayment).Created = "2021-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).Updated = "2021-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).Device = xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - } - result.(*xendit.DirectDebitPayment).RefundedAmount = 0 - result.(*xendit.DirectDebitPayment).Refunds = xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - } - result.(*xendit.DirectDebitPayment).FailureCode = "failure-code" - result.(*xendit.DirectDebitPayment).OTPMobileNumber = "+6281234567890" - result.(*xendit.DirectDebitPayment).OTPExpirationTimestamp = "2100-07-16T02:19:07.277466Z" - result.(*xendit.DirectDebitPayment).SuccessRedirectURL = "https://success-redirect.url" - result.(*xendit.DirectDebitPayment).CheckoutURL = "https://checkout.url" - result.(*xendit.DirectDebitPayment).FailureRedirectURL = "https://failure-redirect.url" - result.(*xendit.DirectDebitPayment).RequiredAction = "VALIDATE_OTP" - - return nil -} - -func TestValidateOTPForDirectDebitPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockValidate) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *ValidateOTPForDirectDebitPaymentParams - expectedRes *xendit.DirectDebitPayment - expectedErr *xendit.Error - }{ - { - desc: "should validate OTP for direct debit payment", - data: &ValidateOTPForDirectDebitPaymentParams{ - DirectDebitID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - OTPCode: "222000", - }, - expectedRes: &xendit.DirectDebitPayment{ - ID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - ReferenceID: "direct-debit-ref-id", - PaymentMethodID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - ChannelCode: xendit.DC_BRI, - Currency: "IDR", - Amount: 15000, - IsOTPRequired: true, - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Description: "test description", - Status: "COMPLETED", - Metadata: map[string]interface{}{ - "meta": "data", - }, - Created: "2021-07-16T02:19:07.277466Z", - Updated: "2021-07-16T02:19:07.277466Z", - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - RefundedAmount: 0, - Refunds: xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - }, - FailureCode: "failure-code", - OTPMobileNumber: "+6281234567890", - OTPExpirationTimestamp: "2100-07-16T02:19:07.277466Z", - SuccessRedirectURL: "https://success-redirect.url", - CheckoutURL: "https://checkout.url", - FailureRedirectURL: "https://failure-redirect.url", - RequiredAction: "VALIDATE_OTP", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &ValidateOTPForDirectDebitPaymentParams{ - DirectDebitID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'OTPCode'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/direct_debits/"+tC.data.DirectDebitID+"/validate_otp/", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.DirectDebitPayment{}, - ).Return(nil) - - resp, err := ValidateOTPForDirectDebitPayment(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGetByID struct { - mock.Mock -} - -func (m *apiRequesterMockGetByID) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - result.(*DirectDebitPaymentResponse).ID = "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c" - result.(*DirectDebitPaymentResponse).ReferenceID = "direct-debit-ref-id" - result.(*DirectDebitPaymentResponse).PaymentMethodID = "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef" - result.(*DirectDebitPaymentResponse).ChannelCode = xendit.DC_BRI - result.(*DirectDebitPaymentResponse).Currency = "IDR" - result.(*DirectDebitPaymentResponse).Amount = 15000 - result.(*DirectDebitPaymentResponse).IsOTPRequired = true - result.(*DirectDebitPaymentResponse).Basket = []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - } - result.(*DirectDebitPaymentResponse).Description = "test description" - result.(*DirectDebitPaymentResponse).Status = "COMPLETED" - result.(*DirectDebitPaymentResponse).Metadata = map[string]interface{}{ - "meta": "data", - } - result.(*DirectDebitPaymentResponse).Created = "2021-07-16T02:19:07.277466Z" - result.(*DirectDebitPaymentResponse).Updated = "2021-07-16T02:19:07.277466Z" - result.(*DirectDebitPaymentResponse).Device = xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - } - result.(*DirectDebitPaymentResponse).RefundedAmount = 0 - result.(*DirectDebitPaymentResponse).Refunds = xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - } - result.(*DirectDebitPaymentResponse).FailureCode = "failure-code" - result.(*DirectDebitPaymentResponse).OTPMobileNumber = "+6281234567890" - result.(*DirectDebitPaymentResponse).OTPExpirationTimestamp = "2100-07-16T02:19:07.277466Z" - result.(*DirectDebitPaymentResponse).SuccessRedirectURL = "https://success-redirect.url" - result.(*DirectDebitPaymentResponse).CheckoutURL = "https://checkout.url" - result.(*DirectDebitPaymentResponse).FailureRedirectURL = "https://failure-redirect.url" - result.(*DirectDebitPaymentResponse).RequiredAction = "VALIDATE_OTP" - - return nil -} - -func TestGetDirectDebitPaymentStatusByID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGetByID) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *GetDirectDebitPaymentStatusByIDParams - expectedRes *xendit.DirectDebitPayment - expectedErr *xendit.Error - }{ - { - desc: "should retrieve direct debit payment by ID", - data: &GetDirectDebitPaymentStatusByIDParams{ - ID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - }, - expectedRes: &xendit.DirectDebitPayment{ - ID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - ReferenceID: "direct-debit-ref-id", - PaymentMethodID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - ChannelCode: xendit.DC_BRI, - Currency: "IDR", - Amount: 15000, - IsOTPRequired: true, - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Description: "test description", - Status: "COMPLETED", - Metadata: map[string]interface{}{ - "meta": "data", - }, - Created: "2021-07-16T02:19:07.277466Z", - Updated: "2021-07-16T02:19:07.277466Z", - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - RefundedAmount: 0, - Refunds: xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - }, - FailureCode: "failure-code", - OTPMobileNumber: "+6281234567890", - OTPExpirationTimestamp: "2100-07-16T02:19:07.277466Z", - SuccessRedirectURL: "https://success-redirect.url", - CheckoutURL: "https://checkout.url", - FailureRedirectURL: "https://failure-redirect.url", - RequiredAction: "VALIDATE_OTP", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetDirectDebitPaymentStatusByIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/direct_debits/"+tC.data.ID+"/", - xendit.Opt.SecretKey, - nil, - nil, - &DirectDebitPaymentResponse{}, - ).Return(nil) - - resp, err := GetDirectDebitPaymentStatusByID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGetByReferenceID struct { - mock.Mock -} - -func (m *apiRequesterMockGetByReferenceID) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "id": "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - "reference_id": "direct-debit-ref-id", - "payment_method_id": "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - "channel_code": "DC_BRI", - "currency": "IDR", - "amount": 15000, - "is_otp_required": true, - "basket": [ - { - "reference_id": "basket-product-ref-id", - "name": "product-name", - "category": "mechanics", - "market": "ID", - "price": 50000, - "quantity": 5, - "type": "product type", - "sub_category": "product sub category", - "description": "product description", - "url": "https://product.url" - } - ], - "description": "test description", - "status": "COMPLETED", - "metadata": { - "meta": "data" - }, - "created": "2021-07-16T02:19:07.277466Z", - "updated": "2021-07-16T02:19:07.277466Z", - "device": { - "id": "device-id", - "ip_address": "0.0.0.0", - "user_agent": "user-agent", - "ad_id": "ad-id", - "imei": "123a456b789c" - }, - "refunded_amount": 0, - "refunds": { - "data": ["a1b", "c2d", "e3f", "g4h"], - "has_more": false, - "url": "https://ref.unds" - }, - "failure_code": "failure-code", - "otp_mobile_number": "+6281234567890", - "otp_expiration_timestamp": "2100-07-16T02:19:07.277466Z", - "success_redirect_url": "https://success-redirect.url", - "checkout_url": "https://checkout.url", - "failure_redirect_url": "https://failure-redirect.url", - "required_action": "VALIDATE_OTP" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetDirectDebitPaymentStatusByReferenceID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGetByReferenceID) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *GetDirectDebitPaymentStatusByReferenceIDParams - expectedRes []xendit.DirectDebitPayment - expectedErr *xendit.Error - }{ - { - desc: "should gets direct debit payment status by reference ID", - data: &GetDirectDebitPaymentStatusByReferenceIDParams{ - ReferenceID: "direct-debit-ref-id", - }, - expectedRes: []xendit.DirectDebitPayment{ - { - ID: "ddpy-7e61b0a7-92f9-4762-a994-c2936306f44c", - ReferenceID: "direct-debit-ref-id", - PaymentMethodID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - ChannelCode: xendit.DC_BRI, - Currency: "IDR", - Amount: 15000, - IsOTPRequired: true, - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Description: "test description", - Status: "COMPLETED", - Metadata: map[string]interface{}{ - "meta": "data", - }, - Created: "2021-07-16T02:19:07.277466Z", - Updated: "2021-07-16T02:19:07.277466Z", - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - RefundedAmount: 0, - Refunds: xendit.DirectDebitRefunds{ - Data: []string{"a1b", "c2d", "e3f", "g4h"}, - HasMore: false, - URL: "https://ref.unds", - }, - FailureCode: "failure-code", - OTPMobileNumber: "+6281234567890", - OTPExpirationTimestamp: "2100-07-16T02:19:07.277466Z", - SuccessRedirectURL: "https://success-redirect.url", - CheckoutURL: "https://checkout.url", - FailureRedirectURL: "https://failure-redirect.url", - RequiredAction: "VALIDATE_OTP", - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetDirectDebitPaymentStatusByReferenceIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/direct_debits?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DirectDebitPayment{}, - ).Return(nil) - - resp, err := GetDirectDebitPaymentStatusByReferenceID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/directdebit/directdebitpayment/example_test.go b/directdebit/directdebitpayment/example_test.go deleted file mode 100644 index 4d916138..00000000 --- a/directdebit/directdebitpayment/example_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package directdebitpayment_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/directdebit/directdebitpayment" -) - -func ExampleCreateDirectDebitPayment() { - xendit.Opt.SecretKey = "examplesecretkey" - - metadata := map[string]interface{}{ - "meta": "data", - } - - data := directdebitpayment.CreateDirectDebitPaymentParams{ - IdempotencyKey: "idem-key", - ReferenceID: "test-ref-id", - PaymentMethodID: "test-pm-id", - Currency: "IDR", - Amount: 15000, - CallbackURL: "http://webhook.site", - EnableOTP: true, - Description: "Test description", - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - SuccessRedirectURL: "https://success-redirect.url", - FailureRedirectURL: "https://failure-redirect.url", - Metadata: metadata, - } - - resp, err := directdebitpayment.CreateDirectDebitPayment(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created direct debit payment: %+v\n", resp) -} - -func ExampleValidateOTPForDirectDebitPayment() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := directdebitpayment.ValidateOTPForDirectDebitPaymentParams{ - DirectDebitID: "test-ddpy-id", - OTPCode: "333000", - } - - resp, err := directdebitpayment.ValidateOTPForDirectDebitPayment(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("validated direct debit payment: %+v\n", resp) -} - -func ExampleGetDirectDebitPaymentStatusByID() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := directdebitpayment.GetDirectDebitPaymentStatusByIDParams{ - ID: "test-ddpy-id", - } - - resp, err := directdebitpayment.GetDirectDebitPaymentStatusByID(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved direct debit payment: %+v\n", resp) -} - -func ExampleGetDirectDebitPaymentStatusByReferenceID() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := directdebitpayment.GetDirectDebitPaymentStatusByReferenceIDParams{ - ReferenceID: "test-ddpy-ref-id", - } - - resp, err := directdebitpayment.GetDirectDebitPaymentStatusByReferenceID(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved direct debit payments: %+v\n", resp) -} diff --git a/directdebit/directdebitpayment/params.go b/directdebit/directdebitpayment/params.go deleted file mode 100644 index e39f49cc..00000000 --- a/directdebit/directdebitpayment/params.go +++ /dev/null @@ -1,53 +0,0 @@ -package directdebitpayment - -import ( - "net/url" - - "github.com/xendit/xendit-go" -) - -// CreateDirectDebitPaymentParams contains parameters for CreateDirectDebitPayment -type CreateDirectDebitPaymentParams struct { - IdempotencyKey string `json:"-"` - ForUserID string `json:"-"` - ReferenceID string `json:"reference_id" validate:"required"` - PaymentMethodID string `json:"payment_method_id" validate:"required"` - Currency string `json:"currency" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - CallbackURL string `json:"callback_url,omitempty"` - EnableOTP bool `json:"enable_otp,omitempty"` - Description string `json:"description,omitempty"` - Device xendit.DirectDebitDevice `json:"device,omitempty"` - Basket []xendit.DirectDebitBasketItem `json:"basket,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// ValidateOTPForDirectDebitPaymentParams contains parameters for ValidateOTPForDirectDebitPayment -type ValidateOTPForDirectDebitPaymentParams struct { - ForUserID string `json:"-"` - DirectDebitID string `json:"direct_debit_id" validate:"required"` - OTPCode string `json:"otp_code" validate:"required"` -} - -// GetDirectDebitPaymentStatusByIDParams contains parameters for GetDirectDebitPaymentStatusByID -type GetDirectDebitPaymentStatusByIDParams struct { - ForUserID string `json:"-"` - ID string `json:"id" validate:"required"` -} - -// GetDirectDebitPaymentStatusByReferenceIDParams contains parameters for GetDirectDebitPaymentStatusByReferenceID -type GetDirectDebitPaymentStatusByReferenceIDParams struct { - ForUserID string `json:"-"` - ReferenceID string `json:"reference_id" validate:"required"` -} - -// QueryString creates query string from GetDirectDebitPaymentStatusByReferenceIDParams, ignores nil values -func (p *GetDirectDebitPaymentStatusByReferenceIDParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("reference_id", p.ReferenceID) - - return urlValues.Encode() -} diff --git a/directdebit/linkedaccount/client.go b/directdebit/linkedaccount/client.go deleted file mode 100644 index 9d43635f..00000000 --- a/directdebit/linkedaccount/client.go +++ /dev/null @@ -1,147 +0,0 @@ -package linkedaccount - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke direct debit (linked account) API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// InitializeLinkedAccountTokenization initialize new linked account tokenization -func (c *Client) InitializeLinkedAccountTokenization(data *InitializeLinkedAccountTokenizationParams) (*xendit.InitializedLinkedAccount, *xendit.Error) { - return c.InitializeLinkedAccountTokenizationWithContext(context.Background(), data) -} - -// InitializeLinkedAccountTokenization initialize new linked account tokenization -func (c *Client) InitializeLinkedAccountTokenizationWithContext(ctx context.Context, data *InitializeLinkedAccountTokenizationParams) (*xendit.InitializedLinkedAccount, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.InitializedLinkedAccount{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/linked_account_tokens/auth", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// ValidateOTPForLinkedAccount validate OTP for linked account -func (c *Client) ValidateOTPForLinkedAccount(data *ValidateOTPForLinkedAccountParams) (*xendit.ValidatedLinkedAccount, *xendit.Error) { - return c.ValidateOTPForLinkedAccountWithContext(context.Background(), data) -} - -// ValidateOTPForLinkedAccount validate OTP for linked account -func (c *Client) ValidateOTPForLinkedAccountWithContext(ctx context.Context, data *ValidateOTPForLinkedAccountParams) (*xendit.ValidatedLinkedAccount, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.ValidatedLinkedAccount{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/linked_account_tokens/%s/validate_otp", c.Opt.XenditURL, data.LinkedAccountTokenID), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// RetrieveAccessibleLinkedAccounts gets accessible linked accounts -func (c *Client) RetrieveAccessibleLinkedAccounts(data *RetrieveAccessibleLinkedAccountParams) ([]xendit.AccessibleLinkedAccount, *xendit.Error) { - return c.RetrieveAccessibleLinkedAccountsWithContext(context.Background(), data) -} - -// RetrieveAccessibleLinkedAccountsWithContext gets accessible linked accounts -func (c *Client) RetrieveAccessibleLinkedAccountsWithContext(ctx context.Context, data *RetrieveAccessibleLinkedAccountParams) ([]xendit.AccessibleLinkedAccount, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.AccessibleLinkedAccount{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/linked_account_tokens/%s/accounts", c.Opt.XenditURL, data.LinkedAccountTokenID), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// UnbindLinkedAccountToken unbind a successful linked account token -func (c *Client) UnbindLinkedAccountToken(data *UnbindLinkedAccountTokenParams) (*xendit.UnbindedLinkedAccount, *xendit.Error) { - return c.UnbindLinkedAccountTokenWithContext(context.Background(), data) -} - -// UnbindLinkedAccountTokenWithContext unbind a successful linked account token -func (c *Client) UnbindLinkedAccountTokenWithContext(ctx context.Context, data *UnbindLinkedAccountTokenParams) (*xendit.UnbindedLinkedAccount, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.UnbindedLinkedAccount{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "DELETE", - fmt.Sprintf("%s/linked_account_tokens/%s", c.Opt.XenditURL, data.LinkedAccountTokenID), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/directdebit/linkedaccount/example_test.go b/directdebit/linkedaccount/example_test.go deleted file mode 100644 index 8282a791..00000000 --- a/directdebit/linkedaccount/example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package linkedaccount_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/directdebit/linkedaccount" -) - -func ExampleInitializeLinkedAccountTokenization() { - xendit.Opt.SecretKey = "examplesecretkey" - - properties := map[string]interface{}{ - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - data := linkedaccount.InitializeLinkedAccountTokenizationParams{ - CustomerID: "test-cust-id", - ChannelCode: xendit.DC_BRI, - Properties: properties, - Metadata: metadata, - } - - resp, err := linkedaccount.InitializeLinkedAccountTokenization(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("initialized linked account tokenization: %+v\n", resp) -} - -func ExampleValidateOTPForLinkedAccount() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := linkedaccount.ValidateOTPForLinkedAccountParams{ - LinkedAccountTokenID: "test-lat-id", - OTPCode: "333000", - } - - resp, err := linkedaccount.ValidateOTPForLinkedAccount(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("validated linked account: %+v\n", resp) -} - -func ExampleRetrieveAccessibleLinkedAccounts() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := linkedaccount.RetrieveAccessibleLinkedAccountParams{ - LinkedAccountTokenID: "test-lat-id", - } - - resp, err := linkedaccount.RetrieveAccessibleLinkedAccounts(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved accessible linked accounts: %+v\n", resp) -} - -func ExampleUnbindLinkedAccountToken() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := linkedaccount.UnbindLinkedAccountTokenParams{ - LinkedAccountTokenID: "test-lat-id", - } - - resp, err := linkedaccount.UnbindLinkedAccountToken(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("unbinded linked account token: %+v\n", resp) -} diff --git a/directdebit/linkedaccount/linkedaccount.go b/directdebit/linkedaccount/linkedaccount.go deleted file mode 100644 index c97b4cbe..00000000 --- a/directdebit/linkedaccount/linkedaccount.go +++ /dev/null @@ -1,74 +0,0 @@ -package linkedaccount - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// InitializeLinkedAccountTokenization initialize new linked account tokenization -func InitializeLinkedAccountTokenization(data *InitializeLinkedAccountTokenizationParams) (*xendit.InitializedLinkedAccount, *xendit.Error) { - return InitializeLinkedAccountTokenizationWithContext(context.Background(), data) -} - -// InitializeLinkedAccountTokenizationWithContext initialize new linked account tokenization -func InitializeLinkedAccountTokenizationWithContext(ctx context.Context, data *InitializeLinkedAccountTokenizationParams) (*xendit.InitializedLinkedAccount, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.InitializeLinkedAccountTokenizationWithContext(ctx, data) -} - -// ValidateOTPForLinkedAccount validate OTP for linked account -func ValidateOTPForLinkedAccount(data *ValidateOTPForLinkedAccountParams) (*xendit.ValidatedLinkedAccount, *xendit.Error) { - return ValidateOTPForLinkedAccountWithContext(context.Background(), data) -} - -// ValidateOTPForLinkedAccountWithContext validate OTP for linked account -func ValidateOTPForLinkedAccountWithContext(ctx context.Context, data *ValidateOTPForLinkedAccountParams) (*xendit.ValidatedLinkedAccount, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ValidateOTPForLinkedAccountWithContext(ctx, data) -} - -// RetrieveAccessibleLinkedAccounts gets accessible linked accounts -func RetrieveAccessibleLinkedAccounts(data *RetrieveAccessibleLinkedAccountParams) ([]xendit.AccessibleLinkedAccount, *xendit.Error) { - return RetrieveAccessibleLinkedAccountsWithContext(context.Background(), data) -} - -// RetrieveAccessibleLinkedAccountsWithContext gets accessible linked accounts -func RetrieveAccessibleLinkedAccountsWithContext(ctx context.Context, data *RetrieveAccessibleLinkedAccountParams) ([]xendit.AccessibleLinkedAccount, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.RetrieveAccessibleLinkedAccountsWithContext(ctx, data) -} - -// UnbindLinkedAccountToken unbind a successful linked account token -func UnbindLinkedAccountToken(data *UnbindLinkedAccountTokenParams) (*xendit.UnbindedLinkedAccount, *xendit.Error) { - return UnbindLinkedAccountTokenWithContext(context.Background(), data) -} - -// UnbindLinkedAccountTokenWithContext unbind a successful linked account token -func UnbindLinkedAccountTokenWithContext(ctx context.Context, data *UnbindLinkedAccountTokenParams) (*xendit.UnbindedLinkedAccount, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.UnbindLinkedAccountTokenWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/directdebit/linkedaccount/linkedaccount_test.go b/directdebit/linkedaccount/linkedaccount_test.go deleted file mode 100644 index ce1581ae..00000000 --- a/directdebit/linkedaccount/linkedaccount_test.go +++ /dev/null @@ -1,315 +0,0 @@ -package linkedaccount - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.InitializedLinkedAccount).ID = "lat-f9dc34e7-153a-444e-b337-cd2599e7f670" - result.(*xendit.InitializedLinkedAccount).CustomerID = "6778b829-1936-4c4a-a321-9a0178840571" - result.(*xendit.InitializedLinkedAccount).ChannelCode = xendit.DC_BRI - result.(*xendit.InitializedLinkedAccount).Status = "PENDING" - - return nil -} - -func TestInitializeLinkedAccountTokenization(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - properties := map[string]interface{}{ - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - } - - testCases := []struct { - desc string - data *InitializeLinkedAccountTokenizationParams - expectedRes *xendit.InitializedLinkedAccount - expectedErr *xendit.Error - }{ - { - desc: "should initialize linked account tokenization", - data: &InitializeLinkedAccountTokenizationParams{ - CustomerID: "6778b829-1936-4c4a-a321-9a0178840571", - ChannelCode: xendit.DC_BRI, - Properties: properties, - }, - expectedRes: &xendit.InitializedLinkedAccount{ - ID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - CustomerID: "6778b829-1936-4c4a-a321-9a0178840571", - ChannelCode: xendit.DC_BRI, - Status: "PENDING", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &InitializeLinkedAccountTokenizationParams{ - ChannelCode: xendit.DC_BRI, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'CustomerID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/linked_account_tokens/auth", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.InitializedLinkedAccount{}, - ).Return(nil) - - resp, err := InitializeLinkedAccountTokenization(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockValidate struct { - mock.Mock -} - -func (m *apiRequesterMockValidate) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.ValidatedLinkedAccount).ID = "lat-f9dc34e7-153a-444e-b337-cd2599e7f670" - result.(*xendit.ValidatedLinkedAccount).CustomerID = "6778b829-1936-4c4a-a321-9a0178840571" - result.(*xendit.ValidatedLinkedAccount).ChannelCode = xendit.DC_BRI - result.(*xendit.ValidatedLinkedAccount).Status = "SUCCESS" - - return nil -} - -func TestValidateOTPForLinkedAccount(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockValidate) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *ValidateOTPForLinkedAccountParams - expectedRes *xendit.ValidatedLinkedAccount - expectedErr *xendit.Error - }{ - { - desc: "should validate OTP for linked account", - data: &ValidateOTPForLinkedAccountParams{ - LinkedAccountTokenID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - OTPCode: "333000", - }, - expectedRes: &xendit.ValidatedLinkedAccount{ - ID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - CustomerID: "6778b829-1936-4c4a-a321-9a0178840571", - ChannelCode: xendit.DC_BRI, - Status: "SUCCESS", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &ValidateOTPForLinkedAccountParams{ - LinkedAccountTokenID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'OTPCode'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/linked_account_tokens/"+tC.data.LinkedAccountTokenID+"/validate_otp", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.ValidatedLinkedAccount{}, - ).Return(nil) - - resp, err := ValidateOTPForLinkedAccount(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockRetrieve struct { - mock.Mock -} - -func (m *apiRequesterMockRetrieve) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "channel_code": "DC_BRI", - "id": "la-958b3e15-a354-4ac1-80d5-d7f68061fda2", - "properties": { - "card_expiry": "11/23", - "card_last_four": "8888", - "currency": "IDR", - "description": "" - }, - "type": "DEBIT_CARD" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestRetrieveAccessibleLinkedAccounts(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockRetrieve) - initTesting(apiRequesterMockObj) - - properties := map[string]interface{}{ - "card_expiry": "11/23", - "card_last_four": "8888", - "currency": "IDR", - "description": "", - } - - testCases := []struct { - desc string - data *RetrieveAccessibleLinkedAccountParams - expectedRes []xendit.AccessibleLinkedAccount - expectedErr *xendit.Error - }{ - { - desc: "should retrieve accessible linked accounts", - data: &RetrieveAccessibleLinkedAccountParams{ - LinkedAccountTokenID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - }, - expectedRes: []xendit.AccessibleLinkedAccount{ - { - ID: "la-958b3e15-a354-4ac1-80d5-d7f68061fda2", - ChannelCode: xendit.DC_BRI, - AccountType: xendit.DEBIT_CARD, - Properties: properties, - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &RetrieveAccessibleLinkedAccountParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'LinkedAccountTokenID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/linked_account_tokens/"+tC.data.LinkedAccountTokenID+"/accounts", - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.AccessibleLinkedAccount{}, - ).Return(nil) - - resp, err := RetrieveAccessibleLinkedAccounts(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockUnbind struct { - mock.Mock -} - -func (m *apiRequesterMockUnbind) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.UnbindedLinkedAccount).ID = "lat-f9dc34e7-153a-444e-b337-cd2599e7f670" - result.(*xendit.UnbindedLinkedAccount).IsDeleted = true - - return nil -} - -func TestUnbindLinkedAccountToken(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockUnbind) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *UnbindLinkedAccountTokenParams - expectedRes *xendit.UnbindedLinkedAccount - expectedErr *xendit.Error - }{ - { - desc: "should unbind linked account token", - data: &UnbindLinkedAccountTokenParams{ - LinkedAccountTokenID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - }, - expectedRes: &xendit.UnbindedLinkedAccount{ - ID: "lat-f9dc34e7-153a-444e-b337-cd2599e7f670", - IsDeleted: true, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &UnbindLinkedAccountTokenParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'LinkedAccountTokenID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "DELETE", - xendit.Opt.XenditURL+"/linked_account_tokens/"+tC.data.LinkedAccountTokenID, - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.UnbindedLinkedAccount{}, - ).Return(nil) - - resp, err := UnbindLinkedAccountToken(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/directdebit/linkedaccount/params.go b/directdebit/linkedaccount/params.go deleted file mode 100644 index 5f19d2dc..00000000 --- a/directdebit/linkedaccount/params.go +++ /dev/null @@ -1,31 +0,0 @@ -package linkedaccount - -import ( - "github.com/xendit/xendit-go" -) - -// InitializeLinkedAccountTokenizationParams contains parameters for InitializeLinkedAccountTokenization -type InitializeLinkedAccountTokenizationParams struct { - ForUserID string `json:"-"` - CustomerID string `json:"customer_id" validate:"required"` - ChannelCode xendit.ChannelCodeEnum `json:"channel_code" validate:"required"` - Properties map[string]interface{} `json:"properties,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// ValidateOTPParams contains parameters for ValidateOTPForLinkedAccount -type ValidateOTPForLinkedAccountParams struct { - ForUserID string `json:"-"` - LinkedAccountTokenID string `json:"linked_account_token_id" validate:"required"` - OTPCode string `json:"otp_code" validate:"required"` -} - -type RetrieveAccessibleLinkedAccountParams struct { - ForUserID string `json:"-"` - LinkedAccountTokenID string `json:"linked_account_token_id" validate:"required"` -} - -type UnbindLinkedAccountTokenParams struct { - ForUserID string `json:"-"` - LinkedAccountTokenID string `json:"linked_account_token_id" validate:"required"` -} diff --git a/directdebit/paymentmethod/client.go b/directdebit/paymentmethod/client.go deleted file mode 100644 index 50bf9008..00000000 --- a/directdebit/paymentmethod/client.go +++ /dev/null @@ -1,84 +0,0 @@ -package paymentmethod - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke e-wallet API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreatePaymentMethod creates new payment method -func (c *Client) CreatePaymentMethod(data *CreatePaymentMethodParams) (*xendit.PaymentMethod, *xendit.Error) { - return c.CreatePaymentMethodWithContext(context.Background(), data) -} - -// CreatePaymentMethodWithContext creates new payment method -func (c *Client) CreatePaymentMethodWithContext(ctx context.Context, data *CreatePaymentMethodParams) (*xendit.PaymentMethod, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.PaymentMethod{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/payment_methods", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetPaymentMethodsByCustomerIDParams gets payment methods by customer ID -func (c *Client) GetPaymentMethodsByCustomerID(data *GetPaymentMethodsByCustomerIDParams) ([]xendit.PaymentMethod, *xendit.Error) { - return c.GetPaymentMethodsByCustomerIDWithContext(context.Background(), data) -} - -// GetPaymentMethodsByCustomerIDWithContext gets payment methods by customer ID -func (c *Client) GetPaymentMethodsByCustomerIDWithContext(ctx context.Context, data *GetPaymentMethodsByCustomerIDParams) ([]xendit.PaymentMethod, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.PaymentMethod{} - var queryString string - - if data != nil { - queryString = data.QueryString() - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/payment_methods?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/directdebit/paymentmethod/example_test.go b/directdebit/paymentmethod/example_test.go deleted file mode 100644 index b57be2aa..00000000 --- a/directdebit/paymentmethod/example_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package paymentmethod_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/directdebit/paymentmethod" -) - -func ExampleCreatePaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - properties := map[string]interface{}{ - "id": "test-la-id", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - data := paymentmethod.CreatePaymentMethodParams{ - CustomerID: "test-cust-id", - Type: xendit.DEBIT_CARD, - Properties: properties, - Metadata: metadata, - } - - resp, err := paymentmethod.CreatePaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment method: %+v\n", resp) -} - -func ExampleGetPaymentMethodsByCustomerID() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := paymentmethod.GetPaymentMethodsByCustomerIDParams{ - CustomerID: "test-cust-id", - } - - resp, err := paymentmethod.GetPaymentMethodsByCustomerID(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved payment methods: %+v\n", resp) -} diff --git a/directdebit/paymentmethod/params.go b/directdebit/paymentmethod/params.go deleted file mode 100644 index 22d9eee3..00000000 --- a/directdebit/paymentmethod/params.go +++ /dev/null @@ -1,31 +0,0 @@ -package paymentmethod - -import ( - "net/url" - - "github.com/xendit/xendit-go" -) - -// CreatePaymentMethodParams contains parameters for CreatePaymentMethod -type CreatePaymentMethodParams struct { - ForUserID string `json:"-"` - CustomerID string `json:"customer_id" validate:"required"` - Type xendit.AccountTypeEnum `json:"type" validate:"required"` - Properties map[string]interface{} `json:"properties" validate:"required"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// GetPaymentMethodsByCustomerIDParams contains parameters for GetPaymentMethodsByCustomerID -type GetPaymentMethodsByCustomerIDParams struct { - ForUserID string `json:"-"` - CustomerID string `json:"customer_id" validate:"required"` -} - -// QueryString creates query string from GetPaymentMethodsByCustomerIDParams, ignores nil values -func (p *GetPaymentMethodsByCustomerIDParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("customer_id", p.CustomerID) - - return urlValues.Encode() -} diff --git a/directdebit/paymentmethod/paymentmethod.go b/directdebit/paymentmethod/paymentmethod.go deleted file mode 100644 index c6941433..00000000 --- a/directdebit/paymentmethod/paymentmethod.go +++ /dev/null @@ -1,44 +0,0 @@ -package paymentmethod - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreatePaymentMethod creates new payment method -func CreatePaymentMethod(data *CreatePaymentMethodParams) (*xendit.PaymentMethod, *xendit.Error) { - return CreatePaymentMethodWithContext(context.Background(), data) -} - -// CreatePaymentMethodWithContext creates new payment method -func CreatePaymentMethodWithContext(ctx context.Context, data *CreatePaymentMethodParams) (*xendit.PaymentMethod, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreatePaymentMethodWithContext(ctx, data) -} - -// GetPaymentMethodsByCustomerID gets payment methods by customer ID -func GetPaymentMethodsByCustomerID(data *GetPaymentMethodsByCustomerIDParams) ([]xendit.PaymentMethod, *xendit.Error) { - return GetPaymentMethodsByCustomerIDWithContext(context.Background(), data) -} - -// GetPaymentMethodsByCustomerIDWithContext gets payment methods by customer ID -func GetPaymentMethodsByCustomerIDWithContext(ctx context.Context, data *GetPaymentMethodsByCustomerIDParams) ([]xendit.PaymentMethod, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetPaymentMethodsByCustomerIDWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/directdebit/paymentmethod/paymentmethod_test.go b/directdebit/paymentmethod/paymentmethod_test.go deleted file mode 100644 index 670f600a..00000000 --- a/directdebit/paymentmethod/paymentmethod_test.go +++ /dev/null @@ -1,230 +0,0 @@ -package paymentmethod - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.PaymentMethod).ID = "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef" - result.(*xendit.PaymentMethod).CustomerID = "4b7b6050-0830-440a-903b-37d527dbbaa9" - result.(*xendit.PaymentMethod).Type = xendit.DEBIT_CARD - result.(*xendit.PaymentMethod).Status = "ACTIVE" - result.(*xendit.PaymentMethod).Created = "2021-07-15T03:17:53.989Z" - result.(*xendit.PaymentMethod).Updated = "2021-07-15T03:17:53.989Z" - result.(*xendit.PaymentMethod).Properties = map[string]interface{}{ - "id": "la-55048b41-a7ab-4799-9f33-6ec5cc078db0", - "currency": "IDR", - "card_expiry": "11/23", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888", - } - result.(*xendit.PaymentMethod).Metadata = map[string]interface{}{ - "meta": "data", - } - - return nil -} - -func TestCreatePaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - requestProperties := map[string]interface{}{ - "id": "la-55048b41-a7ab-4799-9f33-6ec5cc078db0", - } - - responseProperties := map[string]interface{}{ - "id": "la-55048b41-a7ab-4799-9f33-6ec5cc078db0", - "currency": "IDR", - "card_expiry": "11/23", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - testCases := []struct { - desc string - data *CreatePaymentMethodParams - expectedRes *xendit.PaymentMethod - expectedErr *xendit.Error - }{ - { - desc: "should create a payment method", - data: &CreatePaymentMethodParams{ - CustomerID: "4b7b6050-0830-440a-903b-37d527dbbaa9", - Type: xendit.DEBIT_CARD, - Properties: requestProperties, - Metadata: metadata, - }, - expectedRes: &xendit.PaymentMethod{ - ID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - CustomerID: "4b7b6050-0830-440a-903b-37d527dbbaa9", - Type: xendit.DEBIT_CARD, - Status: "ACTIVE", - Created: "2021-07-15T03:17:53.989Z", - Updated: "2021-07-15T03:17:53.989Z", - Properties: responseProperties, - Metadata: metadata, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &CreatePaymentMethodParams{ - Type: xendit.DEBIT_CARD, - Properties: requestProperties, - Metadata: metadata, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'CustomerID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/payment_methods", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.PaymentMethod{}, - ).Return(nil) - - resp, err := CreatePaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGet struct { - mock.Mock -} - -func (m *apiRequesterMockGet) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "id": "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - "customer_id": "4b7b6050-0830-440a-903b-37d527dbbaa9", - "type": "DEBIT_CARD", - "status": "ACTIVE", - "properties": { - "id": "la-55048b41-a7ab-4799-9f33-6ec5cc078db0", - "currency": "IDR", - "card_expiry": "11/23", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888" - }, - "metadata": { - "meta": "data" - }, - "created": "2021-07-15T03:17:53.989Z", - "updated": "2021-07-15T03:17:53.989Z" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetPaymentMethodsByCustomerID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGet) - initTesting(apiRequesterMockObj) - - properties := map[string]interface{}{ - "id": "la-55048b41-a7ab-4799-9f33-6ec5cc078db0", - "currency": "IDR", - "card_expiry": "11/23", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - testCases := []struct { - desc string - data *GetPaymentMethodsByCustomerIDParams - expectedRes []xendit.PaymentMethod - expectedErr *xendit.Error - }{ - { - desc: "should get payment methods by customer ID", - data: &GetPaymentMethodsByCustomerIDParams{ - CustomerID: "4b7b6050-0830-440a-903b-37d527dbbaa9", - }, - expectedRes: []xendit.PaymentMethod{ - { - ID: "pm-ebb1c863-c7b5-4f20-b116-b3071b1d3aef", - CustomerID: "4b7b6050-0830-440a-903b-37d527dbbaa9", - Type: xendit.DEBIT_CARD, - Status: "ACTIVE", - Created: "2021-07-15T03:17:53.989Z", - Updated: "2021-07-15T03:17:53.989Z", - Properties: properties, - Metadata: metadata, - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetPaymentMethodsByCustomerIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'CustomerID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/payment_methods?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.PaymentMethod{}, - ).Return(nil) - - resp, err := GetPaymentMethodsByCustomerID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/disbursement.go b/disbursement.go deleted file mode 100644 index a6b18ad7..00000000 --- a/disbursement.go +++ /dev/null @@ -1,101 +0,0 @@ -package xendit - -import "time" - -// Disbursement contains data from Xendit's API response of disbursement related requests. -// For more details see https://xendit.github.io/apireference/?bash#disbursement. -// For documentation of subpackage disbursement, checkout https://pkg.go.dev/github.com/xendit/xendit-go/disbursement -type Disbursement struct { - ID string `json:"id"` - UserID string `json:"user_id"` - ExternalID string `json:"external_id"` - Amount float64 `json:"amount"` - BankCode string `json:"bank_code"` - AccountHolderName string `json:"account_holder_name"` - DisbursementDescription string `json:"disbursement_description"` - Status string `json:"status"` - EmailTo []string `json:"email_to,omitempty"` - EmailCC []string `json:"email_cc,omitempty"` - EmailBCC []string `json:"email_bcc,omitempty"` - IsInstant bool `json:"is_instant,omitempty"` - FailureCode string `json:"failure_code,omitempty"` -} - -// DisbursementBank contains data from Xendit's API response of Get Disbursement Banks. -type DisbursementBank struct { - Name string `json:"name"` - Code string `json:"code"` - CanDisburse bool `json:"can_disburse"` - CanNameValidate bool `json:"can_name_validate"` -} - -// BatchDisbursement contains data from Xendit's API response of batch disbursement. -// For more details see https://xendit.github.io/apireference/?bash#batch-disbursement. -type BatchDisbursement struct { - Created *time.Time `json:"created"` - Reference string `json:"reference"` - TotalUploadedAmount float64 `json:"total_uploaded_amount"` - TotalUploadedCount int `json:"total_uploaded_count"` - Status string `json:"status"` - ID string `json:"id"` -} - -// Disbursement contains data from Xendit's API response of disbursement related requests. -// For more details see https://docs.google.com/document/d/1eK7rt6AwMZHcAN1wxgqhsesQ_im35t2Q9iuM7bOXI04/edit#. -// For documentation of subpackage disbursement, checkout https://pkg.go.dev/github.com/xendit/xendit-go/disbursement -type DisbursementPh struct { - ID string `json:"id"` - ReferenceID string `json:"reference_id"` - Currency string `json:"currency"` - Amount float64 `json:"amount"` - ChannelCode string `json:"channel_code"` - Description string `json:"description"` - Status string `json:"status"` - Created *time.Time `json:"created,omitempty"` - Updated *time.Time `json:"updated,omitempty"` - ReceiptNotification ReceiptNotification `json:"receipt_notification,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - FailureCode string `json:"failure_code,omitempty"` -} - -// Beneficiary is data that contained in Create at Beneficiary -type Beneficiary struct { - Type string `json:"type"` - GivenNames string `json:"given_names"` - MiddleName string `json:"middle_name"` - Surname string `json:"surname"` - BusinessName string `json:"business_name"` - StreetLine1 string `json:"street_line1"` - StreetLine2 string `json:"street_line2"` - City string `json:"city"` - Province string `json:"province"` - State string `json:"state"` - Country string `json:"country"` - ZipCode string `json:"zip_code"` - MobileNumber string `json:"mobile_number"` - PhoneNumber string `json:"phone_number"` - Email string `json:"email"` -} - -// ReceiptNotification is data that contained in Create at ReceiptNotification -type ReceiptNotification struct { - EmailTo []string `json:"email_to,omitempty"` - EmailCC []string `json:"email_cc,omitempty"` - EmailBCC []string `json:"email_bcc,omitempty"` -} - -// DisbursementChannel contains data from Xendit's API response of Get Disbursement Channels. -type DisbursementChannel struct { - ChannelCode string `json:"channel_code"` - Name string `json:"name"` - ChannelCategory string `json:"channel_category"` - AmountLimits AmountLimits `json:"amount_limits"` - Currency string `json:"currency"` -} - -// AmountLimits is data that contained in DisbursementChannel at Amount Limit. -type AmountLimits struct { - Minimum float64 `json:"minimum"` - Maximum float64 `json:"maximum"` - MinimumIncrement float64 `json:"minimum_increment"` -} diff --git a/disbursement/client.go b/disbursement/client.go deleted file mode 100644 index ae888f7f..00000000 --- a/disbursement/client.go +++ /dev/null @@ -1,181 +0,0 @@ -package disbursement - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new disbursement -func (c *Client) Create(data *CreateParams) (*xendit.Disbursement, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new disbursement with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Disbursement, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Disbursement{} - header := http.Header{} - - if data.IdempotencyKey != "" { - header.Add("X-IDEMPOTENCY-KEY", data.IdempotencyKey) - } - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/disbursements", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetByID gets a disbursement by id -func (c *Client) GetByID(data *GetByIDParams) (*xendit.Disbursement, *xendit.Error) { - return c.GetByIDWithContext(context.Background(), data) -} - -// GetByIDWithContext gets a disbursement by id with context -func (c *Client) GetByIDWithContext(ctx context.Context, data *GetByIDParams) (*xendit.Disbursement, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Disbursement{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursements/%s", c.Opt.XenditURL, data.DisbursementID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetByExternalID gets a disbursement by id -func (c *Client) GetByExternalID(data *GetByExternalIDParams) ([]xendit.Disbursement, *xendit.Error) { - return c.GetByExternalIDWithContext(context.Background(), data) -} - -// GetByExternalIDWithContext gets a disbursement by id with context -func (c *Client) GetByExternalIDWithContext(ctx context.Context, data *GetByExternalIDParams) ([]xendit.Disbursement, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.Disbursement{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursements?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - header, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetAvailableBanks gets available disbursement banks -func (c *Client) GetAvailableBanks() ([]xendit.DisbursementBank, *xendit.Error) { - return c.GetAvailableBanksWithContext(context.Background()) -} - -// GetAvailableBanksWithContext gets available disbursement banks with context -func (c *Client) GetAvailableBanksWithContext(ctx context.Context) ([]xendit.DisbursementBank, *xendit.Error) { - response := []xendit.DisbursementBank{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/available_disbursements_banks", c.Opt.XenditURL), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// CreateBatch creates new batch disbursement -func (c *Client) CreateBatch(data *CreateBatchParams) (*xendit.BatchDisbursement, *xendit.Error) { - return c.CreateBatchWithContext(context.Background(), data) -} - -// CreateBatchWithContext creates new batch disbursement with context -func (c *Client) CreateBatchWithContext(ctx context.Context, data *CreateBatchParams) (*xendit.BatchDisbursement, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.BatchDisbursement{} - header := http.Header{} - - if data.IdempotencyKey != "" { - header.Add("X-IDEMPOTENCY-KEY", data.IdempotencyKey) - } - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/batch_disbursements", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/disbursement/disbursement.go b/disbursement/disbursement.go deleted file mode 100644 index 1d48b4b7..00000000 --- a/disbursement/disbursement.go +++ /dev/null @@ -1,89 +0,0 @@ -package disbursement - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new disbursement -func Create(data *CreateParams) (*xendit.Disbursement, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new disbursement with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Disbursement, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// GetByID gets a disbursement -func GetByID(data *GetByIDParams) (*xendit.Disbursement, *xendit.Error) { - return GetByIDWithContext(context.Background(), data) -} - -// GetByIDWithContext gets a disbursement with context -func GetByIDWithContext(ctx context.Context, data *GetByIDParams) (*xendit.Disbursement, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetByIDWithContext(ctx, data) -} - -// GetByExternalID gets a disbursement -func GetByExternalID(data *GetByExternalIDParams) ([]xendit.Disbursement, *xendit.Error) { - return GetByExternalIDWithContext(context.Background(), data) -} - -// GetByExternalIDWithContext gets a disbursement with context -func GetByExternalIDWithContext(ctx context.Context, data *GetByExternalIDParams) ([]xendit.Disbursement, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetByExternalIDWithContext(ctx, data) -} - -// GetAvailableBanks gets available disbursement banks -func GetAvailableBanks() ([]xendit.DisbursementBank, *xendit.Error) { - return GetAvailableBanksWithContext(context.Background()) -} - -// GetAvailableBanksWithContext gets available disbursement banks with context -func GetAvailableBanksWithContext(ctx context.Context) ([]xendit.DisbursementBank, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetAvailableBanksWithContext(ctx) -} - -// CreateBatch creates new batch disbursement -func CreateBatch(data *CreateBatchParams) (*xendit.BatchDisbursement, *xendit.Error) { - return CreateBatchWithContext(context.Background(), data) -} - -// CreateBatchWithContext creates new batch disbursement with context -func CreateBatchWithContext(ctx context.Context, data *CreateBatchParams) (*xendit.BatchDisbursement, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateBatchWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/disbursement/disbursement_test.go b/disbursement/disbursement_test.go deleted file mode 100644 index 2ab66c0e..00000000 --- a/disbursement/disbursement_test.go +++ /dev/null @@ -1,434 +0,0 @@ -package disbursement_test - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/disbursement" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.Disbursement).ID = "123" - result.(*xendit.Disbursement).UserID = "user-123" - result.(*xendit.Disbursement).ExternalID = "disbursement-external-id" - result.(*xendit.Disbursement).Amount = 200000 - result.(*xendit.Disbursement).BankCode = "BRI" - result.(*xendit.Disbursement).AccountHolderName = "Michael Jackson" - result.(*xendit.Disbursement).DisbursementDescription = "test disbursement" - result.(*xendit.Disbursement).Status = "PENDING" - - return nil -} - -func TestCreate(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursement.CreateParams - expectedRes *xendit.Disbursement - expectedErr *xendit.Error - }{ - { - desc: "should create a disbursement", - data: &disbursement.CreateParams{ - ExternalID: "disbursement-external-id", - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "test disbursement", - Amount: 200000, - }, - expectedRes: &xendit.Disbursement{ - ID: "123", - UserID: "user-123", - ExternalID: "disbursement-external-id", - Amount: 200000, - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - DisbursementDescription: "test disbursement", - Status: "PENDING", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursement.CreateParams{ - ExternalID: "disbursement-external-id", - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "test disbursement", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Amount'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/disbursements", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.Disbursement{}, - ).Return(nil) - - resp, err := disbursement.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetByID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursement.GetByIDParams - expectedRes *xendit.Disbursement - expectedErr *xendit.Error - }{ - { - desc: "should get an disbursement", - data: &disbursement.GetByIDParams{ - DisbursementID: "123", - }, - expectedRes: &xendit.Disbursement{ - ID: "123", - UserID: "user-123", - ExternalID: "disbursement-external-id", - Amount: 200000, - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - DisbursementDescription: "test disbursement", - Status: "PENDING", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursement.GetByIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'DisbursementID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursements/"+tC.data.DisbursementID, - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - nil, - &xendit.Disbursement{}, - ).Return(nil) - - resp, err := disbursement.GetByID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetByExternalIDMock struct { - mock.Mock -} - -func (m *apiRequesterGetByExternalIDMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "status": "PENDING", - "user_id": "user-123", - "external_id": "disbursement-external-id", - "amount": 200000, - "bank_code": "BRI", - "account_holder_name": "Michael Jackson", - "disbursement_description": "test disbursement", - "id": "123" - }, - { - "status": "PENDING", - "user_id": "user-123", - "external_id": "disbursement-external-id", - "amount": 200000, - "bank_code": "BRI", - "account_holder_name": "Michael Jackson", - "disbursement_description": "test disbursement", - "id": "124" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetByExternalID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetByExternalIDMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursement.GetByExternalIDParams - expectedRes []xendit.Disbursement - expectedErr *xendit.Error - }{ - { - desc: "should get a list of disbursements", - data: &disbursement.GetByExternalIDParams{ - ExternalID: "disbursement-external-id", - }, - expectedRes: []xendit.Disbursement{ - { - ID: "123", - UserID: "user-123", - ExternalID: "disbursement-external-id", - Amount: 200000, - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - DisbursementDescription: "test disbursement", - Status: "PENDING", - }, - { - ID: "124", - UserID: "user-123", - ExternalID: "disbursement-external-id", - Amount: 200000, - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - DisbursementDescription: "test disbursement", - Status: "PENDING", - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursement.GetByExternalIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ExternalID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursements?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.Disbursement{}, - ).Return(nil) - - resp, err := disbursement.GetByExternalID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetAvailableBanksMock struct { - mock.Mock -} - -func (m *apiRequesterGetAvailableBanksMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "name": "Bank Mandiri", - "code": "MANDIRI", - "can_disburse": true, - "can_name_validate": true - }, - { - "name": "Bank Negara Indonesia", - "code": "BNI", - "can_disburse": true, - "can_name_validate": true - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetAvailableBanks(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetAvailableBanksMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - expectedRes []xendit.DisbursementBank - expectedErr *xendit.Error - }{ - { - desc: "should get available disbursement banks", - expectedRes: []xendit.DisbursementBank{ - { - Name: "Bank Mandiri", - Code: "MANDIRI", - CanDisburse: true, - CanNameValidate: true, - }, - { - Name: "Bank Negara Indonesia", - Code: "BNI", - CanDisburse: true, - CanNameValidate: true, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/available_disbursements_banks", - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DisbursementBank{}, - ).Return(nil) - - resp, err := disbursement.GetAvailableBanks() - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterBatchMock struct { - mock.Mock -} - -func (m *apiRequesterBatchMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - result.(*xendit.BatchDisbursement).Created = &date - result.(*xendit.BatchDisbursement).Reference = "reference_test" - result.(*xendit.BatchDisbursement).TotalUploadedAmount = 400000 - result.(*xendit.BatchDisbursement).TotalUploadedCount = 2 - result.(*xendit.BatchDisbursement).Status = "NEEDS_APPROVAL" - result.(*xendit.BatchDisbursement).ID = "123" - - return nil -} - -func TestCreateBatch(t *testing.T) { - apiRequesterMockObj := new(apiRequesterBatchMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *disbursement.CreateBatchParams - expectedRes *xendit.BatchDisbursement - expectedErr *xendit.Error - }{ - { - desc: "should create a batch disbursement", - data: &disbursement.CreateBatchParams{ - Reference: "reference_test", - Disbursements: []disbursement.DisbursementItem{ - { - Amount: 200000, - BankCode: "BRI", - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement test 1", - }, - { - Amount: 200000, - BankCode: "BNI", - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement test 2", - }, - }, - }, - expectedRes: &xendit.BatchDisbursement{ - Created: &date, - Reference: "reference_test", - TotalUploadedAmount: 400000, - TotalUploadedCount: 2, - Status: "NEEDS_APPROVAL", - ID: "123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursement.CreateBatchParams{ - Reference: "reference_test", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Disbursements'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/batch_disbursements", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.BatchDisbursement{}, - ).Return(nil) - - resp, err := disbursement.CreateBatch(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/disbursement/event.go b/disbursement/event.go deleted file mode 100644 index 08a33123..00000000 --- a/disbursement/event.go +++ /dev/null @@ -1,16 +0,0 @@ -package disbursement - -type DisbursementCallback struct { - ID string `json:"id"` - Created string `json:"created"` - Updated string `json:"updated"` - ExternalID string `json:"external_id"` - UserID string `json:"user_id"` - Amount float64 `json:"amount"` - BankCode string `json:"bank_code"` - AccountHolderName string `json:"account_holder_name"` - DisbursementDescription string `json:"disbursement_description"` - Status string `json:"status"` - FailureCode string `json:"failure_code,omitempty"` - IsInstant bool `json:"is_instant,omitempty"` -} diff --git a/disbursement/event_test.go b/disbursement/event_test.go deleted file mode 100644 index e9d5969f..00000000 --- a/disbursement/event_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package disbursement_test - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xendit/xendit-go/disbursement" -) - -func TestPayload_Completed(t *testing.T) { - payload := `{ - "id": "57e214ba82b034c325e84d6e", - "created": "2021-07-10T08:15:03.404Z", - "updated": "2021-07-10T08:15:03.404Z", - "external_id": "disbursement_123124123", - "user_id": "57c5aa7a36e3b6a709b6e148", - "amount": 150000, - "bank_code": "BCA", - "account_holder_name": "MICHAEL CHEN", - "disbursement_description": "Refund for shoes", - "status": "COMPLETED", - "is_instant": true - }` - - expectedPayload := disbursement.DisbursementCallback{ - ID: "57e214ba82b034c325e84d6e", - Created: "2021-07-10T08:15:03.404Z", - Updated: "2021-07-10T08:15:03.404Z", - ExternalID: "disbursement_123124123", - UserID: "57c5aa7a36e3b6a709b6e148", - Amount: 150000, - BankCode: "BCA", - AccountHolderName: "MICHAEL CHEN", - DisbursementDescription: "Refund for shoes", - Status: "COMPLETED", - IsInstant: true, - } - - var actualPayload disbursement.DisbursementCallback - err := json.Unmarshal([]byte(payload), &actualPayload) - assert.NoError(t, err) - - assert.Equal(t, expectedPayload, actualPayload) -} - -func TestPayload_Failed(t *testing.T) { - payload := `{ - "id": "57e214ba82b034c325e84d6e", - "created": "2021-07-10T08:15:03.404Z", - "updated": "2021-07-10T08:15:03.404Z", - "external_id": "disbursement_123124123", - "user_id": "57c5aa7a36e3b6a709b6e148", - "amount": 150000, - "bank_code": "BCA", - "account_holder_name": "MICHAEL CHEN", - "disbursement_description": "Refund for shoes", - "status": "FAILED", - "failure_code": "INVALID_DESTINATION", - "is_instant": true - }` - - expectedPayload := disbursement.DisbursementCallback{ - ID: "57e214ba82b034c325e84d6e", - Created: "2021-07-10T08:15:03.404Z", - Updated: "2021-07-10T08:15:03.404Z", - ExternalID: "disbursement_123124123", - UserID: "57c5aa7a36e3b6a709b6e148", - Amount: 150000, - BankCode: "BCA", - AccountHolderName: "MICHAEL CHEN", - DisbursementDescription: "Refund for shoes", - Status: "FAILED", - FailureCode: "INVALID_DESTINATION", - IsInstant: true, - } - - var actualPayload disbursement.DisbursementCallback - err := json.Unmarshal([]byte(payload), &actualPayload) - assert.NoError(t, err) - - assert.Equal(t, expectedPayload, actualPayload) -} diff --git a/disbursement/example_test.go b/disbursement/example_test.go deleted file mode 100644 index 2413d71b..00000000 --- a/disbursement/example_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package disbursement_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/disbursement" -) - -func ExampleCreate() { - xendit.Opt.SecretKey = "examplesecretkey" - - createData := disbursement.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ExternalID: "disbursement-external", - BankCode: "BRI", - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "Disbursement from Go", - Amount: 200000, - } - - resp, err := disbursement.Create(&createData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created disbursement: %+v\n", resp) -} - -func ExampleGetByID() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByIDData := disbursement.GetByIDParams{ - DisbursementID: "123", - } - - resp, err := disbursement.GetByID(&getByIDData) - if err != nil { - log.Fatal(err.ErrorCode, err.Message, err.GetStatus()) - } - - fmt.Printf("retrieved disbursement: %+v\n", resp) -} - -func ExampleGetByExternalID() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByExternalIDData := disbursement.GetByExternalIDParams{ - ExternalID: "disbursement-external-id", - } - - resps, err := disbursement.GetByExternalID(&getByExternalIDData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved disbursements: %+v\n", resps) -} - -func ExampleGetAvailableBanks() { - xendit.Opt.SecretKey = "examplesecretkey" - - availableBanks, err := disbursement.GetAvailableBanks() - if err != nil { - log.Fatal(err) - } - - fmt.Printf("available disbursement banks: %+v\n", availableBanks) -} - -func ExampleCreateBatch() { - xendit.Opt.SecretKey = "examplesecretkey" - - createBatchData := disbursement.CreateBatchParams{ - Reference: "batch_disbursement" + time.Now().String(), - Disbursements: []disbursement.DisbursementItem{ - { - Amount: 200000, - BankCode: "BNI", - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go", - }, - { - Amount: 100000, - BankCode: "BRI", - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go 2", - }, - }, - } - - batchDisbursementResp, err := disbursement.CreateBatch(&createBatchData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created batch disbursement: %+v\n", batchDisbursementResp) -} diff --git a/disbursement/params.go b/disbursement/params.go deleted file mode 100644 index c9b37b1c..00000000 --- a/disbursement/params.go +++ /dev/null @@ -1,62 +0,0 @@ -package disbursement - -import ( - "net/url" -) - -// CreateParams contains parameters for Create -type CreateParams struct { - IdempotencyKey string `json:"-"` - ForUserID string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` - BankCode string `json:"bank_code" validate:"required"` - AccountHolderName string `json:"account_holder_name" validate:"required"` - AccountNumber string `json:"account_number" validate:"required"` - Description string `json:"description" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - EmailTo []string `json:"email_to,omitempty"` - EmailCC []string `json:"email_cc,omitempty"` - EmailBCC []string `json:"email_bcc,omitempty"` -} - -// GetByIDParams contains parameters for GetByID -type GetByIDParams struct { - DisbursementID string `json:"disbursement_id" validate:"required"` - ForUserID string `json:"-"` -} - -// GetByExternalIDParams contains parameters for GetByExternalID -type GetByExternalIDParams struct { - ExternalID string `json:"external_id" validate:"required"` - ForUserID string `json:"-"` -} - -// QueryString creates query string from GetByExternalIDParams, ignores nil values -func (p *GetByExternalIDParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("external_id", p.ExternalID) - - return urlValues.Encode() -} - -// CreateBatchParams contains parameters for CreateBatch -type CreateBatchParams struct { - IdempotencyKey string `json:"-"` - ForUserID string `json:"-"` - Reference string `json:"reference" validate:"required"` - Disbursements []DisbursementItem `json:"disbursements" validate:"required"` -} - -// DisbursementItem is data that contained in CreateBatch at Disbursements -type DisbursementItem struct { - Amount float64 `json:"amount" validate:"required"` - BankCode string `json:"bank_code" validate:"required"` - BankAccountName string `json:"bank_account_name" validate:"required"` - BankAccountNumber string `json:"bank_account_number" validate:"required"` - Description string `json:"description" validate:"required"` - ExternalID string `json:"external_id,omitempty"` - EmailTo []string `json:"email_to,omitempty"` - EmailCC []string `json:"email_cc,omitempty"` - EmailBCC []string `json:"email_bcc,omitempty"` -} diff --git a/disbursementph/client.go b/disbursementph/client.go deleted file mode 100644 index 9a53038c..00000000 --- a/disbursementph/client.go +++ /dev/null @@ -1,185 +0,0 @@ -package disbursementph - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new PHP disbursement -func (c *Client) Create(data *CreateParams) (*xendit.DisbursementPh, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new disbursement with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.DisbursementPh, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.DisbursementPh{} - header := http.Header{} - - if data.IdempotencyKey != "" { - header.Add("XENDIT-IDEMPOTENCY-KEY", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/disbursements", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetByID gets a disbursement by id -func (c *Client) GetByID(data *GetByIDParams) (*xendit.DisbursementPh, *xendit.Error) { - return c.GetByIDWithContext(context.Background(), data) -} - -// GetByIDWithContext gets a disbursement by id with context -func (c *Client) GetByIDWithContext(ctx context.Context, data *GetByIDParams) (*xendit.DisbursementPh, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.DisbursementPh{} - header := http.Header{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursements/%s", c.Opt.XenditURL, data.DisbursementID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetByReferenceID gets a disbursement by id -func (c *Client) GetByReferenceID(data *GetByReferenceIDParams) ([]xendit.DisbursementPh, *xendit.Error) { - return c.GetByReferenceIDWithContext(context.Background(), data) -} - -// GetByReferenceIDWithContext gets a disbursement by id with context -func (c *Client) GetByReferenceIDWithContext(ctx context.Context, data *GetByReferenceIDParams) ([]xendit.DisbursementPh, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.DisbursementPh{} - header := http.Header{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursements?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - header, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetDisbursementChannels gets available disbursement channels -func (c *Client) GetDisbursementChannels() ([]xendit.DisbursementChannel, *xendit.Error) { - return c.GetDisbursementChannelsWithContext(context.Background()) -} - -// GetDisbursementChannelsWithContext gets available disbursement channels with context -func (c *Client) GetDisbursementChannelsWithContext(ctx context.Context) ([]xendit.DisbursementChannel, *xendit.Error) { - response := []xendit.DisbursementChannel{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursement-channels", c.Opt.XenditURL), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetDisbursementChannelsByChannelCategory gets available disbursement channels by ChannelCategory -func (c *Client) GetDisbursementChannelsByChannelCategory(data *GetByChannelCategoryParams) ([]xendit.DisbursementChannel, *xendit.Error) { - return c.GetDisbursementChannelsByChannelCategoryWithContext(context.Background(), data) -} - -// GetDisbursementChannelsByChannelCategoryWithContext gets available disbursement channels by ChannelCategory with context -func (c *Client) GetDisbursementChannelsByChannelCategoryWithContext(ctx context.Context, data *GetByChannelCategoryParams) ([]xendit.DisbursementChannel, *xendit.Error) { - response := []xendit.DisbursementChannel{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursement-channels?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetDisbursementChannelsByChannelCode gets available disbursement channels by ChannelCode -func (c *Client) GetDisbursementChannelsByChannelCode(data *GetByChannelCodeParams) ([]xendit.DisbursementChannel, *xendit.Error) { - return c.GetDisbursementChannelsByChannelCodeWithContext(context.Background(), data) -} - -// GetDisbursementChannelsByChannelCodeWithContext gets available disbursement channels by ChannelCode with context -func (c *Client) GetDisbursementChannelsByChannelCodeWithContext(ctx context.Context, data *GetByChannelCodeParams) ([]xendit.DisbursementChannel, *xendit.Error) { - response := []xendit.DisbursementChannel{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/disbursement-channels?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/disbursementph/disbursement.go b/disbursementph/disbursement.go deleted file mode 100644 index 5cfdaee4..00000000 --- a/disbursementph/disbursement.go +++ /dev/null @@ -1,104 +0,0 @@ -package disbursementph - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new disbursement -func Create(data *CreateParams) (*xendit.DisbursementPh, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new disbursement with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.DisbursementPh, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// GetByID gets a disbursement -func GetByID(data *GetByIDParams) (*xendit.DisbursementPh, *xendit.Error) { - return GetByIDWithContext(context.Background(), data) -} - -// GetByIDWithContext gets a disbursement with context -func GetByIDWithContext(ctx context.Context, data *GetByIDParams) (*xendit.DisbursementPh, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetByIDWithContext(ctx, data) -} - -// GetByReferenceID gets a disbursement -func GetByReferenceID(data *GetByReferenceIDParams) ([]xendit.DisbursementPh, *xendit.Error) { - return GetByReferenceIDWithContext(context.Background(), data) -} - -// GetByExternalIDWithContext gets a disbursement with context -func GetByReferenceIDWithContext(ctx context.Context, data *GetByReferenceIDParams) ([]xendit.DisbursementPh, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetByReferenceIDWithContext(ctx, data) -} - -// GetDisbursementChannels gets available disbursement banks -func GetDisbursementChannels() ([]xendit.DisbursementChannel, *xendit.Error) { - return GetDisbursementChannelsWithContext(context.Background()) -} - -// GetDisbursementChannelsWithContext gets available disbursement banks with context -func GetDisbursementChannelsWithContext(ctx context.Context) ([]xendit.DisbursementChannel, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetDisbursementChannelsWithContext(ctx) -} - -// GetDisbursementChannelsByChannelCategory gets available disbursement banks -func GetDisbursementChannelsByChannelCategory(data *GetByChannelCategoryParams) ([]xendit.DisbursementChannel, *xendit.Error) { - return GetDisbursementChannelsByChannelCategoryWithContext(context.Background(), data) -} - -// GetDisbursementChannelsByChannelCategoryWithContext gets available disbursement banks with context -func GetDisbursementChannelsByChannelCategoryWithContext(ctx context.Context, data *GetByChannelCategoryParams) ([]xendit.DisbursementChannel, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetDisbursementChannelsByChannelCategoryWithContext(ctx, data) -} - -// GetDisbursementChannelsByChannelCode gets available disbursement banks -func GetDisbursementChannelsByChannelCode(data *GetByChannelCodeParams) ([]xendit.DisbursementChannel, *xendit.Error) { - return GetDisbursementChannelsByChannelCodeWithContext(context.Background(), data) -} - -// GetDisbursementChannelsByChannelCodeWithContext gets available disbursement banks with context -func GetDisbursementChannelsByChannelCodeWithContext(ctx context.Context, data *GetByChannelCodeParams) ([]xendit.DisbursementChannel, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetDisbursementChannelsByChannelCodeWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/disbursementph/disbursement_test.go b/disbursementph/disbursement_test.go deleted file mode 100644 index ea65f049..00000000 --- a/disbursementph/disbursement_test.go +++ /dev/null @@ -1,561 +0,0 @@ -package disbursementph_test - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/disbursementph" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.DisbursementPh).ID = "123" - result.(*xendit.DisbursementPh).ReferenceID = "disbursement-reference-id" - result.(*xendit.DisbursementPh).Currency = "currency" - result.(*xendit.DisbursementPh).Amount = 200000 - result.(*xendit.DisbursementPh).ChannelCode = "PH_BDO" - result.(*xendit.DisbursementPh).Description = "test disbursement" - result.(*xendit.DisbursementPh).Status = "PENDING" - result.(*xendit.DisbursementPh).Currency = "PHP" - - return nil -} - -func TestCreate(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursementph.CreateParams - expectedRes *xendit.DisbursementPh - expectedErr *xendit.Error - }{ - { - desc: "should create a disbursement", - data: &disbursementph.CreateParams{ - IdempotencyKey: "test", - ReferenceID: "disbursement-reference-id", - ChannelCode: "PH_BDO", - AccountName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "test disbursement", - Amount: 200000, - Currency: "PHP", - }, - expectedRes: &xendit.DisbursementPh{ - ID: "123", - ReferenceID: "disbursement-reference-id", - Amount: 200000, - ChannelCode: "PH_BDO", - Description: "test disbursement", - Status: "PENDING", - Currency: "PHP", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursementph.CreateParams{ - IdempotencyKey: "test", - ReferenceID: "disbursement-reference-id", - ChannelCode: "PH_BDO", - AccountName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "test disbursement", - Currency: "PHP", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Amount'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/disbursements", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.DisbursementPh{}, - ).Return(nil) - - resp, err := disbursementph.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetByID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursementph.GetByIDParams - expectedRes *xendit.DisbursementPh - expectedErr *xendit.Error - }{ - { - desc: "should get an disbursement", - data: &disbursementph.GetByIDParams{ - DisbursementID: "123", - }, - expectedRes: &xendit.DisbursementPh{ - ID: "123", - ReferenceID: "disbursement-reference-id", - Currency: "PHP", - Amount: 200000, - ChannelCode: "PH_BDO", - Description: "test disbursement", - Status: "PENDING", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursementph.GetByIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'DisbursementID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursements/"+tC.data.DisbursementID, - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - nil, - &xendit.DisbursementPh{}, - ).Return(nil) - - resp, err := disbursementph.GetByID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetByRefernceIDMock struct { - mock.Mock -} - -func (m *apiRequesterGetByRefernceIDMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "status": "PENDING", - "reference_id": "disbursement-reference-id", - "amount": 200000, - "channel_code": "PH_BDO", - "description": "test disbursement", - "id": "123", - "currency":"PHP" - }, - { - "status": "PENDING", - "user_id": "user-123", - "reference_id": "disbursement-reference-id", - "amount": 200000, - "channel_code": "PH_BDO", - "description": "test disbursement", - "id": "124", - "currency":"PHP" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetByExternalID(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetByRefernceIDMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *disbursementph.GetByReferenceIDParams - expectedRes []xendit.DisbursementPh - expectedErr *xendit.Error - }{ - { - desc: "should get a list of disbursements", - data: &disbursementph.GetByReferenceIDParams{ - ReferenceID: "disbursement-reference-id", - }, - expectedRes: []xendit.DisbursementPh{ - { - ID: "123", - ReferenceID: "disbursement-reference-id", - Amount: 200000, - ChannelCode: "PH_BDO", - Description: "test disbursement", - Status: "PENDING", - Currency: "PHP", - }, - { - ID: "124", - ReferenceID: "disbursement-reference-id", - Amount: 200000, - ChannelCode: "PH_BDO", - Description: "test disbursement", - Status: "PENDING", - Currency: "PHP", - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &disbursementph.GetByReferenceIDParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursements?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DisbursementPh{}, - ).Return(nil) - - resp, err := disbursementph.GetByReferenceID(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetDisbursementChannelssMock struct { - mock.Mock -} - -func (m *apiRequesterGetDisbursementChannelssMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "channel_code": "PH_ONB", - "channel_category": "BANK", - "currency": "PHP", - "name": "BDO Network Bank", - "amount_limits": { - "minimum": 1, - "maximum": 50000, - "minimum_increment": 0.01 - } - }, - { - "channel_code": "PH_PAR", - "channel_category": "BANK", - "currency": "PHP", - "name": "Partner Rural Bank (Cotabato), Inc.", - "amount_limits": { - "minimum": 50, - "maximum": 50000, - "minimum_increment": 0.01 - } - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetDisbursementChannels(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetDisbursementChannelssMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - expectedRes []xendit.DisbursementChannel - expectedErr *xendit.Error - }{ - { - desc: "should get available disbursement channels", - expectedRes: []xendit.DisbursementChannel{ - { - ChannelCode: "PH_ONB", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "BDO Network Bank", - AmountLimits: xendit.AmountLimits{ - Minimum: 1, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - { - ChannelCode: "PH_PAR", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "Partner Rural Bank (Cotabato), Inc.", - AmountLimits: xendit.AmountLimits{ - Minimum: 50, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursement-channels", - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DisbursementChannel{}, - ).Return(nil) - - resp, err := disbursementph.GetDisbursementChannels() - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetBankChannelsByChannelCategorysMock struct { - mock.Mock -} - -func (m *apiRequesterGetBankChannelsByChannelCategorysMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "channel_code": "PH_ONB", - "channel_category": "BANK", - "currency": "PHP", - "name": "BDO Network Bank", - "amount_limits": { - "minimum": 1, - "maximum": 50000, - "minimum_increment": 0.01 - } - }, - { - "channel_code": "PH_PAR", - "channel_category": "BANK", - "currency": "PHP", - "name": "Partner Rural Bank (Cotabato), Inc.", - "amount_limits": { - "minimum": 50, - "maximum": 50000, - "minimum_increment": 0.01 - } - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetDisbursementChannelsByChannelCategory(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetBankChannelsByChannelCategorysMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data disbursementph.GetByChannelCategoryParams - expectedRes []xendit.DisbursementChannel - expectedErr *xendit.Error - }{ - { - desc: "should get available disbursement channels by Channel Category", - data: disbursementph.GetByChannelCategoryParams{ - ChannelCategory: "BANK", - }, - expectedRes: []xendit.DisbursementChannel{ - { - ChannelCode: "PH_ONB", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "BDO Network Bank", - AmountLimits: xendit.AmountLimits{ - Minimum: 1, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - { - ChannelCode: "PH_PAR", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "Partner Rural Bank (Cotabato), Inc.", - AmountLimits: xendit.AmountLimits{ - Minimum: 50, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursement-channels?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DisbursementChannel{}, - ).Return(nil) - - resp, err := disbursementph.GetDisbursementChannelsByChannelCategory(&tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetBankChannelsByChannelCodeMock struct { - mock.Mock -} - -func (m *apiRequesterGetBankChannelsByChannelCodeMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "channel_code": "PH_ONB", - "channel_category": "BANK", - "currency": "PHP", - "name": "BDO Network Bank", - "amount_limits": { - "minimum": 1, - "maximum": 50000, - "minimum_increment": 0.01 - } - }, - { - "channel_code": "PH_PAR", - "channel_category": "BANK", - "currency": "PHP", - "name": "Partner Rural Bank (Cotabato), Inc.", - "amount_limits": { - "minimum": 50, - "maximum": 50000, - "minimum_increment": 0.01 - } - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetDisbursementChannelsByChannelCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetBankChannelsByChannelCodeMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data disbursementph.GetByChannelCodeParams - expectedRes []xendit.DisbursementChannel - expectedErr *xendit.Error - }{ - { - desc: "should get available disbursement channels by Channel Code", - data: disbursementph.GetByChannelCodeParams{ - ChannelCode: "PH_BDP", - }, - expectedRes: []xendit.DisbursementChannel{ - { - ChannelCode: "PH_ONB", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "BDO Network Bank", - AmountLimits: xendit.AmountLimits{ - Minimum: 1, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - { - ChannelCode: "PH_PAR", - ChannelCategory: "BANK", - Currency: "PHP", - Name: "Partner Rural Bank (Cotabato), Inc.", - AmountLimits: xendit.AmountLimits{ - Minimum: 50, - Maximum: 50000, - MinimumIncrement: 0.01, - }, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/disbursement-channels?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.DisbursementChannel{}, - ).Return(nil) - - resp, err := disbursementph.GetDisbursementChannelsByChannelCode(&tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/disbursementph/example_test.go b/disbursementph/example_test.go deleted file mode 100644 index 41c05352..00000000 --- a/disbursementph/example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package disbursementph_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/disbursementph" -) - -func ExampleCreate() { - xendit.Opt.SecretKey = "examplesecretkey" - - createData := disbursementph.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ReferenceID: "disbursement-reference", - ChannelCode: "PH_BDO", - AccountName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "Disbursement from Go", - Amount: 200000, - Beneficiary: xendit.Beneficiary{ - Type: "INDIVIDUAL", - GivenNames: "John", - MiddleName: "Michel", - Surname: "Doe", - BusinessName: "Example Business", - StreetLine1: "Sultan Street", - StreetLine2: "BCG", - City: "Manila", - Province: "Manila", - State: "Manila", - Country: "Philippines", - ZipCode: "12345", - MobileNumber: "9876543210", - PhoneNumber: "987654321", - Email: "example@test.com", - }, - ReceiptNotification: xendit.ReceiptNotification{ - EmailTo: []string{"example@test.com"}, - EmailCC: []string{"example@test.com"}, - EmailBCC: []string{"example@test.com"}, - }, - Metadata: map[string]interface{}{ - "meta": "data", - }, - } - - resp, err := disbursementph.Create(&createData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created disbursement: %+v\n", resp) -} - -func ExampleGetByID() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByIDData := disbursementph.GetByIDParams{ - DisbursementID: "123", - } - - resp, err := disbursementph.GetByID(&getByIDData) - if err != nil { - log.Fatal(err.ErrorCode, err.Message, err.GetStatus()) - } - - fmt.Printf("retrieved disbursement: %+v\n", resp) -} - -func ExampleGetByReferenceID() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByReferenceIDData := disbursementph.GetByReferenceIDParams{ - ReferenceID: "disbursement-reference-id", - } - - resps, err := disbursementph.GetByReferenceID(&getByReferenceIDData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved disbursements: %+v\n", resps) -} - -func ExampleGetDisbursementChannels() { - xendit.Opt.SecretKey = "examplesecretkey" - - disbursementChannels, err := disbursementph.GetDisbursementChannels() - if err != nil { - log.Fatal(err) - } - - fmt.Printf("disbursement channels: %+v\n", disbursementChannels) -} - -func ExampleGetDisbursementChannelsByChannelCategory() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByChannelCategoryData := disbursementph.GetByChannelCategoryParams{ - ChannelCategory: "BANK", - } - - disbursementChannels, err := disbursementph.GetDisbursementChannelsByChannelCategory(&getByChannelCategoryData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("disbursement channels: %+v\n", disbursementChannels) -} - -func ExampleGetDisbursementChannelsByChannelCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - getByChannelCodeData := disbursementph.GetByChannelCodeParams{ - ChannelCode: "BANK", - } - - disbursementChannels, err := disbursementph.GetDisbursementChannelsByChannelCode(&getByChannelCodeData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("disbursement channels: %+v\n", disbursementChannels) -} diff --git a/disbursementph/params.go b/disbursementph/params.go deleted file mode 100644 index 3846451c..00000000 --- a/disbursementph/params.go +++ /dev/null @@ -1,69 +0,0 @@ -package disbursementph - -import ( - "net/url" - - "github.com/xendit/xendit-go" -) - -// CreateParams contains parameters for Create -type CreateParams struct { - IdempotencyKey string `json:"xendit_idempotency_key" validate:"required"` - ReferenceID string `json:"reference_id" validate:"required"` - Currency string `json:"currency" validate:"required"` - ChannelCode string `json:"channel_code" validate:"required"` - AccountName string `json:"account_name" validate:"required"` - AccountNumber string `json:"account_number" validate:"required"` - Description string `json:"description" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - Beneficiary xendit.Beneficiary `json:"beneficiary,omitempty"` - ReceiptNotification xendit.ReceiptNotification `json:"receipt_notification,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// GetByIDParams contains parameters for GetByID -type GetByIDParams struct { - DisbursementID string `json:"disbursement_id" validate:"required"` -} - -// GetByReferenceIDParams contains parameters for GetByReferenceID -type GetByReferenceIDParams struct { - ReferenceID string `json:"reference_id" validate:"required"` -} - -// QueryString creates query string from GetByReferenceIDParams, ignores nil values -func (p *GetByReferenceIDParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("reference_id", p.ReferenceID) - - return urlValues.Encode() -} - -// GetByChannelCategoryParams contains parameters for GetDisbursementChannelByChannelCategory -type GetByChannelCategoryParams struct { - ChannelCategory string `json:"channel_category" validate:"required"` -} - -// QueryString creates query string from GetByChannelCategoryParams, ignores nil values -func (p *GetByChannelCategoryParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("channel_category", p.ChannelCategory) - - return urlValues.Encode() -} - -// GetByChannelCodeParams contains parameters for GetDisbursementChannelByChannelCode -type GetByChannelCodeParams struct { - ChannelCode string `json:"channel_code" validate:"required"` -} - -// QueryString creates query string from GetByChannelCodeParams, ignores nil values -func (p *GetByChannelCodeParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("channel_code", p.ChannelCode) - - return urlValues.Encode() -} diff --git a/docs/BalanceApi.md b/docs/BalanceApi.md new file mode 100644 index 00000000..942dfbfb --- /dev/null +++ b/docs/BalanceApi.md @@ -0,0 +1,91 @@ +# xendit\BalanceApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**GetBalance**](BalanceApi.md#GetBalance) | **Get** /balance | Retrieves balances for a business, default to CASH type | + + + +## GetBalance + +Retrieves balances for a business, default to CASH type + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + balance_and_transaction "github.com/xendit/xendit-go/v3/balance_and_transaction" +) + +func main() { + + // The selected balance type + // (default to "CASH") + accountType := "CASH" // [OPTIONAL] | string + + // Currency for filter for customers with multi currency accounts + currency := "IDR" // [OPTIONAL] | string + + // The sub-account user-id that you want to make this transaction for. This header + // is only used if you have access to xenPlatform. See xenPlatform for more + // information + forUserId := "5dbf20d7c8eb0c0896f811b6" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.BalanceApi.GetBalance(context.Background()). + AccountType(accountType). + Currency(currency). + ForUserId(forUserId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BalanceApi.GetBalance``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBalance`: Balance + fmt.Fprintf(os.Stdout, "Response from `BalanceApi.GetBalance`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBalanceRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **accountType** |**string**| The selected balance type | [default to "CASH"] | +| **currency** |**string**| Currency for filter for customers with multi currency accounts | | +| **forUserId** |**string**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | | + +### Return type + +[**Balance**](balance_and_transaction/Balance.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/InvoiceApi.md b/docs/InvoiceApi.md new file mode 100644 index 00000000..1f42f308 --- /dev/null +++ b/docs/InvoiceApi.md @@ -0,0 +1,337 @@ +# xendit\InvoiceApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**CreateInvoice**](InvoiceApi.md#CreateInvoice) | **Post** /v2/invoices/ | Create an invoice | +| [**ExpireInvoice**](InvoiceApi.md#ExpireInvoice) | **Post** /invoices/{invoice_id}/expire! | Manually expire an invoice | +| [**GetInvoiceById**](InvoiceApi.md#GetInvoiceById) | **Get** /v2/invoices/{invoice_id} | Get invoice by invoice id | +| [**GetInvoices**](InvoiceApi.md#GetInvoices) | **Get** /v2/invoices | Get all Invoices | + + + +## CreateInvoice + +Create an invoice + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + invoice "github.com/xendit/xendit-go/v3/invoice" +) + +func main() { + + createInvoiceRequest := *invoice.NewCreateInvoiceRequest("ExternalId_example", float32(123)) // [REQUIRED] | CreateInvoiceRequest + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.InvoiceApi.CreateInvoice(context.Background()). + CreateInvoiceRequest(createInvoiceRequest). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceApi.CreateInvoice``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateInvoice`: Invoice + fmt.Fprintf(os.Stdout, "Response from `InvoiceApi.CreateInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateInvoiceRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **createInvoiceRequest** |[**CreateInvoiceRequest**](invoice/CreateInvoiceRequest.md)| | | + +### Return type + +[**Invoice**](invoice/Invoice.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## ExpireInvoice + +Manually expire an invoice + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + invoice "github.com/xendit/xendit-go/v3/invoice" +) + +func main() { + + // Invoice ID to be expired + invoiceId := "5f4708b7bd394b0400b96276" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.InvoiceApi.ExpireInvoice(context.Background(), invoiceId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceApi.ExpireInvoice``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ExpireInvoice`: Invoice + fmt.Fprintf(os.Stdout, "Response from `InvoiceApi.ExpireInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **invoiceId** | **string** | Invoice ID to be expired | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiExpireInvoiceRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**Invoice**](invoice/Invoice.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetInvoiceById + +Get invoice by invoice id + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + invoice "github.com/xendit/xendit-go/v3/invoice" +) + +func main() { + + // Invoice ID + invoiceId := "62efe4c33e45294d63f585f2" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.InvoiceApi.GetInvoiceById(context.Background(), invoiceId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceApi.GetInvoiceById``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvoiceById`: Invoice + fmt.Fprintf(os.Stdout, "Response from `InvoiceApi.GetInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **invoiceId** | **string** | Invoice ID | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoiceByIdRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**Invoice**](invoice/Invoice.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetInvoices + +Get all Invoices + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + xendit "github.com/xendit/xendit-go/v3" + invoice "github.com/xendit/xendit-go/v3/invoice" +) + +func main() { + + externalId := "test-external" // [OPTIONAL] | string + + statuses := []invoice.InvoiceStatus{invoice.InvoiceStatus("PENDING")} // [OPTIONAL] | []InvoiceStatus + + limit := float32(10) // [OPTIONAL] | float32 + + createdAfter := time.Now() // [OPTIONAL] | time.Time + + createdBefore := time.Now() // [OPTIONAL] | time.Time + + paidAfter := time.Now() // [OPTIONAL] | time.Time + + paidBefore := time.Now() // [OPTIONAL] | time.Time + + expiredAfter := time.Now() // [OPTIONAL] | time.Time + + expiredBefore := time.Now() // [OPTIONAL] | time.Time + + lastInvoice := "62efe4c33e45294d63f585f2" // [OPTIONAL] | string + + clientTypes := []invoice.InvoiceClientType{invoice.InvoiceClientType("DASHBOARD")} // [OPTIONAL] | []InvoiceClientType + + paymentChannels := []string{"Inner_example"} // [OPTIONAL] | []string + + onDemandLink := "test-link" // [OPTIONAL] | string + + recurringPaymentId := "62efe4c33e45294d63f585f2" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.InvoiceApi.GetInvoices(context.Background()). + ExternalId(externalId). + Statuses(statuses). + Limit(limit). + CreatedAfter(createdAfter). + CreatedBefore(createdBefore). + PaidAfter(paidAfter). + PaidBefore(paidBefore). + ExpiredAfter(expiredAfter). + ExpiredBefore(expiredBefore). + LastInvoice(lastInvoice). + ClientTypes(clientTypes). + PaymentChannels(paymentChannels). + OnDemandLink(onDemandLink). + RecurringPaymentId(recurringPaymentId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoiceApi.GetInvoices``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvoices`: []Invoice + fmt.Fprintf(os.Stdout, "Response from `InvoiceApi.GetInvoices`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoicesRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **externalId** |**string**| | | +| **statuses** |[**InvoiceStatus[]**](invoice/InvoiceStatus.md)| | | +| **limit** |**float32**| | | +| **createdAfter** |**time.Time**| | | +| **createdBefore** |**time.Time**| | | +| **paidAfter** |**time.Time**| | | +| **paidBefore** |**time.Time**| | | +| **expiredAfter** |**time.Time**| | | +| **expiredBefore** |**time.Time**| | | +| **lastInvoice** |**string**| | | +| **clientTypes** |[**InvoiceClientType[]**](invoice/InvoiceClientType.md)| | | +| **paymentChannels** |**string[]**| | | +| **onDemandLink** |**string**| | | +| **recurringPaymentId** |**string**| | | + +### Return type + +[**[]Invoice**](invoice/Invoice.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/PaymentMethodApi.md b/docs/PaymentMethodApi.md new file mode 100644 index 00000000..d5380abb --- /dev/null +++ b/docs/PaymentMethodApi.md @@ -0,0 +1,755 @@ +# xendit\PaymentMethodApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**AuthPaymentMethod**](PaymentMethodApi.md#AuthPaymentMethod) | **Post** /v2/payment_methods/{paymentMethodId}/auth | Validate a payment method's linking OTP | +| [**CreatePaymentMethod**](PaymentMethodApi.md#CreatePaymentMethod) | **Post** /v2/payment_methods | Creates payment method | +| [**ExpirePaymentMethod**](PaymentMethodApi.md#ExpirePaymentMethod) | **Post** /v2/payment_methods/{paymentMethodId}/expire | Expires a payment method | +| [**GetAllPaymentChannels**](PaymentMethodApi.md#GetAllPaymentChannels) | **Get** /v2/payment_methods/channels | Get all payment channels | +| [**GetAllPaymentMethods**](PaymentMethodApi.md#GetAllPaymentMethods) | **Get** /v2/payment_methods | Get all payment methods by filters | +| [**GetPaymentMethodByID**](PaymentMethodApi.md#GetPaymentMethodByID) | **Get** /v2/payment_methods/{paymentMethodId} | Get payment method by ID | +| [**GetPaymentsByPaymentMethodId**](PaymentMethodApi.md#GetPaymentsByPaymentMethodId) | **Get** /v2/payment_methods/{paymentMethodId}/payments | Returns payments with matching PaymentMethodID. | +| [**PatchPaymentMethod**](PaymentMethodApi.md#PatchPaymentMethod) | **Patch** /v2/payment_methods/{paymentMethodId} | Patch payment methods | +| [**SimulatePayment**](PaymentMethodApi.md#SimulatePayment) | **Post** /v2/payment_methods/{paymentMethodId}/payments/simulate | Makes payment with matching PaymentMethodID. | + + + +## AuthPaymentMethod + +Validate a payment method's linking OTP + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + paymentMethodAuthParameters := *payment_method.NewPaymentMethodAuthParameters("AuthCode_example") // [OPTIONAL] | PaymentMethodAuthParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.AuthPaymentMethod(context.Background(), paymentMethodId). + PaymentMethodAuthParameters(paymentMethodAuthParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.AuthPaymentMethod``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AuthPaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.AuthPaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAuthPaymentMethodRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **paymentMethodAuthParameters** |[**PaymentMethodAuthParameters**](payment_method/PaymentMethodAuthParameters.md)| | | + +### Return type + +[**PaymentMethod**](payment_method/PaymentMethod.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## CreatePaymentMethod + +Creates payment method + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodParameters := *payment_method.NewPaymentMethodParameters(payment_method.PaymentMethodType("CARD"), payment_method.PaymentMethodReusability("MULTIPLE_USE")) // [OPTIONAL] | PaymentMethodParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.CreatePaymentMethod(context.Background()). + PaymentMethodParameters(paymentMethodParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.CreatePaymentMethod``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreatePaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.CreatePaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePaymentMethodRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **paymentMethodParameters** |[**PaymentMethodParameters**](payment_method/PaymentMethodParameters.md)| | | + +### Return type + +[**PaymentMethod**](payment_method/PaymentMethod.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## ExpirePaymentMethod + +Expires a payment method + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + paymentMethodExpireParameters := *payment_method.NewPaymentMethodExpireParameters() // [OPTIONAL] | PaymentMethodExpireParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.ExpirePaymentMethod(context.Background(), paymentMethodId). + PaymentMethodExpireParameters(paymentMethodExpireParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.ExpirePaymentMethod``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ExpirePaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.ExpirePaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiExpirePaymentMethodRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **paymentMethodExpireParameters** |[**PaymentMethodExpireParameters**](payment_method/PaymentMethodExpireParameters.md)| | | + +### Return type + +[**PaymentMethod**](payment_method/PaymentMethod.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetAllPaymentChannels + +Get all payment channels + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + // (default to true) + isActivated := true // [OPTIONAL] | bool + + type_ := "DIRECT_DEBIT" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.GetAllPaymentChannels(context.Background()). + IsActivated(isActivated). + Type_(type_). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.GetAllPaymentChannels``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllPaymentChannels`: PaymentChannelList + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.GetAllPaymentChannels`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllPaymentChannelsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **isActivated** |**bool**| | [default to true] | +| **type_** |**string**| | | + +### Return type + +[**PaymentChannelList**](payment_method/PaymentChannelList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetAllPaymentMethods + +Get all payment methods by filters + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + id := []string{"Inner_example"} // [OPTIONAL] | []string + + type_ := []string{"Inner_example"} // [OPTIONAL] | []string + + status := []payment_method.PaymentMethodStatus{payment_method.PaymentMethodStatus("ACTIVE")} // [OPTIONAL] | []PaymentMethodStatus + + reusability := payment_method.PaymentMethodReusability("MULTIPLE_USE") // [OPTIONAL] | PaymentMethodReusability + + customerId := "customerId_example" // [OPTIONAL] | string + + referenceId := "referenceId_example" // [OPTIONAL] | string + + afterId := "afterId_example" // [OPTIONAL] | string + + beforeId := "beforeId_example" // [OPTIONAL] | string + + limit := int32(56) // [OPTIONAL] | int32 + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.GetAllPaymentMethods(context.Background()). + Id(id). + Type_(type_). + Status(status). + Reusability(reusability). + CustomerId(customerId). + ReferenceId(referenceId). + AfterId(afterId). + BeforeId(beforeId). + Limit(limit). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.GetAllPaymentMethods``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllPaymentMethods`: PaymentMethodList + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.GetAllPaymentMethods`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllPaymentMethodsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** |**string[]**| | | +| **type_** |**string[]**| | | +| **status** |[**PaymentMethodStatus[]**](payment_method/PaymentMethodStatus.md)| | | +| **reusability** |[**PaymentMethodReusability**](payment_method/PaymentMethodReusabilitypayment_method/.md)| | | +| **customerId** |**string**| | | +| **referenceId** |**string**| | | +| **afterId** |**string**| | | +| **beforeId** |**string**| | | +| **limit** |**int32**| | | + +### Return type + +[**PaymentMethodList**](payment_method/PaymentMethodList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPaymentMethodByID + +Get payment method by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.GetPaymentMethodByID(context.Background(), paymentMethodId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.GetPaymentMethodByID``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPaymentMethodByID`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.GetPaymentMethodByID`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentMethodByIDRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**PaymentMethod**](payment_method/PaymentMethod.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPaymentsByPaymentMethodId + +Returns payments with matching PaymentMethodID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + paymentRequestId := []string{"Inner_example"} // [OPTIONAL] | []string + + paymentMethodId2 := []string{"Inner_example"} // [OPTIONAL] | []string + + referenceId := []string{"Inner_example"} // [OPTIONAL] | []string + + paymentMethodType := []payment_method.PaymentMethodType{payment_method.PaymentMethodType("CARD")} // [OPTIONAL] | []PaymentMethodType + + channelCode := []string{"Inner_example"} // [OPTIONAL] | []string + + status := []string{"Inner_example"} // [OPTIONAL] | []string + + currency := []string{"Inner_example"} // [OPTIONAL] | []string + + createdGte := time.Now() // [OPTIONAL] | time.Time + + createdLte := time.Now() // [OPTIONAL] | time.Time + + updatedGte := time.Now() // [OPTIONAL] | time.Time + + updatedLte := time.Now() // [OPTIONAL] | time.Time + + limit := int32(56) // [OPTIONAL] | int32 + + afterId := "afterId_example" // [OPTIONAL] | string + + beforeId := "beforeId_example" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.GetPaymentsByPaymentMethodId(context.Background(), paymentMethodId). + PaymentRequestId(paymentRequestId). + PaymentMethodId2(paymentMethodId2). + ReferenceId(referenceId). + PaymentMethodType(paymentMethodType). + ChannelCode(channelCode). + Status(status). + Currency(currency). + CreatedGte(createdGte). + CreatedLte(createdLte). + UpdatedGte(updatedGte). + UpdatedLte(updatedLte). + Limit(limit). + AfterId(afterId). + BeforeId(beforeId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.GetPaymentsByPaymentMethodId``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPaymentsByPaymentMethodId`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.GetPaymentsByPaymentMethodId`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentsByPaymentMethodIdRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **paymentRequestId** |**string[]**| | | +| **paymentMethodId2** |**string[]**| | | +| **referenceId** |**string[]**| | | +| **paymentMethodType** |[**PaymentMethodType[]**](payment_method/PaymentMethodType.md)| | | +| **channelCode** |**string[]**| | | +| **status** |**string[]**| | | +| **currency** |**string[]**| | | +| **createdGte** |**time.Time**| | | +| **createdLte** |**time.Time**| | | +| **updatedGte** |**time.Time**| | | +| **updatedLte** |**time.Time**| | | +| **limit** |**int32**| | | +| **afterId** |**string**| | | +| **beforeId** |**string**| | | + +### Return type + +**map[string]interface{}** + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## PatchPaymentMethod + +Patch payment methods + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + paymentMethodUpdateParameters := *payment_method.NewPaymentMethodUpdateParameters() // [OPTIONAL] | PaymentMethodUpdateParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentMethodApi.PatchPaymentMethod(context.Background(), paymentMethodId). + PaymentMethodUpdateParameters(paymentMethodUpdateParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.PatchPaymentMethod``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchPaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodApi.PatchPaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPatchPaymentMethodRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **paymentMethodUpdateParameters** |[**PaymentMethodUpdateParameters**](payment_method/PaymentMethodUpdateParameters.md)| | | + +### Return type + +[**PaymentMethod**](payment_method/PaymentMethod.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## SimulatePayment + +Makes payment with matching PaymentMethodID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + + paymentMethodId := "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + simulatePaymentRequest := *payment_method.NewSimulatePaymentRequest() // [OPTIONAL] | SimulatePaymentRequest + + xenditClient := xendit.NewClient("API-KEY") + + r, err := xenditClient.PaymentMethodApi.SimulatePayment(context.Background(), paymentMethodId). + SimulatePaymentRequest(simulatePaymentRequest). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodApi.SimulatePayment``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentMethodId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSimulatePaymentRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **simulatePaymentRequest** |[**SimulatePaymentRequest**](payment_method/SimulatePaymentRequest.md)| | | + +### Return type + + (empty response body) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md new file mode 100644 index 00000000..7c852cc5 --- /dev/null +++ b/docs/PaymentRequestApi.md @@ -0,0 +1,550 @@ +# xendit\PaymentRequestApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**AuthorizePaymentRequest**](PaymentRequestApi.md#AuthorizePaymentRequest) | **Post** /payment_requests/{paymentRequestId}/auth | Payment Request Authorize | +| [**CapturePaymentRequest**](PaymentRequestApi.md#CapturePaymentRequest) | **Post** /payment_requests/{paymentRequestId}/captures | Payment Request Capture | +| [**CreatePaymentRequest**](PaymentRequestApi.md#CreatePaymentRequest) | **Post** /payment_requests | Create Payment Request | +| [**GetAllPaymentRequests**](PaymentRequestApi.md#GetAllPaymentRequests) | **Get** /payment_requests | Get all payment requests by filter | +| [**GetPaymentRequestByID**](PaymentRequestApi.md#GetPaymentRequestByID) | **Get** /payment_requests/{paymentRequestId} | Get payment request by ID | +| [**GetPaymentRequestCaptures**](PaymentRequestApi.md#GetPaymentRequestCaptures) | **Get** /payment_requests/{paymentRequestId}/captures | Get Payment Request Capture | +| [**ResendPaymentRequestAuth**](PaymentRequestApi.md#ResendPaymentRequestAuth) | **Post** /payment_requests/{paymentRequestId}/auth/resend | Payment Request Resend Auth | + + + +## AuthorizePaymentRequest + +Payment Request Authorize + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + paymentRequestId := "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + paymentRequestAuthParameters := *payment_request.NewPaymentRequestAuthParameters("AuthCode_example") // [OPTIONAL] | PaymentRequestAuthParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.AuthorizePaymentRequest(context.Background(), paymentRequestId). + PaymentRequestAuthParameters(paymentRequestAuthParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.AuthorizePaymentRequest``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AuthorizePaymentRequest`: PaymentRequest + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.AuthorizePaymentRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentRequestId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAuthorizePaymentRequestRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **paymentRequestAuthParameters** |[**PaymentRequestAuthParameters**](payment_request/PaymentRequestAuthParameters.md)| | | + +### Return type + +[**PaymentRequest**](payment_request/PaymentRequest.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## CapturePaymentRequest + +Payment Request Capture + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + paymentRequestId := "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + captureParameters := *payment_request.NewCaptureParameters(float64(123)) // [OPTIONAL] | CaptureParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.CapturePaymentRequest(context.Background(), paymentRequestId). + CaptureParameters(captureParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.CapturePaymentRequest``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CapturePaymentRequest`: Capture + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.CapturePaymentRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentRequestId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCapturePaymentRequestRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **captureParameters** |[**CaptureParameters**](payment_request/CaptureParameters.md)| | | + +### Return type + +[**Capture**](payment_request/Capture.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## CreatePaymentRequest + +Create Payment Request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + idempotencyKey := "5f9a3fbd571a1c4068aa40ce" // [OPTIONAL] | string + + paymentRequestParameters := *payment_request.NewPaymentRequestParameters(payment_request.PaymentRequestCurrency("IDR")) // [OPTIONAL] | PaymentRequestParameters + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.CreatePaymentRequest(context.Background()). + IdempotencyKey(idempotencyKey). + PaymentRequestParameters(paymentRequestParameters). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.CreatePaymentRequest``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreatePaymentRequest`: PaymentRequest + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.CreatePaymentRequest`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePaymentRequestRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **idempotencyKey** |**string**| | | +| **paymentRequestParameters** |[**PaymentRequestParameters**](payment_request/PaymentRequestParameters.md)| | | + +### Return type + +[**PaymentRequest**](payment_request/PaymentRequest.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetAllPaymentRequests + +Get all payment requests by filter + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + referenceId := []string{"Inner_example"} // [OPTIONAL] | []string + + id := []string{"Inner_example"} // [OPTIONAL] | []string + + customerId := []string{"Inner_example"} // [OPTIONAL] | []string + + limit := int32(56) // [OPTIONAL] | int32 + + beforeId := "beforeId_example" // [OPTIONAL] | string + + afterId := "afterId_example" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.GetAllPaymentRequests(context.Background()). + ReferenceId(referenceId). + Id(id). + CustomerId(customerId). + Limit(limit). + BeforeId(beforeId). + AfterId(afterId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.GetAllPaymentRequests``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllPaymentRequests`: PaymentRequestListResponse + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.GetAllPaymentRequests`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllPaymentRequestsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **referenceId** |**string[]**| | | +| **id** |**string[]**| | | +| **customerId** |**string[]**| | | +| **limit** |**int32**| | | +| **beforeId** |**string**| | | +| **afterId** |**string**| | | + +### Return type + +[**PaymentRequestListResponse**](payment_request/PaymentRequestListResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPaymentRequestByID + +Get payment request by ID + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + paymentRequestId := "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.GetPaymentRequestByID(context.Background(), paymentRequestId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.GetPaymentRequestByID``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPaymentRequestByID`: PaymentRequest + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.GetPaymentRequestByID`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentRequestId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentRequestByIDRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**PaymentRequest**](payment_request/PaymentRequest.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPaymentRequestCaptures + +Get Payment Request Capture + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + paymentRequestId := "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + limit := int32(56) // [OPTIONAL] | int32 + + afterId := "afterId_example" // [OPTIONAL] | string + + beforeId := "beforeId_example" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.GetPaymentRequestCaptures(context.Background(), paymentRequestId). + Limit(limit). + AfterId(afterId). + BeforeId(beforeId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.GetPaymentRequestCaptures``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPaymentRequestCaptures`: CaptureListResponse + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.GetPaymentRequestCaptures`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentRequestId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentRequestCapturesRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **limit** |**int32**| | | +| **afterId** |**string**| | | +| **beforeId** |**string**| | | + +### Return type + +[**CaptureListResponse**](payment_request/CaptureListResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## ResendPaymentRequestAuth + +Payment Request Resend Auth + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + + paymentRequestId := "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PaymentRequestApi.ResendPaymentRequestAuth(context.Background(), paymentRequestId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentRequestApi.ResendPaymentRequestAuth``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ResendPaymentRequestAuth`: PaymentRequest + fmt.Fprintf(os.Stdout, "Response from `PaymentRequestApi.ResendPaymentRequestAuth`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **paymentRequestId** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiResendPaymentRequestAuthRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**PaymentRequest**](payment_request/PaymentRequest.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/PayoutApi.md b/docs/PayoutApi.md new file mode 100644 index 00000000..15fd6173 --- /dev/null +++ b/docs/PayoutApi.md @@ -0,0 +1,391 @@ +# xendit\PayoutApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**CancelPayout**](PayoutApi.md#CancelPayout) | **Post** /v2/payouts/{id}/cancel | API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. | +| [**CreatePayout**](PayoutApi.md#CreatePayout) | **Post** /v2/payouts | API to send money at scale to bank accounts & eWallets | +| [**GetPayoutById**](PayoutApi.md#GetPayoutById) | **Get** /v2/payouts/{id} | API to fetch the current status, or details of the payout | +| [**GetPayoutChannels**](PayoutApi.md#GetPayoutChannels) | **Get** /payouts_channels | API providing the current list of banks and e-wallets we support for payouts for both regions | +| [**GetPayouts**](PayoutApi.md#GetPayouts) | **Get** /v2/payouts | API to retrieve all matching payouts with reference ID | + + + +## CancelPayout + +API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payout "github.com/xendit/xendit-go/v3/payout" +) + +func main() { + + // Payout id returned from the response of /v2/payouts + id := "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PayoutApi.CancelPayout(context.Background(), id). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PayoutApi.CancelPayout``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CancelPayout`: GetPayouts200ResponseDataInner + fmt.Fprintf(os.Stdout, "Response from `PayoutApi.CancelPayout`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **id** | **string** | Payout id returned from the response of /v2/payouts | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCancelPayoutRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**GetPayouts200ResponseDataInner**](payout/GetPayouts200ResponseDataInner.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## CreatePayout + +API to send money at scale to bank accounts & eWallets + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payout "github.com/xendit/xendit-go/v3/payout" +) + +func main() { + + // A unique key to prevent duplicate requests from pushing through our system. No + // expiration. + idempotencyKey := "DISB-1234" // [REQUIRED] | string + + // The sub-account user-id that you want to make this transaction for. This header + // is only used if you have access to xenPlatform. See xenPlatform for more + // information. + forUserId := "5dbf20d7c8eb0c0896f811b6" // [OPTIONAL] | string + + createPayoutRequest := *payout.NewCreatePayoutRequest("DISB-001", "PH_BDO", *payout.NewDigitalPayoutChannelProperties("9999999999"), float32(15000.05), "PHP") // [OPTIONAL] | CreatePayoutRequest + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PayoutApi.CreatePayout(context.Background()). + IdempotencyKey(idempotencyKey). + ForUserId(forUserId). + CreatePayoutRequest(createPayoutRequest). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PayoutApi.CreatePayout``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreatePayout`: GetPayouts200ResponseDataInner + fmt.Fprintf(os.Stdout, "Response from `PayoutApi.CreatePayout`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePayoutRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **idempotencyKey** |**string**| A unique key to prevent duplicate requests from pushing through our system. No expiration. | | +| **forUserId** |**string**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. | | +| **createPayoutRequest** |[**CreatePayoutRequest**](payout/CreatePayoutRequest.md)| | | + +### Return type + +[**GetPayouts200ResponseDataInner**](payout/GetPayouts200ResponseDataInner.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPayoutById + +API to fetch the current status, or details of the payout + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payout "github.com/xendit/xendit-go/v3/payout" +) + +func main() { + + // Payout id returned from the response of /v2/payouts + id := "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" // [REQUIRED] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PayoutApi.GetPayoutById(context.Background(), id). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PayoutApi.GetPayoutById``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPayoutById`: GetPayouts200ResponseDataInner + fmt.Fprintf(os.Stdout, "Response from `PayoutApi.GetPayoutById`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **id** | **string** | Payout id returned from the response of /v2/payouts | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPayoutByIdRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| + +### Return type + +[**GetPayouts200ResponseDataInner**](payout/GetPayouts200ResponseDataInner.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPayoutChannels + +API providing the current list of banks and e-wallets we support for payouts for both regions + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payout "github.com/xendit/xendit-go/v3/payout" +) + +func main() { + + // Filter channels by currency from ISO-4217 values + currency := "IDR, PHP" // [OPTIONAL] | string + + // Filter channels by category + channelCategory := []payout.ChannelCategory{payout.ChannelCategory("BANK")} // [OPTIONAL] | []ChannelCategory + + // Filter channels by channel code, prefixed by ISO-3166 country code + channelCode := "ID_MANDIRI, PH_GCASH" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PayoutApi.GetPayoutChannels(context.Background()). + Currency(currency). + ChannelCategory(channelCategory). + ChannelCode(channelCode). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PayoutApi.GetPayoutChannels``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPayoutChannels`: []Channel + fmt.Fprintf(os.Stdout, "Response from `PayoutApi.GetPayoutChannels`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPayoutChannelsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **currency** |**string**| Filter channels by currency from ISO-4217 values | | +| **channelCategory** |[**ChannelCategory[]**](payout/ChannelCategory.md)| Filter channels by category | | +| **channelCode** |**string**| Filter channels by channel code, prefixed by ISO-3166 country code | | + +### Return type + +[**[]Channel**](payout/Channel.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetPayouts + +API to retrieve all matching payouts with reference ID + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payout "github.com/xendit/xendit-go/v3/payout" +) + +func main() { + + // Reference_id provided when creating the payout + referenceId := "DISB-123" // [REQUIRED] | string + + // Number of records to fetch per API call + limit := float32(10) // [OPTIONAL] | float32 + + // Used to fetch record after this payout unique id + afterId := "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" // [OPTIONAL] | string + + // Used to fetch record before this payout unique id + beforeId := "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.PayoutApi.GetPayouts(context.Background()). + ReferenceId(referenceId). + Limit(limit). + AfterId(afterId). + BeforeId(beforeId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PayoutApi.GetPayouts``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPayouts`: GetPayouts200Response + fmt.Fprintf(os.Stdout, "Response from `PayoutApi.GetPayouts`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPayoutsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **referenceId** |**string**| Reference_id provided when creating the payout | | +| **limit** |**float32**| Number of records to fetch per API call | | +| **afterId** |**string**| Used to fetch record after this payout unique id | | +| **beforeId** |**string**| Used to fetch record before this payout unique id | | + +### Return type + +[**GetPayouts200Response**](payout/GetPayouts200Response.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/RefundApi.md b/docs/RefundApi.md new file mode 100644 index 00000000..c0226c2a --- /dev/null +++ b/docs/RefundApi.md @@ -0,0 +1,287 @@ +# xendit\RefundApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**CancelRefund**](RefundApi.md#CancelRefund) | **Post** /refunds/{refundID}/cancel | | +| [**CreateRefund**](RefundApi.md#CreateRefund) | **Post** /refunds | | +| [**GetAllRefunds**](RefundApi.md#GetAllRefunds) | **Get** /refunds/ | | +| [**GetRefund**](RefundApi.md#GetRefund) | **Get** /refunds/{refundID} | | + + + +## CancelRefund + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + refund "github.com/xendit/xendit-go/v3/refund" +) + +func main() { + + refundID := "rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + idempotencyKey := "9797b5a6-54ad-4511-80a4-ec451346808b" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.RefundApi.CancelRefund(context.Background(), refundID). + IdempotencyKey(idempotencyKey). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RefundApi.CancelRefund``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CancelRefund`: Refund + fmt.Fprintf(os.Stdout, "Response from `RefundApi.CancelRefund`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **refundID** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCancelRefundRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **idempotencyKey** |**string**| | | + +### Return type + +[**Refund**](refund/Refund.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## CreateRefund + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + refund "github.com/xendit/xendit-go/v3/refund" +) + +func main() { + + idempotencyKey := "9797b5a6-54ad-4511-80a4-ec451346808b" // [OPTIONAL] | string + + createRefund := *refund.NewCreateRefund() // [OPTIONAL] | CreateRefund + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.RefundApi.CreateRefund(context.Background()). + IdempotencyKey(idempotencyKey). + CreateRefund(createRefund). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RefundApi.CreateRefund``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRefund`: Refund + fmt.Fprintf(os.Stdout, "Response from `RefundApi.CreateRefund`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRefundRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **idempotencyKey** |**string**| | | +| **createRefund** |[**CreateRefund**](refund/CreateRefund.md)| | | + +### Return type + +[**Refund**](refund/Refund.md) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetAllRefunds + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + refund "github.com/xendit/xendit-go/v3/refund" +) + +func main() { + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.RefundApi.GetAllRefunds(context.Background()). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RefundApi.GetAllRefunds``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllRefunds`: RefundList + fmt.Fprintf(os.Stdout, "Response from `RefundApi.GetAllRefunds`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllRefundsRequest struct via the builder pattern + + +### Return type + +[**RefundList**](refund/RefundList.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetRefund + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + refund "github.com/xendit/xendit-go/v3/refund" +) + +func main() { + + refundID := "rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822" // [REQUIRED] | string + + idempotencyKey := "9797b5a6-54ad-4511-80a4-ec451346808b" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.RefundApi.GetRefund(context.Background(), refundID). + IdempotencyKey(idempotencyKey). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RefundApi.GetRefund``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRefund`: Refund + fmt.Fprintf(os.Stdout, "Response from `RefundApi.GetRefund`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **refundID** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRefundRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **idempotencyKey** |**string**| | | + +### Return type + +[**Refund**](refund/Refund.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md new file mode 100644 index 00000000..d3ab29c7 --- /dev/null +++ b/docs/TransactionApi.md @@ -0,0 +1,228 @@ +# xendit\TransactionApi + +All URIs are relative to *https://api.xendit.co* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**GetAllTransactions**](TransactionApi.md#GetAllTransactions) | **Get** /transactions | Get a list of transactions | +| [**GetTransactionByID**](TransactionApi.md#GetTransactionByID) | **Get** /transactions/{id} | Get a transaction based on its id | + + + +## GetAllTransactions + +Get a list of transactions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + balance_and_transaction "github.com/xendit/xendit-go/v3/balance_and_transaction" +) + +func main() { + + // The sub-account user-id that you want to make this transaction for. This header + // is only used if you have access to xenPlatform. See xenPlatform for more + // information + forUserId := "5dbf20d7c8eb0c0896f811b6" // [OPTIONAL] | string + + // Transaction types that will be included in the result. Default is to include all + // transaction types + types := []balance_and_transaction.TransactionTypes{balance_and_transaction.TransactionTypes("BATCH_DISBURSEMENT")} // [OPTIONAL] | []TransactionTypes + + // Status of the transaction. Default is to include all status. + statuses := []balance_and_transaction.TransactionStatuses{balance_and_transaction.TransactionStatuses("SUCCESS")} // [OPTIONAL] | []TransactionStatuses + + // Payment channels in which the transaction is carried out. Default is to include + // all channels. + channelCategories := []balance_and_transaction.ChannelsCategories{balance_and_transaction.ChannelsCategories("BANK")} // [OPTIONAL] | []ChannelsCategories + + // To filter the result for transactions with matching reference given (case + // sensitive) + referenceId := "ref23232" // [OPTIONAL] | string + + // To filter the result for transactions with matching product_id (a.k.a payment_id) + // given (case sensitive) + productId := "d290f1ee-6c54-4b01-90e6-d701748f0701" // [OPTIONAL] | string + + // Account identifier of transaction. The format will be different from each + // channel. For example, on `BANK` channel it will be account number and on `CARD` + // it will be masked card number. + accountIdentifier := "123123123" // [OPTIONAL] | string + + // Specific transaction amount to search for + amount := float32(100) // [OPTIONAL] | float32 + + currency := balance_and_transaction.Currency("IDR") // [OPTIONAL] | Currency + + // Filter time of transaction by created date. If not specified will list all dates. + created := map[string][]balance_and_transaction.DateRangeFilter{"key": map[string]interface{}{ ... }} // [OPTIONAL] | DateRangeFilter + + // Filter time of transaction by updated date. If not specified will list all dates. + updated := map[string][]balance_and_transaction.DateRangeFilter{"key": map[string]interface{}{ ... }} // [OPTIONAL] | DateRangeFilter + + // number of items in the result per page. Another name for \"results_per_page\" + // (default to 10) + limit := float32(10) // [OPTIONAL] | float32 + + afterId := "afterId_example" // [OPTIONAL] | string + + beforeId := "beforeId_example" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.TransactionApi.GetAllTransactions(context.Background()). + ForUserId(forUserId). + Types(types). + Statuses(statuses). + ChannelCategories(channelCategories). + ReferenceId(referenceId). + ProductId(productId). + AccountIdentifier(accountIdentifier). + Amount(amount). + Currency(currency). + Created(created). + Updated(updated). + Limit(limit). + AfterId(afterId). + BeforeId(beforeId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TransactionApi.GetAllTransactions``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAllTransactions`: TransactionsResponse + fmt.Fprintf(os.Stdout, "Response from `TransactionApi.GetAllTransactions`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAllTransactionsRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forUserId** |**string**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | | +| **types** |[**TransactionTypes[]**](balance_and_transaction/TransactionTypes.md)| Transaction types that will be included in the result. Default is to include all transaction types | | +| **statuses** |[**TransactionStatuses[]**](balance_and_transaction/TransactionStatuses.md)| Status of the transaction. Default is to include all status. | | +| **channelCategories** |[**ChannelsCategories[]**](balance_and_transaction/ChannelsCategories.md)| Payment channels in which the transaction is carried out. Default is to include all channels. | | +| **referenceId** |**string**| To filter the result for transactions with matching reference given (case sensitive) | | +| **productId** |**string**| To filter the result for transactions with matching product_id (a.k.a payment_id) given (case sensitive) | | +| **accountIdentifier** |**string**| Account identifier of transaction. The format will be different from each channel. For example, on `BANK` channel it will be account number and on `CARD` it will be masked card number. | | +| **amount** |**float32**| Specific transaction amount to search for | | +| **currency** |[**Currency**](balance_and_transaction/Currencybalance_and_transaction/.md)| | | +| **created** |[**DateRangeFilter**](balance_and_transaction/DateRangeFilterbalance_and_transaction/.md)| Filter time of transaction by created date. If not specified will list all dates. | | +| **updated** |[**DateRangeFilter**](balance_and_transaction/DateRangeFilterbalance_and_transaction/.md)| Filter time of transaction by updated date. If not specified will list all dates. | | +| **limit** |**float32**| number of items in the result per page. Another name for \"results_per_page\" | [default to 10] | +| **afterId** |**string**| | | +| **beforeId** |**string**| | | + +### Return type + +[**TransactionsResponse**](balance_and_transaction/TransactionsResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + + +## GetTransactionByID + +Get a transaction based on its id + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + balance_and_transaction "github.com/xendit/xendit-go/v3/balance_and_transaction" +) + +func main() { + + id := "id_example" // [REQUIRED] | string + + // The sub-account user-id that you want to make this transaction for. This header + // is only used if you have access to xenPlatform. See xenPlatform for more + // information + forUserId := "5dbf20d7c8eb0c0896f811b6" // [OPTIONAL] | string + + xenditClient := xendit.NewClient("API-KEY") + + resp, r, err := xenditClient.TransactionApi.GetTransactionByID(context.Background(), id). + ForUserId(forUserId). // [OPTIONAL] + Execute() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TransactionApi.GetTransactionByID``: %v\n", err.Error()) + + b, _ := json.Marshal(err.FullError()) + fmt.Fprintf(os.Stderr, "Full Error Struct: %v\n", string(b)) + + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTransactionByID`: TransactionResponse + fmt.Fprintf(os.Stdout, "Response from `TransactionApi.GetTransactionByID`: %v\n", resp) +} +``` + +### Path Parameters + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.| | +| **id** | **string** | | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTransactionByIDRequest struct via the builder pattern + + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| +| **forUserId** |**string**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | | + +### Return type + +[**TransactionResponse**](balance_and_transaction/TransactionResponse.md) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) +[[Back to README]](../README.md) + diff --git a/docs/balance_and_transaction.yaml b/docs/balance_and_transaction.yaml new file mode 100644 index 00000000..08feb4de --- /dev/null +++ b/docs/balance_and_transaction.yaml @@ -0,0 +1,1054 @@ +openapi: 3.0.0 +info: + contact: + email: email@xendit.com + description: "# Introduction\nThis specification describes how to use the Transaction\ + \ Service V4 API. \n\n**Transaction Service** is the service that records the\ + \ customer transactions and is responsible to calculate their balance. All products\ + \ that move customer money around whether it is money-in, money-out, or transfer\ + \ will interact with the Transaction Service on its flow. Transaction Service\ + \ is the source of truth of Xendit and Customer regarding how much money that\ + \ customer has that is stored in Xendit. Transaction Service is the source that\ + \ is used for both our internal and customer financial reconciliation. Internally,\ + \ the Transaction Service data structure is similar to how double-entry accounting\ + \ works.\n\n## How Xendit teams/services do integrate with Transaction Service\ + \ V4\n\n\n**Channel product team/service** They interact with the Transaction\ + \ Service when they want to record the transactions. This transaction can be money-in\ + \ (balance added), money-out (balance deducted), transfer, refund/void/reversal,\ + \ or other kind of transaction that affects customer balance. Product team also\ + \ interacts with the Transaction Service for getting information about the transaction\ + \ or balance.\n\n**Billing/Fee team/service** They interact with Transaction Service\ + \ either as the dependency of Transaction Service for getting the correct fee\ + \ calculation/settings. Or using Transaction Service for getting the transaction/fee\ + \ information to calculate the bill for the customer.\n\n**NUX team/service**\ + \ They interact with the Transaction Service to set up the customer ledger_account\ + \ that is used to record their transactions.\n\n**Finance team/service** They\ + \ interact with the Transaction Service to get the transaction and balance data\ + \ for each customer to do reconciliation.\n\n**Dashboard/API team/service** They\ + \ interact with the Transaction Service as a proxy to show the data to the Customer.\n\ + \n## Prerequisites\n\nBefore staring to use **Transaction Service API** you need\ + \ to complete a few things:\n1. Find out **Base URL** for the API. Every endpoint\ + \ definition in this document contains list of available servers (local, staging,\ + \ production)\n2. Set up ledger accounts using business id and currency. **Ledger\ + \ Account** represents the account of the customer that will be used to associate\ + \ with ledger lines. Each business may have at least 1 ledger account group (a\ + \ group consists of a few accounts of types such as cash, liability, holding),\ + \ and the money movement of their ledger will revolve around those ledger accounts.\ + \ **Ledger Lines** that show a debit or credit transaction for a ledger account.\ + \ We’re using the double-entry principle in accounting where we should post 2\ + \ lines every time we make a transaction, 1 to debit an account and 1 to credit\ + \ another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup)\ + \ section of this document\n3. To be able to create payments with fee/VAT the\ + \ Product rate settings and VAT rate settings should be created using Transaction\ + \ Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate\ + \ settings.\n\n\n## Transaction flows\n\nTo integrate with the Transaction Service\ + \ you should decide what types of transaction flows your integration will be using.\ + \ Transaction flow is set by the transaction `type` during transaction creation\n\ + \n1. Money In flows\n 1. Payment from credit card\n\n\n `type: CREDIT_CARD_PAYMENT`\n\ + \t\t\n\t\t\n 3. Payment from other sources without fee/VAT\n\n\n `type:\ + \ DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT,\ + \ PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT`\n\t\t\n\t\t\n 4.\ + \ Payment from other sources with fee/VAT\n\n\n `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT,\ + \ IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT,\ + \ PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER,\ + \ ACH_PAYMENT, CRYPTO_PAYMENT`\n\t\t\n\t\t\n 5. Billing deposit from cash\n\ + \n\n `type: BILLING_DEPOSIT`\n\t\t\n\t\t\n 6. Billing deposit from other\ + \ sources\n\n\n `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT`\n\ + \t\t\n\t\t\n2. Money out flows\n 1. Instant payment\n\n\n `type: simple\ + \ money out types`\n\t\t\t\t\n `status: COMPLETED`\n\t\t\n\t\t\n 2.\ + \ Simple payment without fee/VAT\n\n\n `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION,\ + \ LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL`\n\ + \n\n 3. Simple payment with fee/VAT\n\n\n `type: ISSUING_FUNDING, BATCH_DISBURSEMENT,\ + \ CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT`\n\ + \t\t\n\t\t\n 4. Billing withdraw to cash\n\n\n `type: BILLING_WITHDRAWAL`\n\ + \t\t\n\t\t\n 4. Billing withdraw to other destinations\n\n\n `type:\ + \ BILL_PAYMENT`\n\t\t\n\t\t\n3. Reversal flow\n\n Some of transactions could\ + \ be reversed. See Reversible / non reversible transaction types section of this document. To\ + \ reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction\ + \ status `REVERSED`.\n\t\t\n4. Void/Cancellation Flow\n\n Transaction in the\ + \ `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id)\ + \ endpoint with the transaction status `VOIDED`.\n\t\t\n\t\t\n5. Switcher flow\n\ + \n Switchers are transactions that do not affect the customer balance. These\ + \ are transactions that goes directly to the customers’ account and simply passes\ + \ through Xendit. Therefore, it will not impact the customer balance and we will\ + \ only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment`\ + \ field to `true`.\n\n\n\n\t\t\n## Instant/non instant settlement\n\nTransactions\ + \ can be performed instantly (instant settlement) or with delay (non instant settlement).\ + \ Some of the transaction types are only instantly processed, some of them support\ + \ both instant and non instant settlement and some of them have only non instant\ + \ settlement. If settlement is instant than balance will be changed instantly.\ + \ In opposite case the transaction status has to be set into PENDING_SETTLEMENT\ + \ and settlement date should be provided. \n\n1. Instant settlement Money In transaction\ + \ types\n\n `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT,\ + \ ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK,\ + \ PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM`\n\t\t\n2. Both instant and\ + \ non instant Money In transaction types\n\n `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER,\ + \ ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE,\ + \ PAYLATER_PAYMENT`\n\n3. Non Instant settlement Money In transaction types\n\n\ + \ `CREDIT_CARD_PAYMENT`\n\t\t\n4. Instant settlement Money Out transaction\ + \ types\n\n `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING,\ + \ BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION`\n\n5. Both instant and non instant\ + \ settlement supported Money Out transaction types\n\n `CHARGEBACK_DEDUCTION`\n\ + \n6. Non Instant settlement Money Out transaction types\n\n All other money\ + \ out types are non instant settlement\n\n## Reversible / non reversible transaction\ + \ types\n\nSome transactions can be reversed. Here are the list of transaction\ + \ types that could be reversed: \n\n`CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT,\ + \ REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT,\ + \ FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT,\ + \ IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT,\ + \ CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT,\ + \ EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION,\ + \ FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT,\ + \ BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT,\ + \ BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK`\n\n\ + \ \n## How to create transaction\n\nAfter you created or already have the `BUSINESS_CASH`\ + \ ledger account ID (See Prerequisites\ + \ section) and you know what transaction flows are going to be used you can create\ + \ the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint\n\n## How to update\ + \ transaction\n\nTo update transaction you should do PATCH request to the Update transaction (/api/transactions/::id)\ + \ endpoint\n\n\n" + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: Transaction Service V4 API + version: 3.4.2 + x-logo: + url: https://dashboard.xendit.co/assets/images/xendit-blue-logo.svg +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /balance: + get: + description: "Retrieves balance for your business, defaults to CASH type" + operationId: getBalance + parameters: + - description: The selected balance type + explode: true + in: query + name: account_type + required: false + schema: + default: CASH + enum: + - CASH + - HOLDING + - TAX + example: CASH + type: string + style: form + - description: Currency for filter for customers with multi currency accounts + explode: true + in: query + name: currency + required: false + schema: + example: IDR + type: string + style: form + - description: The sub-account user-id that you want to make this transaction + for. This header is only used if you have access to xenPlatform. See xenPlatform + for more information + explode: false + in: header + name: for-user-id + required: false + schema: + example: 5dbf20d7c8eb0c0896f811b6 + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Balance' + description: success + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "invalid input, object invalid" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ServerError' + description: Errors + summary: "Retrieves balances for a business, default to CASH type" + tags: + - balance + /transactions: + get: + description: Get a list of all transactions based on filter and search parameters. + operationId: getAllTransactions + parameters: + - description: The sub-account user-id that you want to make this transaction + for. This header is only used if you have access to xenPlatform. See xenPlatform + for more information + explode: false + in: header + name: for-user-id + required: false + schema: + example: 5dbf20d7c8eb0c0896f811b6 + type: string + style: simple + - description: Transaction types that will be included in the result. Default + is to include all transaction types + example: + - DISBURSEMENT + - PAYMENT + explode: true + in: query + name: types + required: false + schema: + items: + $ref: '#/components/schemas/TransactionTypes' + type: array + style: form + - description: Status of the transaction. Default is to include all status. + example: + - SUCCESS + - PENDING + explode: true + in: query + name: statuses + required: false + schema: + items: + $ref: '#/components/schemas/TransactionStatuses' + type: array + style: form + - description: Payment channels in which the transaction is carried out. Default + is to include all channels. + example: + - BANK + - INVOICE + explode: true + in: query + name: channel_categories + required: false + schema: + items: + $ref: '#/components/schemas/ChannelsCategories' + type: array + style: form + - description: To filter the result for transactions with matching reference + given (case sensitive) + example: ref23232 + explode: true + in: query + name: reference_id + required: false + schema: + type: string + style: form + - description: To filter the result for transactions with matching product_id + (a.k.a payment_id) given (case sensitive) + example: d290f1ee-6c54-4b01-90e6-d701748f0701 + explode: true + in: query + name: product_id + required: false + schema: + type: string + style: form + - description: "Account identifier of transaction. The format will be different\ + \ from each channel. For example, on `BANK` channel it will be account number\ + \ and on `CARD` it will be masked card number." + example: 123123123 + explode: true + in: query + name: account_identifier + required: false + schema: + type: string + style: form + - description: Specific transaction amount to search for + example: 100 + explode: true + in: query + name: amount + required: false + schema: + type: number + style: form + - explode: true + in: query + name: currency + required: false + schema: + $ref: '#/components/schemas/Currency' + style: form + - description: Filter time of transaction by created date. If not specified + will list all dates. + explode: true + in: query + name: created + required: false + schema: + $ref: '#/components/schemas/DateRangeFilter' + style: deepObject + - description: Filter time of transaction by updated date. If not specified + will list all dates. + explode: true + in: query + name: updated + required: false + schema: + $ref: '#/components/schemas/DateRangeFilter' + style: deepObject + - description: number of items in the result per page. Another name for "results_per_page" + example: 10 + explode: true + in: query + name: limit + required: false + schema: + default: 10 + maximum: 50 + type: number + style: form + - explode: true + in: query + name: after_id + required: false + schema: + $ref: '#/components/schemas/TransactionId' + style: form + - explode: true + in: query + name: before_id + required: false + schema: + $ref: '#/components/schemas/TransactionId' + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactionsResponse' + description: List of transaction object + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "invalid input, object invalid" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ServerError' + description: Errors + summary: Get a list of transactions + tags: + - transaction + /transactions/{id}: + get: + description: Get single specific transaction by transaction id. + operationId: getTransactionByID + parameters: + - description: The sub-account user-id that you want to make this transaction + for. This header is only used if you have access to xenPlatform. See xenPlatform + for more information + explode: false + in: header + name: for-user-id + required: false + schema: + example: 5dbf20d7c8eb0c0896f811b6 + type: string + style: simple + - explode: false + in: path + name: id + required: true + schema: + $ref: '#/components/schemas/TransactionId' + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactionResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationError' + description: "invalid input, object invalid" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ServerError' + description: Errors + summary: Get a transaction based on its id + tags: + - transaction +components: + parameters: + TransactionTypes: + description: Transaction types that will be included in the result. Default + is to include all transaction types + example: + - DISBURSEMENT + - PAYMENT + explode: true + in: query + name: types + required: false + schema: + items: + $ref: '#/components/schemas/TransactionTypes' + type: array + style: form + TransactionStatuses: + description: Status of the transaction. Default is to include all status. + example: + - SUCCESS + - PENDING + explode: true + in: query + name: statuses + required: false + schema: + items: + $ref: '#/components/schemas/TransactionStatuses' + type: array + style: form + ChannelsCategories: + description: Payment channels in which the transaction is carried out. Default + is to include all channels. + example: + - BANK + - INVOICE + explode: true + in: query + name: channel_categories + required: false + schema: + items: + $ref: '#/components/schemas/ChannelsCategories' + type: array + style: form + ReferenceId: + description: To filter the result for transactions with matching reference given + (case sensitive) + example: ref23232 + explode: true + in: query + name: reference_id + required: false + schema: + type: string + style: form + ProductId: + description: To filter the result for transactions with matching product_id + (a.k.a payment_id) given (case sensitive) + example: d290f1ee-6c54-4b01-90e6-d701748f0701 + explode: true + in: query + name: product_id + required: false + schema: + type: string + style: form + AccountIdentifier: + description: "Account identifier of transaction. The format will be different\ + \ from each channel. For example, on `BANK` channel it will be account number\ + \ and on `CARD` it will be masked card number." + example: 123123123 + explode: true + in: query + name: account_identifier + required: false + schema: + type: string + style: form + Amount: + description: Specific transaction amount to search for + example: 100 + explode: true + in: query + name: amount + required: false + schema: + type: number + style: form + Limit: + description: number of items in the result per page. Another name for "results_per_page" + example: 10 + explode: true + in: query + name: limit + required: false + schema: + default: 10 + maximum: 50 + type: number + style: form + schemas: + Balance: + description: The balance remaining in your account + example: + balance: 123000.12 + properties: + balance: + example: 123000.12 + type: number + required: + - balance + type: object + LinkItem: + example: + method: GET + rel: next + href: /transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc + properties: + href: + description: "URI of target, this will be to the next link." + example: /transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc + type: string + rel: + description: The relationship between source and target. The value will + be `next`. + example: next + type: string + method: + description: "The HTTP method, the value will be `GET`." + example: GET + type: string + required: + - href + - method + - rel + type: object + TransactionsResponse: + description: Returns an array of Transaction Objects. Returns empty array when + there is no result. + example: + data: + - amount: 150.21 + settlement_status: PENDING + reference_id: My custom reference + created: 2016-08-29T09:12:33.001Z + fee: + third_party_withholding_tax: 10 + value_added_tax: 1 + xendit_withholding_tax: 10 + xendit_fee: 10 + status: PENDING + account_identifier: "123123123" + channel_code: BCA + type: null + channel_category: INVOICE + estimated_settlement_time: 2016-08-29T09:12:33.001Z + cashflow: MONEY_IN + product_id: d290f1ee-6c54-4b01-90e6-d701748f0851 + currency: IDR + id: txn_438e4b61-7c4c-4dbb-bbba-94a896bff333 + business_id: 5fc9f5b246f820517e38c84d + updated: 2016-08-29T09:12:33.001Z + status: SUCCESS + - amount: 150.21 + settlement_status: PENDING + reference_id: My custom reference + created: 2016-08-29T09:12:33.001Z + fee: + third_party_withholding_tax: 10 + value_added_tax: 1 + xendit_withholding_tax: 10 + xendit_fee: 10 + status: PENDING + account_identifier: "123123123" + channel_code: BCA + type: null + channel_category: INVOICE + estimated_settlement_time: 2016-08-29T09:12:33.001Z + cashflow: MONEY_IN + product_id: d290f1ee-6c54-4b01-90e6-d701748f0851 + currency: IDR + id: txn_438e4b61-7c4c-4dbb-bbba-94a896bff333 + business_id: 5fc9f5b246f820517e38c84d + updated: 2016-08-29T09:12:33.001Z + status: SUCCESS + links: + - method: GET + rel: next + href: /transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc + - method: GET + rel: next + href: /transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc + has_more: true + properties: + has_more: + description: Indicates whether there are more items to be queried with `after_id` + of the last item from the current result. Use the `links` to follow to + the next result. + type: boolean + links: + description: The links to the next page based on LinkItem if there is next + result. + items: + $ref: '#/components/schemas/LinkItem' + type: array + data: + items: + $ref: '#/components/schemas/TransactionResponse' + type: array + required: + - data + - has_more + type: object + DateRangeFilter: + properties: + gte: + description: Start time of transaction. If not specified will list all dates. + example: 2020-08-29T17:00:00Z + format: date-time + type: string + lte: + description: End time of transaction. If not specified will list all dates. + example: 2020-08-29T17:00:00Z + format: date-time + type: string + type: object + TransactionId: + description: The unique id of a transaction. It will have `txn_` as prefix + example: txn_438e4b61-7c4c-4dbb-bbba-94a896bff333 + pattern: "^txn_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + type: string + Currency: + enum: + - IDR + - PHP + - USD + - JPY + - VND + - SGD + - AED + - AFN + - ALL + - AMD + - ANG + - AOA + - ARS + - AUD + - AWG + - AZN + - BAM + - BBD + - BDT + - BGN + - BHD + - BIF + - BMD + - BND + - BOB + - BRL + - BSD + - BTN + - BWP + - BYN + - BZD + - CAD + - CDF + - CHF + - CLP + - CNY + - COP + - CRC + - CUC + - CUP + - CVE + - CZK + - DJF + - DKK + - DOP + - DZD + - EGP + - ERN + - ETB + - EUR + - FJD + - FKP + - GBP + - GEL + - GGP + - GHS + - GIP + - GMD + - GNF + - GTQ + - GYD + - HKD + - HNL + - HRK + - HTG + - HUF + - ILS + - IMP + - INR + - IQD + - IRR + - ISK + - JEP + - JMD + - JOD + - KES + - KGS + - KHR + - KMF + - KPW + - KRW + - KWD + - KYD + - KZT + - LAK + - LBP + - LKR + - LRD + - LSL + - LYD + - MAD + - MDL + - MGA + - MKD + - MMK + - MNT + - MOP + - MRU + - MUR + - MVR + - MWK + - MXN + - MYR + - MZN + - NAD + - NGN + - NIO + - NOK + - NPR + - NZD + - OMR + - PAB + - PEN + - PGK + - PKR + - PLN + - PYG + - QAR + - RON + - RSD + - RUB + - RWF + - SAR + - SBD + - SCR + - SDG + - SEK + - SHP + - SLL + - SOS + - SPL + - SRD + - STN + - SVC + - SYP + - SZL + - THB + - TJS + - TMT + - TND + - TOP + - TRY + - TTD + - TVD + - TWD + - TZS + - UAH + - UGX + - UYU + - UZS + - VEF + - VUV + - WST + - XAF + - XCD + - XDR + - XOF + - XPF + - YER + - ZAR + - ZMW + - ZWD + example: IDR + type: string + ValidationError: + properties: + status_code: + example: 400 + type: number + error: + example: API_VALIDATION_ERROR + type: string + message: + example: \"from\" is required. \"status\" is required. \"currency\" is required + type: string + validation: + example: + source: query + keys: + - from + - status + - currency + nullable: true + type: object + required: + - error + - message + - status_code + type: object + ServerError: + properties: + status_code: + example: 500 + type: number + error: + example: Internal Server Error + type: string + message: + example: An internal server error occurred + type: string + required: + - error + - message + - status_code + type: object + TransactionTypes: + enum: + - BATCH_DISBURSEMENT + - DISBURSEMENT + - PAYMENT + - REMITTANCE + - REMITTANCE_PAYOUT + - REMITTANCE_COLLECTION + - TRANSFER + - PLATFORM_FEE + - REFUND + - CASHBACK + - TOPUP + - WITHDRAWAL + - OTHER + example: DISBURSEMENT + type: string + ChannelsCategories: + enum: + - BANK + - CARDLESS_CREDIT + - PAYLATER + - CARDS + - CASH + - DIRECT_DEBIT + - EWALLET + - INVOICE + - QR_CODE + - RETAIL_OUTLET + - VIRTUAL_ACCOUNT + - XENPLATFORM + - DIRECT_BANK_TRANSFER + - OTHER + example: INVOICE + type: string + TransactionResponse: + example: + amount: 150.21 + settlement_status: PENDING + reference_id: My custom reference + created: 2016-08-29T09:12:33.001Z + fee: + third_party_withholding_tax: 10 + value_added_tax: 1 + xendit_withholding_tax: 10 + xendit_fee: 10 + status: PENDING + account_identifier: "123123123" + channel_code: BCA + type: null + channel_category: INVOICE + estimated_settlement_time: 2016-08-29T09:12:33.001Z + cashflow: MONEY_IN + product_id: d290f1ee-6c54-4b01-90e6-d701748f0851 + currency: IDR + id: txn_438e4b61-7c4c-4dbb-bbba-94a896bff333 + business_id: 5fc9f5b246f820517e38c84d + updated: 2016-08-29T09:12:33.001Z + status: SUCCESS + properties: + id: + description: The unique id of a transaction. It will have `txn_` as prefix + example: txn_438e4b61-7c4c-4dbb-bbba-94a896bff333 + pattern: "^txn_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + type: string + product_id: + description: The product_id of the transaction. Product id will have a different + prefix for each product. You can use this id to match the transaction + from this API to each product API. + example: d290f1ee-6c54-4b01-90e6-d701748f0851 + type: string + type: + $ref: '#/components/schemas/TransactionResponse_type' + status: + $ref: '#/components/schemas/TransactionStatuses' + channel_category: + $ref: '#/components/schemas/ChannelsCategories' + channel_code: + description: "The channel of the transaction that is used. See [channel\ + \ codes](https://docs.xendit.co/xendisburse/channel-codes) for the list\ + \ of available per channel categories." + example: BCA + nullable: true + type: string + account_identifier: + description: Account identifier of transaction. The format will be different + from each channel. + example: "123123123" + nullable: true + type: string + reference_id: + description: customer supplied reference/external_id + example: My custom reference + type: string + currency: + $ref: '#/components/schemas/Currency' + amount: + description: The transaction amount. The number of decimal places will be + different for each currency according to ISO 4217. + example: 150.21 + type: number + cashflow: + description: "Representing whether the transaction is money in or money\ + \ out For transfer, the transfer out side it will shows up as money out\ + \ and on transfer in side in will shows up as money-in. Available values\ + \ are `MONEY_IN` for money in and `MONEY_OUT` for money out." + enum: + - MONEY_IN + - MONEY_OUT + type: string + settlement_status: + description: The settlement status of the transaction. `PENDING` - Transaction + amount has not been settled to merchant's balance. `SETTLED` - Transaction + has been settled to merchant's balance + enum: + - PENDING + - SETTLED + nullable: true + type: string + estimated_settlement_time: + description: "Estimated settlement time will only apply to money-in transactions.\ + \ For money-out transaction, the value will be `NULL`. Estimated settlement\ + \ time in which transaction amount will be settled to merchant's balance." + example: 2016-08-29T09:12:33.001Z + format: date-time + nullable: true + type: string + business_id: + description: The id of business where this transaction belong to + example: 5fc9f5b246f820517e38c84d + type: string + fee: + $ref: '#/components/schemas/FeeResponse' + created: + description: Transaction created timestamp (UTC+0) + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + updated: + description: Transaction updated timestamp (UTC+0) + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + required: + - account_identifier + - amount + - business_id + - cashflow + - channel_category + - channel_code + - created + - currency + - fee + - id + - product_id + - reference_id + - status + - type + - updated + type: object + FeeResponse: + example: + third_party_withholding_tax: 10 + value_added_tax: 1 + xendit_withholding_tax: 10 + xendit_fee: 10 + status: PENDING + properties: + xendit_fee: + description: Amount of the Xendit fee for this transaction. + example: 10 + type: number + value_added_tax: + description: Amount of the VAT for this transaction. + example: 1 + type: number + xendit_withholding_tax: + description: "Amount of the Xendit Withholding Tax for this transaction\ + \ if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat)\ + \ for more information." + example: 10 + type: number + third_party_withholding_tax: + description: | + Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank + example: 10 + type: number + status: + enum: + - PENDING + - COMPLETED + - CANCELED + - REVERSED + type: string + required: + - value_added_tax + - xendit_fee + type: object + TransactionStatuses: + enum: + - SUCCESS + - PENDING + - FAILED + - REVERSED + - VOIDED + example: SUCCESS + type: string + TransactionResponse_type: + anyOf: + - $ref: '#/components/schemas/TransactionTypes' + - type: string + description: The type of the transactions. diff --git a/docs/balance_and_transaction/Balance.md b/docs/balance_and_transaction/Balance.md new file mode 100644 index 00000000..14bea107 --- /dev/null +++ b/docs/balance_and_transaction/Balance.md @@ -0,0 +1,51 @@ +# Balance + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Balance** | **float32** | | | + +## Methods + +### NewBalance + +`func NewBalance(balance float32, ) *Balance` + +NewBalance instantiates a new Balance object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBalanceWithDefaults + +`func NewBalanceWithDefaults() *Balance` + +NewBalanceWithDefaults instantiates a new Balance object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBalance + +`func (o *Balance) GetBalance() float32` + +GetBalance returns the Balance field if non-nil, zero value otherwise. + +### GetBalanceOk + +`func (o *Balance) GetBalanceOk() (*float32, bool)` + +GetBalanceOk returns a tuple with the Balance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBalance + +`func (o *Balance) SetBalance(v float32)` + +SetBalance sets Balance field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/ChannelsCategories.md b/docs/balance_and_transaction/ChannelsCategories.md new file mode 100644 index 00000000..99935add --- /dev/null +++ b/docs/balance_and_transaction/ChannelsCategories.md @@ -0,0 +1,37 @@ +# ChannelsCategories + +## Enum + + +* `BANK` (value: `"BANK"`) + +* `CARDLESS_CREDIT` (value: `"CARDLESS_CREDIT"`) + +* `PAYLATER` (value: `"PAYLATER"`) + +* `CARDS` (value: `"CARDS"`) + +* `CASH` (value: `"CASH"`) + +* `DIRECT_DEBIT` (value: `"DIRECT_DEBIT"`) + +* `EWALLET` (value: `"EWALLET"`) + +* `INVOICE` (value: `"INVOICE"`) + +* `QR_CODE` (value: `"QR_CODE"`) + +* `RETAIL_OUTLET` (value: `"RETAIL_OUTLET"`) + +* `VIRTUAL_ACCOUNT` (value: `"VIRTUAL_ACCOUNT"`) + +* `XENPLATFORM` (value: `"XENPLATFORM"`) + +* `DIRECT_BANK_TRANSFER` (value: `"DIRECT_BANK_TRANSFER"`) + +* `OTHER` (value: `"OTHER"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/Currency.md b/docs/balance_and_transaction/Currency.md new file mode 100644 index 00000000..0e0e1f29 --- /dev/null +++ b/docs/balance_and_transaction/Currency.md @@ -0,0 +1,333 @@ +# Currency + +## Enum + + +* `IDR` (value: `"IDR"`) + +* `PHP` (value: `"PHP"`) + +* `USD` (value: `"USD"`) + +* `JPY` (value: `"JPY"`) + +* `VND` (value: `"VND"`) + +* `SGD` (value: `"SGD"`) + +* `AED` (value: `"AED"`) + +* `AFN` (value: `"AFN"`) + +* `ALL` (value: `"ALL"`) + +* `AMD` (value: `"AMD"`) + +* `ANG` (value: `"ANG"`) + +* `AOA` (value: `"AOA"`) + +* `ARS` (value: `"ARS"`) + +* `AUD` (value: `"AUD"`) + +* `AWG` (value: `"AWG"`) + +* `AZN` (value: `"AZN"`) + +* `BAM` (value: `"BAM"`) + +* `BBD` (value: `"BBD"`) + +* `BDT` (value: `"BDT"`) + +* `BGN` (value: `"BGN"`) + +* `BHD` (value: `"BHD"`) + +* `BIF` (value: `"BIF"`) + +* `BMD` (value: `"BMD"`) + +* `BND` (value: `"BND"`) + +* `BOB` (value: `"BOB"`) + +* `BRL` (value: `"BRL"`) + +* `BSD` (value: `"BSD"`) + +* `BTN` (value: `"BTN"`) + +* `BWP` (value: `"BWP"`) + +* `BYN` (value: `"BYN"`) + +* `BZD` (value: `"BZD"`) + +* `CAD` (value: `"CAD"`) + +* `CDF` (value: `"CDF"`) + +* `CHF` (value: `"CHF"`) + +* `CLP` (value: `"CLP"`) + +* `CNY` (value: `"CNY"`) + +* `COP` (value: `"COP"`) + +* `CRC` (value: `"CRC"`) + +* `CUC` (value: `"CUC"`) + +* `CUP` (value: `"CUP"`) + +* `CVE` (value: `"CVE"`) + +* `CZK` (value: `"CZK"`) + +* `DJF` (value: `"DJF"`) + +* `DKK` (value: `"DKK"`) + +* `DOP` (value: `"DOP"`) + +* `DZD` (value: `"DZD"`) + +* `EGP` (value: `"EGP"`) + +* `ERN` (value: `"ERN"`) + +* `ETB` (value: `"ETB"`) + +* `EUR` (value: `"EUR"`) + +* `FJD` (value: `"FJD"`) + +* `FKP` (value: `"FKP"`) + +* `GBP` (value: `"GBP"`) + +* `GEL` (value: `"GEL"`) + +* `GGP` (value: `"GGP"`) + +* `GHS` (value: `"GHS"`) + +* `GIP` (value: `"GIP"`) + +* `GMD` (value: `"GMD"`) + +* `GNF` (value: `"GNF"`) + +* `GTQ` (value: `"GTQ"`) + +* `GYD` (value: `"GYD"`) + +* `HKD` (value: `"HKD"`) + +* `HNL` (value: `"HNL"`) + +* `HRK` (value: `"HRK"`) + +* `HTG` (value: `"HTG"`) + +* `HUF` (value: `"HUF"`) + +* `ILS` (value: `"ILS"`) + +* `IMP` (value: `"IMP"`) + +* `INR` (value: `"INR"`) + +* `IQD` (value: `"IQD"`) + +* `IRR` (value: `"IRR"`) + +* `ISK` (value: `"ISK"`) + +* `JEP` (value: `"JEP"`) + +* `JMD` (value: `"JMD"`) + +* `JOD` (value: `"JOD"`) + +* `KES` (value: `"KES"`) + +* `KGS` (value: `"KGS"`) + +* `KHR` (value: `"KHR"`) + +* `KMF` (value: `"KMF"`) + +* `KPW` (value: `"KPW"`) + +* `KRW` (value: `"KRW"`) + +* `KWD` (value: `"KWD"`) + +* `KYD` (value: `"KYD"`) + +* `KZT` (value: `"KZT"`) + +* `LAK` (value: `"LAK"`) + +* `LBP` (value: `"LBP"`) + +* `LKR` (value: `"LKR"`) + +* `LRD` (value: `"LRD"`) + +* `LSL` (value: `"LSL"`) + +* `LYD` (value: `"LYD"`) + +* `MAD` (value: `"MAD"`) + +* `MDL` (value: `"MDL"`) + +* `MGA` (value: `"MGA"`) + +* `MKD` (value: `"MKD"`) + +* `MMK` (value: `"MMK"`) + +* `MNT` (value: `"MNT"`) + +* `MOP` (value: `"MOP"`) + +* `MRU` (value: `"MRU"`) + +* `MUR` (value: `"MUR"`) + +* `MVR` (value: `"MVR"`) + +* `MWK` (value: `"MWK"`) + +* `MXN` (value: `"MXN"`) + +* `MYR` (value: `"MYR"`) + +* `MZN` (value: `"MZN"`) + +* `NAD` (value: `"NAD"`) + +* `NGN` (value: `"NGN"`) + +* `NIO` (value: `"NIO"`) + +* `NOK` (value: `"NOK"`) + +* `NPR` (value: `"NPR"`) + +* `NZD` (value: `"NZD"`) + +* `OMR` (value: `"OMR"`) + +* `PAB` (value: `"PAB"`) + +* `PEN` (value: `"PEN"`) + +* `PGK` (value: `"PGK"`) + +* `PKR` (value: `"PKR"`) + +* `PLN` (value: `"PLN"`) + +* `PYG` (value: `"PYG"`) + +* `QAR` (value: `"QAR"`) + +* `RON` (value: `"RON"`) + +* `RSD` (value: `"RSD"`) + +* `RUB` (value: `"RUB"`) + +* `RWF` (value: `"RWF"`) + +* `SAR` (value: `"SAR"`) + +* `SBD` (value: `"SBD"`) + +* `SCR` (value: `"SCR"`) + +* `SDG` (value: `"SDG"`) + +* `SEK` (value: `"SEK"`) + +* `SHP` (value: `"SHP"`) + +* `SLL` (value: `"SLL"`) + +* `SOS` (value: `"SOS"`) + +* `SPL` (value: `"SPL"`) + +* `SRD` (value: `"SRD"`) + +* `STN` (value: `"STN"`) + +* `SVC` (value: `"SVC"`) + +* `SYP` (value: `"SYP"`) + +* `SZL` (value: `"SZL"`) + +* `THB` (value: `"THB"`) + +* `TJS` (value: `"TJS"`) + +* `TMT` (value: `"TMT"`) + +* `TND` (value: `"TND"`) + +* `TOP` (value: `"TOP"`) + +* `TRY` (value: `"TRY"`) + +* `TTD` (value: `"TTD"`) + +* `TVD` (value: `"TVD"`) + +* `TWD` (value: `"TWD"`) + +* `TZS` (value: `"TZS"`) + +* `UAH` (value: `"UAH"`) + +* `UGX` (value: `"UGX"`) + +* `UYU` (value: `"UYU"`) + +* `UZS` (value: `"UZS"`) + +* `VEF` (value: `"VEF"`) + +* `VUV` (value: `"VUV"`) + +* `WST` (value: `"WST"`) + +* `XAF` (value: `"XAF"`) + +* `XCD` (value: `"XCD"`) + +* `XDR` (value: `"XDR"`) + +* `XOF` (value: `"XOF"`) + +* `XPF` (value: `"XPF"`) + +* `YER` (value: `"YER"`) + +* `ZAR` (value: `"ZAR"`) + +* `ZMW` (value: `"ZMW"`) + +* `ZWD` (value: `"ZWD"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/DateRangeFilter.md b/docs/balance_and_transaction/DateRangeFilter.md new file mode 100644 index 00000000..2840622e --- /dev/null +++ b/docs/balance_and_transaction/DateRangeFilter.md @@ -0,0 +1,82 @@ +# DateRangeFilter + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Gte** | Pointer to **time.Time** | Start time of transaction. If not specified will list all dates. | [optional] | +| **Lte** | Pointer to **time.Time** | End time of transaction. If not specified will list all dates. | [optional] | + +## Methods + +### NewDateRangeFilter + +`func NewDateRangeFilter() *DateRangeFilter` + +NewDateRangeFilter instantiates a new DateRangeFilter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDateRangeFilterWithDefaults + +`func NewDateRangeFilterWithDefaults() *DateRangeFilter` + +NewDateRangeFilterWithDefaults instantiates a new DateRangeFilter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGte + +`func (o *DateRangeFilter) GetGte() time.Time` + +GetGte returns the Gte field if non-nil, zero value otherwise. + +### GetGteOk + +`func (o *DateRangeFilter) GetGteOk() (*time.Time, bool)` + +GetGteOk returns a tuple with the Gte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGte + +`func (o *DateRangeFilter) SetGte(v time.Time)` + +SetGte sets Gte field to given value. + +### HasGte + +`func (o *DateRangeFilter) HasGte() bool` + +HasGte returns a boolean if a field has been set. + +### GetLte + +`func (o *DateRangeFilter) GetLte() time.Time` + +GetLte returns the Lte field if non-nil, zero value otherwise. + +### GetLteOk + +`func (o *DateRangeFilter) GetLteOk() (*time.Time, bool)` + +GetLteOk returns a tuple with the Lte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLte + +`func (o *DateRangeFilter) SetLte(v time.Time)` + +SetLte sets Lte field to given value. + +### HasLte + +`func (o *DateRangeFilter) HasLte() bool` + +HasLte returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/FeeResponse.md b/docs/balance_and_transaction/FeeResponse.md new file mode 100644 index 00000000..73aa0015 --- /dev/null +++ b/docs/balance_and_transaction/FeeResponse.md @@ -0,0 +1,150 @@ +# FeeResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **XenditFee** | **float32** | Amount of the Xendit fee for this transaction. | | +| **ValueAddedTax** | **float32** | Amount of the VAT for this transaction. | | +| **XenditWithholdingTax** | Pointer to **float32** | Amount of the Xendit Withholding Tax for this transaction if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat) for more information. | [optional] | +| **ThirdPartyWithholdingTax** | Pointer to **float32** | Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank | [optional] | +| **Status** | Pointer to **string** | | [optional] | + +## Methods + +### NewFeeResponse + +`func NewFeeResponse(xenditFee float32, valueAddedTax float32, ) *FeeResponse` + +NewFeeResponse instantiates a new FeeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFeeResponseWithDefaults + +`func NewFeeResponseWithDefaults() *FeeResponse` + +NewFeeResponseWithDefaults instantiates a new FeeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetXenditFee + +`func (o *FeeResponse) GetXenditFee() float32` + +GetXenditFee returns the XenditFee field if non-nil, zero value otherwise. + +### GetXenditFeeOk + +`func (o *FeeResponse) GetXenditFeeOk() (*float32, bool)` + +GetXenditFeeOk returns a tuple with the XenditFee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetXenditFee + +`func (o *FeeResponse) SetXenditFee(v float32)` + +SetXenditFee sets XenditFee field to given value. + + +### GetValueAddedTax + +`func (o *FeeResponse) GetValueAddedTax() float32` + +GetValueAddedTax returns the ValueAddedTax field if non-nil, zero value otherwise. + +### GetValueAddedTaxOk + +`func (o *FeeResponse) GetValueAddedTaxOk() (*float32, bool)` + +GetValueAddedTaxOk returns a tuple with the ValueAddedTax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValueAddedTax + +`func (o *FeeResponse) SetValueAddedTax(v float32)` + +SetValueAddedTax sets ValueAddedTax field to given value. + + +### GetXenditWithholdingTax + +`func (o *FeeResponse) GetXenditWithholdingTax() float32` + +GetXenditWithholdingTax returns the XenditWithholdingTax field if non-nil, zero value otherwise. + +### GetXenditWithholdingTaxOk + +`func (o *FeeResponse) GetXenditWithholdingTaxOk() (*float32, bool)` + +GetXenditWithholdingTaxOk returns a tuple with the XenditWithholdingTax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetXenditWithholdingTax + +`func (o *FeeResponse) SetXenditWithholdingTax(v float32)` + +SetXenditWithholdingTax sets XenditWithholdingTax field to given value. + +### HasXenditWithholdingTax + +`func (o *FeeResponse) HasXenditWithholdingTax() bool` + +HasXenditWithholdingTax returns a boolean if a field has been set. + +### GetThirdPartyWithholdingTax + +`func (o *FeeResponse) GetThirdPartyWithholdingTax() float32` + +GetThirdPartyWithholdingTax returns the ThirdPartyWithholdingTax field if non-nil, zero value otherwise. + +### GetThirdPartyWithholdingTaxOk + +`func (o *FeeResponse) GetThirdPartyWithholdingTaxOk() (*float32, bool)` + +GetThirdPartyWithholdingTaxOk returns a tuple with the ThirdPartyWithholdingTax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThirdPartyWithholdingTax + +`func (o *FeeResponse) SetThirdPartyWithholdingTax(v float32)` + +SetThirdPartyWithholdingTax sets ThirdPartyWithholdingTax field to given value. + +### HasThirdPartyWithholdingTax + +`func (o *FeeResponse) HasThirdPartyWithholdingTax() bool` + +HasThirdPartyWithholdingTax returns a boolean if a field has been set. + +### GetStatus + +`func (o *FeeResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *FeeResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *FeeResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *FeeResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/LinkItem.md b/docs/balance_and_transaction/LinkItem.md new file mode 100644 index 00000000..3371b626 --- /dev/null +++ b/docs/balance_and_transaction/LinkItem.md @@ -0,0 +1,93 @@ +# LinkItem + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Href** | **string** | URI of target, this will be to the next link. | | +| **Rel** | **string** | The relationship between source and target. The value will be `next`. | | +| **Method** | **string** | The HTTP method, the value will be `GET`. | | + +## Methods + +### NewLinkItem + +`func NewLinkItem(href string, rel string, method string, ) *LinkItem` + +NewLinkItem instantiates a new LinkItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLinkItemWithDefaults + +`func NewLinkItemWithDefaults() *LinkItem` + +NewLinkItemWithDefaults instantiates a new LinkItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *LinkItem) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *LinkItem) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *LinkItem) SetHref(v string)` + +SetHref sets Href field to given value. + + +### GetRel + +`func (o *LinkItem) GetRel() string` + +GetRel returns the Rel field if non-nil, zero value otherwise. + +### GetRelOk + +`func (o *LinkItem) GetRelOk() (*string, bool)` + +GetRelOk returns a tuple with the Rel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRel + +`func (o *LinkItem) SetRel(v string)` + +SetRel sets Rel field to given value. + + +### GetMethod + +`func (o *LinkItem) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *LinkItem) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *LinkItem) SetMethod(v string)` + +SetMethod sets Method field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/ServerError.md b/docs/balance_and_transaction/ServerError.md new file mode 100644 index 00000000..dcd048c7 --- /dev/null +++ b/docs/balance_and_transaction/ServerError.md @@ -0,0 +1,93 @@ +# ServerError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **StatusCode** | **float32** | | | +| **Error** | **string** | | | +| **Message** | **string** | | | + +## Methods + +### NewServerError + +`func NewServerError(statusCode float32, error_ string, message string, ) *ServerError` + +NewServerError instantiates a new ServerError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServerErrorWithDefaults + +`func NewServerErrorWithDefaults() *ServerError` + +NewServerErrorWithDefaults instantiates a new ServerError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatusCode + +`func (o *ServerError) GetStatusCode() float32` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *ServerError) GetStatusCodeOk() (*float32, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *ServerError) SetStatusCode(v float32)` + +SetStatusCode sets StatusCode field to given value. + + +### GetError + +`func (o *ServerError) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ServerError) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ServerError) SetError(v string)` + +SetError sets Error field to given value. + + +### GetMessage + +`func (o *ServerError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ServerError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ServerError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/TransactionResponse.md b/docs/balance_and_transaction/TransactionResponse.md new file mode 100644 index 00000000..31d739e4 --- /dev/null +++ b/docs/balance_and_transaction/TransactionResponse.md @@ -0,0 +1,437 @@ +# TransactionResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | The unique id of a transaction. It will have `txn_` as prefix | | +| **ProductId** | **string** | The product_id of the transaction. Product id will have a different prefix for each product. You can use this id to match the transaction from this API to each product API. | | +| **Type** | [**TransactionResponseType**](TransactionResponseType.md) | | | +| **Status** | [**TransactionStatuses**](TransactionStatuses.md) | | | +| **ChannelCategory** | [**ChannelsCategories**](ChannelsCategories.md) | | | +| **ChannelCode** | **NullableString** | The channel of the transaction that is used. See [channel codes](https://docs.xendit.co/xendisburse/channel-codes) for the list of available per channel categories. | | +| **AccountIdentifier** | **NullableString** | Account identifier of transaction. The format will be different from each channel. | | +| **ReferenceId** | **string** | customer supplied reference/external_id | | +| **Currency** | [**Currency**](Currency.md) | | | +| **Amount** | **float32** | The transaction amount. The number of decimal places will be different for each currency according to ISO 4217. | | +| **Cashflow** | **string** | Representing whether the transaction is money in or money out For transfer, the transfer out side it will shows up as money out and on transfer in side in will shows up as money-in. Available values are `MONEY_IN` for money in and `MONEY_OUT` for money out. | | +| **SettlementStatus** | Pointer to **NullableString** | The settlement status of the transaction. `PENDING` - Transaction amount has not been settled to merchant's balance. `SETTLED` - Transaction has been settled to merchant's balance | [optional] | +| **EstimatedSettlementTime** | Pointer to **NullableTime** | Estimated settlement time will only apply to money-in transactions. For money-out transaction, the value will be `NULL`. Estimated settlement time in which transaction amount will be settled to merchant's balance. | [optional] | +| **BusinessId** | **string** | The id of business where this transaction belong to | | +| **Fee** | [**FeeResponse**](FeeResponse.md) | | | +| **Created** | **time.Time** | Transaction created timestamp (UTC+0) | | +| **Updated** | **time.Time** | Transaction updated timestamp (UTC+0) | | + +## Methods + +### NewTransactionResponse + +`func NewTransactionResponse(id string, productId string, type_ TransactionResponseType, status TransactionStatuses, channelCategory ChannelsCategories, channelCode NullableString, accountIdentifier NullableString, referenceId string, currency Currency, amount float32, cashflow string, businessId string, fee FeeResponse, created time.Time, updated time.Time, ) *TransactionResponse` + +NewTransactionResponse instantiates a new TransactionResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionResponseWithDefaults + +`func NewTransactionResponseWithDefaults() *TransactionResponse` + +NewTransactionResponseWithDefaults instantiates a new TransactionResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *TransactionResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TransactionResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TransactionResponse) SetId(v string)` + +SetId sets Id field to given value. + + +### GetProductId + +`func (o *TransactionResponse) GetProductId() string` + +GetProductId returns the ProductId field if non-nil, zero value otherwise. + +### GetProductIdOk + +`func (o *TransactionResponse) GetProductIdOk() (*string, bool)` + +GetProductIdOk returns a tuple with the ProductId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProductId + +`func (o *TransactionResponse) SetProductId(v string)` + +SetProductId sets ProductId field to given value. + + +### GetType + +`func (o *TransactionResponse) GetType() TransactionResponseType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *TransactionResponse) GetTypeOk() (*TransactionResponseType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *TransactionResponse) SetType(v TransactionResponseType)` + +SetType sets Type field to given value. + + +### GetStatus + +`func (o *TransactionResponse) GetStatus() TransactionStatuses` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *TransactionResponse) GetStatusOk() (*TransactionStatuses, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *TransactionResponse) SetStatus(v TransactionStatuses)` + +SetStatus sets Status field to given value. + + +### GetChannelCategory + +`func (o *TransactionResponse) GetChannelCategory() ChannelsCategories` + +GetChannelCategory returns the ChannelCategory field if non-nil, zero value otherwise. + +### GetChannelCategoryOk + +`func (o *TransactionResponse) GetChannelCategoryOk() (*ChannelsCategories, bool)` + +GetChannelCategoryOk returns a tuple with the ChannelCategory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCategory + +`func (o *TransactionResponse) SetChannelCategory(v ChannelsCategories)` + +SetChannelCategory sets ChannelCategory field to given value. + + +### GetChannelCode + +`func (o *TransactionResponse) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *TransactionResponse) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *TransactionResponse) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### SetChannelCodeNil + +`func (o *TransactionResponse) SetChannelCodeNil(b bool)` + + SetChannelCodeNil sets the value for ChannelCode to be an explicit nil + +### UnsetChannelCode +`func (o *TransactionResponse) UnsetChannelCode()` + +UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +### GetAccountIdentifier + +`func (o *TransactionResponse) GetAccountIdentifier() string` + +GetAccountIdentifier returns the AccountIdentifier field if non-nil, zero value otherwise. + +### GetAccountIdentifierOk + +`func (o *TransactionResponse) GetAccountIdentifierOk() (*string, bool)` + +GetAccountIdentifierOk returns a tuple with the AccountIdentifier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountIdentifier + +`func (o *TransactionResponse) SetAccountIdentifier(v string)` + +SetAccountIdentifier sets AccountIdentifier field to given value. + + +### SetAccountIdentifierNil + +`func (o *TransactionResponse) SetAccountIdentifierNil(b bool)` + + SetAccountIdentifierNil sets the value for AccountIdentifier to be an explicit nil + +### UnsetAccountIdentifier +`func (o *TransactionResponse) UnsetAccountIdentifier()` + +UnsetAccountIdentifier ensures that no value is present for AccountIdentifier, not even an explicit nil +### GetReferenceId + +`func (o *TransactionResponse) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *TransactionResponse) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *TransactionResponse) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetCurrency + +`func (o *TransactionResponse) GetCurrency() Currency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *TransactionResponse) GetCurrencyOk() (*Currency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *TransactionResponse) SetCurrency(v Currency)` + +SetCurrency sets Currency field to given value. + + +### GetAmount + +`func (o *TransactionResponse) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *TransactionResponse) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *TransactionResponse) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetCashflow + +`func (o *TransactionResponse) GetCashflow() string` + +GetCashflow returns the Cashflow field if non-nil, zero value otherwise. + +### GetCashflowOk + +`func (o *TransactionResponse) GetCashflowOk() (*string, bool)` + +GetCashflowOk returns a tuple with the Cashflow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCashflow + +`func (o *TransactionResponse) SetCashflow(v string)` + +SetCashflow sets Cashflow field to given value. + + +### GetSettlementStatus + +`func (o *TransactionResponse) GetSettlementStatus() string` + +GetSettlementStatus returns the SettlementStatus field if non-nil, zero value otherwise. + +### GetSettlementStatusOk + +`func (o *TransactionResponse) GetSettlementStatusOk() (*string, bool)` + +GetSettlementStatusOk returns a tuple with the SettlementStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSettlementStatus + +`func (o *TransactionResponse) SetSettlementStatus(v string)` + +SetSettlementStatus sets SettlementStatus field to given value. + +### HasSettlementStatus + +`func (o *TransactionResponse) HasSettlementStatus() bool` + +HasSettlementStatus returns a boolean if a field has been set. + +### SetSettlementStatusNil + +`func (o *TransactionResponse) SetSettlementStatusNil(b bool)` + + SetSettlementStatusNil sets the value for SettlementStatus to be an explicit nil + +### UnsetSettlementStatus +`func (o *TransactionResponse) UnsetSettlementStatus()` + +UnsetSettlementStatus ensures that no value is present for SettlementStatus, not even an explicit nil +### GetEstimatedSettlementTime + +`func (o *TransactionResponse) GetEstimatedSettlementTime() time.Time` + +GetEstimatedSettlementTime returns the EstimatedSettlementTime field if non-nil, zero value otherwise. + +### GetEstimatedSettlementTimeOk + +`func (o *TransactionResponse) GetEstimatedSettlementTimeOk() (*time.Time, bool)` + +GetEstimatedSettlementTimeOk returns a tuple with the EstimatedSettlementTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEstimatedSettlementTime + +`func (o *TransactionResponse) SetEstimatedSettlementTime(v time.Time)` + +SetEstimatedSettlementTime sets EstimatedSettlementTime field to given value. + +### HasEstimatedSettlementTime + +`func (o *TransactionResponse) HasEstimatedSettlementTime() bool` + +HasEstimatedSettlementTime returns a boolean if a field has been set. + +### SetEstimatedSettlementTimeNil + +`func (o *TransactionResponse) SetEstimatedSettlementTimeNil(b bool)` + + SetEstimatedSettlementTimeNil sets the value for EstimatedSettlementTime to be an explicit nil + +### UnsetEstimatedSettlementTime +`func (o *TransactionResponse) UnsetEstimatedSettlementTime()` + +UnsetEstimatedSettlementTime ensures that no value is present for EstimatedSettlementTime, not even an explicit nil +### GetBusinessId + +`func (o *TransactionResponse) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *TransactionResponse) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *TransactionResponse) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetFee + +`func (o *TransactionResponse) GetFee() FeeResponse` + +GetFee returns the Fee field if non-nil, zero value otherwise. + +### GetFeeOk + +`func (o *TransactionResponse) GetFeeOk() (*FeeResponse, bool)` + +GetFeeOk returns a tuple with the Fee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFee + +`func (o *TransactionResponse) SetFee(v FeeResponse)` + +SetFee sets Fee field to given value. + + +### GetCreated + +`func (o *TransactionResponse) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *TransactionResponse) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *TransactionResponse) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *TransactionResponse) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *TransactionResponse) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *TransactionResponse) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/TransactionResponseType.md b/docs/balance_and_transaction/TransactionResponseType.md new file mode 100644 index 00000000..2d43a9f9 --- /dev/null +++ b/docs/balance_and_transaction/TransactionResponseType.md @@ -0,0 +1,30 @@ +# TransactionResponseType + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | + +## Methods + +### NewTransactionResponseType + +`func NewTransactionResponseType() *TransactionResponseType` + +NewTransactionResponseType instantiates a new TransactionResponseType object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionResponseTypeWithDefaults + +`func NewTransactionResponseTypeWithDefaults() *TransactionResponseType` + +NewTransactionResponseTypeWithDefaults instantiates a new TransactionResponseType object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/TransactionStatuses.md b/docs/balance_and_transaction/TransactionStatuses.md new file mode 100644 index 00000000..bf6c50a1 --- /dev/null +++ b/docs/balance_and_transaction/TransactionStatuses.md @@ -0,0 +1,19 @@ +# TransactionStatuses + +## Enum + + +* `SUCCESS` (value: `"SUCCESS"`) + +* `PENDING` (value: `"PENDING"`) + +* `FAILED` (value: `"FAILED"`) + +* `REVERSED` (value: `"REVERSED"`) + +* `VOIDED` (value: `"VOIDED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/TransactionTypes.md b/docs/balance_and_transaction/TransactionTypes.md new file mode 100644 index 00000000..f97825b3 --- /dev/null +++ b/docs/balance_and_transaction/TransactionTypes.md @@ -0,0 +1,35 @@ +# TransactionTypes + +## Enum + + +* `BATCH_DISBURSEMENT` (value: `"BATCH_DISBURSEMENT"`) + +* `DISBURSEMENT` (value: `"DISBURSEMENT"`) + +* `PAYMENT` (value: `"PAYMENT"`) + +* `REMITTANCE` (value: `"REMITTANCE"`) + +* `REMITTANCE_PAYOUT` (value: `"REMITTANCE_PAYOUT"`) + +* `REMITTANCE_COLLECTION` (value: `"REMITTANCE_COLLECTION"`) + +* `TRANSFER` (value: `"TRANSFER"`) + +* `PLATFORM_FEE` (value: `"PLATFORM_FEE"`) + +* `REFUND` (value: `"REFUND"`) + +* `CASHBACK` (value: `"CASHBACK"`) + +* `TOPUP` (value: `"TOPUP"`) + +* `WITHDRAWAL` (value: `"WITHDRAWAL"`) + +* `OTHER` (value: `"OTHER"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/TransactionsResponse.md b/docs/balance_and_transaction/TransactionsResponse.md new file mode 100644 index 00000000..15871049 --- /dev/null +++ b/docs/balance_and_transaction/TransactionsResponse.md @@ -0,0 +1,98 @@ +# TransactionsResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **HasMore** | **bool** | Indicates whether there are more items to be queried with `after_id` of the last item from the current result. Use the `links` to follow to the next result. | | +| **Links** | Pointer to [**LinkItem[]**](LinkItem.md) | The links to the next page based on LinkItem if there is next result. | [optional] | +| **Data** | [**TransactionResponse[]**](TransactionResponse.md) | | | + +## Methods + +### NewTransactionsResponse + +`func NewTransactionsResponse(hasMore bool, data []TransactionResponse, ) *TransactionsResponse` + +NewTransactionsResponse instantiates a new TransactionsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransactionsResponseWithDefaults + +`func NewTransactionsResponseWithDefaults() *TransactionsResponse` + +NewTransactionsResponseWithDefaults instantiates a new TransactionsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHasMore + +`func (o *TransactionsResponse) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *TransactionsResponse) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *TransactionsResponse) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + + +### GetLinks + +`func (o *TransactionsResponse) GetLinks() []LinkItem` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *TransactionsResponse) GetLinksOk() (*[]LinkItem, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *TransactionsResponse) SetLinks(v []LinkItem)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *TransactionsResponse) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + +### GetData + +`func (o *TransactionsResponse) GetData() []TransactionResponse` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *TransactionsResponse) GetDataOk() (*[]TransactionResponse, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *TransactionsResponse) SetData(v []TransactionResponse)` + +SetData sets Data field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/balance_and_transaction/ValidationError.md b/docs/balance_and_transaction/ValidationError.md new file mode 100644 index 00000000..e2e4d06b --- /dev/null +++ b/docs/balance_and_transaction/ValidationError.md @@ -0,0 +1,129 @@ +# ValidationError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **StatusCode** | **float32** | | | +| **Error** | **string** | | | +| **Message** | **string** | | | +| **Validation** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewValidationError + +`func NewValidationError(statusCode float32, error_ string, message string, ) *ValidationError` + +NewValidationError instantiates a new ValidationError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewValidationErrorWithDefaults + +`func NewValidationErrorWithDefaults() *ValidationError` + +NewValidationErrorWithDefaults instantiates a new ValidationError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatusCode + +`func (o *ValidationError) GetStatusCode() float32` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *ValidationError) GetStatusCodeOk() (*float32, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *ValidationError) SetStatusCode(v float32)` + +SetStatusCode sets StatusCode field to given value. + + +### GetError + +`func (o *ValidationError) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *ValidationError) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *ValidationError) SetError(v string)` + +SetError sets Error field to given value. + + +### GetMessage + +`func (o *ValidationError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ValidationError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ValidationError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetValidation + +`func (o *ValidationError) GetValidation() map[string]interface{}` + +GetValidation returns the Validation field if non-nil, zero value otherwise. + +### GetValidationOk + +`func (o *ValidationError) GetValidationOk() (*map[string]interface{}, bool)` + +GetValidationOk returns a tuple with the Validation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValidation + +`func (o *ValidationError) SetValidation(v map[string]interface{})` + +SetValidation sets Validation field to given value. + +### HasValidation + +`func (o *ValidationError) HasValidation() bool` + +HasValidation returns a boolean if a field has been set. + +### SetValidationNil + +`func (o *ValidationError) SetValidationNil(b bool)` + + SetValidationNil sets the value for Validation to be an explicit nil + +### UnsetValidation +`func (o *ValidationError) UnsetValidation()` + +UnsetValidation ensures that no value is present for Validation, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/header.jpg b/docs/header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4252b5afc067084ce8e81134c970ce5717e5e436 GIT binary patch literal 112861 zcmeFY1yEbv*EdSN1u8&sD_*=ngBEy-J4KS<6cQ{!iaR`|K+&MVr8p!62oPMJ;_d{8 z;_ePDy*%%ockcb>Ki|y#UYWVyH_tkmWcE4xthMvod#|(iZ>{rt^7jvd7b*(M3IuoV z+#yi9JqUi!5Xk;r`cKKXd0)nFND<`Pg^l+nNtn9)vS|BqHZP%|gLgGMc z&(8^k>$j>IZjJt%>Ho*}<0lUv-G4xM@83*2kr3Rue{1^Q-Mi18kv}B9|A^qWaBG|7 z5$R(xrk4WD@1KxUP_c+;fxu?2NZbe|wV<$!qub}a{K}4TJgbnXf}*xA&^`ETOk8|I z7Pjj9=-69;PVDdj8@sGI#L3wupk?teC_AUTLeA2vdadC1Gy(Cw+cuHhBO#C`h&mw=75;_V~Tl0d@;7ws8(X$HTo$#;dzoz2={t0hx4dkKfbk zgC0rX47y7+Hc&F>%;$hujfvWZS_~+=D6sKY1Nc(wSNG%s^kK&3sgICv>~8{_#y@Vj zk|$Q~jW=VYr*^F_px)OWrAIl}aoDD=M}z3a)Sbj@^{q#Tx_*C18eWb5%E0>vD>he$ z{U+d&u9cwO`P1jBiMpxVzjFSYKe^&Rdj9{2kJ@(WSyk1juxm6zo4w8S0D1?vg-YcpsHXRo36YhNgG&e#7 zA^3)s>wiW$bWGY((>xJx=Z~)D`YY~In@7V-;pPo}xYm>_Hwk|7pc+f6K8u^P1e|#@ zm^viy;Ft8drjD+s)>z4uu;&$xT1IIrTA5Un|FH@7ztvrImJ3k0W|4tisWOrph^|Nw zv7r>@MBpiS`%(j5c659)N@g$M6H2q98u0NESQ3~kl{VBFKQqo>1{tK_?+Ik$Xn`by znBY$RuD&*>gGjKv{w#MR$$SHS1|>BgTp+aduNB)%BP22OneHkr@3j^%vL~Y&YLzgW1h;Mz}0S42)q|uIJ$zft^oP|Yy|&rg?}=f&pkO} zD)fuA$?X2)x%Xb+<%=rw zE5epc`FXGML+6rV4#UZ!GM?%8Y<6E0%G%V?mLI3Z`qD^vP@3j2N5a+%+vEInxk+*T zx*z9u_G4uxZHA#|+*M#jQ|?HYh)c7tP54qWt*$>NWVz|Wu=Twagq@a;*`jD?TzxE; z|LoenwAN?yE|bKn6vOlK>}d8a8;yZt7GdRFk_dS@Z|}tzdg54tA<3t&r=6I&Y!cn5 z`xFF_Hgf?hmkzJSIjr5!lG^u<5;)v#BGlIF|C(zOV~BMW2o#y zboZ9r!cKq57wfW>}*Vl(@}-to!*oP zEy^e_rqfPK$3OnJnza9s#@>6ezuzUidzmx&o8Y_iJ&^0*CL5lAM}Lg*RF%(CQsU~P zbu*eCaxh1FGxxOVwMm9QnxXMG!TrKx7lT^vf3bL%w2{R>R5Qc>+so%AbLIrO!q}f_ z@WCOksOtbxFX(3T$iB=k`K^UNH;}xz8!tE0`pc*mVGSQ4*>C@%>;JeD#InuJuV$*( zq9DHs9`rrcpODT?)N96CeefUWsZBcB-~60?Q|ubm>Y{q>B7BkM<#|)=b^enyr+*l> zQv5GyJXSf0ykV2_y!rEkRK07+-RSAgBgazd_gm6?j~6%N@_!SkHWHmuqW$h=>sC!% zZch2_uSq|i5 z&VLwwg~dxh9p>L1npq0kT))C@FC3^uiO8d4%l>aP#s_SiY%-r+wBu@N_A>TAa+k7v z41ca{BN*u*9IoCmb4RA2RkB<(Dv8aBeib!LoOb$IRQdeFr;MR^E0YYj;m2Pa-5{KX zk3xDZOLEbgB#6fNs%QYCAifiyFuO@aw+1*W))HfZXS6wA$UAF!YRIdM7*~VRB#Qv` zFYuuzC_HOi*Q8#l6AO}d_BTObVOU`riupRkxB1us?YLbr0n3vOK#BmY&(D%}IcUim zMI^%^4CDaT7(C`&Egdb}I%aAxB>P5b<~YyxNxO1`{cnO7;Q)DEV6ogKm!tp=_wi8l zCVltQwmxw?A+=rR#~yR6&Z1*gap!~L&K@za?;VEYobUptY(_r&cLGgO-E^1LDiJ&gU?pZ+HVu5EZ__)KuBs&Tw+!=@OjL% zDR@5}@+vo-$ZmxD9M$^uiCIGc$?@Sv;~BJ-CuvJTkICqDrDQO@&*JR68S2Lcf$F33 zalE;mtj>ybLtWkG$jDeuh%*$Sv;q?sWAO&|doxV1q^zNE{kpn9c^2-JHL*T#UaQg;o<2xoWAGGOJ;6zY zd${Dj>)y zg-t7@KCRITf+}T`&8xuH5jW_Sqoq3-PybnNI)3Y>6%XcW`krOT(#@?`JIcXgiwnQ+ zIHtuT8Il&_v?u<)i9#9rEXRt_OyqHKKsuT=i)c{l5&z#q_RbTNnC7;ELFpmFM-%o~ z0&QBo8x6qvhNR-J?{t!aE(@FPS$^544u83*BuxJ%kd)w```Nij%OORbHS~X+1NfIe z^pI&`A=+-{SP}c1AYkob@pk5jYO(2LMWOUof>EEB`^jI!{vh$r#X7cMb+kSo8sGgU z07-h^JkeU)z&U~bhIbjLo0^N-My0%FPR8q7AaqBRS$pFOQ7A?>W}AGOl}@pWfcTp3 z$TSG`z#m~f(gqB7X4bVJfC`?JgiHypD-ol;{)y6EgTW|Tn|e;g=*_+%_qOYor;a)K zjO7CG$A-4!VrWCKRxF?H!REgqL;2rmD?)7dTP!Pe|+Ltc`Wi~it8dRP(39>#UPH2df9nA z0yL$-!|R-uc?aQba)xHWqZv9Sw6B7k`3;W^l3_mvNt@56BYq8nyz7rZXikRZC~=iq z*=d)^C|I$A?ZegB$eGj<4KD1tByEZ79yECz%0U)0c~<9V9`*7!!TXESL$*=BFqhv1 zR;}xT2PSi8>JR}0{$$oC0-IO?;YL&|WXN(5F@%SHmw%UGkrvb*X&FYn)Y0y>tX;lt z%)2??UTcM|=G66}GICSNiwHJxs}qmu1hwh(npBK8cZ1V9&N@x__BzE7Wfx|^7%{42 zc73K2S9!;49dA%AOq` zb&PgHvXAQmBzZ^|3LNP#=1tXR)#`mW+E<~<7cl)!Vzd6~^^{7Y;G}BxjylW|=<7}O zo4~qkHCCTm+vD9D%c^s(-eN7C8n_mVjZgq&LQHLHMSVZJ%%^^ZXgcgE+PM}O^9)g)04D9Go_g+`;31)s7QT~^%GgLC@wYs&OW^p{O=k++BdP(71Z9dC%c`CbOhkgLJTC~7;~ zMkKgcU&`@ju2}8-(w(kTub7^9K0B^U;5I}5Ib@m;gFiae4kFK#He8JuX&R4sOXU9i zA>WhX-GaAbgr|8bI~E?yogq8+rQy@q7_-;%iriL=ygS=498(d0rnJQq$@EC2oSNSR z>?;YGjIh4WiCBeVggztW4m8m1Z#NKFsW7-OysCeQv#HwoXQU_Y-9Qc^<1&edHvYwl{EsK@8J~;1cDae{M9p%<`C*%`-p{jzu@0)Nv74F-B(Po2&e_3Y zwG>|PotK{KpAWmYU&j5lxi#9+&Z5&8YhgdEJQ;=?vEm>qf144%=Y39Q=D7QXCd!$$ zZ)JWfsiU?z1?t4AJ!rFQ8gMpJY6bzyCHBg%tWB%_;To}4uP{odv^nF2$m%(#VS(<+ zMNi;7Eyb9|+A5#MS@mu8G_?A)>8h*!C5p=iQ}wbA)DPb8C#dF+6{?$$wSKEkYx>t1 z(3!awt6!hlRhw2|yBiRnWB{;mVn%1h)V`jY#VE5bH$tn3S_bacQ?qwsp+`E*fWa@6 zPkk(O-8YiT_3W<61f)2yFv(fx>3MJUy)P%OjZCVB@06rxd_?i8R*z}l2)Vz_Y|!Ll z)uBr^z-7A;5wG66xjWU?6Vx*=X73t(AUfjy&cP!V$JPDtRFh_0S2s8zr%;Oh%CUt{ z_K}|nxgY5AX%e2|1?3|5DzUw~r>}d2f^~y5}vh*$OV`ldES)3>d zY>Lsywl2<S4ysh1GtV0!CR79rq1gotY!T z&c_e@a^2mLjkvv*)kf4e*$f*D`*${*XT@CAfoFhf?YxpJO;t+v=hItlhhT=WL1sp6wpa=5U`1D{)h)8mu66^;rI+JY98R8+uo&Bz#HvBA|5mU{ zjK!TWeEJOMVFDi3(kzyc4f!9Z+kZ*vj;({j^^tMU^U+<;pAsL**^ZQMmqL>K*PpR| zWZ%>s2u+Wr7SC15uM>vR88M}2K||6)q|%*2EHEDgf8NB0W{_+19i2D73CN{0d?9

n<@6ZK(Bv!J)v!t<+iSPd zqav1MRq&ee>SrDGow#ahp@tDRtIh=ji&@*%gVG5UYC?EXpUP&&FoYqkj##O@&s;o1egw@pn zT0y*jl(9u5clu=b z1!2s+nhU}X$Lx}F4N&TQf7rziq|jmIBer!d?~NaT`gG?tC-p*$I|eRIAuKV?Fn8hC z$#cwumg7Yk#R%bJ)^f2vh+$7QKU*qx8O-ymMlpg5pbC4U^Ri zUKlf~l&&cFbay%SU79)aYmg7bvFbGLOHz!_m)RM%XA;(ipCuAiNyR%X3@m%54P}~u zhDCuTNP2~BOPMW+ z=vrdxGUqf;I}97=eT%Y9B+%Q7MPg7@Me1_||b=j1j<3*PqS{wyx(k0v|&!T8;q-!{(ooGm0;^oeu@lMQ<;nS3MThXmcTi&Zn9^ZU- zS<8y+qy|5j7){|6QwHEd2%H=efb0n5fskrwscgQK$}7UVfB)?8!Sj}!aReg1XCCt z-BCY@kCHW*xm(CLJ9a9^O}x^XN1^sN0r$>CB(7+BPeWVWEerZd3`o<3!8Q(hmtc#N z?Q906p4x|3JhdtCOmBaR#pdY%t?M3Eu7JKZ&gI6w4~vDPTF~Gcm4OCzsxf4=?(XDk z-O1dXij~3_J?1k?g?1jdj*5wUMC2m=a{cPgA6L8hSA?=~#_o=WUyllZ6V$ML&DTi% z#dpF#W`enR7OFjCx?W&$-JJB31-jn)R{VeNJ^#LP5A4b0H$`j&Yh=nXPgCE|P+Bkp zXrMn1zP4B_rcj;~pLsb+G8jOe5SNT?X^~CtG=Kaq=5(1+6tc?stO4q}%rTr!$%q(V zJ+tfeNMuqZi(L}odrptA16v$nh4p z3}Zlro(K?@zyCs^%PjcybR%@QZc0ed1d?rkG$U-pGvwKh@gz zSH7jvUv2N^HYqc%7v%jW_$18V;_?KusCr{HE469f>@*E<9s%48)je7>SG-t*+G)nL zpVVzpZVgob;Id>~DmWf2_WhoD5ZLbiAR-1@w#qm{KL@lEqE$*AM$#sX2bT(ef#6o` zNBWte##mUYa2(#?F8QgkN)L}*$d)M&|EEYOBRz0PMv~ncJID(o3x zTIBcx(9YvndxZlk*d)wCZ8?-Td z1TFD6s-4w|J$Z%0R#3x|ZGrx6nOumw({nm80Wu~XK47q(sfhwQkf{J1BdlGEw653O4Gg}#*n2&-}y{}8)K9g7%j=GH$ zR8e1?r<5+QhS4Ph9zZ@IX99XoF69geZNaY(_CjqS*}589rM2d-Nw$9zq%tPYpPB~X zaYhZyT#4_uE{iwn_VaFrOLVzk3=?yyySTzgK*Pn_KGW=s*6_&$>+~)4IHUDeip|{e z^vRxupg71u#b;H&=V!KO-Am!1uGOPNd%fP?hLwFmRiU~kytCtHw9b-cO^O0V>s{+u zQIkPA4G$S#*Itsy_7i_0P^9>QynM>8N>3NWHX@j~gYWUo8X#oVl(!IJqEkPS>8UvE zDgXCF;lEApgt(ut(7OE`-tqrY`x!01eiFM)dB(H#{3G3F&TjEvMvyRsY`RCuwB6nJ5u_jhOx>5*f5q}O;c5X%P;Os0P(IX8`9#BH- z#;ZnjXYx~QlmD6$o_h|RkF_C*X!&+E`4cM{@h&j#IQ>YeWQpe@YY^W)g3+Gm2aefT zt(J5MToSikbXp|4O_(2DOLIDTc)`xIB|qlfMRBnhZ9hCXd|Gp5C8H{&%mZ@rv?&B^ zp`vvyGA&#LocE$;xD8VSS4obgce9;^wvzTBP7^u@Ya_{X))(S$J70Us6Garp(vrq# z;#zbo&k%9Og0CHFBhxDxo2nM5E~-^}|3>>jo=y?5ca*ALUxfPeQCpcTIke^4V|(#t&;GKCzUyIY^My$T5((XQ$!T{9I_*b>YUJvMyH zAJ;sUt#FB#r+kf?Yf&zla~YF&p-@9*mvbeu0@<{sh~>#X1Pi=WTkX~`TFLKlO#9)v z3t1qWVs&tFQdnyeqgsvJ@qr=WlWQokQg{r*gn*WomZ+{SM|}!H5zr4$S^GO`#3e>f zE^6XSPA*AKzu7sxp3brcF+gOEx$a&+d2WCnJRI~sZ1s`v#YP~)ofGO7ygpdk9RzA6 zQ;T`1+Bdh?eXG=dMp%p@>v^LThN>ldJ9NO?WJ~4$Qc?(En_&KnZZ&P7KBn**%qOUF zX-lC(bEHg`i^POwsMlPV_h5Fz#0Pv3ks<5s8Qb>Hf|^on5f)z2nkwSSG)K9Pa%i$++Dyg1Crc?^?haT7&LY&1=>!Y zB_U>)r6lp@3x8uF2+4PN`AP3xaQYqMyT8u0wfQh}fH+pV2-<*l5=5Uio?uLh3C zReT>IVCPP*k~3X-d7#2sb~XoB_*obfmIuzSCy?vI zWC;9ceb(xKb6_l~XlbHvwZCo&eIJ{cPz8-%s|g_r$q&msA%`czD>+r#?%O^-veb#RKn^QbzpZ@n!P;QpCxYb>PZ{QFuoExGg%&70oNnDM^iJg zR?OJMYQPj)w-H46X|keqNBJH_U>tM5c&}ME>yZE}vL8-M0|E57V){LD8pjQo3f zOro{L<9ZQ!rk7d~aco_2T@#xmx&t{Pg|AkMUZ*q$E9(w;^9*}^E;!}CV`@1fRCzq< zIkzh1RpQNFWQC1YR%KGL>~vuCVppb%)vYBK!o_wnW6fhl>ezP-2E28;dqXA#MwcBF z(l=jrO(?!qSqD^c4bn6b0p{1lFey)1BL^VKvr&-gv>nR=nSUE7|BGJ_FI@J%EUB;i z%WdtM{-uOboualfK^Z3*S#l|j*oT!k$(cJUjqBLr{08c}W#9Q+V@1V?+q()kb2Zp0 zIzAtgd!v&WGH0f}q@zpv<}2f%PLrxsFi-cjgW^cEqqT4^J*y|N4vXu?$1jN{B?;(q zP7FqYuV>TFj)SG*{nvT8%8s95Iff_DeLZ*9@BM(&`&}Zkm=cU*4|0Jujm;B8ZFI4C zJgaAloO^V!wX9&waOgxaVLJDTr$SmAF5nzrreLV~GPd_!UX9(`+EgJ&GrPDfGIn`` zvzkYv`qpDp zG5O8`pmAr{Tc_{WkGLy*+Ls7%9>dE(wJ!;X89r^Exlz{;7qC6{ zaXD9X_iOF6>MSfVh`X2gbUj$?TLv{PkB}_4)}iXlVz8i6E+pk*1%fPv<)om( z!rq6n#BwseEcS8gI9FtK0`$e+I(GQvnHWjGw^4ctJcj(XQb?gkoZ41eD6?##>q{=> z{A4F*RMv4obRd&s9MzhXigtY7fO^_81N9+ewHOw+=NwZw1{NF8RlpUdq0<_e0VE_q zpf8D}?$2y46f-jlb-RIc=R!AZh!&mnHjxw^@;q52>DOjCZPMy4_&6uMO&_N_u_-|KCx$29h`C3cg#<@rGo_ha>4 zb>80}(|3($R$`7J&PMZOmC22&3qm-waJZ9<4JJr*&85S0?Z2#b6$)`H8N#}ANR%IjLu~R`Jxn8h- zrsdSIPHbwahOjdQ9w)xOyhi*`W3P0$j;e2GEH@=@Zj^7Tcrn3^BjGneau0bi$SC|( zjPdHKz4}p;jrkr%kwyN{AVKeBztyOg3wd-sm+G;xZtD#GOUuR4RB7Bh^=PCIdmH~b zJDk&ajPIqoVZ(x2O^Mhu8b>4w?Cd2)&l)VzNbtj3y)` z<+9<5?9*4PHtBOfaHTajEF`UugY%5KUhW~|I#r9Rn$F(H$cFew8NVl!U<;HAXWGXL zpOoYeJ+{1Lo&H7uc(l*RT>JiHaAT1<0z$7y8LcNR*W;PSrs5I(1Xn2ug z^~YH+FOhYn0|yab?BIqs=~GJ2qPZn4K?`H0)3jW9z5e!O=!eYGcZa^Db%i{#lA-?O zye#lv6x+ec6TBAASCu39diCLnL3nj0sYRLFJVI~ABD%Ie1DOk1>0B|pdQdaPLWkV_ zZlC+2*>7{tyCB)6V+~?EzOJYm*#m-)Bq%&Yu_SOvl0dM8wU`Q!X12^apsV~nD_L(r zt1}f7G$Te5AX?Nr|7OZ9c(>Sq-EO!(VN~6Ei)K^I#9E08mHtdW)mb3in0;L@$|@J( z&d#5brOWg*qb)Q7lo-BG`U|{qo3$oTR}~ZAKGLQ?D&SdUUK^AZgPho1tr%yI;lR}%pZyg+L)_MD_>`~F(iND4^Qw2{ zDL>TAGnVhsP?B4ckfY|GPN>W+8LPlYpSO_+pLwN-WCMJOHT`kW59 zsFCdp`4$w8bWejg-}om$t3+`HBytdjWlmjwzIdHaRcO#%Rgg%pO* znT!c?pxkrlPTZw_6UbZ{Mo0F!VIF`>*DSN#*))_Ut}Ls#ZSExo=`JZjtvY9VM8eKa z={CMYmXIn|9vk&)O}!&SR`20PPb2Fgwkr1?5t=oz8%u;*_OMUr+yB_4P|(V?WsTr8 zeub_{jKSpQ&*)hN|0bZ(n=iK5w4Ryg%BZNDSF9lOr)6yxs(%_XUC#SDtNJbeP)rP> zi1Dg0Xf)W)_J&kHP3G2$eRB%_=2lq;66SSUxwL)Y3Y){&6kpmzMDFbxKKCK%d@yb2 zgkwvN0VmW+qAplN%O|1aPgWFP5R|QJHU(GImtgPITe!c*5RY&{NT9wuFdq<1&GPxG1l08 z9h)vOyz7o#mCqBD`8FtpW6cg9*BEEu8zL~iqY#5l7QV!UX`OVo;?e`sZO_&vi$TJ@ zhJbgHP^I#OAMP#C3APlGszB0e+;GceE{;cIAFONADdom3$?WAeo}&{9@2FcT4bWG& zI)k(Ab+fLlYhr=puKd=nD_s787p@IU49|Wv2@;M0_w%6jx``POrk7& zEJf}`V#o~k))Xd-mX?mG#!uGV)y}I&z}?$@h=QS;gwarD%K~jb+Sc4!2NruUs(^6S z=bUkR_59aUDtsxLX7r&0Lr??l^ozkKrSJsfr?!F|XTHHPkkrhO);`uO+7$B~m$=lA zN1_D+&sNjOrYk0-v_7TP>(E=g95`{HPj?>QYuOEFiCDnCJ~@l+np z=7KOe-$(bx^E9eP=;lRI$q#HSPoly2FH(<3Hu#jiet!8zZeH_jT`LQ6MN5NdWqoRo z$Cr;#tO53ADV*uOLFICx5hQ|E_c=cqebiPMUiNN#$Za`^jX$no*X^`&8soxFcd#o8 zH@*uBI{+MslRM8&=D@gT8)|isr`mrV+%SsUIFp1|L+E3C&ah*}eJj0lFme5Dd7iLH z#cTli9#EkmN6SMd?Wl6CM0f{zmre77WmBi8Muf4yz(kR-c3&^ z4k7RAdfTc%eNdNfUoS(J;m67a>*SObu~fB4TFOe5Sws82$qRX?A2eh|g9c;eV_(Nm`?;Vrvz0p8nr+2( z!LNtomEQ5kLI&08gQG67;6~{qdhsJw+AJ`>Q$TDW#zO6=p!v)=O1n6&;nJ-6%m1i8#tlqC!NsXk*pJb&D7oU^dBQ7x`J( zq~+1w-vrRj;Hk(tS8npHb*x$=z1Xg9zzMOvLQtAr$rYYtSgE84W(hC~pIm2|IY~34gDzQ?}@yufY{g77a*u}OIZ>yNto6d9$1uv?NA50gTsWB5g$V{K$~xW@X$|B2%>)lg!^N(mYQdzt!B~t9cub;w(DpGs=~J zQ@50E*(w%VJ-RQzEm+*m$i02^NNa#pikfLPCk`6A{&1&5qGH*Kfy^tt>J*;4JL9ej zw6{!z_AOJuT)uU-?zki?4~a}|1F-1nisr<_**zWP3A2cSD;+zsu7vUq@z94$pv*#| zWGGMbKsugO{@4QO54*HmY&gh3WgG$IQUS027dPDh->d(p`DJisf+0B8a5UK`W|^^x z;x|F(FY0Wwx85~ZZhs2VQ1s6@O27h^+V*Cg=LtEu{fqyg8EDy82>Wv^44y34wA5I> zw063jM~y9Upl{-?OI}>_l{FrEQzHtU#fljgRj-+)asbq5zRXV&Kvy?vPiJrBQTOsIq*lw(T@!QXbd8&JSQ<+%;(p3HCM@% zinj7-t+EXzUvBQagx_W>(puAITKMUNS?_KtNE`29K4_fCme4cj&1k+_izFX(QkYx{ zV+YW_1pGj7;ozO*Uc<8Ywc4ioBRW2`LblAYuI71BIYiuJXhJSUVzqMsdCz)n530l` z$~iY?&w0f=V_nRXk=Qax>ng`6XPuH8C`SE#D;N00iayZ(%sE`5{8G~Ov*nLrB27_E~=tmUB|mk)FEB{#2EBjIm?JLISv%d!E3 z34rmQBF8&S9JHi8qI02Z@Mi&|#`sjDw_lLf>v=X`#(kWi*|zJ~ucqx3PN|BWJliS;X51!Y0#sY7@zdo}K?1Ljo>fBv3#zA{ zrIsnkblW2n#b(LIn^nbmNBP1RnZLVi>$GnldXmU`v(XW!N+i3e!+0a`Fi<^HOp0Q4 zKd4`%qGc5{UTX3Zs*c8FI!=kumeiM7*v`9qXFhe8)K^Fm18=x&Vzmi(VEhg|R!L_C zf=!C3T1%)M3)O!kvn_i5T%W?BWJ0AY4S8=hqy6oEz*cJYZGQ4NpX`r7rU;;lwbWV1 zfCTv`xh`jR8M=!?=~!v;+o`syp_2q4I!3vl^HVtMD1=XDCd;1z7k~bgB5%Hw*8jd} zATCMAIU}bCPB)6L=C#Xj#E-3v=g8d$!3A=oD56++d)p)B&BvR|qHClC|>QGb;ud+;KWW~y3;jwxN?<`v*<(*AU#+2u1`TpqaW*1_P zk@BJd*B0^G*p6erI9xrWEEE+x)K^NT&llKlU)3k0cc!$_A}^OYT^tCIhwD3`8nIKM zqCjYIuyxL|iRpH#c(Q4u?!4IwTTm#&E1$DPH}uOj`5ot#@VP+Kjs|r%ey#5j+G6k3 zNaV?OKFoivq+d4OQpgFIa}Bp~c$$$v<2vr4ywx`$&Yg4}gENXT>6}Ht5}6gnFcn0@ zQ9d@b3;Ol!jd9~bp2QDL7};;cU4uad+;qjd%C9Q!A<3E=3ytXxqyxe7EZ!*-?f|jB z`Vjx2^irZC7swWUhWa+?1}{b=k#{)fG=0uef zp^D~M=nZ=6l-bI#orA`HnFWQDM$W1_-+$m#A!~i-mG2J{%qq4=GuvaA%T&p2?}L$ zpsiUBd}o<@wsA5rAy+MoM^`;j&m(d(cDV9(r9@;J28Ket=|}`fxJ_fay2=|d8l>F& zpmxVu4oYO4n8|f1$UGy&SSq|xn6fDq*6KN(sXdsDe8{X^&Lz~mbFt64X+r;?$KT-Z z(1nx>gc(#0vJ!}(t#wjTrG0tSOlQJGDL0Xr=askDUv2m8e20=-Wv#z->r7%%kCqj- zz|E4mfY6Ew zJEvW&x0%2VCZ{`ag<~)l1AI1%!I%aKMnmhC&kG63xIMs5sDGDICsh6TE$@B%+0t}> zk9Z}!=euaRBDu%JsS^D8t+wk!%{X=IOUVM!I9!fNdR>r~h_s`?(?MbFqN#+qa$x9v z!R$!Qz;7H;_GLyRCq7mh2O^AMf#$qwOZLwL7GZT54w>FJ!U||(%HDb>;W%Vte@din zp8KaMEn~KK!W%n|?wXW>v32 z-5+$5?evZn54_4K>vOtZwqxNkKv!>8`{BPBgiBZ+Re!}kBh!EKsHfINuP&APC6;PS zos*iwrdz1A;cIkY6G?+OXxncvy4Q|jm?5Z03bktXc?6vJv3uIKT=)BTClNuF17Xod zG_RzEp%&29YpAYr>M9VJnySsdb#C{2v(U{5CnnA6x&Wwzj6{Q?^>7c z&Z8?@X@VwzbBoceq@#DwyVQ3pcAjA*h(7Jq`&?H)a`Al98-G1cDmGy8CY2TOn}9dx zmO+lKvS0`Y*^zzMvJT*6*EZiQlYBRH>fIF9af257`rgQG-iV+g@~{%%l5lZ)G#1r-S2U$- zG7WIcl)s2CN&2O8ZW%V~B57J9OrB_N&E2r0F0LFoqQ4p}Ys4$K`MN7r-o#Q%(FuES zuy6FLa@UcAOHTA_UszvGY!VCjF84*|0Xo;g%iiB+6t`npJ4Q@T>%YJ)=Z?H4`o2~t8tVcHmpi3es+8ut$ScS7#B|lvx3o1hz={}O zp(G2wjm_O}A?A%(WiD|uR~@x49;1Sjd7-6U;Ln$I zJdK6r^6^D%H)3k$uY|mBzL@PPpeNfk8WuMq&@CG#QKn}MwKv#_(jQNCIl(Kz zzup}zOfKBJ@P~0M1V7JPlRX8;{-h2P=0>e06T-WjL#&l_PrBQ#(zVTXhqc?v5ZwyQSArHP^O?4&!LLUp;m=*!YVO z5AIMcJ)9M=ToO}v``-VaLlSc4tw1YHDSSthHe;fl4vXP&)8r8os9v2@-$_5k?UowV z=ns%a*AH^M?As&GidW%!5QmSB?)Rt5BC~i-*PZf℘%GNXL`#Vtk$YD7{pgi!0`l zPW$_pwo!ehU%qWSvs#bAF{UXE)g`LEG$k2x$!p$meLe_(zE>26t}_*JO&x~N{<+(2 z#$|<&t%cAa<}Lc7ChBx@BIu{ ztG{lwkx)~f`F+;;!iED89pzH~5Gd?C{G>8DLT^$FUD8(^Fqx>+@a_bS(xa{Uzu0@v zsJ60hTaYSe5@1Bm8OqpX5S9Rup~xU1L=qrknIy7I&R}xJ zCW#EK@AkN3e7DEw?sxmW_pi^7eKdylIojGfT6?Xv=bS5k2o;3~b4M!Y)!0;ddz|m; z6hY37QFG`g2Bxtx43j$VW{V0OW2OZ(Z+hwHAqskPwYw=nwO&$t0H~^9md+(YV8!*H zxL?cgN8lj#pv*os`@7%+zC--43J_-ABE7(qQS%#NDTW){`fGw>1Q!q2ZmF(CCjm63 zR|*Z-1}p+sIeRl&)R7MLe0;fn-&Qhy?=>9q{^{GIL@+bwPOP0SMWAE?P?;0em>7Y{ zAQ*LU<`~@63caR}_Pd7|&tiNeI~ips`(e5 ztE)So=4G#SbQtzvC1Dez-RhYhK$i1jV0a?AHtpX!70#8zqciG-r3i=xbNWkQ|wjyH=vE zz_@jfvBup6=Rq%%^acE|nco_sTuJ1&n9eH`*VUaw7U6KG{Zm$y2X(Uz^L2K@&H&>RK|8bH zyy%6lN(Ty`v@a~wT$w`U%3`W;Nyp>N2FRMfy4oH+?(HQavP{z*K=98My z&MLSaF*xg~N)jVRKbXX$v><9Q3Rxf^XMNA%GPcl@nZrTKA5bIGzN*1#?Dd@vs*GYjIx(Sr3r|u-j0E&Fuv2*voLMd^(v-O#-~^Jty!Vqthtx< zE+)6peXH4C01i8e78NQ9HJw0K?PvaJQUL!Y^l*gtvu!5V(WK~*ZZ*EuQn*k-e2d7} z%3(Nia%J&CiOIn1+}ya^;IMnlEjOu;K$UtZX}OKbn2)iDZi(NG!zNTbxjCrYJ>_c2 zAgu27azcY_h`9U`OQz;?A6{jmG3sTYdylOxUx`;!PKD=Dj-1yKg6TsIUT;UI%hi}S zGqU?@o;f!sI*=F=%TKLR0Nx(ip8(HGY1r7~QX&R)B4YW={bQm}@3)_A2F87VmgJ*E z?Z8^&I2AdQ!TYi`j6%19#|E!U4 zi^w4!xd5Al0iZ{{L&m<)fQ}bnSVz~dQLU|kXa*2~U;9KJd2`naBI#f>@%tma2caY48;+K~rYt?(VE^~Z=W zGN`U9cAB@Q*Y({!Vr<|3sZrCN`Fnj(zo#aJlJp#)Kx~{iKU2>{VKj-F$YH%l{&%Q7 zXBgC8CG+av=w<9`vAG1rs?+;n?UdAWG@>d=HH@k^D&nVuuB|te(JWx8TteN_McLFF za&y5B60S1sb(qINZo}WQ^F+uFc4qcohh2*6T5Ee<#eDnY?0erW897c2fYgS)01cyL zHr;<=u$59t1imab5Gy-%_e9fA!Mr9AOCTF+y# z4+P8Y9JKMin}}y^S>}<`Oz(V^mF}RQFo)a{!msg0J(z?DGLyT)0gNY~g2O$lED<5IuMq;o5UX&SH*^+!o8gb9aE zyq`AU3hGpZCH8|h*FNf*H~~vnk#7UD`kxhL=5QgfX={-xP}6Av2vM$DRb+2zP({OX zGR}ANxXlKuIT-5;%6tr)LdmCWB(P@UtFGal>k2IcUTOQ2!Q42r=6obo+-c7t<=TqZ z^()I;vYfc~tAq=`lL!*n96t5t>}5+UgqT}laZ9!spLnGK6(C+(&gjkh$tgt6iy<~^ z2fA_~nt|Gb=BI1-r^EQxW(Vq(nr}1}-4HptB{o`%xlB>C(Va_tm(OTvp`8XA%zTC< z{Or4GEglx|0>OZ8S%Y^k?ZlL2 z2Ug_pYz_St=@FePDz}>tnOdI;4v6OM2rb-#7X(T~nt)0Npb1qitiZNMX2?kV)}o=9 zf>c#an-}cWO>7x#*xqc z#ToX2QLU^!Mkh4K!vjBkE}EEYsObV$k8cPlYim7>S(O!PkY`=O``E6|m~R9v+iw*( zL=${MO!5IN*Q|!%hbl1uJ)hviIRL(Gq%xfQbKjiH|6cV z`XfY7wp^_GmMm-gtA!~iNjRwScn>d~LF`H_h{gHDHe`x}v-yEljDVp6F@awGbop{M z#o8EQaE0x+DR`@}7@_e*IdUKtIbi52d=k1ocKUEHv%q&%j+2wiXQC?#LR6rQ#Y^ko zE!mcgex%VTgfD6EoX#d#1D#XqpQWc?2+t^mJVuyK_>SHj$671 zWiuI!4g9GP)qVE9WfUQdSssFnPZ|oB2(j}cKjw!`rc*0`j8PW*er`K&J4WgTe8U}@ za898<8+jDk!?J3ivX_2E8rCL*x$e%g*OY4Cmxngdvp87Y?#DGa2VB~bl`VWVedtuT z`PiYPVfwHs%+Py4#h)DrZ`>%g?3;mverArq_qz!vrTbg4;fHJZ@@3|;(Viu0QN#65 z!#jPdWEX5_R|CZci1bS+1`OVoWX%j}D058+;x4B=e8}iV3d896S&-Y5jCJ2R9mhWJ z_ED^A^;j~_q$aQ#k2^)P-TP?%sA5yvgREB zf%6@owzOS=fJ&aLHEOZyLG<8#8uwZjZNOoLL1D8Yxy?S77ltz_@h1dtiPglipP6Bk|aI-d!M>|hikb?Lk{Gmuk5LAunUHcV zPR-K91Z0=Bp_`q^cn#eElzmwSV)x1dZ|1~=4nkRCxEzO}dd4{0l%7eRb%4H3{T8Nw zKFQ~6&XOB_PNDGdF7>M=|6j~Ea1ZdVHr9>?qae1)3gkiAc?d@&iiwdqC!uZ zhQ^S-vgGHo&O5#mi|=okuHHggIb_40ZB$HF#kJ|S+ty_V&NKomWhUNI$3WD)`XZUK z>6Z|4(pO&uZ1v1k>jne;3Tkv)KKeX(*XMmIf2H_NefOKVlM`*I5JUf1&^)7EumT|@ zV2UU!_d>yPngalWf3##8(fY6$`ItnA<_c83C3~4m63F@U6{}@q=WpsRpmXWT+`ms) zPw%=P_l|}YEksd*h@)geSNV<0)}IJVKblV=?~ zfV|WUl2(uCt<18@TK&?FBSAMo{fB=irnLR!Mm+O8%arcsEm@5>-QOl=o8+!3NacZ` zZ;-wr#fm|#ia)`}dU4R7!<2390~R08r`xt9n?!KGt^{orj z|23!s_Qq!#DU9VwU;2=nbep9r>VTPw0*6xbJhGQB++cJxEVyP7Uc|T4(otY^BhvJAZ7^Y>wAId@{*4 z>^ayM>%+cdFd#3qyrOijGU-_}==Jeq;VvbUyboNE zi;MQI+VQ10g0kJMd}hRMo3}72X_csUs340{B;^Z_leipzcJE?KrhH1lVS?!Fu5a@Q zv?cO*Wi5wA0w-oR$u2~}65Rzik>x$h83olxb?;+sAZA@UEMk1b`iN9!PhDOuz56SP4#i^C)7h<6OZ*vnp zV@Xj;_T?2$S8=r^VB;;I>givj0cE-PXI@-rdy(@wb&(-^?ZkKkZPv-IxoE5_HOAxdYp*=Xss^T4i)-!)_EumkCbr~AJDtaEWs zTv((-lkAxCmBA0!`Sisz8QwAPf}1?CKxfXV+?=9K#@r~^vZj|izK&}WR}s$pMO72Z zpVy#@{JNYQb|sZX`gZ5c`qXG!s9@ERIy*P301oWEb>i#pYT2+ zxq6T;7XA#&Qr#tzGcD-34xB4&sz&C`NvBp1Ai=QE)i!33)uO!Gi3{(g;h~)FT1qBI z<^T|awy@*$q9N*b(3O4#d590g040yB%9wmaYG)Ed{3o|kdv`+kMw)NQxUlYL49;bV z1usi-UE2%bE$UgT0Qmg$Wv=+oeL&Dgy-kog|H!B2FN@}sN#>zjjdk(GoG$em^36b+ z8xQusSM-G#JB|O&sHjPyfBPq%`-?Zojt1z)##C|AQ8L8bX#M?xo;b5#v1}x*#yAq~ ztV)Bj0j=(uo0PX0Yo+racK6IGzPpanupcPx7Hhe&5b3(>q1yL-nrKlxpVi|`AJaUG zdxTJvXxVz|pOIY&D96k6Ged?sY$IYfeWGXfxL${CS$uI&a)v(7I-}~%mIwXv${J2gWLlkedoi6AoVcGz z5`m2u^gZh-OOXk#b-nT!^G;lC>#O&-Oe&(7-;tjeZ+$T}aRWzf zc2ISk1n5HsNtpTkaGKZ|-eUC>RSePB%rz7GZ* z72lFwhg6&9j{h6 zh>j(_HYf?~oh`><*LO*abqQSkX(F@lJs~0?ph-fYS9szMWdK6}PvjvIS)}O*E7%3>Em6e_J|8+Wkx6u0U31hwo|0QAk{NEDB>`f!ASb6vw z5mR>YEjbQ(aC7fa@QGJiv^LN!b)~oB9r#>3%7>A{TK$~Q&gcx11Caf~$Hj>}XHF}H z90z^uKmRxjwEEjRTtgqNrkEpk=Pwu2xqZ1T7!dc>%M7`m-`7$)Zi1?vjFp4ykdoOX zWkx+9ngg^3U{q*E=-7Mm$g{V;;=}qY15|nVN)wd-TKaI;k?dLLLiV&s18-+}+O(v{ z-zR16&KoiWMn!X- z)%)`$<5t^WuTmz*+KO2YE>MI}%4*X$!~c|3yHv=$32b-FcnA53f!LdK4FNc0JD*&A zGi0j{UJ{?Mn)Bi_8r9>=zFS>2armB(dh1X_^hm4PyY1fGDn{!;s?b)xUV`dNKc``v9@r4zqNHtw-`Y=U+k+K(t5A!g) zZ{n1{$$U0mfs=9U)5aMNP2ryJ;k-mt*nXS$G?#bh`~f!Yp&xk?Ub+vKu);(6F_@~Q zC?()C_`2(xXd(<7UNIMDROiq=X_m8IACBQqTI#T>rI(NBnQ9J{97B{g8Ud_~3+36} zTjt-y&c#>Ml-QcBsRQqubMRAyK7sdh$$rQ69+V5jwu|`dzVtgH@OFVz{)Rmy6QbYT znVs)F2=W}s63Fivs}F?lzRvG995*v}1i+ay9%bSmN_K4TOg6BIg=dd$Kvo-MqeQkk zR^x4!QR9MQ5{wM^wPWA0O0=!iU@B#1FRn(Rcl$gzKK?ad(>Pl=O+FDz!DAhPB4p|k zKnrVLj?O|kLKdj0{)UU-?lJ3ungJAN7W*#@YzNPWY!uvLAgSV6-Z>KCxbhN}s_$98 zu=F86aWMZyEoSLoc6GGF>h5sGCSv&w#0iuWsdZa5)C->2`MD(hXe7`Jnf>_} zwt7zD=lSOcr>yjsv3Jk}#~VYU)Yb|9EK)mAckGr-j$v``$(tWD5&HIR8(H=9a<^oS zMV$Qki{0kkgd6wkKV8^ZnjyDjVp0aTWVMU8WIYUJH5Ye|XGzyy1ziIN5dJ%k2d+P@ zZv;z28#co+!4zTQ#Sx^tkaoGZ?SoSn{%B2MjWsGIy3`Uyzlc0FJ3~mNun8&1u={f6D6g>nk*{P1afB|5F(+y)J zCTN-2BWHHc1!Ez(OakvGwWQ_I=WmnCEnxE{%$(mY;*C!n3c&|81vMT^^Q*Fak9iS0 zzE_F{4QyA6EQ`M#=VT+xVw>1b61*X zRT;!HtZvp)wIF_7GGNKvMA!lH{!~#pSu}l?04mKI3hS6$q!)^;@Vw^gU%P zJLNv}oDVS1uiR^)ODgdL! zXIU1?wI3NmE`8k8dujum`shD8MQ*7I>0}+-S0N{6k z2+L&8Is+wLu4C7tYn4^IrhX~~D*d(TppC7_+}S6lRgPy%n(%GH>5p)i6~y>%d;iNd z@6c%%f+jXsd`F3uTHcEX!3S#rP3+WJ&DUuoIzr^@Entks)p9M#rR_PEn$CVt)B^O` z1*$pdH>SKNXe1j=#NqmN1MkVm{`cu<_gphiA*@Hk|S&mn@JB#b( zc3|hKk8Ph>%GdE7fez(WTmI3AsDQNeUR83waA8os^-|O6z&Ma9tIie40}##S>7?b< zP#wy?fo(`i*pZadwpmdwP5sf5EeXP?OwXCTimAyxs{W&gXVV)g=We*-*RqG(6SCY8 zh2{4uP}E$O3XcLCxu92oWss$^Co`qxdCJn9*DT?d%*t@_LZ#cgL|Xb&Pvc8DF)dFm zJ*%x)iMJ~_8ro>n)9;)<5%FKige_UhC$5R@84 z79}T>2ej4Yy=c}IM>%v|;POVHvoA5IR&v8dLdlywJ(3fwL9&pFtGELtr^AxMMS&R% z8h4K}Sj~T!Zz8>0&&m|MQAWMHt9dLQ?lxbU8geR3t36fq^v8nwr61&t#Kq>&D=!;-2b&dRuX^?peY3fY^c_ zq!OxS?L>js?mc1ILi)o7sI}wXfSQIfa`>=xDL#{$_G>6L&4qvDmUZ7);M946r#kG^ zFBoIta@>a`B86>jCzgA6@CfL>ircG3e0l5OIqkmH1X{fnP~s5A6r_ipAPUKBEC~`E zRD(mVn|(2lGZ+*er^NniT>stUf#}4=_C~$1kDwjqk8GgpWK1`pZ;V5}Sf!A270|B! zV@Jq4QydZ#G}jt>0;X51R_WNNV61hm?%b@?NhB}*;d!ap6)0du`9L)os(U=&*TeTu zSI~HQLPdt7RkJ9=_bQ@*?%9uU87^47A1JnKad5TFR>UXUjSW`AY?d-r3WYmb&X5?M zX5AuX{i_HyN$CQoLf9b4s%+|c$1^@B#oReZH!Wf_JAbFDLd$-3&Mn!i&Z_hrNBSLK ze)3a-b`A)F?OBINL}_gI7SP`95XxS~SoF$R6EJ3h=oL^dV`S06{Bhbo<5_z27NT%2EZ4FkoL*G!zOB_1 zN0r^z(;2J)++)oEMM?dYBxKZKrg(Zyaip+tOU5A{n!3&3B_#oNuq`ROr1>pk)^Inv zR{NBCmc>*6tGhu5Pye`E;&dj z*57qMcbV8zV6%Wq5kR6-=DKc~FAK|__`aI8)qCQ*Q~;}}!84H@or=kdAF?IIig44& zL8hXQ)pQo+f=3F7MZ|_d8@Wl8F0G#BeQY@ZsF4@Av24TeJIr%}80kt+6rw z+^Ekz*WO?A9vSfLb&h)hy?@adduYoeDV72af079HYEPHK#{;G%iMaT{yCe1T58g{S zv#gX`+Fc2S#+yL2#~socnh*rtQHBjp+R`cKS`5JRbP`Kd*|sF2IY{_XZ8ijA3-6!w zagLPi*dZ{&f~;b8n112(<@<>2#(Gvpy3;l=xYTgB7(H+_6|)&(<0vtjsH0l z96n^IKLf1kAW(3C)7qu=1gloQh{4!`1r~9v?9r{ zE@=#64Aynl)3)q;ysC1+-ZTJE3A}56~oNyFozk0%TNDy%P;R{1*%iEEDWa$0WnJy}rc2lRBq_qf;BQ>@2wX=_B(e>ku5QTJ$>A3Sb!aqcIfi4OiI%vV86C zgl#97$fe?>4b?1hlJC}KS%D|%){QiZag|eTyP8bTwExdU0d(I`TUwY?m+4o|M^5B{(3Tr?XIqY zJlO+VYu&b8uFl*v9k(m#o&drD{qfoM#`Y!nic7{ZMDW7G@l9E|-oARDnAg#z`{C&c zbS@Wv6n@#>3S|R)mYW3-QOUC`o6?*^*5-~Z06f~^KIJxK_rtK?i zCYq6o>->tFD$PwdG;875o~@fTjQ2g_41S$4c{(%0f9Aj`);9=c(C@Q8qgqv+`F=}w ziEqz+kmwNO>(Ddb(;*_g+fQ{*{~fGt7zT+YbZRednW4`vqI=iRB=&3z@*6p+csB}1)yJ7or&tjj2bRx zo$oX^qz|FBTw0S%FVgnDRpx_po$bVuGU@rs{HY>;_HHw-ew_u8X5qbxTe`VX@2r<$ z&avHGTM}bVGtw6~bxx5J-Hg2=2{>?{Mwl|q`$4KpOQ*d6f2dqPZfs!{>B-4DjB$)@ z15h`!3(Ie_7CK$$c|RZMOgtFqnPcUM+wvI`9?y3B$7q1HOK&6B^z!qYrAM**={Ap_10mJI-iR&5;kVtuZ?zDBhZK?OxOV3n}##O+LRpB*TuPw(mGTJXtY0Pj5`UCMDr+ z{v6lI{mxpvP;yJQvba42uECq@#rXx^k{!4xo#2(JgMP%F7l{jBPrBWb8H%m89^5-F zoqj`{debpA5^a0&c=5lx#Q%5t|1T&XBq5iYB{gm_kk@WRd=fE{>6lL_^BT(xGBHgw znqi1N{1`*W+L#esHLKpy(oqU@d==2w(*BsBQLC(AC5tyt{#D2yU8MO{^N>P~|V8p=`+E#i4BjBZqudnQ~tCp5KsZNWl z6FGkj_nX85w|haJShLlQaVC7#5E#}2g{sf3t51pysl-qoFK?_5VpTVvF4muXabsX? z@!qjNG}qKH-ITlZfB&LG6b~tNaf*D-;VoD^cQGE`8FvAG z@jX=Sfx0*p{U#*i`a0JDUuc5O$=z^LaxIpVOwwW>MD#SOSlkGGHlSS*nb@kblqFRG zU**6|JNY{VEA6GD0S(-5?@RH6TAv^S;}c_@sG1nEQ}_$?UjefLdo{MaS7L3{VYNy!;TN!J;EwM!l!@h=P%JQ!_W~ymY z;m=s@)Q0Ayy{os&6l=`(?|}clGVTiR*r^X50oWC ze#tkZAHzn6vH3Q?2UWZL{pk#b@TLvuUVdqXke{#{=Ft1=g9U* zcwF%GbA<(7c^0>eHcPK5tFOldXTp{_6`)SXMWXz^Ax~_F5)2T>7MaUNE?|VOp+`VR z`MUzg?V=bZ75ZWrr#AGU=_hXYl15(5%}Qzmo{T@xg7#FXo3wu>_wuy5XTDE)X;Iwcz(5~4#_iwBZ^zR?`lVV3M zLHBJ$dUpC-6)03Zh?MQuo3*LVCPsMDU~u+`cC_h7)+Y4*n=c z`>v!GPj#Sr{^Mv~47h=(T$ngd&=W!L0@fHd*gbWn)9wHMkN@ufJ|S4ZaiXLPvs@rb z>9D$9DQ3#h`}+0%efC`Y5T1J!3KZTkNoZ|#9ucO`sdwegDpEPTxaYwGXT|J=GK_rb zrKk8&fqG0$qd!+H?bgN2DC|HczUEE{4wLZ!Q#f2V0{ld9c$K8Ysr4)0pd(nEQ`CDr z0bK4KKe*PC7au4ytd6qOhqHUE;cQF`RhuG=)$t_-ac<5nRa-AkMA3r>Be>4T*1Ge; zm0u;S9ryVMKV3+5Q=J=Kn+0-H&t=Wf`03c&4qPX-kNDUWF;N>85Zuday_c4M6@GmM z6Pv_Ylo1}?l7(G{nSaj>jM z&7lq-zKQh);vz%~9!A{@Uih6YnUhiKaeah+C98xds;Q;_z~dlnapj^AvWrorEu#6> z!0Qq>c?mMEvp55cOPTEjs3xD1`%^y7mh^jgnOy5gBl0A;HZn8e0~8=*CgF;BsUvc! zk&|AO9Zc$or^`<>+7c~+bzQ+0tqw3^P5zfp0tjRc*CN-gv02!V zEz*n~2PMa!=XeLIT0Ebm0UdfpG%6+4DwqJ0b2C;$T<6ItBaqmSC)opLd)s6C6lD}B z=^nhNP-+m0_a(RXP4&S&BgMxamwPe&n`E}nK4TS1xDMjvUtH7=F!*Q(X zblvRie5llwORKh1U2>V<4kh|i?-y>iSX(Lit$qDM9pVVe{sn3-^8Hzpbf(V>Evh)0vRvmIWpg_) zQh*lV@N~-?3=o%B2qm9*uVLhLvb_psewLd=RS~+z?@+S!28KV|!+Ronfj zxNPGJk=^>-U{@9J`2!KSVZq!apG++%aL^_;HfLPG*~l5o6ge5k$NtxUXA%F;zO)RR zu+e@7+3-|8$+>6xv$KlK@=iSglKuIYmOBAdp201E>Kkhm(5>uMTuBb(ffudWJCRJE z8MK%UIMDH+ZJEt4`_nc5m>c#Y6ywofWq}fK`)oVS|0a>Gx{7&y<@Ix?l_-)bxDyXo z*($ia2%60k6*ZJv+!XJ+mWiIt8u&Ap??*b+Ijvk9y)j_i6k*q#1i&QWkY^CdS2OFf zU8R%2iyfZ_?K|>I+y$9ZAW&sU5BXj5q~s`b>?7$AGx*lmBGVXJ0sDO!=OyLJR*;jc zw#idx{oY-|?<_1STIt)tv@g9 zz2VNKxfQ)j034AJnBu;psnaXdYk;!mq!RsE8cEX2;sF`{XkX=&ZK;VStkE80TF$23jPT7*<}h=3E7@3pE3dy;IDpd zCY`V_%Vst7mw&JEr4Yf<=Uj(&5{^sYDM5wZBndOg*0*!5H31OO3tWOTv}M3kYr>%< zu{FvR6a;C|7H-8-an#5qeu#~IGo7&%W2vD~&OO~oF39G95%4ppJsuUJ2{iF~EyGdr zQiR@yp_$G<<|@uN;yV%5H~7H4<)w*(lZBJsU*Y}+YIf4$*K9T zx|p4ELZ@~nwOXBD-;#;@LpJx49$0Rl6+jxb>-fZjtBq78D!l9YWvnHrl=oq*3a%{Y z9}c%Ph2}8rgExshua=g;zEKprBd@A`AYTn#c9>)=sp5FVC%6@9F0Gx`eUZ(vU)@hG z?*?&d7mK#j3>;O-=a-G6NYGfek^WSE$hBp+N$`O!s$PFazF48(IJs`u>K`!I-dcIZ z?4&5&C1nfRT9GI!wBd(Er-stj)BTYuQfQu1)w)|TxGXm}aXvwR7jOsw5}tXZ%pOnV zCm`FDFrK=U*uEzGL|jP`24Tcku{QE6J!jqw7T4pKVqB~tBX@%f+&tv#>P&BsDO~<$ zm;zWGV6sm8RAi=YI*sk`O=`#EhI1ZYDJ=(T<@P&fqQ~+I_eMKBpVXF~8c!0XZ8Zn6 zE*wtTEN=w$zmB#zVYdt*{?kS3j&*y{L}BYdYd@dvQNjoQOWki@pz553Lt~jdv9KM! zj>j!#P^_k1@X69XWRQut;*c&o8FP$7#3qL)g*=sFxM8ss92o#F7XhUc;n2Wo?ZTzZ zb)nI>qiQ-6yh*^OFG-eMT5zTaNwH5p)Gp&~X5_WblQ`Wm?Hp|52;LSO%}J`Zha!;Y zQXP;ilBoJ>5GN!b3!wU|MoGdE9Nua0OOCmqBfo z#s-2A!P=+qm)kgmy~$lC%N?6m=IvA~`et@#f16|fRXg$iYr^5azHglj!M<}q9x}@k zkk4k(tIemKDmcZPluAFD4kh83?o`@JXcupM`s^?ShAewz97|>TiP@fP88DQmGOEqE zj79=Ys)Q_KTO@I`tsMZ`_zY+|7ECHQX7o#jXIW(2zR8XIVjuHP_GEfpd)=(MvO{i) z5V2|!T!ZwOeR&vpm+?urR$ib&*i_)g1>UOdFNya>)^Nt-qmD38@bjhX(%euw#nklY z<5pU~?5U#K)SqAaDqpql5SGn1)7m(8wkVuV!YXf`{F5Qvxj4%5d~8DO)Jppcg^coH0UQXS<~H{;#l!_%OA= zyu~UYQAf!=f9{#@XcL0TGID5^E`Ds#mLI`qEWeGg-ky53S^+d}`7ZKO!>9jkO$&s{ zcKN6#O^zInf4A^b3nt(id-8C+FFLV`7W}=WRZHTJ24+v(p?9}HCC%H%u8$;0nS}i zC*>0enVl&Nzkzy5_(zM)wOIAJ#D9f~3e7Ue($XSNEviZ#PBA>EnDVKbfI-!8KUF-y zX$3BouaF2zBJn9WGD=HJW3yN_(SRB&XAucLmr%&0V{Tx)H?wCG-Jz|k<;8-cq55X` z!-|8I&p(PKDc@3N-sOclQ;X(y#HIADyf)oQ51x33;Gu>_Ot`LkO4^j@7Cu>NbdoGr zl(tEr)|bm6mhdI0tm)J4=%zF$l)n0oQkX@6)luW9CrMK|YF-`ek=%_MOs%L6GgLd@ zB~0t`xMTSX=Gj@C`h;(-xzv;|J-rUBdKRnCWnkxyE&Rp`qVMo~Hq+!~R-t0z^qi%} zy@01;Db;si-MJb_$X%pjHZ7Y_#5hO>Ypo_(;!RNK9Z^jvsH9^#Tkg7wgiJ1ql+V#z zP~&|fraJv2a@Tzz$B88(%{xjfQ)NWtEDjCwL=fci|xncj7qUo9Zzl!Vcb`Q6~bQF%vF>PO#AEZCsINECnMfyH( zpXhg=Y+HZAIv4D)|LR%2Ldm(_)MCjb>oUE_mYm_$u2YyhY5DpLp;pNt5imR#y?@?p zCoc*m8piXtsQdTbXjrh%cXr)872A;h=6ORXt$PaL6{ZXeiqWwDNXt5!#2XJN zjt&Cr-bz@=heD2@l&wrl>Zm=>h1G~Zw4>$q(!ZgU%+k$Xeozt+yq31L!qt-0q2uaM zC+(zH`QgxCJGiEwBa=yDlq0mjS&t)=*`Jw{VB`$ZX~o*?Zv@)a4&ytw_NuX32kqUc zTmk=q1nmffYIi}_xiQ)i@oH+^8(u&+w$|fw^ZacD`2UmR`JWEx|I7J*MiMBYB2U3s z_LIo=N^zjN_b=1|^!|zeIQJAHq^9?*|9IecQH?R-CgwROnqwIRX)}VuQ9L=;gbOom zSL{5hVr%@X3f89~cjwdgKKfe!1P`nb@J?G7r2XtRIxWr{B!r(~c+BtD7NYoW=V?df z&Ztr9sZ)YWf^r|fYIu01iG$C4(ml_S_8UH@vGt|i`w#l_PmH&F$C9$-f2<^GXDmKA zCKmsgAMb9hoX0uiJqRu!uVH`GaM^BV1aB1j>ql1qFgCf7?VA2Q`u8*?vjMSv3Fs46-> zYhRnK3Rw24u(6-kd8ZKNKp!p#PNTU`n)?S#60-S0Z`~fCOrH91+OR!x6KAqP-;LBT z(c*dmyuuDtfhd7TL3M5%8qhC6Tdj|1-cFEiVwPJoNO;&IF0 z`TaJueyU65Hqxw>1vrg$#5UqBU8B>+>Ufw=)EM~d0<#RcYdn0TXAb4w8I(P*QGl=; zv-7G!+0hj*<+`Et1qw1$Zswu)Q@bt%u2u31IPz8k|Ax>E4{MvLR=WMPx2;E2+s;d( z^^dZIklW|#oEf3EeWhiWL1XVXdK1z`5)Pu4r6{2IWsiB14sxhaiiHouEt#k+XW2d3 z_oCR3!P6%(_Njf5++qV68eCy+-ibluLzWtDdD#Ljkil8A`b_(^7&I_-ZK0bW8uU^Y zXg$qh39D&U!_8M!mAlDHpdsumrwh#|oL8F{aYPVlYbIJ|Q4tf9TW!53MN08@87`fZ z9VhMR5rgb+=vf1g#*&T-wuPsmQa67DU$k1$LUk;Exjk! z%-12`R{yTa?O&?5@YER0vNyNxux*|)!LrPp`ZUr7>YFZw+N= z^w(F42|ym#B>{;oaP@*c#xB115&v%jb6spnz60Cbp1GWQ{1U*%bq&f=FlBwk*Ar{t zj$~5eyib%C6=g4%K#u54mFtohbvk7QNU%J(>SscYl0v{#>8$szarFd#ycmu;E6Y!ZHdPaaKk6TN`bn^mbi7sfEuS3pQ>M&EpW2DkYXA8kcI5wT z6qU!ubbJMO=Vn(qYztuhQ5Z`HE{(fY@FW&RI+3CLSbA}o3VXH#`Kydq#Yp6fND{gr z>0arF>L4LPa#`fJr5)J?EiPX*(Uy<;gCPANeJ}!86zpz{A?K`u3{(NoR5krfy1O3I zSqMKaLyG7UNhPjOaCo-n-af*Snz|p)H&GQ2vKFZBSyy>NS|Jr+RX^4HR!POw_EOyu zuO5GCe>hGPc0Xci=}GK!5@!XP5&^8%N!H+C?lgNTlJ3K^qfwX@DZ&J`Xb|=8TAr;i zTeRF+It)a7t}^M^IuAGy@!?^|PolnR7X=ji{%-c(Afv@kkBi1m#A-f6YcHH}=dk!* zPJcme%ZsgU^Wssfvdrl!gT@BJ$}JfHlQ9gZHvqgZIGZ;?A+C3Zx^q*N@=XZ+l@H)a&17 z5DE&TwBeVioWyM*Bd0f2Kj>%j%ajkZ1U}iZ{jpsemkm3y+}GEaG}eO5oKuf$Z;OM^ z(=!__Lf}G_sW?Vr+kTtLw%3Kjj((tqbip2yn7r-MF4+H%M!)SI9J44Wh!zze&qV$h zFwV-1s2wgd_U}VE+$ebgouu1TU!Y2tE?|T7rEBj^ak{3fexz@vhW~l3NUoqXploW( zUh;zrRPu)dN7}$UosL!)9!e1k?rEN?YM7^Xie=Up@6Qs$zFkKu2zxaHfrN;+TMi*j0GZpoKd^UMj)Lp`G&9%)~Rdx~FhsRUTg`+&C#$gy` zoL!Oz<&W^t`H-=}b&TGL)^tg^UQf?>Nkkd@(H>AHZ8fS<+{@zP1V%I7Iw@iN(2~(= znlmx`MQmK+mw0Go%*Xg(3oRN_Rcy1=swQrM?;Q3C`aB&|@Q2(P%6OK6%p?p(7`dPzWQ-;S$p4!)4N5hsUNYDs-0^9hA|a@UpxQ(`6d~1 zV>gR*qTpPPxn#L!%ZQF`0JFeI&(DNI^$nT+17z7TUVi1@%+CMl%e$4{nJY9YbD4!r zN^o;><1uk!0Sua?iK-L^Ff7lC?!uyPSnmEJ($kQfJoeyP@LntAz701VHa==I8^CK& z6T>1XThQc~VX!?fF7$`1)R1FyO-K4X4Ab6l;*chhuaLq@V^cxR@r-zRN%J`@C>=!& zP^)un5-1ttDI;dBxUsIU)!qzF2Jw4Y{MtuV*zzL!)_SEMNj-g@n(D;<8V>CnVX2%~ zo|DoT3MwjLQtpP`qepRWr8xQr{A$7Z@Ry1sU1htw%D4ROqWG&V25mj1O{~#OgX->S zlMATFgMP1wjU);BB2AIm>Mceweiiwe?J$#HvN<)j!7SFa2!i#`qS)|=nbeWmA=~qG zaunQ-MMyK1>>%E2(i-qsi|%>NJIH(_9bVEabE-(UST0@YfoEkhK8k`-FBO7bDU zNksI7(vufeFcn4$G>BmWOF_Y4B7QXJ+Bs3)&q)**?8AY@>7)iss_%Es8I*O} z(nl&F0002=^iio#=A`@w+XpSNKpsI$Nuy0^=cPN;Mod!fuvjENdzofFKeuhV7*z>d zr8BL}r52T!ngFG0@BcyFdq%afZ2P`m%aP!K$$61YHehnvw#m@~1c+!Oa?W5x*bAGC z2qIZTlY)xP7NarPPa%e(i(d++p@E)8|Js#?|6HD}HF z`+vwtjyEp_J0v+1TpP94z^N9e%2i01thB{?6&aRL5G{Y$Uaz(xvFm5khZ^id5lu|7 zHR|fF7yvzar>jFb@nPTj<{}Bb^-6TU+9(OJ$hPd^9iUb_@^WDsj%@#(b8MLkIP;;-OpLzV^)S`XF~C6C#bs>Rpy z=%oOtZ30 zPWR84FXBCPt$WvRT}Wh>^`4Zx;$j46(!dW4zoO9Xg#%0oR~8B_{z!AoUCf{`4KvRe z?~^u%aSNJRI$|5~UjCN%GE7&DGo9qE>bm3=K`-FuByY5nhpE5`Syzg(NQZ7y?jM7) z-mnTG|1t67U_FC@*#4h>GnZH^6^oK7U-O;R5=;#+FM$oE({rA|nAu)6%M&80wJ^Zr zmZrIS#OPz@x`t|WEDulIMVU@LHPyd2-il3z4v-kfEh^UAtE$Q3RKljqxjZ|SB{J1) z>^vD_mRlaxv#ri&j8Ul|ed7S%G=FV4xL;ard*?!+YUO)vu>kAM@T*;Y)4=?V%C5Td zj;8bHOVYY{bh{Ars-}_`W}f_@57TP%T%I?iRIOHcZX~jS+I;qYm1Jl`7Irv?zFQ1y z=X-M2?bx1OYs-#RZl)e$>9$Y>b^rrsuns|xlIWqZBo&(R#dWnvdArn- zgRAt|VtE0R)gZ13MY|6Ts}&wj81#0jF0a-I-{_M6R#~=AIG^dBE`e@FQbWwwDmKSb zep)P3`NWmbk~Z1Y2n4-Q4|2q*#McnEq+h{4S#4lD)!b9XLyC&W!`>}QuAW%;AkosI z#?G!NMUjpU9_a(cVD+Q`j|?@9+Ha=Ha_R;+W&RMxs206}5%gpz7)OZ~qt@;w-By=i zHHUN`9z#XHe8C-*J%3Bd9>C`CmR|hj#+ajia>M+YMU#DiV3SHYF%ceYVK5_8z2LPM zQf_B*+A48+){k^!<#ZLsAzl5xU(X^pSuRVX-v>|&q49IH%+Y<=HraeaL4Vu=8Gzy2 znW07i2CqSHOWO71Eanrh@LISgHjbg0d0H!r7j-XN>af@zsR(6;U(yfj8_y>h(g$Uf z9kk*1QtPl^xXq2J3zsTVC%Rz=xRo5F5lL2UNwUR*=wyWt)Uye^S*#2h0?fi# zz9hWBVs~fU*iw|wH!BefxcmiCU*!NZ;APWSDWe(EHi(>*Q)5i;$8OQVtlYt%>&WLg+~{2XCA`zVc)gT_G3S4JxIAzIVAtP4|aa|n4Q*Rwz~O! z71;Jyn%2A3F=@lPZcvfVP20_iCN-3Y@^DqM^|h?%6o`z%7@+Ytk*5Swr0J^u9xSrn zIxcK}^XYNMH(TpfOF zoi$H}TDqiTub+QAb*UfgcvAZ6(W~9@cEj=(sHK0+Yf;?*_qUNH1Bh9qBIp&ZIuAWe zU6|=qo}Mi4F7%ACBJG=7*uw5~wlMw1>@n<{(sM~?$9O$xj3%#9Z;gFwdlgy1mEe{Z zrEX$t?H>Ilqei#K{11DMuF==p67c9Os5e5M32WZxqMVfao_LqWvDUopHKV8%xBv8O z|1=;E9ii8!es8iewcLv{yg_Dj38}1z5$T;p%#q^+UOQr9ZIbNk#;BI5$NS^)s8QFV zA}qB5#X3TX!A+N!L3oJmz>qdm{zE=vqgE-DXyV5UC6e`|s)Vg#E7}Tu^6v(;PFngR zsa_KT;yDdHAC-Bm;@XDJHQkiswvjM?Cx$F;wWK0*Yl1XBD-J$HIgkscdaX+b`D{qD%`~hjhwdY$lp}s=~3kTImThOw+=F!iz4R z_Rr?EzdEG)bJVyNx+wZOa`by|HW%EwX*8WE9oWvyTPOX{yEOmFY48 zo-?I7F;0m!_mOnivcl=eCRgiv89- zWN3fwJx&g$T*9!bN0y^!8D3H3+CwePgs9EhW`@?8qRyFHohOA-_DtQQ^(uXb!|!&- z#8PEQTnF%k{wZK6G#YYi=i$Z5eJN6JFGY*K54D-{y&R#dKgFUX&93indDyoAC*>T` zqm{^hRBfo-_7r%?(pCILFR+-kUS={wZFML$kwCu(4l_15_nW3n9^}yXtXhmWDlI($ zy2d^E`wmcU)(^AYK#B%HV}}Jw%NfiV6wY_P>@01}suqI=6{imV=mQq8WJ-`;m>_}EB?tqHOjfYCU7N7uNLerH z8z;KEnLh@v6u8plE-k9Bd$-1<7oSDBi-~X8oy%5qqlfQ~i40IV=B0f{8O4K?Dhkbb zN`kUa;%Yjt1gyyf#$qx(nIv}oUGZH%Iwee};oBU%E*O&AvgUj^OtrCz@%7gO#z$`G z8*{r0My};ypX1lUcPtq&U%diOl^(d+qMW>HrGuq{TW2cEqna(;{p)(dA90FkotTOw zx@D6gUuNk)C-V7yXQ~?qYINfVz(+pnpR(oc`xcNssqJ3FYxc=VUMLucSb+K#9q#nq zdqi=ok%ltV^Zf)Bd39Q0ca_Q_L6#|=jvZf>g}6p8l9!ja51pIc2`$sV3y}e2DO)1( zCERf@-aaD;Ccu*AEz5OV;9#G5fluX-sUQ0F8xGOV0c_W)`gCwzL$dO-qw>GR-PZg# zaHiO*B-bh-L6>IsE~Dg!QAzs6R!Lfia_d@s>xWPX$DB827-H?hhL`TISg+zqwfNVv z8aw1lbSNl?^Sz>Ti&(ZotHnZt|E!VN;!wbbZB_iHNNQqse>FV5NT>`<^M)Ip@d75De8+iojPtxQr!q8K85A_d7&T8|J zXYFe>?aAQOVFPs5I{zy30uWiRDLfy+zxpK$xF6e6jG!t_#+tMz%X*(r+V<& zXOnR>39EsAw(kuqmDIUxOVAi%=F_sz`0l9xhACRY?{svE7m_^2&sAG@d^mZu2@r7G2b~wfhgs5B&%h8rgv;ACAo!q97~4t zDdcPb5I$%Pkt~aCKu^yYd8Q<|UEZ5-Vf@~Rj7q{7Yzy;4i6M=ISJS_#^B+h4(HhTN zGC}+@zhc|+Jwa18DR}#P4=T;TS2R1{qUJ>qGM`=nKA|^qHua4V*e>Xpt!FS9T`Kk( zSrlIjg>N^&Mb060YDfpTNEd^`N5E*Yt7DLiB0Jf?3x9MUB$ z?_R}Ywd+33*1wNW-K>eLYd*6Z`NgaiS{0@JOD}7MdhuYO560#s+}jHHK5WaK1x8J z)Z$Q{NR384Ga0gGrhLScv9mx{sIJP8*s-hSgb^GVo%0>HrgbmI<_{WJY--M=O5rN*SuDtvC&f`T197gTCET=B0 z)HK*zv}h2x*CYtf)Uug-lp-_qJ`-Kyb<_L*S`KUvN; zF~uhav0`6VTah|+at9iC>DmVGhlwDq`AXRT>iY2Kx{WLhbmH&L`k^OJa4Naz?>q1I z%B~*NPUg7y6=)v2xtG@mly!|?aeR8#U?RjwL_!iAR38etFh@Tp&J%;A=kLnL_H&nu zTPl5~M87lAD|qo>?NT{R6&uxevoe*H)7F7|9DF7}+TITt;Zaw_e77Q!UNk{iJ>0eX zWIpO_k8;mp^w+zRKGkw#bMyyFX$3`vsU9pkmn{G0{PjQoj{C0Cx~B6_CyEHXnD*zR zN~?e0(X;lj!g2iIeqvNE)3WT0&U}~>1!Sw_VdC;-OcGcW##Ba(Uo5E&l-pw5{ze>MNOAXBJ@(ClFOb4SZm01 zBt(`O(NZE|wD+~*QWZ@uSnwj+y4B_zS_mT~^7+~`p(<3SxO&rTSB<7t4Ew9#ZGGP& zZY-CbJlX%|E`9jno_>LPeWF^nbD$h=1jSHM^)+t_#w-cQbY)z{T~#EKv_hM)fn$hO zd-iV?o!nDrCv=by0okrsqm&Lg8KahbunoCU>Oc=mT@f|tQfjWy;@d2K zbt$`cr4QOE+l(d(%s(D^f%<+n4x^>!r4Ziu*^2p^;=5l6gxWObH~Hb+FSYRhxbmCI z)IjWXBh&L9Iau2oY|9##)Y4aHK2Jb>2^`FA6r64`Pi2eSo}S03NDA^gJ(qd30k(o> zY<8#s)#^S^kysYPiSMHoLmO5^?h6U>S}_C7fZyYo`VJKK7$lM^(}8d8 zuMIiAgz^`zTxsB>+dQnq7_#2gVNmCDFZ&)l3r^uq34Q>15WDa?Ot7qu6qZ1%0ID7) z1HDVGf?YaOM@g#S5eMX0N+;N~U*B;N&UR6fA3FM&1{lVa=}4h)zaD~LR)-Cb z;m6<)+?dz=2Sv>CYriSF7?!L+2k`<^KsA#a)rrd}8CfrD(Y%4t%xu}RUlL}SiiJ~o zoaUZkgHF)p`dJGYLY#j(4+M4nHcqS&L5t4sm}UieDRo(dZ|p)Dhq^_Fic;2ios-S{ zw)WL7<2!fH4g#MX;A2_bK3Rno`mAc*-0K0SUJqd?o+W#;87jG9I@C0=9-z{V{>L_CEs9~;5rLYn!Py}wqy8MeE7$;i7zUe}sESI8tzMI~bY)^CIKaU+PP=(5SbVSQc{uQQ+fp1cUB zx8T77^A&e_UUOPphkSlC)KY6|+X-_}eV$9Q0}ku#S{h!602HWmn_UxplUHes@AwDrDGIY%mTJtwhRTdDVrDTP-{rXjv`neI&%V%c4PY7VT*M zv)1O(@~h)9sR_Bl=ojM?x+3-R)k!kaV~_=?t56l!amH>fDtNS&b7Evkql+V+UL!X$JbbWf0^C2_5qybSmKyUhS zcLP>K@7JTn_)4fW>NKQWq)aYSR*a`k7qMP-)|n0K@b~u> z)rJW`9<<*>1!-)b%Q?aXZ3YA!600wSUyfeFa7irFI|2aPDfS|ekk%T$?$$$u*Hcq- zLnGPHWuU+BU@eP_hvigy7kX%%R4oogOFC&c{BD^2exFd}FpH;O zX9(IOHCe96rgs-aF2=mbFuK$!8NWojQoy)g=!WV;Prt-#Ii{d@0b7lW4});R*lJY$ zHmg|cy<`(GNXCsSh?O>%V4?=Lbs-B!#Ky+A<*lRAk}2xluyBi-1e)CLwKX^6ECmI| zop}gAMcVXxMI0%ND)I7FTjzA>=dFa2h6eXmCgf_jxmk#S|2DpsmCwCeu5x6cv2qp| z^KL*pAM1vwq-&v-x7RuX<$w@^ErF*khv18n{?&auNk$)#PTG$Fu*Xbcct*t{eRh_R z&bi2Rz5us^{MT&RJ|4DMBm_v;XwisRMA{Ivi_xYFG$5p%0MD;%ikVriOxf~cIIpMM z%o>3#742Co9}+?|u-&D!-mxYwf;d^I+FfKx50F9 zQC2=)q{!vNz^@;!lR{(_G5s!;^~XQ)Z^IS5S7F8rxMoiS&10%B=tINz?aLRcb!pA! zKe-FOaRCFPd=mZL?Oa-HDrSYS_SJ?WwX1GR{=B~*pbV@f%_*w?OSic1*1Yleou%Y$ zdUBZNNKt33|M~BOfBct2{^y4ssdd>tMO^C!#4yZSnE`(EsNP^z9TCm|EM8dkc*tUgJJ~Ly&3J-JnS-zOPkeL6O| zzk@-={KJUkWUKI0zIjRQKhR9odHP+Yv#k`SkEcJ~0?mV5c_j6aBG0==!zpKBe6_9! zn>Dh)ZnfYrT9frgH|#Q_fzW*9{LwKfTXpeOq`q2pJ%x5J?=N+9(2M>CmC$Jdmnld@ zo+u@t!VG8`D*x$ItmGJw^>+L3I~tdM8Iw{|dkXp(4~LgVhSZ>4zR!Oxfxix}0tZ|> z(?sh38gh3#JY!4XQ#7^PO_{m5`yNE%P-`9h)#tY$4Uqrs5d z=2QZv@KD&pOkKl}THNeaTe)RT&77@?v+mjB=2`c|WviaGDeC;h+IJ+jG+hKS1n=<5 zs90Fk-lj9o-okRRZ&;XKyOi5~p4X|Ao1pxMyS^JQW`NPytQ`|k+6Ch zWh?8!v7*|G3!f0L-4Qz8v{o&%HBS;IJ)X>9 zcAV!(u9bf>@kG86KQ7~TSBR9!v9Or$BXgTF7%=IuH>Fv_iWGRPXk%nHJDxPFIVbV- zJx}vg%(q=raV)TtwwW9Sb)&BAS#E82j+w+8*syOnjC){65{Pf zt4uu|@_5Hyb5EPG^=IujHMJ{UQp9B6&a;?l;bKju;MKtnF(1yzv>eyf{(N(Nxc^Dd zX<)lu+0Lb2_jg?O^+cn++jwK(Gb5wj>V%44-N<4ZV3l%*tLFz^OO*a!mlE6SSev-H z0#4jzW#3jS9bi z@IVl)o(=SMVx$Y|YxLN^6=?GA%<5|nOkl&7@2l_{o{|H*Pq^GBxVO0a#Gb3Ws08`w zTB+^KwR&JE-p-LdLU?;YVp*wOdD(XBgJRB?ZE->m6#_04x+j^U-o@!?-x!%b=T~`4 zTg$n=D6>$uwSH5vN7^=RyKz!{E3_S0l;m99b#H+9ve>~M8XtuBuQZ)!K^tM#7HW{F zdxl&o`>OUYKtemMw;}0xnmR zao0Y_xQ*Kea=yYUK7tPNmBe~YTznH=a4I|Z^BTD*u$$I!v(o^_Z^Gih{K)E zc;)|6HL{;P?Noa%{Nz^zTPW${-*=Eos^_HT9*#|AGHF;b=v_hi4fM2GRX9ldikGMw z;-i|R5<+H{PUmx8hwT4K_U9;$$ZM@IoV@M5vf})=W^yXqMC=$oy;Tl6)NFYQ=p0>~ z5+M7dz+p8{2Nx&82NVsLat&9L^J`T}VefUA10^8pkR?pPg9!&H4LUJI%F9 z$;nm!0Gyph_r|HTafXe&t&#popC7to8yKkQ|Fuv$!3@!YapBG6Z!C>@gXbZrg&@W& z2Ik`dF9D9C_+wk-fZ7{ z)o$`p;J=;8!AGlaGNo-qqh`XD29T!uR958FtK-WS-K$kd$M0)QH#7P;af7+nC)Yld zFJ6#5`CCbHJ=Qp1kJgaUDvQ@Z@Wz`j#SieL#v}jb)+MW0sFN3<<~h#u2Y4XlBn|1q z{yt%jJ``XC!iLk7{#UjJc_b6!#sJ<;h9!Ru=vpi;{`#e_twwUr(i5Roe|3MH)q$y% zddJ}oB*_;&j=^2h@wY-R3W~-gu%zgZT8t=7>-OW(K z2+DkD+G18r(rjV@?4k-&J zHSEJmX67?9N43#%35(nRoI#BTTvqRf21G&MJkWuf#GslRm%rB6AJOPpH@v}W>*4$p z4zhlhx6_WR;8jcaNhdaPXK88UV`WIMvL@R16%!udH7o@>fi+?+YEh&yeB0oX_-AO9 ziTf`HshFt|?}V6_0Y`*yv;8{a4$VclgjT;(0;g&aNq)dReYe!^sbULn(&zWGX1-+o@wMxP$@bk+NW1)s3cmc}=I=Wj{A*9))yKIC ztH7*u{|*-e*NV6&20JZu(e-6SAfJ0>|LX|?)d&4uyLXTD`QG^+YBbIZ-`iNm=b6u| zk95Yni6pvSxczyvXG7n1DPC1hzNGGT@9=Nef@fQHz8aKoEe_NE#C+5`Yvptzz95eK zCV18W(~$t7!)YN8^=_Cv|2y~Zi}v;AoRYReE8l!-N_>5JaR!8=FkxW77i&1C{MVO_ zK z!TYDd);xAzz4dyh^-OaG6h~Uq82V8);eMFCI^DP-dt3>emR}Y5^9|#DG1bmXszk7g z>i9uKP)u^!7p^2su<-Y#8AK18gls+p9RCVzIo8)@0o@>8hB}*A)hmE_Gj@gukhPE- zGv&bz@tvy54Yp4Q|Mv9$_bxsMY|e!GgpS^5xp9J8DgaJN%j+ zna^~ku3Fw){Laq$<3HN^JEffMXvdqQu8RFX1aSkKE>C!Nn%#`G`b$>+IGVlpm460T zB@>)r%)p-?CiO90$KWs1dRhan^cn=O>F|W9knCXoqWh+RL5t=Jq8y%^sX`2|bIs4@$Gi56B5J9@a1jYf3){sd+FnV{>h7#< zn2g)@k$|=*8m1U|138ltLWI~xrtD{18$QD*W`N8{ey8xFSo46za-0!ch8E6@STy4* zOI~TxZ6`stZu<9(j@~AQqJJ*oCXTFfe_qTFmVRwqjV=GNFCnNhhc|EFjqeFhUT|@v zx7U0x|5ba1bg8{0T+feCKx8ty*uo4*So?dw_9+s0?a1os+%3%wSBuseO_KO7d)^c%x+(`baaw9ra*D8$IVo8Q!T zMbhDI8Qd@9$(yy%^Nq>n0qa}N0Q0qdqwsR0fLjhTo_YViAKp@Rtuc;PuJY=qlMStj z*#;;n)2tNd@8Ku`VU?1%*?F(9q_&B#>+VgC?$-LK$QZIRC(~HeV0&19!rtF^I&qgB zaU@;7-;TJ-tDY)etbV5|D@FUP{^^_Bxmx|1x)nJjtp#xjLb+w~mZo@c(z7!IVj5bJ zYFtlqb%dR=N-eng%z}fD#jRdR*6?W(p>9~hB4W=F&qeEf32Fk#>E5SJwtCq3ZU5ec z&+~vr()dTY_cAhKnUKhJVQDo;~+7 zuGjsFva4IE7csUQ;dhZue4iL_pZiXr#O1SP zNA#4iv_ow|FAkpR;_6@XmM~{G3l2qmoPXD0k+};DP2UEFl7#df8u{zaC8n1e(Lr|G zm)~`tAgRZPJQq+ctjw+SYx_~5Sz*uF{3WH+y67rqH{hr-B_D+szZ?Oye?kBH_lN4g zN10R1!b0qU#L4i&C%G?QdIyzKVJX)9iE!zEU=?btuvXpbbZKHrdW9p2p(-34^1TnO z(+9!cUv{veJ(pjGZ4??BkC>^BHBIvrP|~&{r|x>|nsk67A?%p1Kzj#Cqntla@go&* z^9NFSD6`a_zG@nJY^XFL?#2_(&r`s&&=Ct&H-5g;x^%w0YcIlP^7HRIFE3Oz5<;uN zc?p#bQPbf`=rtgS-U5}E7!A_~P6B9Ch}LD_wy3jjb_Y$a#_q{Pz*r{|H4H)&PMaEu zK)3!)yg2KNl}$_2s`4BS#mQD4UaA9#wJ(%H-tRmH!?e-As~Y`yl&H1qAlYp7Y68QN zp1UK9d^^VZdl#a24wWy`M8Bi{h5}UMv! zd5qg}mD6o2Ira3HYy=aeAb|CHLitVjKV@WRpIz6B3ha6`+?;mb{&9hm`umRcmxx2w z&P3(07U-=DN1^IJSXp;t!$Aybr!sTlS9TH4Lbu^$?&GlPIdr*~V`GtQNxe#bSMc>Q z^i)k%BtiR%)k8H5r5dXep!fG3yd&qe#{TM4zrEs!Y|RS89}jx3xH&V`OKzZz1syX5 z-JA+#5j*Iow>&|IG1xOe=LpY~z~)_WSnAUu?uqc;dBbIQ!(UJHj8#dqWJ8Lk^}Or9 zG&6>f>Y@tvDBo`sID9x-S#Y^aHa%k(uRrXCkxfr662;}6nPvO8|8_4vZJ3PR1d>5% z-JZ8E&s4~!XGzHCn>+4a^;{SB7KStPE@WcN_3Qr*H!MlQ`)tE?ZZ~hk$A5UE42^&J zf}N0mrr38i_m2L{NxTDNdS2+|@1mdWjZI>Ul1eyLJr_GDjn-xXYW<#`ifho5bvJ-| z+K(n7x}`Pu#_gFdd;2K*{=6OFbVW&`s}Od3;JQa`CAEDp)`u8uHV6K5zr6l^_2?AP zUP?V2!Mj2a30?1U!VFf#E^S_YwEetZKz=ea09I+imOmK}&)DXuTe zPS6}cn^9nsQ#^sjgS(6T>hVBY%lnc-C50Odah==Nx_DO)1yj#5uct1dP5PABw8@5P zP2L7cdR`6l!te(}EF(t4K7-R8vPBAlJgJ8p;Ay{*Oe1%h@Xs?>2iIZ)H0*2#h}>xq zLW-Q`9lt<@e-wy17=1RXluB~v? z26G=XQmsF=eSZ@fWqo&LG2jzi(NU59dz8j+ekt*}&FcE3m7MYjSdc{nG9=i@9jF)S z4myE6*9td&FV{a4*#(3Nq`^@1R&UN^F}5jCdh_^N&!+9A$zz_c8%L=FgvI>&Ux!tA zg#GDtfixJ#rzyQi;to9vV;_`3WY7%eAxak?1)t~F{sP~0z39RrmHupy&(;p0gj+F0 z=~>_Smd*4W#kV;4h@OGuGW9AaeS7Vc{rmNt9vBCnUu+AX*3{r9U1yFZtd)AywGS~? zsG4utNgcZ4LgFE)A$G$II@>Om&GK?PS)tk&i(xBhQ$3kfu|VfmPa-4dhZ++#U$Dd; ztdw6Uuy~wZ!KOYJ3pgC39cSGKwLW{F`p5r#qx?4QH0+fWga{fv&A)635tUkViO{Is z^SQd_T22t(czES{v&ZIc@!`o||Na7+wlV9*!f^bdQ!x^VM!AorCWi9g<9J|gv4hP6 zeo<5ega~{DwyFZs&G1X4SISK(?i+3OlK&xJi;Hv6H}=AxvRYRTt(NnGL<6;HXaJ*N z{xQ6Nd&P;p^On7r!=SG@@q6`oBZ6oAJJk`pNR{p9V6gaib?Uy%h-$gIN{a2pc*K z(F~WBY)07%^iI$Y!@iA&xPxGFMD?yF22asFd1(%|G8r>%2xRp5Jr;1ee$Cs}!gq!; zKFRv~P8Fvh8QJlJK#Uf1LNFTVCAYbx`ckh!i%ya_&78#xWUhUzi?(ePuzLSA8&(*$ z!bVMK8!ADKncTq9ApUbTrQW7vYPBo3?M|}qn4J8JOliL8)935a2U<>qLh#Z=>*}gF zwp8itZOWhV3byx1vvF`)gyI*Jxx*7ULl$bRU)w-e%u1B&4}#wN8BRVRkYJW^<>-3% z{0=*4zC~B+#^5qf|LkH-TuinN;&3%u^JE}@dq$7hK3?$LUT^o;_@K+`U!VCY;S!O& zdUnI%8aPklrz*T6B$HYOY1WESR<7D}1$qUwE4D)!(F=P^W;i5wOae2Y8Or@6_*iV6 ze>H=2qT=v|Cb*1@4f5)$K?mAQIjdxwd-Ssw~UJ%9Zrak z^qt1NcrOk@px7>*sORT^`tXvp({kZV{(4P^$p>QqaR|jz08Gp~Q0*HcW-ZYZiezQnhvd&m| z4P(K!Ra34gk@s#HGjdauv!C@|DcL>#qN$1gN0jyhHPy1rDv z-c|Rz=6Zc_#=b8;>a*LS>_5wcbjl0N=N6)A1#Or%)C|r513X_*prJt_l)Fsz@HHMx z7Tm0W^{;~NkEMv*;VmAoJO6c&cbPJ+f)03BG{)XJLR%O17q0W(8}srQ)zUzzy-cSw z|EQyT3bJ3x4ZZh*#Jr6+Uv-O_Q%vSfp3O}Ssi%38G)p~-Bcbtq-zgeluTw{I*f+P? zUxBwDQ~S>-fTXJh1Sbq0n0g1hAACyRw)gf5)38+N)ca|l#jVY&!)%@Xh;?1TVuDOj z^1RQ4SLt=Ncb$n#awJE^2VA1|t8To@D^>LUOtsLg?ltaDO=ag?emSH<0BJJPz$TcP zkc<#Dfd`U0ok3q|;bQVbc+uK9PiV(J)1;Mtv=mRZoS-l-vOyJKkwaZtf)=y{i>Guf-LP0i_V8}f%+oop*r~eLTk^`Xz!(g_ELvq(A*OK zOg8%PTW0hhK~dnAxy5R$Piy6j&Fr-t{3V|*DnM7in~$2fLdU=ZVS`ipLT~9sntBXs zv@16#Q$q#5AU>p9@($h~@L>IG=_%`E2Ry*IcAiblBjm($^>B2x(QHM!>hC+EXhA@K z%`u~RhK1bu+~yT*iHoH>L>chmEH)I1EcToXaf?r70J)o?T{^SDzRWJ|@$th6^YgnV z6Fpf%^0fVJRRn{Hev8Z0yT}*m?E$8)8o(-c(@w)bo!|Uye#6~FH_ffAbRMByhbyw) z81)4gG_Ok}x^GCAqMUqLRleoSN={T?DBW6e!Ta?HK#-U{amcr;-FTsXcyDTjhV?r) zH#e6EDtLP)(SsT&!%G%YtNKyhZ9r3J5|yHs8)nlhn?VBF0D&gZ{L0+C<=i(_F3QVg zh&@sIFNzD@rc0kbGThu~6OA01>3C=xl#}?)kgQS^ycRcUlucdoXj!|;0+}?w$AbK! zg8ohAi{K$I7O|bwWcu{Zf0lX~v_GyQ9X}&fT0@9pLR4Z}_0H)fzH2`50}LU8yu{Ow zu6=gPul6uB5QiC0aoEewj4WPVl^PmdizI zi`L>j+^!+qIqx;T^l+5qd9gIPY-XrVPUI8c#NCXlMtoL0bhsuPc^y`M3CasBS^38U0j_WrF8 zsOTHsA6>3{qQ!nmHP1KaW|&=-mxi}xR7)VfS9|&U%8w5&$FR=L@|gGmj0+M5th?5n z38-U*_Fa#`GgrOk&_H3G*`lB+Kgdkph>gYR5x%IXinVq^7C{;-X@~c*$O~}VbsoTW z9D}6ZHLCH!g~igc(~cK(2k}L)Z^=?tdBMd_vO40`ulxtqWwUhb+&aSKX+4iG@Js(B zhEdKr_N^giJ1f^j4UYveyzZw~7>y#WxzkKW`SfFYa8Qq*}aSl~WVs8WFvwn)yofTUvGw0^vcKeo~nvE0-LysZPZ$o5LLf)p) zF)bGN-BfDMH!vIiE?YnDG&5T7xlcg@EFu`W7UsVml@j_al6Y^@`Jw{nm(I&1V^wCz z@@z&YKH+;g)#-5e!-HQNs;#YpoM29Q#>Y6TAX@gI3*`HxK{$M zMCpFk><FN0t1z9Pmd!|adyH0%ofJ6XbXqH)E zkJh;-L1rsRXl1fomv^y6FnzG9oLS(E2-2|*HUKM12QmmH?lfJrtc#0>2& z0Y8uQDwC9K^=@OKGi;9XJjRNF3e& z*!44V>R8wcugMoJDkNHmf6b0i&fC8Xu%Yosu8$#&nr-`)p;c$!z}77_?_{~3Fh)02 zj8~1BXvL{SY47x;>EG8oCt2EeZ8o1+X$zW#%yO(A`nG!?nvHV`%TCwiyXDw?ZY)aR zt8=N>nEz5X#KY~juzhBGPsFdp&dk${R)@-zliksQD`Tc5{yuLhE^`gS)0c!owAp?!3j8E-j<@<9~&eqZo#-faVKYshg zl*L!6cd&wOMqgIMzBunR?P=jU*h(rZI#u_+&Ktp1v$)lJmQ3C26KCuZ5x4`gPI3U2 znjs`d3{V$0%Prtnl#lrmW=fS_-6yS!S*W_4{+i7g$}h-%JR_2ifpGJ*XdpS*p0utJvURdS!h)KGW{jVL0w%r6NYy#k2_X_Gv z603+7Dv^Ex-Wl*D!0Bns>RAr8d79PzQmbMUHe!>JEpIZeCY3`&D1v&I~U zk+uVPIdrr zcC;V0-Pab7hWHCFRAU`S>-~t3tdkgS`vBTuvMYZ6TU#-8?)3?qK4Bl5$*7 zhVnAsI{!3wyF+vYB%8NK&3nNJ-d`oxd(7p9NX)2#z7vM?V zk_qD8ofbkPK{!A6^`6-I&BW?6P3lx_0R$LczvimawSweLpEi_e5uOx}zufs^Rh}@B z10b~sRUN^73w(dUd6;RGv?;GNcF z!`Qd1k@Lo%XuO1TtIz`fpTpNP--ZR%1p7+E0Qiq%3%yC@cN%t`{I@3qckkozULP*er~q0DgqiCqI6 zVeWvSH8)UDo;RKFhIw+Ac&pF5;Mza5h|P)4p?w86_^sHv3z|zulY92^mHgy#J>58q z{e4|QRsnjYd;vK$x}ui2Vl2p-tu;*v%Sl&FNH#r{huBoaR^>cczuN_+YOJuBX=*et zcMS=Yix)tpnPvPK>Vp3n1hF`krx{V-QzMYGKzkd@b&&e?CpX0@>~bHUl=D^jm*9fj zag8sIG(BR2PgpWUhrLEN+-%jRZsrQRNIyMT|(`nDI{Dt>9b>rKWqKk-ky<%G+L zyMDfJ-)`$##%W-n@FwXShQHPycR8lLcrzy|kuo9F(-J(YUL3UMcxe2}dgx(nNynoA zRuL=v==4RvY(0yue$ZkoEj!3JWVEzy!{^W@2~?@=N1uT4MT@FalL)ZZ(x^Bo9u(EW zsKo$NRg%79`7hUv({?Y4fJwt7d#n>8O%HxNuj>d?BB6T zhHu3Js8(@2@eAMQ=V&e4>$QwFZM`{qKYFHo5cpuZS8O&><7+b>#z_CDr!Pa)E;P-M zTeLj0M`lxaqZ*b(-yNzL@Khe>ne1|PI`BlH!%ZpYVPjWpWRI1f3Xmw@ChFxBx!5|1 zZYfiEsJrZHvo&qjgi3OE-@7bCtTv47C?f4jnnbC+2FILWC#m`_OS3V3%UL5ZCb!%5LdsI;#>oIt}99BplyH6Bdw|{|*-xbjX^Alevi~QD*xNK2t$DiI@dc1%Z^? zOj~tKFNmJ{>BI?$ry-!WT{bVUK`!^LiiNE$f5-s8!(@IY7%iuidDy-t`uu3^iY!Z+h&;UfF)gPdzJs@}D;Lkj&82$%TZt5eunQgGOF&`07z-#8Kh5}_0k zuM9fR?z&vlNEBUbgbCM2_}4AB7V}uyz^&i^#>WAT>0=z;pNdA2a;l;jf{C}zd7t(k zAkVp<_bAEV2%`%8(WQk7SC#vLy7zWnM@4>k)Q>Ol&{4!uG{XTaJT&80O-6+=)r`-j?SSFM$ph6d zx8X|o25!F4oAQCd&WtFZDUo^+>n$U5FY{E>cGeItWLD6nMb6sz*FAMmnyhO9lX)W@$IQHQBWVDQaOh6+bF3q~C{tr`t6*6Y39k4e+XtA-AKxqPYZO5Bm&nncn< zO34hk>c}=4*%KpO;aOJJLu`M{;Kvojy=ix?83aCFdn03q%*SOAf%TKlvwNjSeXq6R zf&YWL_l#;QYuhwk<#M*MF*(~rlT8u`43tgICP*Ses7?nLVS*Z^Z~(4*D({ z%MAQL>kKrDv@t@^BN{Jl37a&1`uf>p$_O^CE%B8z+PqVwzmNBrAtJpzCOQi&V%QTV z$Kt}J#HD(|KG5rHnz%{qobJ++WZ1Nf1UHwA<(IA!Bgfpi*#7uh$Kx12Zk|VhMdlSqg_+W*EW(L(#4Hiy8y2!$nWfbz4%yBw&OzKl0w~#lM z^*mpXgZi-vETPE|paOybBAX0Amm!rqsY&B+#Yf_BF;7ZgI*czL@$m@u=WN}zv@Ds; zA6*=5YqVN+m6`Ro&x=YzB(muVA5=wKTbI{4pf_8$co$aHqp`O+?Zv@1iOfSe5H9&> z|IL<{m3vo)5lvJzs2UqP<8PnR?5&fk>iV`5)+sd@+M$mLO`}@AF-0^?+!V@;@lxeX zA^Z*t-F!n{-3)R(IVP>ina6C_Mr?WV7z}o=R3GVnEsK24&d;u9ajgN7OUv2&rZ#df zUu}?|#y-w01UAr7Fx6{5p3^g9`}>45qadlo8fC`=6zwqSd*CQ5GJkBXvartet&}W8 zO$4x=LzW1;gDScY+lv3Jd*ODVA^c)T$jM~J(cn?mU>gj3XdE^%@40N!r?w_|Ozm-i!N1Xn|J?`Y_@;3IhI+3Xn~bouZ(x+LSC{!?Q#fS3o z>foo#7Kq2uGisjed;@t)&(d_^SozZOIW>_qU-qO{tu7qtBn+%%D!@0V2O36d~yXyVC+j=gb}JJy$l~clbN6IGm=*fN_SV zP@}62th*}LvSeJ};Q41IKte;;4}qk8Og>$D;9}+wiJ>wS*NhhtIC!%2P`AylS5IIi zoaOH|I*Fv)9X_bAKI@<_icLcoI+D%Xfjtdmla^@~K|7~S@xF@^|C#O1(K0?G#1&%s zQA%A|cb__&cdV|t4fkU-s|aGbY=eWb`^q(9M_F&;=Qi(}+us`O8JG97;SG&`+BM+8 zc;DJnO%rEgY}U3{zW#uv(ca^(Q zZ?Mllkv7_2)3BM_0Y#_`qCn^DDe1xHV}2pt?*`wO*(cAulu2_xI2Z64N@Rdrml~hQ z>NdO*uCZZqf@xM=_8^N(!CuAuPcC&AD^j*rtE}#Y_SrHp{M7?`TXI~CnPZ{CA&M%38>_JkpL<~8im`>!yWA?qTc9b znZ2P_;onN((-b1ZzozQ$APWAWr_ZvB49fd@Lwd~@|NnNp| z5D>=c7>4x&^#d7V<%6LoL6oQJ-)KCeS=YF*setPobzKRUXG37aQh$vGz86fbx055B zTkCEd@^p$T&ngX0=a3mif`8B9q91-^H`Hp}udv@!IXe-cNPd?iS+zP{A!A{xk&Wc? zGpyr2fA#s*Vc&9%8XZOdKhxXXl#;r#4LNKKc(wSm&r^bpCwxZm<(TLyb61u5c*gB6 zgUU>Owp&pI)y}5KL*R@eJW7ZYK$v_ zFy`k6u!w*D^g5m!sa?(-+dOp4Nak;>By2SW|$T27dHIMwqAyu#mp+9CFODUt%S*vs=RT z4XjqbqPnNh>T|oIvpOOQf4;&jQV9HE_RI0sWU4ff z0`7si2k}W~Q1scH>9-XEVr5CMGJq5C**t5OgzY~kbCxphu~1+`E4o1FbkweqrHql$ z$`sW*L?+xlgpz<(?V0otNWapYmAcnpVQ*3OXO5jpT4m&q9c~j-VQ`HBO$1i_Lqf*4 z^_Bql51net9k5V0T)o^#lUCNWmy+p3wa~Shl{UKn616qOs&l%uAf?$~$7WCPDbWV4 zVeNTpzH=L#5K;YWM<(;JebTrgsj*ii^J+7On7nw?uTax|6*Dx(jW8tm&4V!8;CVn) zDJui0HZ`^rbHH_+_CiTl-mO%qF`SG3T>aCg{^oZJ*zj3O8nG^a+jFP>i+|Fix7KqZ z#2F+0uR>AY`bb?!iH43bZ8SQ=RI`QA$Jo8SDHysL7v(tLmo$936{adH|5tZUSnGWI z2+AVNx`6_CI^oV>k-_5pCQvN&IdOcZiSpIOZ*3gEB+k{&jmCEz9cKGn>ac~G;+l6& z1aK`uRWpy`7$WhUO))XZo=4LgV-&_AgKXM_u#m)5!1#O9JyE>+WFyB$hw2nvAj7vM zAGdy;Ktp8x=*BUBVw~qhZ}htguMIVUxe|~mYZ3O@Vzhe)HLgu-0-g3=C~8Jqi%FIH z!VVx(=c7HiX`-_mTr;5?>j?BCYIj0JHH`uCwqsi;)oD1X3SC&CF;l1i~UoH4p2H0^FIa=3%DI?s1Q zIJv+v=~?WDk;Yx71`6;*{ud~v*_!0#JPp+Du65Wh?|j{6GooSW(z4R#j=WRn^Oq(p*QOq||7zErXfkbWF7~knj|= zS^FU(w68Z&CbBRRh}KnnfTJS|q{<+5O2I(G@8vHoi#Gt?gP2`e8$s*QaW$n(&rG#$QG!+evG4ga_30YTqAj zdGtI5nvSP%?s~`%s-72iAohEJX-DgQfvYDyghTI;$zDFr7yf}bFR*SAheOoonn|9l zVmGN{V%F)KCGi(4oKMtKR{mIt37Y$jcTt^gbCZ-c`}D!lWeEQtbb^c95@x<;?ey0-coXh8zW`VV0h zK;a`7yz%W3rvZr~;}^oOQJ#0V4f?8Mx^q&QPlVq(M%i)LBTX`R{f(sZ)ye*#!YS6M ztj3tb{BxeNGP^3FXo7~mPziuvIGlY|gZm{B%nev{UyRu(YgQj0uJToJ$^Ydc5U`_H z=%Jku^2MU%>m-Z*;UpZxXE9pim|99|?HX$J1RIlO^M_)!16HQ4k>4)8zCW^}n!ti% zzE0xH9m-xmv?q3FMcPAS0b=sh(NN|X-9Tz;1uobb0(t1E%5USJn`o|UtHDkp4fzwh z;6c09& z5szse$UUFQ8o0wtDiQfnr)<9&t-;DfFY#mM(E;7r5l2q^*Qiy2-W@7G#S2{xO6{BO zQen2{#$)9-2G74!!p*Xv!c`ZNKcdJw+LJF__zwd`0{^Vt%_Mv%J+ zQL-PbKc1HI%@%qd(ci@992e)HjIv{o?M=zvs(1;Tdq_uLVqD}T2iAGYPh&eQY4+r^ zfU$^FXH(_eY~$S(_c|sk>y0C*R~wNan08*GXi}6ufok9N!;&(*mRN)i zCJ-VmpSk%#yOX&S7$C6Tym^`(5gr56=`-#mH5N|KGj}hW6?YTIlqoz}PEP4hD%Gbt zJ(i}&W-HYTGx~=5uS_NerCy=)e%Y1>4No0>O$!{y(`Jo5je2b#HlPXX!#GCMcrI`b z-NCmOqER|I$=&3FvxK4%#rtd$qsM|CxMM?DoD(h*PvO5{AXxuGGb7<4(n{rt;U|!q zpqmt4y_*{o{bizo1#DchtxeYCo2wtLCQG;yLv-339tig^_B776j~`RKZep^(R*iNK z>8(t`rADe1;1KXkN?auKMWp)yJn`g&mMxeyziw%;;BA?oKd2L+N%xW1#_1FO%QKP* z^+8hAzTf_3w6e(E904QQsn0RJaSW;GE0N*mr+ z%=$YK+o8_7>pX!kO7MYwjnx6;oq+AcYTgm7o|30lk^9bRcIVQPIT-WB2>+?=P3L3; z^dt5U2<|nrRD|45WkOemY-9Z^ zRuN@(bt|}Dara?z22F70?l$DK)64dL1@E)}uxncBqxfr?X2$DWKyb-iF|X)H(bb5_ z>z_`FpLiv$!iVy_^mY-P(lyyMrTdlmZ;)&Vo}**30=fA3_)021qJg7zsq2~d>@dL$Du8|FgWnd z>XWuP%WVUG#OcdQyNGw^CKw!-um)z*UnU|`De+pIL6#Rl;{6Uzv)Ra03NkkKS{NO= zq%NO8*6?&1A`{+q8^>JRRV|a?*|v)Ob9Dk~ zT}+jZ4ZO4l;yfj|xvAT>V`R?Cgh5(^^J@C!wjrj%rDeteqY6F^HXh}I=*^bn6a>wt z-{rXnT72}qm;vdj59;3NbDsOV_3?jBs1j{X&`JH2wMedDA=N6HDz43vuIIGF<~;T7 z%8JKw&O1SqZ{PUZ8dBY(R+yTZ=_{e*(SI9mi(wO`vXh_Exl`dr(wBNQlIu(J6I-CO z;71CnL$qXu4P*Oi7j{(7;qDwlFW*^%{MozIQ?Qadx#r#)w^;5^N)yae8}Kuln}M&o zU;oi;u^kD1hjlHEI}joqz%tv+C%NQ5@o!?!7t2i|=osp#gC^DH6*yk+g_#!#^gR-8 z_^8H$>ihCUz}ZlBb}B{SAzDElBGcw4cYpJXsmxvuMDb-5_?2Bndg@NP;`BSEnYRk0bZ^T`>ufEgh@&M#^)-&oj~_`(W1& zef}#gn`<};!~8a;uT}9UG`sj1+JYY7?hYRZt-fssNk6BVgH%bs06us<_9|%Ey-4Q7 z|INP8kh41P-jAw85A{Niq+W{S+*|z_za9=*{@FL;y*nkP>hr+6MV{U9uSEj5o#q7B zC%)HtJ}&w?Rsq0%Dgb0!{K%Wlow?Nz7uWY4I)Bo}t3SR3?(z#35rXNW`V)&fOOr<| z9KY|#=}O$fZs?`HI0Q0HrK7n`kCr>X-?W%RR!-Eb8fmacZtR~b%nTC%52#ej2469+ zpXSQ|H6=ae2~HS*Ck6U)GS+vy$Jj0|I=7tga-Bi&s(*~yBL!q{30rq8ftkr-f+e2K z@#X$~vAe|Kx!LR{v}$9ni+^L+@>}5ufoq?5a`|G)d2^iW9G()O3m!nG@^Vohbf`87 zj40gdzHl443NDb@6$p8{W8KF*n}}%FcEW0{kzd~oVj%p053{iu&+m}n9M)z}tGIRc znD0*gD~z$(26Ud0{b~Ys?RT*S*`o@oNk7Z8Cai@MYAoibKz*DFh^p&p$E*C(Zi z)$=Z31(uHQ^6Hv4uJT5jrKm*A%F{4Vkh#@dD4|A&rXHDklb>=${viS+X{=|x?`KT4 zo^=IBA6xN3$a>P>)sYw)bB7(tN~pc}KC#Z=Lc6s-@IfS^nwH=H7Z+ z&;ncI4KErdeHj%@4#dGaEnlCG<$L}*Yo<(Fybps6ZZOwpWdG(^81a+Epp)Wb* zRrv8)@*r72?A$mn>3vyb7Z(p~%6k&c99brfRw-l8JX2Y-{fo#OXBg$s+a4a3Je$_P z5*G~Dw_+Dj&;I@=1rNL&AX80@F>lmviEsGY1?Yh+}Tibe#tts^3kYsr` z#cpdrFr6FKQ01R-D%b=;8%l4SB9%T^YRP?@x)=hPyi`CI& z8C(v?=5ufj{{pyg$lCGzz73W8yWHn)@yT6)fcpkX>_D-Yv}MLlu{1Jpud7x3sccf{ zQ9%8JDJ($NO1`c_$JZPg0?JE@HD&MZ0lUZ8Xng`k%ruBRAF|%R-+B6efGUai69R^8 z1=LLp&u85pK3nb+r5J6FTAlFyGHP&Tbst3rd^Y!A=d+l{u@8)r*_zVlm6T~+Yh02& zMt2TIrNjI_^Ti#<8k}Kncy9PfQ#*4r9-vmpjQRoEhS`&DY41Yy+grsA`rZ}s8Vz?o z^jVN3s@Jv#wu{=|w}t|%hwY!OIpefu>lCm%)wQ}L2=AS@KNeLGZqxG%sZy$5c=ulm zvuUcMHXaJ817lZ1&%5#!mB#FIl0GlGvrx^5=LAV3k`*kY)+jiJ%bBQ$+d+~a1|~jr z5bKwkB%T$~@(T%LY}tRzcJlWc=2?eJ@Y~!+4w0!V3UnD$tP?h+AnZItdZR(j$050+ zs`Y?lOveax*&|tltexK^E;fKD*JjtL5$iW$Uf@3wocuInZAmOqTPv#Z3mK+DA1m7V?Oz=maOZu2|eXQ2&wL7#7~63d6n^l z-lhIT`4Idow7Rrcq&ww7JY!+Iair>3gRZ@vyUINJc#`C3Pm}LP@1mG38_PL&>WRs* z>zw`H0sS+Sh~zKq5=y8st8HAxYp#CxV^wv;)|mgdpmPl?n{)13#< z4y#sMu@MUSv`%2usLoQC+HfG$wrVbp;gMq2EmRnVunxy3#^xQRj z#mn~>DKW8aBQl3ZF7H!M1-K0SAH|M?1sdW^a0a1`A2P6#(aPj_E#JHxp;-ipetjHl zE6U8weEvSz%xj&1;d_^-t0|XIXl&vGTPvJ4z1Jp{(B=uz!7Me#=sU_<|NJ~>K{roG zS6g>RS1mg#Nmu`LD}!Z48lj1obIb%#KQ#YTzI?2ScFUo=Q}zQri?9p&mBTx^>joFl ztQV_P?TQ@|RmG#hZA}nb-qJoVoQ{h%#bs0wN!#v7lrK`Sv3oY6>D7mg(}8V!t+82$ zQFOZAd-&ZnmEXV6Uq>m5*(ADi@g#6D2{p)t(9SD(oS!`9ABN4=?TRk#f5LF7cuIW# z=Z4Zrz{Jd0Qy*V7l+?J1x&7VY;r4x>UgTsk$}}Y!^Z5Ob$;i9(x*U=jq%*DF=Y%Se zI?o3*ajg!<%syJ$rC*_9Wqq+#@^uSBO=X>AwIE59S`VLtptXZv!S}P6?T!7QzwE{! z1uIg`n!vtogoTpzR4miaHB~7W;o2#=VASGwRGX2Jo#ofBoLWH6aJBjm*<|Gc&afZX zPh1&R_sC06cQ|q3KZ%nrU2rj-_QX6?KIWCwa6qMB@5ulXZ!rYZoFqot64-Iz8t8Ew zkEue@QESusdyiy%g4e-LT;iXdLm3eV`?I($hw_s0Y~UI$VhbYZt77qBGw&WWa)T*2 z7!Z$Anfj30Y@Lyv2e~I~tl13xTZtaAW@}U`njR%Sn)h;u1CTd@;5ZQa!P;U9$tfZ4l>_IHkq=R=A52LpcYTOPntK2gR@hLT6 zL0@@)i8r2jw}c%nun#H1_h1E;+udWFb`Y_^tp`V%&31`O%#2E>$=RhtA~GHya&kUK zGPnMEQ>FeKRt8y4nJLy4B;;8z#O6OEioG6D)d68tiRRU+b96A@r^o0_wv61$Tl>;K z=CraHWdq&T#{1^vre88$>Ub}^oj;JU7T;fS#Bw||+SQX=^aGY84k`ex!fRqeXKAdj z0!}m(P!z$?m}5+AhRav*^viRKDUF%)fN@Tf%J_RVsoji5x2kO;h&YQL)aA9aI(IC& zAaUD!ZCMYF_bW0f6oLhoQr0_K__s*^++fIbkisc~=^En@ijmT#x!tkBbZ0G{*LS}E z1c*kLv^PBdqHP=GH{Ye;Jn=C(qoDO#C5g|X23C^(&kf~^n`Gl=j@C292b1xPYbx~C z7k%DLtjz&FYhI>eL+eMjMre4oRmfgYIFX`PxidOB`Xho${hu2jboLL2DiveM%8lzS zBfD>|R5lj=T1!=eUmk6>cpq|ncElh@lwMDrCIOG)larI21!ZGr=xRzUY8}c6We?X% zgVqE)0-7HrAl>EQabcm95u|magapy}IzW`uXA@i64C?&QbboHC#+k9)--~lT^Ygdz zs%iv{UCy}`(wGah8(<^`5V5E{((M!nD3iJ4Tc;!j!#5!Sk?hTp*Ebgo?|8AUzUdVM z3k)x(Z%aK@+n=5!HqbtKGw+{9u3JkdsFw^(vei6llqHRy2>bTxeY13z&;~88Jdt$( z#K%rbB*eImm}D1Giwkt>GpBGHV`t(EhkN<-Rj8n8LqHM&;4oF@%Px&gpNu_e^o_ zyis&^Y>}{GtUmQ{e*(&QZr6Bz97Jgg?D>J<(^C%M?#+_p?<^hg9hsgnl2cWtg@V}* z8ee&rg}Z^}O|na-K~yYmmi9}jqy}G54}mkUo$PbYX#3-Wrj76O)y=}d-&-oSqIhs& zMReuIVoZuWuLk&&AAPz8q@7itr|CHi>QT+q@msEe=Yi{?)=D>bwA^9GE;tqu!dNje z+5o_6i4|tT8|_-o{wg=_ogl|9odi-b7F!w%h!y^GgLf2sQGx>8{W)q`5CEDyoz}4{ zQhUnmuk_mapBn;(4in3%UNYki>>5+4TIw2N4%zD+E5ca>_pLLzC0jwh(q&=S zqKesTMp<0hI|*OKM-~=IQ>Rxf^`%Ae72@^s1!lOXI^ZVz6*!xNgHLzhq~vn{(;9k66YXClxPyy zV#Dv^kK4&ywg0R0tpCmb-Qivw>XI8#Bm28vS%}lw9cTrA!=I{MEymNdx*T3z6nIL1PUjxklr9eX^N!;~b_?4yD`<<6*mrlZoHtC6;#o#+@h zKO4`#{z&ixaIjiQv=}gVO*j|Rnk?6xXL~)aWv=-du0^{?J}T`D9O=K_`P%$vnCj90 z+1>r}V=h0u%temduh5sV?5_&oc4BY6m8a4jk=Q6y20CFA4a03zaN9`I7E8YRbrhA<$maAH4bxre#ObM0%S?i` z?nQMra=2a+KEZhGpytU^lG^;yVnjpf$(bPRskB_E!iWTaTB?Ga0;^22U}rHZfGNvg zf52NY1ciCL>>njrMPu=Lt|g0BD-iEJ#~!e&z!}+Qb@!fKANR(q1mI| zkhGs7r6OE<#i$Y_{Zig$z&&AUo#JMXm3=lRBXrY`Zc-%zv|5C{{L5s`>64-|=mua- z=A9-LbMv#RT>WqiFL+aqZA#MPS@%qYL+Qy{X4t^5QYM=aE9^myMUe!we|zeMjkc=d zFh0=l(o0S-;b68)EvE4Lh`_m|(rV)B2iOdYxGp-LKkA>T8sNgRqv61k=?^*>$@&Y;)GVG0-z(=^>lf=zky~|rL?}OR{0Bc5MWUQz9@@XK&oZ{@t*DAcM;E#(t9w$E&DlIk| z@GIV4%MlisvjKe5L`1D7IFFf*jwVnQD;XY{XOu4OmuT5J0Ql(Z8Uwt{#c6UI{Dj^9 zsUKdT-7QcYYN7m=pN7kw z_1we=_1!J4Fza44=H|tMUr=grZVn{JwgYy=z{Ooo{Or8z0wLy-Ij*udyA0pDE^^rc zuX8*|%*n~yT_4kmGFeZ37-GuFBxgHA2s&}GCfP}RA(c_y76V;Rvt=Ka3aC}{vv7YX z%c~#4#^YErDqY6WEP_&YMzX-s9lSLIUBl0;#gL$5<$l9D0mEj(P-Ts28@XHKB*|DizZ%SoH+1qk-yL$-Bty<;hNq6F$ zGwo3)hfv)8qViaCEaUbx^?8FLRkOrJ;N&0JQqpBQUtyesnAGf-YB{!aG#$kxN8CM^ z-^*SO`Ogi0M{%J_r$ca~@BQ)o`stv}$(LSU?d*`MofaaMvusF)~fLklVz$%uFVA+rC^zPMAt!o~H7v(=Jkvv5ki1_y(} zj74%FCESdqm_!$oI^}kghWt`$uF$?*#EVZwNaaC826k3|DeNrXI=z;&0z4)@QDOQ4 zBSa6^W64gvm+dDDIDX9*uKEG!{-C`*9fRN~&+kc?w5T|B&l4BE9%!)=sUZ;D8DT zl#TK|rwyowdA=Nc+QAP=jrUB-EmEQ@=Wf5%vG|Rdn*Ioaxys4;&n6k-NHmNH0xWSm*qNTu+e%19Qz^Hld)C+0}z*~8< zjB7BMA&zgQqHSGxoV+5c*}~;qqfvBzSN2=|L64r|(6kg%Y0FLiAEI<@wlEpzs$;9) zLWW2B#aCRJ9Uq$cGX8Yu0qZ={))h$DSbrXK4C{r7yBZKWs-c!=OtfjmftqWpq2&ud zB>NMU-XG-Jm?!$Fs5>aA)}?ixm(Er&JVI`#RBnu+D9Xi6C&yU-XUiVWEZ5glr;l1H zdE?~08~d=LlE3=eyn0qTI3F%UP59FCTRAE9r8(BgJn__++c?b6t{!oBT_;i9$%|m@ zV&#=(!Dk*Ho-ds zV|?M4#-j}n439>}&FCw9W*){o_F7SxLJTpySd)4JVy(Wuu0&dKW6MKO zvhf-nTD{b{A;GH>ZCwz*qT0VU;xN;E4-?Hh>ACbDoX!MP(qZWQ!0sI|dYf2tH>y78rR3 zTLiN_sWY>#+}1r4>Z0w}J$XL0h&bJ2G7o|?Nh5=q99Ymc%Za&Vb!^io#RUNdoF(qc z*com;f3`mJ-1T{2(?|gZt~T!*(}lxfr3pDX#Hrm>-&J-cqH9Mr<2TRQ%2bCPt$P5+ zae!^v$cil|5t%Da&)1*)wd<3QLf9E@Ekx*Dz0{bzp~H`nj);99woVS-RiKa-xrr;% z)S%76N(faC>$1g;RmqWRFFj}m3#V9+8w{#`pVtoL=J6?Qju}S!vpw%}51&<$D*7Di z)wjeBy*fL&gT~_$eW0okry{O6^m(jbf-63(eq#OYdS2Gf6AbvA+1S@x9{k7e;%kB%;k^j>_XF&*ZT3io;!yO04` zwmRRGL^?|64~OEWy>c@Kp7dcqArPpth_dV&kzGmfMXX8dG@A_jeCf@XTX5>KbfP;j zD*ZY%oL?D+sccBBs8J4Yko7X-u|chqzSDwVd*;jA0Tq1>T-{k17v_0nH8M8uXgYrI zi%FvweYVw1zwN!6U#CU)NZTAGxCkduk~#ZzTw5^e@>Hc(FYK~|G)<#hC|eu&XQ~j&>%6y1+z~^~yJE=W`0?%=z8Jcw^~^XSRXMh> ztO<6MQ5TfosB<)?c7hn_XY?%==OuOGXHFjAeyiGIMN)0~KvwHo=OwV|O^EKyNzWf$8jWp|05MvMAF~wRXk_O+>Ms=^5I8VTtn&BbD(SI> z=LblYXcLF~SjBpB`uQn0Ak>eZy1SF)++ubl_P{Yh1Q>IqvS7S0S3QJU8Nxw_@{ z;d}($HOO>P(l;b74=%=U>`+zMp2dYVr`uj=jXY8-_{CPDGdp;bvfNZ{(mLckC~lS5 zpbM9>n#yldW3j(Ni@#M9@6!~Sd5Dfa z$j3d7>*_^yS#}hf%}JTCao9xAS-Z3DbYYWc*GDr8X(2SMTRM=2;tCc>q<_YJOKB+F zr*qgKZbqvyQqqL)8y6pJ5z4x1EzRMc=reAc)%Tpy>uFGZ&c-ZU&6qEI_i^<_4Shq^ zI+Lki0q6*OR08*xDslqhh1H$%3f^{`c8xbUa2MDFnOK*U$8_Lrss(+8L--s%l#8H` z0c zZM1FqM^0-`>LHS7oagj^5Rt=T-ZE#>s)C_NiGiOb^gelW$~H=>OFAX3&66tG29Z@U zplRd)j4Bsn=-DVC?a_KU-lfV|F#@l4nry4adIeCg|#rDdnf7<43~ONYtkY`0@|73OQbI?%XrRkzt6s)0rVH)+Jq zdZ_;2J|6$G$>+cQJC#OTW~_H^+~CRLMLkSlXeIHV8?UW);(oR9@_k+)|M~^G+D}jU zRMJC%x8DBCldffU!!HLiS_Hs8Vj4VHNC=dFUu&2L{#e^;$PJ$~Ys!<&`I`L0>ep`$z@>s+KJ2Axu*Nhy=M*sg7WO01rAp#5H9^-vy9+=8)jSaQm7q8 z=2c|{9tg|rci5lr{+8$&1DTKDLla9Ka#CY=C?B7_86u|(ZgolsHqj1>Mcb&H8}>3h zC|cZuZOT}=7S?ZMcHP#uLFa=0tgLPZ~wWmE4{DrXS&?TFtx&4!y`+1 zD|^WCxZ^=#(LTQQB5ZRWU#xhk)7OTJ=xE5ig1AhyiXJJ3ooTsDR%bK5jo-i}1r7coE?IhQf^C!`@ z^ON(2MTK8R8{#64ckzR+j&|jKZ-mXJknRy;Z+pup5i}co=sKP0y$URTQ#8TbFzG2;cI+vjXaG1$~iEwoRFP^ z{1=bBJMzD@wCwDHCWg`F<+#I6{;b5t^6#%)LVaKX1|5PRlo}T+j-pB81mYNMN!{)eh=RyF7k)og4!p zu#=#418P8)S)2of=*H6LkETJZ9;EF>^!gQDBCz_PqS+M{BV8Yok0nh8!)MUZ&Z5uh z{u<;kcj!soEsK>f-a2@1??asE`{_K#mvq&mol1g=$+f2D#1qy_*?U4ODIxI0CuLPd z`Pd>h9){;HqBXHE^#n570xXW>3VcOUJz8?vc!&MV;G@M;MD-oIpPK*m65P1)pJw0x)|kez^dLib*0P&uE*CjI zR`W3CgWr!jjjhc|W7&b?eJb~8bVbonyRi>Cs*t|%i-s{CvNP*g& zTaHO@Pilp0EQ@S>D7~4!D{1IE4N~(HNXo^TH1~5nlT>@QIAy>ctu4%c{es}ma#PqYWwG~xh8iIww+qnsdveUY%9Nuc zTd_flcIeI?LT(^KRK>az6%?PkS|xL(Kz64f{z8$PDgxN(c9?nOjCSM3BctW2;{v?o z&h9ZenN&I?tWQTX5RX2#cW6!vRP_)wkiYd?jg)ZcbKF1z%rNkKAqefQw zd7u;16IA8*dRc8_6qje4rjsvLA1S5J51zD)wqP)9tOET(BrzF`Q(cUh(@ z#i*6ZNVj6gg8CY^YJ2X3cV{bm=no_Xoai;AmbYcE)1kK6CEF7XFyG0~1g%z~r8;xG z{MUD%vA?)#?t;VSWzNoAj+Bp;tquh!ZW;0$E#wZ%I2Gs!l;Do2O_h9{f-RH+Fi5)Z5X<)nTpJy8f?K zEj!V06^InU>23$gv018!RQ)RLWrLs&^`@t|n>@+@M*-(H-(9m!@poSvR~Ji3aI8l7 z30klPfI$Or^YyAKgc{|QWj9;?Y&}ogCJ)S`(xu*|=6s)rb0v#Av#r0YDIzh-Yw>de zEFP4iuGZ{Og!Jm!l;+lHvlE_pK5Rl4Pw`+jd_ww8NPF!g4HztL%-Wyf4iOpjqjT=x%xl-8K@ zcVRP+ZHPYwK2v-s7XSK{c-3$pZ8XJ19cw;s7&69s82W!lyZ;|-{3o(Vzdx_<8h+>H zoVm1pd&IX9j5D7aBN%p1I>sL}Ne@4G3pih~)_RBSZr2loijPHhX!Egg4?y-GbEv(* zV;hVMmaGuvX}d10RTSf{F$CwS^p|af03zdvBu_^j#3eM0RdIK01!4LR>?+Sl>iLOx z>ZKu=rVK~XSa7*&cDXWi8Xq%gji)lyQXC!~{iXPMIiyh~s5ywvvUk5vudhee5I7VS zHiAOmL5R-rXSSM*PHNQ|pZAO#lLy_?)TXz8UFEk1=B6s^DvWRqec^>E62l#cRgkoXmojUw8K=Pu`7Ky>FY|{^y1f#V_g+-}2)WdFZB{#jk<5e{O_w ztdZAuuUlV9T_sB<5nWFjg2w@hZ5n57t9r&4Q;i7YmY4_>xzcPEvbQ4 zx`Ef%>iDr&HV;*25^`ccRyn9`q10~D^>)u$qkUIYxzL~z6B}b zN*U$;KjvBdchB>G){rnz^YV|TazA>4m33npDH8Nq=#{%QliFk0${hDVypcw<9k2Kx zy^i=9^ykk0;H#JK$7~Oc=Ug74i4x$&uBDgBn<+?AuHlqg zZmS!+=AGRn)^!w>KRq9>@yxRr!~&Q1YM@pyb%dDql%L;GtSZ;+AY4XijC%Ln2H=>R z=BkJh>7CyIe^XBREjM|t9`l@RpY?kSixH2itkJzew}-sm7xhVgzjU=6dTQ-2GbrxJ z0yNya@A&Rq)bo=Ijc(D7dg{V%6XYs1cGDxx+7;=3-WYx0b{tULI}b8UI66FA&WszD zUqc&@u_U>vxuH`Ax^CHT9aK5#i?jMV=) zk<>)l=Yt+47cz!RYmxu>K4x)5Q$_!Fqp&Ce;Fk7y@(064!SwMzH#VQFF#Huxn05g(%dtAWLe&qsZPYfuUL%^o=*kDt4QTI z8kV-lQF9gFCbR#xP23qB6^ySE{>fcNo}ElI0gbLy+4BXXEjI80)n&UL#+T8NwSN1 z5BZyY2U=wQhvGX0#}mLEuH3Pa*W5$p&aVY+y7+23nQb8XPdq%C7VTen*9`58lR26` z#(O+%J-_gJiv6}(e&N;S+l;jgm$v-EYnD8JyYYzJjPG9@fD3KayGq+3b?afK5aQON#k zr0bwl>K#sc;I@ld&N_%{0n5niLy_2GFvi%vOjQij%NSlMoxH@bWX0y1p z^Zw2)tHqPv;~Fds+>tU$G?M+=n{x$dTs=)6CunYI>uZ6(@J5k-+XusE z#G>zmd&bZcez@WQ)5E0Z?wMbBd1@yI`-7D0LP6la?Z%_v9=hWaSk*x~)8X}GZo51z z%fpE@E1Px98ofmJYfTC~25~6_d}&=efG52u7`1d1ZV-f;z#9%=%QU`0rxZ{1kq)XE zdx>l-0)=2`u~5p~d1urN9i)zk#e6lzFit0@DTjb5_ox7ENW0pp2Dp73TwMQr;t-(M zu>S2qV-)(WigX$)4)ndsUk9W>GC(ytqPrOqh@Ka_CJh8VBZK!fAYu#Ive}tkbfq^G zv=iuJflQhL^4Sn(_{R>O7ZLHR0&mPIA9g9>NI__V7-EH2>`=lLo$Q8;P}%jr^6Z2I zFcS<8kB^H)t|M@pJ8d8&UV+gu^hk#NFR1=VFIA+Dgdhr72EqkB__0tNohUs!5C9-l zCn&o7Cnx=HIR7_btAvgi$-AC|^V7}oEM4yirwYj=ehfod-URfaX`77uMi z&R|voVMOwnLCDd#H=wsYZ9wGEeEr;7Wlc0jAeh}#b=5Y>SQb&xMA$dU0MrW9sl$af zqa-*vg8%&6uHOb-^BXJd!?C(XlZH22& zx`FVAQ2MT+u|zo_{w-?p47qO1K&SfGG7kUo?uDt54e3nDyF^dT2EU&mmu zA*a(=!5^iQqq8VdW~7TIZ7i}4t6);3$a~ty3V>%bR(%eL>oOe>WAo^R(Y?7DV$7nd z>s8(w&1d-}suay*EVFRzqdb3Rd~B8g?z5{i)PDs!re@Usnkb{F*H`M56Pw7J_VJqn zVqtxvj6!tDo$ZR_M^&+;>Iv3csZ}~=#dX)hfUtLJYPC+xPR+JwS{4qdiK*Tyn}u>e zGxrqrfMhd2*k~T}&Z{-;&4?qp?a*F*m{luK()U&mn;~mpr_qhXfDJh^6|+^zr!1G} z>0Jh-mZZaHpjO|fI&HdQXFi2x^i-gY!neaFZdh1o_5g(?7tPbdv)rPTC6;?#r%~3Z z2}+Vkpd7E~RQbCzgja#x5vr%;96@fFYvkG*twtl<(4<#P>ir<>;h^o?$XJEdTz{uC zrOs4?>R!RFjUKx~451pEcG9ivO zx$~~O1r=`{a|o)na~9=i+GJ>FRTahYp}^E^m5-1-NuZ{qi< zGJUr!>U4Ok^ISO}viIlM7c063=r`@K$%J(_@Fn-p6r+rL7E&PE0C@5uLG+)k91ZmY zJBK1R07>J0(=*~Equ}Y&IT9-8)g|W`HZNa@h&tNyWF^yZdq2_#7X&N+yy}i?%-@G@ zL(wGJlQQhqei+zSv(WAdUrikkB&9J~wBMh)3w*8B4Iw;hV_X^y;;E1>i1GQHo{9Om zNCrBRxRH`{ouC~VL~Nv0+UT7PBW6+bo^_EQ$mEQ9Zin1?=O-39fKwqMTTY{6SWvUB zQF=iO)%;_JZ>UNn1xAhAcy^ydl+&7gpPRU9U~&*UU*brpJ@tyJvI%H3bu?nI=k3#+ z&PwuoZ{PJl+xoxY^1pkj5QD-(%gaFedBxe%RWF#-E+&Y83KUv zooUxm4M|Sd7lAZVLi_XsmP)S#dbJea$?`kjhg)1&_n*2Ya(j+^^dH(PRZpY#BRa2W zY@m5kq2N&Ub|c1+pkLV{#a^UXfR>o6)y=x;TcvK%^HIL9xB59b!!VPn+*nROc8kQF zd0S(49(^+YFG`GuC{i_04KbZUZe*DYk#6J`QH6f4Me3#rE;svxdIF?UcTqNEELHJ% zo_B^-87&UEen8EzlwPWc?MQ+kcSwX)BJvkBbuu))R#(**I%KFAD==hVwhA|3GynL7H~3rIWzc+cvA{z(r^7wc)P=*{Oy#|GO1G=w8Nc3}nwvi^zkT;J#VPE;xBOaYeTv4ER_Tu0B4e#H%?SF^YzKi{NQi(PiL`j;PYpEkb=A?JMoJNT z!ty*6=W1uj#Elr#d2djYVx;f>P2O(8g)M0FT{>IwBu6`KHodS>VK~O(d{FR#s?xN0 z+Kc-tkm6Xg&|=@23R%a+BVB`-zfEVV*M7oA+&ez6#pXKluIoqDppdB~5G?sYklO52f8^Khhe3BKDS#VsaIy$uOkKba;T(ggxFZX-Bfcg+n*rJa^lB{zReS_qvNR7d+WEd)|EIi?=ERhaB`Q>vYD%vSDDL2`I2N&*&&ezE)d`nKnUpn zc*WFI75G=2GRi2d@v2PN&KG|G5AUg?m(0q*3q@~ro5M_@;uOKa@1=ivYuh_6|51SV&d;9~!gQQTBuQQcFB(IpJ zaEKZf^9NXFNo4eMKc~q(lMVJ}1Wx(LN5hk)@n!ByDPl>!=gOgkMQzTMgdru6>ssk^ zxYgXfFMoGIT-Nj9)YVlb+WO4L(+L!enFT8)7u|ObxH)-K`o?nfxi*krenF9E`X#Q@ zuVrzXRyq946VU2*17zPE>sZ1s)!`y18pt#hdmhHMhQBZN>!SoG$oJ%&+T!}0>WRnx)y^>HqpJRqH$`j$~ ze^5)8LI_L;P|SP9_UE|SBlQhJ(|aaq*O*7|%WqYsggO}sho*xTZ#ltJufrpVAM&Je zSfp^L3)|I$PXZ&=k&NUTD?mtt-0 zq+<*NNt;44_r=6jx7Ho=(uVxxh6U4-4Iw?8s3;3~rif+k#crO-KAa38!WvUp>O#bU z&eP6(VlZbQ@cz$#_Tc~h7pN-L4XlaL*S&@SGe)Q5$5?aq^cS9s-@+>%G3H-*l8ZBC z`w_bX088a}cz6sOMfhK5($rLJ>#+Q4THyH;otsI@L2;8l^WU4qQ9s#V6el2oCV9g4 z3I0WIYDpWMV>63$Y|;Y$Oilc3Zyb~Hrz~jJ`NmtlBA_Ew^EMGF?DmUyXzMocauig8F~+9u)$vnWdQEV?8)B= z95sA}(VquXty^O`R--7AB1xw;zoOtzUBa30mQ4U>kL|3;VPwp=VT+RvTi_$D4T?(* z_bXYy02{_x%pi{jz}{F!Tg`u)_-L^(d}gvH{&WM~w^)eq6JOwL+4UQWo(7rw^%HFL zh2sKV-8d=SmIxn7ra|_rij9S9$*_O-)T4iR=zr)LkMTt^qI?)bd$TJ}$y`9|y#$vj zk%sFVEpP~q1rIX9hp;;X$f>H^Nl`vDcF}B&=RRMjd9a^ZZ>zW)o+dC6*rj+2Zm1z5LTA9ap#JG_@Oyy z*~CwtzCNmnnMK_OrK~4$^hHtgZ^b{$5&G$|%Ey`taV;+s5`)-|$5^@)!PhBr38p|5)lpGj z%ZTefE2bWdvGsN$LynKY^!aXmH%ng_uORUUIkyJx%!)~=pw5~=xwF}NR9+~hr zXAu(z7fpW8G&y`}UqmA#x<&&<%}W&HIs6+{PS(6ZAcGBI;2spYPzFm-s~5?sVPC=E z{A}CUvlZGo4o9a<3BEde(2B^4>_u+Qu#V&!;y(26b%eG`EyCYeI0rwxF%8qBix+f^ zyaLz-MsJzzI?|50)%lGU-!k$)Qg1m3>dyT*7HBt3Qe%eP&Q#PZ?kc0n++3-}EtIBE zCp{t8hl_vxd%1q5(~dSU46|SG-M3MSJ(h#xmFRAT*#hUam8zy(-0*}89ZD{pr!~-s z2lkcYXcSDh^1XiHUFt2~X|lOSsou8N+yw&^CEYPTDNT}Xx6Qg)qw;dpD8!$5czyNE z&qyN|^LK>1-8c+&P2Pi>I=S7Lup@+*-Oj)8@S263mzMonyHC=79?}YD%#xJeB?>lN z4+4MTnN69Sokf)L5?sLpU;DL9M`qC$Y~th}ls|$G{;k(B&=&bo@Ssl<1v-tR(|j-* zdkYdOs3$wb4}P`!8!Cu&0N()8!F`H8rJc7WMi`p0M#|wgoPYC*Y4DL zpByG{9~m_Hb^zIQLlGN;V#BgLMW@6GGO(l|RACu3hY-keZ{Jvg9y6-+whZiyDlGM0oC!e`3^_g*#duhtBw$K7GBaG_IgTj> z>?}hJJW^noFU#hS00D=f2nK^Ng%*ZxqA z=1~huhHZk76l1=#0NA7EQiO*~FX9gJL^U;$*0RK#R|lo21o)OQj=iM8XpDAEQycW@ zWDYu7e;RVp@)l2f>E5-^<_W^a9L`wJl8kmte=DELixp5KNLd}25H^UD*^nb?Ru0KH zyhO>c*v2&rNG9g%!MdBu$3Ao&8FvClz1(!oL?)h>yy{hyu~#uy;R4?p3bi#40vS#D zWYwDn23cv&-u4mB$fzjGN_>N8IZk+4k?OEG@bgbqhaSpjmUJrEvoSPWV$bsBFRWq_ zX9Ed#?=2`cO*RDUeNm~FXwsQ&M`e;}xuuob=C%4B_^Gs2OCQYOVpedS)H*jf-dlt0 z#q*!t-~VH8{Ga~)-zka5*=jBLM}6X<9dW;4yW1`}k6o6`V?H-Oc{$V3jDG_eFgq0xsc=Xxj$B8R* zr^SbiM^;l>tgRgiGsZG~Dm9<1w=|Q(6gY{WaQ~6!_h*+a6;|29i~)paHNkD5z-Pro zvql!dNKxa}y8=tl*-I6X53h#$2M#G_vuA$;$gd44Ldo;H;Cu(4u>a)Y*N$5(H_mXL zTY0-*c=`?6%BH`Y4icB$exLEXuWa2yn5DRzHP0cqx7jmEmamIjivRQDL5P=$^VH0a zUgO+^K%Oe5`c)0bQ^ma4+K@?X`YSi#RveR0esu#qUl>Wg29x=WE*WcBwNbu-;3b{0 zv%~TD(|Pt*J>8uQ0kp_EI7+tomH4QK;foHPYy_JvFpG;W+8rFTYG*|cGbVb^P^$Jl zOEx3l`b;DxwKQVb_4g`CHc%|T0;)cOj{^+^XaLB}%6lrxWRWXAPcJ+P2V*Qi7Gk=d z;_rTMI!czno&?gpI`>-jBk@?UilQi5$k8cfhT!WewAnBlG0Kd^E|zbvx%yHG+0CWs z4mwQpx<5JL5R_O$NzxXy*REg-UY2cnT{o$`yMtyJ2ezbIK6*A+;?5SS&t9jYAwHLL zG}4f8F_T$XIFT3dNY(zYrQs>9Yg0l;wC0P6v4=y>5AGGwS4JdHw?eB63RKRLUeP^^ z@KFA_aGy7CkEe1$3*1|fw5%2O<`$jccdJ`){Wuh(Pk7y|QS=KhCYX};{1B6Om(X(3 z;&^h$82V`{brTQo#rLiAd*Lj?LUH8gtE((@{L1x3KSPTG2}|e9i=X9x1KixB&*rhB zzZl|mWMOmr*p21#sL7aB?fZqd$*6WUsPhZ2s@G)-ep_i29py0y%F|vVi}xRgA=tPJ zp2n1k-54FXy?xG@_VHi4!2kJLS%AfcBjs>+{P zUMz^Q6{%*F9}aF5Yikn=25M1T#P^)2{X8z+-SJbjQAn)rt;rB(+qs6T#+aI~Oh2sw zpn9S%RF!Y_7!wCFBaF~?RnBOX3=!uu94NA~UUkvgSBSyHB)LIovS*{0VSIFiBc$tJz41>s`mV^tnu za*-a;<$cP0NA}V9hjM3ckNk;h9vAhtSM>i8&V4D+~ zrM7Sv#r0y>ksrpB2aZrS`jX%rm@YjO{y3+-t`w@qZphuphYNBHBzCLwI>8?&LMWES z3BA{}W1r{C6c+U{ssOuN>ACT}_xUwQ1=#xKw0-5F$WSj!0*}LqmeLYn@{?gOwzj`X zr~9MlGXQ@gb|PmfPp!jDZv4coOUR;!p9RG^F+RqnRap?o|#s zrc;Od%7L`D9z;!yHxX|y zJeMzuxV$X;CN;Hf$u`?t^>eKON^gOYtM@)9&3v)xQJLRWG3-|5Z_TlM8t+S0AK|o> zLX{mCSm7=5LyY*uw!qts4A!MoW67KROu_G!;m7_J&XtcnvKWJ!j0aRSA~qZv34@g? zre>h90cT}Y(@14VXr;%Wivkf$H!rHqUXS&*p-cKB@*F6kI$i}C#!RRfG^Kg@ka-3r zk@!K~VJ=RHEcs-mIkW+4>av5SD>IBSl=z;`Xz0%Va@~rMeEz{|K{1gKvlCo)^5?X? za#Jhc=Zs1wBDsgg(mgf=#yHu{7OG#7ikY;?Oyov}WxDqB%J)_AoHo>{L3&J5 zn_dg6PV}0U`aK6F@CTKYf(7R8_>4Qzr0be(?d4Acp`mG0lwv7Zb+ppTLYnVRGh3IzI+KQc zNTRQ428jA{d@WbvU80JTnW*C`iL6`?Z+fJXUPoArIxu8O)oD+@!&BQwLG-uiRIaW0zNjzsM{FJEcoJtcN-{8>-Hx7I$ zy&>?yE1?O|+6E{lX~baK0JBa>2;1J|{II$EZhxemo%%4j+@ky6kTd^b9RCmf{I99a zRYV>0?lmaZPB9!rnYIFpi8;zwgEX3ryQCYuW}oG2+ynDnLFmj>?9=TqAhns`~w>M1IJ!AvT51)|RixO=>6bwuD$i3d@8ncXnVd0mw6I zn(fF}rg_sZjSu7wQHa>!wf!bI_SLTQ*(mpX;3h42+YC0I+6;>0A6)n4X`e_IK+A07 z{Hj~d4JsXTDpISh=#~-4QEEs^DeIj1!7&*7$1Z)|4&kvp%j1WCteR?Mwlq>Lkw$LA z8o1%V&D87K6y6*$POy7`ojGVU&|QPpH-*+1ZCN_x!T z8WE*2_C-LdaM-{ET+n=_>kKNW!cUo;XwIXs)pVF>VDM`loFmSaap(?ZQ1@qeEQd`- ztJZf`HAbSZPG{MtwJdpZp9!H~x+ndVaTi|loHf|l8X>)xMJ6G(n-S4+`qTm+WH= zA=jS+#8@Y9v=N+49~Y?FWNtoVQy}4<(h=#OKN}Am8+7=k(Rp^+qF3oi;&q5hBtc&) zsD=%6v%k;b2U6>M-W#_4g(oc3(&t8@>Fw+kY{{Pwa&w+m(1b(|nwU(NZ#^59sz~r- z3M5puH7?`%%{s(Df_@%Y*}mE~PWbHe@~l!wFqA`}bFAuGdw@bL6Q2JO%$ z@;?}>IYk)Qx8{dg)9$~0YoCp9OVn;k+FfPDc&rx5^z@#1PMoFp)%2VE&dYBi^U|TSo6zi0eZ3kvB z5($b3{}MzOPJscUn5`m@;KZ-Zq>`T${WTVUlk!uLTnS%_-j=eu8l1^CzaYYCBl_(< z9J`4NXJ%v#)KWow&w>%ade!uOv$kb z87x7hrS~62vRN6=%D|k$U%q#vW2!q-=t{V{w+fWpnh}=MK@&F3CQM}jWH`xar}0_l zy3VIBli)y*CObwPUYmNUzt?W-YdAMkz$_nWikuSeBC{uhc=8Ea(z9?W z$C$*@k@0NOGWGIiv&E!Usl*Y2iPVFn0HU?Gj8U=+;dP2sz?iIAqwL1-%+kyoK#)S-t+qz4XoAp@@RL`=}I}z<> z$Ex{jYXIB10nQLl9hG}bw#iVEDq7Yfqsv)hHD=%a);4ug8Ku|@P&+eEoSe{b6fA0C z?q_Wm-+UI;3b|IZB8$P~FTB;$1hvBY9m+e)wYio>EsO3W(j9i7#r&b2J1#)D3e&8q z30MLSwRRLX%@t51LejaR$1|BORV=TGHTd~ZZ?9^VS0yxc(BMAE$KckA)MWYq33)i^ z`=xS+z?1Z!IPosN==3b6MY)#Aev^#J8cf9Y8BdV zlrd;pDe+;AR6N>v@fE%7dPBd@TwjGWB&UHUvIE^W>D=C6H0iYAv}!^UBOunk?Md31 zZs*pv-0=Ehy<`dnp46Hqv>Qp2emsrT*^C9sV0uzTI}Q6;Kr+% z8p!STw70I~Oy*j@j=c=Wnf-Lam>x>34BD(vkgy-CK(&F>tV&-40-04zA2)$=bkJoL77qoc6{Pu!dv=C~2R%Fd#yNg4g*IVx0zQ++Ey?A^%E;4<3 zJGR&)+;T39u$6 zZpIflZFau*e`5CGjz*;?&b__Ygl)gu^k~_{Ae7^AcP1^|9nVJ z6#qI~lp)Ss&SG?>(lL@eoG8cKu`(M)+#5-ZS%{FdiHJ#{M-nj__e>YP+kut^I}c#p`U2%ilWoq>pqR=gximr$w3!o3I0hMPu*ZPnj>ndpyVy zvmCr1p$&ZCP)husAZ8=hxgu=|US-Pr+!FX-SJ*qLcvkk#_%cPao|YjK`umV$lL@BC zUw95J10D~zCES^8S-s(7r1LehTaAd6+7)0J`A;j5c*1;%{4&IQ5(DsA2qJbL^R{Q6 zm#S#q*-%x~vJlvNVrH2d)T$C&kaR!XH5S~}smm0p;y1DIXs#UIC$ws=qs4l*MyPhd{=Qcur4zaV3q*Oc&2QQ;tFqY+S{?R@Rh*m1LtSYnB6=-uHQ zIes#qw0tad)4|UFYE*TI2uF4qWexPiDloVsH9Slv>Fc7Fyp0;U30aDos2A(y5~9iK zmn^eEK|NDc6bFnW_hjywf+&MRlwWfq2&X3`ZF{JFwP^CnnLa^l!2^GQTeEJ*BmT7&hJX%#MG zG!YZ|3(qFqWr0@G?R#aEw^gO!mM00P%J2?{b_Ah4DJnUCvQmZlshFixPRy-_&v z!mo7c=KSPOo>65UGu`xIJZx%0Y*2pw#(zt91YHS8G;-P8|0c(X!8Vop$S1G`VAB%u z(@|dYZqXD%`Z?95#3Ec2bq?QRjO#a%{)MqU2&sI86&Jo#{DlBdIyh$(V9UR!Tjr2^ zsE>p^E}lT$k4$U|J4P`Dd03biL*+Oe>`*AciK55Gn+Qu1$llr; z?ezj54Y^2&tNc;QZT{#b{VV!cPzP zp9RO!MLNhDPx{rKHI>gGYLd^)K-y4G)}-=vknLocY_B01bsf9YjO0W3DT`J2Nm7Bc zRvQ{^U!wDoKNX90`7*e>XIoYWK*VyAYn-hm$_iH+xp1TJFFhic`ok5(RK z%0yIV@Vtwiyon9>i=)OilN#`Jh-*6Ek0?rX=B(1sc&&rTMY_)IN;4CElvP;z6l6O= zOVALk0$13sZBCfT%=OOqt!^DNRCk(kI)}_ets4YH%jPf?A(bbM6UuB?qK#wI3iLBJ zzC~}&tF&S>UJuO81jg} zm6Y8?%Z`pjy%jxu#=>z0nx4j99cJ;lI#h85yM_jm;bPC=7oHai?A0~N%MVM4fW_?F z0)PgS;uIa;sp<4}og@sf>zT7vg`fH-Z40uI9_AFb8sAT(DosnGwH-HN|Nei~kC zGcIn!m}Kn}a$Bz%S~~;{N5rc@Wj;q#q`@}ECZi?L4R*7LlQ`qLjgKd@Cca(UaU3zL zXIr47(SS^?4635i$ry|=1q)o?+mmgAazit^0_Nekb!Fxh=P<3fMI$FpmK3ItGIf*TTxSd$k~*L8yg7ry5CS+8}zt}daIgr%+t{JWl$3W{=mBQlgx~E z0jJ6LDun2c!U!uTCLey%KTcvrDH)cKN&XSeGJ?!Dilh5kVQ@#bG|(Ltb8B80y~wE> z8f6GwE+~3BoLetQFMeii&Y-mG|9W2ZOxEC=@$q|0!7`w3S#c6_RNXbdMkd9uREm8r z^cj~N->CQ}n(&z^y9M`35xF`B2i70c38-G;RG+f?+(~Rhc&r*PG>R*pc@Mbn<5j9C(f+9bAcfAXT5mT~m zP;{tn9je7uH+4c-xP4x&9_6_sn_^wOG4usnnsg4U^#3py|6g(YUxHMLmS-;xsh7P( zS$mDAcYf$6qnaI*A<*}udw!ZDEw=HLex6pit+!yk6d_+Qzkmo}es1^I*88i=`z^mA z-#=Vpww1cLWUPPT!3I}aeCEY_ZD_WzZ!-pfmCj)|%& z4yv*J%I1zQGgIfBV`)P`z6sfZB+WnbYJ}{jckyQc)AY{^rS-T8UZEJKW^Q~kTvHlf zziKJmQ09Vf-D$W0*93`Oeus}lZ_Rd>Fy)-7(AS`f44MrfrXLDtIde5Vy*)5)&Xm8! z$0M9$N8VI_p3Ib{kTjgZY#k!VDolzxpLP7QiI<*PfZ?0bMINu;6rqEua_uRQ}Ar@Xe>htkZ zcqrh?!e+13NN08S3Dfj;KXcCnN$9PuHHt<4%iF#fQE^s2{>q6w2+_fSCEZSgd3db9KIMy*cU z$!W84N>OTl&PkbtOADfBe)cjpMIH^TX^9Hjm*0QwB`>JzWO7C0G}=CH2(-nr_CIPo zgep}xPC%WYXrWD6k;xcrQM8_D*=`A%6fw%LX5JjrZd(BvWA7yJwF-2!SGT}1D(Cgn|AZ%0|FuoFI1-P~6ql#ry~-Da`_J7+?Mwzg{)_bc$5 zuvOCE4dl3td$Qi&s(UxK;7`qUY1U1XJ2$XFGrUY9r*C$*Ku@Q8u|MtiWdTlbOW5x+)Hb>Y%lRE95AlpV21J80huuK9)iOUuuH zKRMld05vqMnlaG4G|Fyg-Ytbdk=AR=8oF${5a!b_VSP{namX>W>snI$b{5C0#wuC%#^ z`7KO(yI{HwgMptkn=_YRhnBK^rD%6Y*^Mq}oevr)#bTV!wVEsea=f}I%mBoX=XXls z!y%s8tQ)w}0bKHGgXR?uFMan5Z;R-U;}v?hCavZ3f}J?_A5o8ZZ>3m?$XR^ZW{$0g z$rtVqCj9x|B_c_4<;+^l^wR%GvZwOZEKiqrK(0xGNh5$6t794ZrZ>r^Ok9 z2jvZZ9uRPER-Hdp%L1v4251@bDr{@J=5qrSPV;n9QSxTr&4Z zl5EJ?Wy?IpY|e8_W8ZgZDL@-_c&T>8B2vItEnt}jDYWIOPn0JlaLOzS~ zW-8yD9lR1C=M+}d&ECew#_nONEu;2>Em<|MhPmS=L-g&Pjs=ff7RiYzclv4|4XRpo z4Gbv*N4oIQ3!+P9g%P3b2C>>gmUe$zrOREkK^h~d8$kCgTA_8P1?`PJ^f3TYej8!wcn3@}_~(*%`wFrO(d!RvNW zDSU~~4M)fVVdZ@2H%CarX#k5^LxM%hwiZE@Z)A z0rauY&UN-JSBmD_oHBk&^A>0mBk*@B~+$SS1Q8rg~(jD;?|Sq8aO$6f2Ob8*JH(2PZgenIuYCdJRsFH>kb ztKI$6`jXM&PD5zo)dV@t@fZ^jCIR&FqSuC-h}yhl#3b2LKu3XS*Ymy`fqLOtZlTQyYXaw`cp@GdNyp1ur zUwCj_6Pdfw7V?C`FjC#&8B{BM9xkK_dny<@X9mjV_fFpAjIR4en*F}B6NCZeY@Nk~ zOX;&P5Q1G`B-xQp6B&9uPN5on)2xrz-Yhr8nwQ;>pSTU{czu(&uIe;DL+346dYv|y z%38WR#rAWpSR23x{LuUr#dYba+L+ab|y|q6AI-@%@zT6)xHfV^ipu5 zD78PB%YQ!EkfNp+T3HduueyMV)d!huH=g(%uqwNG6|f*d&9XVN?B~a5fzZ%Mg?dvt@CFhsl7*fA8LjJjMg=pOoVAFd8OqI z#|N3aK3A{4(R6Q)MHshFdvPD>u=Qu6=Spu$&~v>uQ|^zWPzJjEgi%%^U_rA#|8bW2 zpTGYt)GiJGxN9EUscLUqKU(8CMCb4t8!0MpAIp3;S(23!#~J;M=I3U8zwRg?KU^;N zB+|%|Ul2L4^kA4=8{jV?R4R2#;Uf z^T{4ktVE4(P!s|+L~R75?am*s?TYpa<)!urNgumO&IQojeflP-}_vh>L zg6Byirr%D*2MrqV+ofnYOjo*CJ`Q{FLpng=J`o+U0xwAbtD+GI&-=e<;=RQO-y{rA z2}Xf@mp|?W*qK;5Q)-MebI%IK%{+}%{p4Uplt{@un=RWd*!9#dcb=atgLNJUez_zZ zi3nMiRhb^OpuzN`W2Jw(Zo;xsUp8r6rOem47AN=Tba65jt<++=LoW-b*{*NDM7W%w zvu7*B1DX8m!F>kp)>UuA*>lO|GfNenEkPg-6=t)Q-LzG2moh$(?SQKlgQC~WogksR z>36-9iVrDbLmwc`v*uYa4UVyHb^k$})+)Tru7S$VI}d3V(@9I*kns3m+yzn1kjCP0 z3eQx0jVU`*1f&R7c1k`Q(3+{Z$PW$6xWlCt2W^={hnLOgLjJQn^KWG^sPB4u*2paF zLlGV~T{hdRfEKRe>EXyXcDAq@<_ejbMXtt9Z@c9 znD*VMb>5q>skqmcG>-NCzKLj4{+%R?Ww9?JDwuM%otmQV41L5^UvNx~;ouU%Bt#V( ziW?+SlrGVR&fAKbR&5DutAV?~`bwN>g?}9M0frBIWajMuC6JM4(7is^Re^>)d9jH&Ls>6 z?D~hr2FczGwdh{jIi6o#c^!E!?c^t?KGG3v(h*90nmix0a~OjZ6@7EbXD)1NaUq-e;yjJx;q{UNP;_p0#idyHa$FFR=#rQ~x0wx0v67u;)rV&^A4DMS1Us z3Sw7peuI{xn5eH$xRyL*JfRdK*kri3-tl~Q&%Mo!Vn9fWwu)4tqp;HEUVi|`q z3?NZStmExe<4G@OTp?iu(V`_=)AP5|0(6*P_@~!OC_>{edY#9Fqd@81^f{@BN&3S% zoKys^SgfsuwyfpHET;Iq!()5hn2J{O*Xuz#+?=tj2GO>&r-Xwh9ygOMa|KL)LxFz# z>`9qtE_|;5do`qs`QggePr$B;%v-;HilLrcf2x<#CAK=IG9j)hT{4h5WKP{v(b^|x zbvWzuY`aS>yGdk$Bc!?dNpc!ZQx(6Q5bj|g4okEqBTwx@$JW>K4CrM(2& zFALL8s7fpy%EQX#1 zfH1ROW(`<}Mosy0RY>(#j^Hr*lIY!5?2Ezt`hbK7?YMp92gxs@a#Jb|RyG8ZO?;JV zxtVlMM6MvxYtC_Z{XeEb)#pRo`mgg-9}7If>10gibgqI+vZ7R{sokDpQ}MT$0@sqT zD76NccIJ7m6>~R7ylH2yz>-J~ZMa>mvN=B@)cBlDzzCGquh|%jWR$k087uQ~A%oNp zre`DY(-7JCl%**n#t(i-XaWJTx(|R%MC$qUq3OBmVZ=$9nZiD<_I7E0bvJ93UDVtq4 z1kL6zkzO-eTO!1POcBV<(CvalLZAjA00<-`B(4J*Z-#_qA`s21+!|vn;pnKWbl%u0 zLo*%p4!XL!bZdSr_O%%q$@Y!0)9A=aw;U@*I3}kxX8VYhWzK@*2(~80UUN!C8VXlE zRbpKxC;_-)RVr5BBuB)(EuoL}6kQouIs>%FnC7Kt0u0~ z^!LyMC@(BRNgG-#0ohvLQEp?$OO`^=g9 zJagWE&%DnwXZ>-_n#oM&y4L!wb**cy-}m$F867{`e$Qr{=_os^CvdajecklzaS5i? z*{a(C30s6V>j#B1{IR4-p_FWG!&ui`WQ$@^qa!^LS+B8et||KRme-C{$135&Fc>M% z`U{K=p_Upo@lerp9W+I*$qgg)+!;*deWBPFZDV=4V6W$h$xF_jO1&A`_%?)_%4Kw~ znLEFD8D`S$%EAjrmqJBESzr(PUXU#?LDcf-$H#t_A2xm5tA$_xw1yj}4rx5RcWOau zp6rBXRFd0mD#(v}HO6uGS1qAp1)?TNpu~O~JNd+H{wD;su8hvlj#r#prC9E4r&zI` z#~B4bO87%fR6g`cly2H5QW0y!t#o>TtrGy8AGhcHDuT z|G*StN8Y{nHqmii@QevB`Rm%=v|g$HVlsQ=anw zJvaRyQXx}nA<1Sz9zd@bxSLKtNyUa;OA{KJdt}o2MvpYT3l#riKC-FJg{U$ec7bN`H^QC z7=-9g58vQ0d=rHBF0+l1EoefFom7U=Y@NGZUUT-W*OTDRr`>V!vK|^hJAJ z*}mn)Rz=HLjL#}?xBpn;s^065(^2owi6_QC8^laa~lj znDtG2XGM$(jN)}jA|VD9i}R}-{9H`4)Or;Ty3Y!;AOMRq9*mmozWNEUekTAu0Hzef zS=P3N|IN7ntt=x2&x|nAYI1*X^BlhwijFEyeGbGx1TZ^BoRO=yc=cm^_X0zF{Q1+r z6!2@S$1l2T=yZK#5yCuAv>L(N)~s9K2uNpRvV0-ZQwTrPX1w4P4z)h~BtWUBD7nzfumlUJd6!xtAEN+Nu!O&UMOs@RX9K4Kt< z`k~uAyoI!M6;Yx*eFvHz4wD zqjtRoL}AC13x8b`W%B1>kY%Ol1P(om+oLJ|FIgtL(cANZ@niG8)}V#STvqOXtzUnO zkS3$^;Uc=5ihSi0=gWFF{BxtoLPR7Fj+cQ+TE zan7Bf9*dE*);*RqNm{;b^P|3A*q?0e?>RoJr>m3Qsim@b73>4WW$3_?Y1%a*B~ljY z{buZ9#;Rf@Yw5_i6+)nM7_s0hSF7+CKdn{5Y@|}Sygo-4Huv;!bqmW$=-t`2xpb4P z)v5F@)<_!OcUw57@v}CpH~B%JSJ7bM@WFNx*@^Ruq#<*6C>PgZcIzn1zZdak;b6;K zQQqxgvwsTiqC@QMD(Evfbw?qyITK6Wb%wP!v{NfvC6C@Ego=_vZiyY)E~{BFHS8e! z$zGGyfwk&YQeS;x-GkNyoe*W}vAt-%YnYvDaHu*3~-Jw6Ef+1=6eKJu8h8EeT)N zPXv#OZ&+L=ut#zy3~f04p2M9Gz<$d&>~?bMV|WRpPMD+gNQza(tL^SX6Is;j$x+p3 z0vPL4$MxT9v=o(zeORKxWmwZ0$B!|BLSLAegtZm7d+_s{g}2AV_REBk5zsM>gMIUDF9bN21t+03D zTeq6anIC#rD9p`vdJ&MQ;m|ts+&u-o5Go4iAjDd!t>7QSh1fcTpW*OIFaGTqoT> zf25a8H_-0$SnIQ_hL!fjW5a5mnE20#q>G(Hq_>F*I0V;TVvNnV+WEMB?4 zkMkBkXsT(pOU=R;QaD{J}=`DSjkxhF71atJITmMPR7YH>(aCi+qW4* zo_H>288!8wk(+3V4y=8%ln`dDKR?Vtu)^Zo7Z_R9Jh3 zLb(>xy(g;LQTV&FQp`eP%mps?Ia~d%CQ2n+&-t`(gME zy*svD?S7&gQpJduv*I$aO=HVWJGiO&uWL8@DBFcHEF-o;mp7J8v!6wFM`0<6N8ppJ zmY-_L`mpUxhU7nqD9~8tQ#+5%Z8dM$MUYYd%jLNo_|k~#Rrk*<_evk~*i9hsN9IZA9e+*++L_}~sl(6Y`f9Kz-sflY*}rPNLyM~Qa+hZzjD zOdsMV^hl5I&m{VUkm)Lm1MXVi4{@Aig-6eKgz zh$tUww;V0b{JN$awWC-36?jo{D907_@94eZecq@q#0p;GVDrygzukcjcvjg4n>nCs z<5j@`8^6lLg!?>!+m;vWjali!oSD=tPn{a0n9Oad2i~-k zU=CtuzB^u5@z=F`BhAlCrEZCa&wBKMgEVrA(XknvI)BvLxgiY~FbrB6J3cF5sCS{z z^FYGZep$6s^%YVhQPb^HK?O|-*JwN`VAex z;%vrs_Ab>`(X}>;uTA1QP=xB-+GUa?^vu6BfMA6(A>1>5l(^t&P{H2i(RI6MOghQh zxQu@XWSIJJo&wLhcI`_>>d3v5?WD#HaOFF=0dlt4G`L=Cip3>DiTjbIU%}(PcXylA zEB1jr-|;rqN`KYwnvP2?{CEg<^|Zz@$6at_^4#;l`kl^%9E4cqUhdSCGn-V%V~QL>i^)CzA`%906)4rAjg zPZ@1^B~l$Sz|P1llBlK>jtrp%k{rZ5+%47AE8l1r%%`tV6-`WmiP;~brQbwFV6y_X z4GUaCX1*MbJU>#%XNG9fbJo7#G9au=efJ5JDxM0(2$+WcXj0;zN1{5HE=S!!i=zki z-kBv{y}lQuC7gd~>Y4>kT%NZSS~B>q!_Tax6vdQsIy+~@O45rs3YS>;cZB@YTC4@3 zzSS^!f|iYeJ^lOIq0KjB>}X?1s4DGCy>F;E#Bw^j*&4Ff^KuEm{|z2z^bF2+gYI!d z;7=-ss_&KOD{eTE*9R#ZDH)j>vZ~|x!MDg29R7j4vP0_IM8=}ixhZZp+ewnHw=@@m zIw3cyt8e|Jg8Z@3z`L--SU{ba<8wDdmif34VcBanYqn&J&6&H&{KD|aeeLiQ8z3oI z%GGp;GFamw2yCtWtH>v|k3$2y?0LKg(w*s*-1I$O<#$Vo)p5y=B#nxAw@l45v~wBr zq;>Umf(4BNeumSJ<=F$aR1&Ld02XmV!zS6aEegTVrc!tDZy>ElWm2@IGonTzcGf~` zC5D90_fK8lrAhWq&Geq)JeULnj~hsLAT#aWV1^Tuh|x^0^Wap7g;;``sqs~r1Az6HGk#>SmxQM})}!~)2vce?>rWFIJ3%jr6>(5f8e~6#S2W-pUlBHZ)F)hAW~6CqaZ{;9 zn!~aQSaWyN_zYEF0@ZTxlixH;HI2*atJJ1oD3=8i#gjjm+qt0tQnA;K5g- zK>d~tupUC^x)sGZ1m=p2iEW8}j=18W_*~BTG}o{rYgC?hnMub;m?fD{CHfg?X$?p7 zUb%YOClisN(szm%Yju~8yd8Xmt|cKdG#di0C*J1Ye=g@&zUj~2*kt2oSrt8mpLFy2 zgING4mgNfjs~^cYz<%a&{HRQ|D`f)3>~{+i32nPS20>ae9>-V-*!IB2UX=m*qnZTb zh>E`Gk;P#MTNDK+WY(*%!4uJFEE#x|PIb9TgjDEGD{EgtXh(Tr8N{OQ_8`b{H1lt{ zySd)!cy(Ocz$U6BQqKpn~ zI|VH&(ytf&5VS}3?o#9QsW;;*b}T*|SZHv0dgOi_DYKS*SSgicP2*JAbJekSl9xKM zE)I7QtJv)7W5KcATkO3w#~j`+)Z)ysf4PPtN(z$J83TSF-&$4sJ2*QULq^*VKn zb3y7>7~|_u>_1yxIMeR&&IUC(H7?Up6IuNtY!GJ@BtPyp7lq1$M83GE?TP9Yj8j!( z^{4>sAa{&ljH8H*RSKF18v(y?i!9&G&H9shzrE_c*pgdBnI&nr$7;Ya;2A?#R^+p< zra(8k4;b9|1Z~}frBNZIk*FR`?ifrFp_>Y(#b*As{@?;{=&At9tnu3`wNZ~F#KtBp zjPMC?g9F7^$c$CS^VaHu5DfkP_(;6w9M>XS%8%fULeIh14HvX-it@+iMXPE{#^c3) zXQ#zd>Le!lr+Z_)uYu~>cYO=P?2pj0Q*UW{3;s(d%j6Hs-6UG1=MO46%n&*s*t9ro zvwn=)PVW&lRvg3T758{0=}23S_kctbl{B*7E56^+Ii@IlmPEUE?6UaNjw^aPiBwaZ zTp5v*S+TlH%Rvn5A~ywUNMAM?Ey(GqpH=BMPqpLN%@Ag#fMVxmEToIb{ig<(z5ni6 zU~NV8q52phAf?GgIya}anm%!9*>b(O@D1MGdkFL7vpADyN3JGLO0=gW-tB=38EtRx z64~eSeKp?tIzJo}P#bJ!JhPnDOEk>IRp+O*1Y&OT>ae);=q#djS;icW^P@-x`(nM9e?)*EOwiDg+^N z@X7i><|ewtB-lA&a>oe18yDB782Oc7$+lSP+dq&0o7r}u++S(EfevR6+WXfp-r~}Q zb)PTZ|JERG8Zphn(8kuGzc#HpPLd1TgDfph^DL-{8O(`vU#&0J{)`h&PpX?ZW>0~< z|2@VZJ1ATX<Vc1f_QzG*ASk;C4ppHXo-w)u1UH? z8IV|yI(@lzq;t(7v7N^5h?L5t7jJx zmMef42JrirF3jwe4fe4(S9ehCLi3o2JpJre@dOK8UBGRS+QWa353;*ZC$Qc-ShJmL&UkR`{C0{*|C;tZ*?OB z+kR9Y2`K8@PMoaoer90ZBk*=WMVsw&Vypmt$*+=odj_Jg@wx15%}CAO`#$pR)-Qvd zyy>C76O9$jqm@#Ni~c1(2sfx$7d+U0vs1buBd}1Ya-+9*{0F)rdW81xo`WuLO%uVL z5<*u<^amc8Et4N7(ceBXnXTl)Olbq9=sHdvYA)u zoi=3XV!~$>5`SA?ac82W;~fqpT6ZiLO?EC7jkmhu%iyu&9A-1lY3W~qT?#Zx(m6m8 zSTaFBNJB%fO(`+1*7!>Bc+G5C;7@a$jY1qXH)Yk$A}FrIVxg zuCw(1z|-x;O;iQBrk933N#&o+Vme9iDilHe$cVMZek*v(TRm-<@)5Vb$_w>->y=2QAnn znhju1BW~lR<`-Ug9ysN6e0a3?xunAB=0H#W?tq0*44Q z0mGG*hLtEogh-~QwzjgLfB^5AJ!>-(6+HhhZe1B1&nD+t`46@(28$~~WXnn+kUwnl zHAjKuT+Q3-!xRxYTHr5o#|`MeG~{%yDlYoZ=v?BYB#XMoN1>dYfN+TsNSZmlUEs)| zV4{vhoQZ~DWxX{wN^u&Oby9D!3dGj;U|aAnMp$$IcV|ZbF_`~PuBz{7U)|U)ZLBEg zWAZzkQC|0^JtLk-Cp5^&&B66gcRHVjIFw9~khZ+GepKz9wQsT$xvfsw7I#WHkX;(q zc?&{k=6Z%#xVv-wmwH-8?__>Dy8$Vf>8(9I>py6@VSzv3CM)kinCM1_!nZ$>mvdgv z8iNhW(n}AQ1(s)4MCn=5B?dzJj#Rc))B@-d2GfvzCVmEsYanrj#t2+%!@y<(es^h* z!E=uOqfo$LN}9o*#DXpwhZCcpE(C~dYA|@F7CvRKJnP#~BanN$J0$G(?oO+GSWk@q zlu=Y=LT9VRzTxR^k_jM`jd?!#oC`u&jAEp)oPq4yEA>4Y^`(nRx(1`(SI0HD2Iuq# zG{&am)frnZjk!=9v>v@_Qn~3mvFPI?MgJM8AgCsrV47LB8F0bYzIxh0u8cSJDlg5H zDqQ04GsQjGm&&y%Gu>gdK?Zg_%~UP*uC)YstCSaL_cK4=3E6pF_?&V*YxZUtAR5oCKqh4lB!`N4^V z`drksDzgOywG4`M#0vC@M1?9ue8oW&5L|d0GUEyClQ0xOS(E z-H1rtSw(_YN^r?yO%`t=M=i_sepv{^eI=}nkp4q)u2M`b`2^j@O>D~ee=d=Mv)OjmW6;^ zG%UqMcX@mM)CH+=YcvRNG>a zM-&my%2>ZUaGzoW@eWpX_mZBV={;KA9<#F9bUj#w8R>VW>z+LPpu9I|{rA>enmMcMLT+3oJW zSPki^%eNq?*CDKy2w|ulJE5I}(pJM7>F#b4a9WXuPU_!n`mgKtQ8_ivqKvgn$-7u6 zuS>$(6YcNqvJWi2cgX6!ODW*5K&>)TFcr7@`(0uKEJoq76j?bEfQJ^|9peMWQC`VL z)*wBQauEeY5LNU~X~ss)85tQJfj}qxOYr5kF{&othJnlmh>38ftkFgtd>)Ys9<%h) z_F{l|-LnUPUoft-cFOiAuF7(xEXFY|hA~diiHagS=v-Vpy6Dtn|ADoVD`H^!CARv^ zh1-Bli`N>^q3=2_?B~86|hB>XN zsRZ$HJR7I)LGUva=Y|oRg30wFtna%t9vS4QJ)qUM;d)nK_&udnRWf_1Iuq|JxFr{i ztDL~me#F@-mn|R+$!`ZCZ1=>Lpb!*eCTIP2oV1jrKMpOQoLJN8Vt$jJ|8d(YLMEla zUqiyQFLRQ*m!ezaMxq@f%lsv&i&nWZVh=&zS7$G+EPq`isByJqcsow&4+XyndVB%! zoVyGoE594)T{-YQKcIN=^$32xd>!X~b9GwYsY1h5r>wHZ;EkGZ9%sPsM^5$htox=e zkUu(Ty7;(F4_XAI?EM{5)P&22S{Nt-e&N1w>*2#K4RR)S-Je{!L8Nk*w{ErB9cY-` z0FqtvyTJGwnudOXPa2I=G`+y8+P)A)D?R1R{yhHFe*4Nb^FFh+#O~>q1i|J=;8#om zniE1JbJ^kO9%3tx4lwVOWs?23vEhG&(SNh*^$B+&bXIDn5bOA-$_$4e6Ze_Ej?E-x znOA!ckYe9#&;ac^h2NZ54BK+ZJH`t+3~=+83|Vq<9wAl-9!5PV=q0-~ZKW2N2A&_& zOdZ8SB?GMgc*=aZPj=be&F-m^<+JK56IhX6POAXZNJ-Y>hGsOCLQnm_=&PsS?9aln zI|^}1Lc})Hx$l*ire`Tdzi;odW}l_4*zS;=7D+pigPk)Te#gCWj|2*aDGhkCy)HGzyo zc=6Wl69MFayZbj9ZsDoc#0HCI!L7Bq8fihyy!RQqje356)vF-8O^vyGZ@ykCCrz-t z4KmHepZ8_=>tTwMq_u5S8vip`|In4}dQh)On)8FxK6g%EL5}USTEz){Z7i!XTpMTM zxvJ+Omo#SoogG>*$+lQAycf};e=*Ly9*<#FV}+dw*O|`)`YFc|*>m$!E|L`-OnglKVB20@u;{gpBjOz75bJcAdw4Nd?`TcME*~=~}j+6I~=U zsY(%Tp-TiW1viwc{)qxkrFB2%0`NE(RHo7Y0YMq-eyV=eT{^%FW>}xEy8IFm59MpK zxdi;WM)9VZTR8c|7Fe{fGIJPm5_R$G+VhG!*I-OKYM4|rLQeHwfVOqPw7>Q*+Ol(A zofi!J3I5ujGF&=H)}S&sV%ZS-aK$3}q*m7I#<^fEN8$a{;zQ}(Y=$3fN2Z@kO0A7f zhbCs@8>dLy-p$rZ!fhi{&N&B1EL&jx9&+WVtID?f6XN7(oUTlqsYA5IrkvYkj!}&p z1;}TgH~T1e(<_xMtBmUgX?z4v71@pQGq}tvEk4>yOd9g;SkMypjS@}(bH3hJJ>0{o+fg3BBuUM$566hB8L$k9qJf{dnY1 zcXDi&9cilVw-QQ`hIe^3;OYWNm+c0!vUL+p=@lYB?7)$8dE3kxSJffVvPtK6M-ORI zgABRb-NlC-d*wDZdX%ye%eteh2VR*r^f}l<#E|bYwPB`b^PJ|s_GAmFD=U$XESlxl>{18%5tHkLELZx zJCX6wSTWufX?8kIG6pIF*rSS;j0`?0q?1&K8|Umdl7{3&6UfqTuoOdXDIJqEeqNk! z&xc*kD82_*={`4wsp8E*@MZ28?E*brD~|J+0oO;VB9LWXeGzRG+Y^w zH6M4XZI^0hT<{i;NS;^@?LK2(3TRqC>U!p*-B8x(ToSpb-?`$LeJ{=kj=#klOMLAY zpwE0##R9Jumn|ASSVUtxWdX6Rw(zu!f8yeQQu!UyP{za3BC9j}N8FuxX*$a>;@!qx zD)#*XV&DC+qe7tQ`n*_5-u{${EB&-DKq32%$P$4+E-=p>nDDYTu4iS#oL_OR|PW44i>=hdN8;fyJPt6p|Kcg$3~K2k<`)}oHPOLZddIjtdwdv z;h1NcW7HjyW)T^Zcop~CR^8qXVL(w*Zi$JpC6#D5@F9Cc&}NWgu~!fVUa9LiDcP~= z_(h$>wTF_PK&v^Arb45t?HU|4mI7lluhyj`D?4nTyoXT0b0u#s#H2*-;z8i6hfku< zt(hrAZ@|*LRbyC8Zuj;dGwhozElZvyS3N!Rj#=y@f-zD1)EfmSGM+1zOof%ue$CH( zB`ty2s7D48J&qoE(t)LosUok_K3BEHBT&5ZgkjA!vkt8X0e-p@rZM~DBqLaeMDyjb zrQZ7o$?KEhx;8WA6HDX!Q_KGQ_QGQt8{aysm?VqL-@VJ|CMp)P!L>YQYaOJBHX zTt!Fl=z>)8xF?Y_kr!x7-xsE zeKP8q4gF1MmliUr&&Z|yePrEYzIr|VZ@I@mqz!|ir@iAD7GA>rtavrSiq6i)Gp5Sj zlh#>Wdy~fWPqR*M#T^xsT7o9Sp7^M%0Jd4X+m$(({a8wRESd$`4Daya?T`{VdyoYO zzUeH>sT_*Bn~5?nuQDpuG*L75s$gm4s`DYb2_kyU4bI+vtTL=tLYFdU><2Aza|W23 z7geO{niB4}&eM8GTlvvGsd7Yl9p-`GCK(F4By4E4b%V4Oh_@G(jLV>9Q+h?kM}`!p zh0}ykdg+sZWUFa{?l+vujMw&;G7XX&07B05W01ZjIK5?61&`cYuviK|Fqc&!HaM(F zu!}=(sdHA`+5_nO>4Bc71pzs?0Q-gkcnQ?h47`c2wgi?BsS9sVW=vkXr4HMSk3-%LMX)IGc@vc;6(-8i+U z;SzNeWk5Iqc-Z|!D!=xj+4BaLy>zyJu27SNfixx-46vDqyC$gg65Gr5%DdJJ^KEWQ zskJx9x%;HdvXl3tc0QD@){c#hjjRLHMF91%`shUcLS(G)3yFjaNlZ&#m7KHy09NVg zm=)EuJ5Jgs&?a}b&(r#bv-W(Ugp?xF?PG(Xot(V1k3Yq9(o@cE>KXz|v&8%(rxc*` zT)t@4?U!H`wDverH?_}V^+xwkcu`UD56WYG9>xYFk8K54><6%Lv9V0X*-oxB<8{qe z>H(~?vqAd$V3|ddlH?-!H-BmwFTBxeIBgcN{-A3>v*}1%&b-f%zfZ{SW5ZV^C3b$a zzO!5M}I*y*G=@`^=d=|{HS!4d|8s`1T7S_92agJd~Um2n}O_6Ov*I|TLtjpGD zrb2HY5rIQ+T5jD5JYx|#usD)@ur{;t>g{OyzdcUgZI_v~kqRWe7wkrObaisKf?mN@ z4nCCc%k=6QD~v2E7Q9)@P3N@V6Q=8-wiAIz<{1>ahj4Kf@hgcG1qs)_2Ap0L|Y7i;UNCa&B~(UrbX>l zI{VAzS#}Z4__PkcDnWN4wKF5;%mEm4OxSO*e24!W&;KLpZh|dKFuN7LXPME$%bdA7 zb6(BTPHzfKl&hB3)y>fVmPobR(<&&R--`p;9&zQ$$p!dLJ2*(;o!map~ANN-RE zIOLIOg}MEYlM>d3cs-}0#8KmY!Ux}t+_>6_-a;H{{`Mvlovhz7bqSd`oH!SrA5Hdil!hLzZ)H5` zd1ff_9vRDT=JSzg8cyx1Ug<0!OnxB}&D*hFEFTTH5s^s?(-CXo-{cMCG52T z0*lIwzy}KL$N?CVWin>d=n$6as?7E4nqT|WsCRH?C7~O^7?YQ7fw3=79Qmvz*yB6K zqdxp(2ITaa1CnSGu;Q{)yXB#EsPQp8sIyV<>3_u6(}9EO>mwwm!cBo4w_17EG~Uz~ zIqj+LFvw;i#I)30ipwEBBa@R!EYF7Ev^G*W$hl~qi_W`^wVZ8!o2=}5G$9V_xb7^t zj|-TNHQ_QHUj#cMrkl)l$ZO?Een0koCk1xt9-;at2?jeo>d1 z3{)5y`%u;))NLK-yEp)^ZvyE zJ?oYdOi{k3dbfX8T0w&gGHIWb5|g_=&d{5If9h3<6_X&sv$??NbX@kz5ND39v zY#B$j-u&f2)?0^Aa+gfwe2DaT&$&HwE2+w=-Vs<3UaE|=3;np2pp(m@;4J!{p|BKL zWgeE>)SWoen@FNo&W9GR1O@Zfvuy09wS!;9F!k-j8-oA-6OQqHB*)sLL9&)SaE2urLH}YjE z4H2Gor)Hgm>7Pmkq)B}378tNbC$~uE%au*4lR~U(B=vToJ2eID(W614GAeE};gN>5 z@nTwgU$YtR%y~<0>G}Np^WDvyH>FUl@T|vF>B-#_vEs2B*2^yDW13sy8fN4L*NF8C zKh;%zzAa|!3AFlk0~@TBL3k~F%H{eAuW3^eDn*1j5M0zk%Zy>#Q3I`SEBcwIf1#8Q?4uAFt7}K{MZq@o0%1*$%a?LgKUJyfi0qqoUeWs}wOeNfAmG8qq20;(-s@*0>3{!gG8z#M-k5gL1-jlO za-q4Q$gQ%yuvRgb9RK$*8e07CP90^58>SiVans2>2bY05@9e^oTBvI6hb~nQkK0js zp5EpoYkoHmCQ((6Z%0K-5cMi5ZhjuLWe6|>aqAGQRwLotFp}u;gZ}8cM@h2edBWBx znzq>{xKZ3~i9NCli2urK%mD)FNm{PQ8aLqH52Zf)@~<2FA9P`ShDbp)bRsx$$(VymsHE<7bnroYyeQ zMU3mh>9QZK-D?K_kk1b;Oop3u*QnU|p(?{PM3Yla1X6Xe%e-5*j#;Y2!F%aVb*=^E zT(@Dh$ccpmSermyZ0foo0;j|SKW^Vh%7m7bKshH54~yZSBF4!g8SZGG=X}mB^xFV4PfNu^p%5B7}IfB5%iI)e*E@uc^S= zs6ap!e|a%PMg68)%Vc(;%ju#pthCZhPBLbM#d>~UOac^uELxR}9PC^zyRSE9eViGm z%;s>B?`q2NdUvb>swygLY=UF%SHNZzKIxP+`LJvE|J zGJY-2(J=qfB0Q}BZy4>f36t^Pm#e|EiL%^-e%@b`y5n1>>D@7f3`A9 zb{>z_=YH4kJW0$!;&x!;(OpzsccW@val9zGcGvEW->guOLBot?EDEa{nDOo-;Y}*l z^2w;Hd|EU26d&(XJ;?&tP;rTMsGh_`&+J{_rSYF$Axr(gu1x`dT|0Nm-s0v{d3-8= zuV?Ptf-U7s_UzS3VIxI@9E?S@iY{_Uf4>HGe=H-}zHP|;sWvzvf2u$`?4{=S_mViD zn&RWq4~CjsrdFH--udKf!_&{CWQ}>)?6Z^5?QH zWtT4adCMPi(fcDzX6+FXk*}G{C!xTy+nDdBg%m$EtmvTW&@7g8#2E+s^kT+ZaHapN z70f+YUbCn;lbPw_1T|EK7QKrxMt9)7S zU8yx#`F^!@-i^`&jN~k2?*jTff7~Ipvg>)N04kw7p~H7OK%=YY3`RL}V{chxwxAZW#x2Ae{>~`=`;*y-PO%oJ3*`>reJe=Pvh*ZcC9I0&aTE zBPKC9(0Nr+25e*m&jxC}Q?xvDnlW<}l}*(d^LKb=QByHeJ&kzi3gL|T#3~!-Jz4fL zr%PR}QA}qt&s-AgRpowz6?bjp&ho8a*G6k&OPWd0`u)QCVeBr+I#xd82z2_B3UZvh z9?XIDqIv}?t=L2tFJ^5|;A~SmFiuy1KE$gsW9bUwSH5f;BX=BzAs{a;Si+;wU{A#0 zFXv40-!?T%_{o7sBl)-2{YPwkQFk;ax5Pp!_`qf*o9=vGnIlIeVddK5DPJXrbNKF$lEwh2sReH`w6;(`qf(n2sSr#CW z-H>QEWqVfT6d2`IukGd1BF+=p(2l_v#5Q@=p{dQz$6zhhdsqQ5fQ_!q{cap+`$)wg z*_ctytN5&EDU2%o8!gS7_;QQYYWzYLzGHxDargMFn?w0w+x(UCtwaB+R(qV|Ze7Nf zuyGcQA->lLQMYp(7%SuUY_6-2pKj=2YHg5oq|m=2ig}tEh-Y49AB!Mbb((Fh)=oZw hU`j3#8(rzNb*p3XA;tUQZeAb%X@mcl!trb3e*vuzR>}YX literal 0 HcmV?d00001 diff --git a/docs/invoice.yaml b/docs/invoice.yaml new file mode 100644 index 00000000..6e64ecbe --- /dev/null +++ b/docs/invoice.yaml @@ -0,0 +1,1405 @@ +openapi: 3.0.0 +info: + description: xendit-invoice-service descriptions + title: xendit-invoice-service + version: 1.5.0 +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /v2/invoices/: + post: + operationId: createInvoice + requestBody: + content: + application/json: + examples: + Create Invoice Request: + value: + external_id: test1234 + description: Test Invoice + amount: 10000 + invoice_duration: 172800 + currency: IDR + reminder_time: 1 + schema: + $ref: '#/components/schemas/CreateInvoiceRequest' + required: true + responses: + "200": + content: + application/json: + examples: + Successfully created Invoice: + $ref: '#/components/examples/InvoiceExample' + value: null + schema: + $ref: '#/components/schemas/Invoice' + description: OK + "400": + content: + application/json: + examples: + Maximum Transfer Amount Error: + value: + error_code: MAXIMUM_TRANSFER_AMOUNT_ERROR + message: "The maximum amount for using this payment is ${currency}\ + \ 5,000,000" + No Collections Method Error: + value: + error_code: NO_COLLECTION_METHODS_ERROR + message: Could not create invoice without any active payment channels + Email Format Error: + summary: EMAIL_FORMAT_ERROR + value: + error_code: EMAIL_FORMAT_ERROR + message: Customer email format is invalid + Unavailable Payment Error: + value: + error_code: UNAVAILABLE_PAYMENT_METHOD_ERROR + message: The payment method choices did not match with the available + one on this business + Unsupported Currency Error: + value: + error_code: UNSUPPORTED_CURRENCY + message: The payment currency request is not supported for this + payment channel + Currency Mismatch Error: + summary: Invoice settings not found for this currency' + value: + error_code: MISMATCH_CURRENCY_ERROR + message: "" + Invalid Remind Time Error: + value: + error_code: INVALID_REMINDER_TIME + message: The reminder time is invalid + Invoice Amount Mismatch: + value: + error_code: INVOICE_AMOUNT_MISMATCHED_CLOSED_VA_EXPECTED_AMOUNT + message: Could not create invoice due to invoice amount is not + match with Closed VA expected amount." + schema: + $ref: '#/components/schemas/BadRequestError' + description: Bad request + "401": + content: + application/json: + examples: + Invalid API Key: + $ref: '#/components/examples/InvalidApiKeyExample' + value: null + schema: + $ref: '#/components/schemas/UnauthorizedError' + description: Unauthorized + "403": + content: + application/json: + examples: + Access Suspended: + $ref: '#/components/examples/AccessSuspendedErrorExample' + value: null + schema: + $ref: '#/components/schemas/ForbiddenError' + description: Forbidden + "404": + content: + application/json: + examples: + Callback Virtual Account Error: + value: + error_code: CALLBACK_VIRTUAL_ACCOUNT_NOT_FOUND_ERROR + message: Could not find callback virtual account + Unique Account Number Error: + value: + error_code: UNIQUE_ACCOUNT_NUMBER_UNAVAILABLE_ERROR + message: There is no available virtual account in your non-fixed + virtual account range + Payment Code Not Available: + value: + error_code: PAYMENT_CODE_NOT_AVAILABLE_ERROR + message: No more vacant space for convenience store code + schema: + $ref: '#/components/schemas/InvoiceNotFoundError' + description: Not found + security: + - {} + summary: Create an invoice + tags: + - invoice + /v2/invoices/{invoice_id}: + get: + operationId: getInvoiceById + parameters: + - description: Invoice ID + explode: false + in: path + name: invoice_id + required: true + schema: + example: 62efe4c33e45294d63f585f2 + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Invoice' + description: OK + "401": + content: + application/json: + examples: + Invalid API Key: + $ref: '#/components/examples/InvalidApiKeyExample' + value: null + schema: + $ref: '#/components/schemas/UnauthorizedError' + description: Unauthorized + "404": + content: + application/json: + examples: + Invoice not found: + $ref: '#/components/examples/InvoiceNotFoundErrorExample' + value: null + schema: + $ref: '#/components/schemas/InvoiceError404ResponseDefinition' + description: Not found + "500": + content: + application/json: + examples: + Internal Server error: + $ref: '#/components/examples/ServerErrorExample' + value: null + schema: + $ref: '#/components/schemas/ServerError' + description: Internal server error + security: + - {} + summary: Get invoice by invoice id + tags: + - invoice + /v2/invoices: + get: + operationId: getInvoices + parameters: + - explode: true + in: query + name: external_id + required: false + schema: + example: test-external + type: string + style: form + - explode: true + in: query + name: statuses + required: false + schema: + example: + - PENDING + - SETTLED + items: + $ref: '#/components/schemas/InvoiceStatus' + type: array + style: form + - explode: true + in: query + name: limit + required: false + schema: + example: 10 + type: number + style: form + - explode: true + in: query + name: created_after + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: created_before + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: paid_after + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: paid_before + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: expired_after + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: expired_before + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: last_invoice + required: false + schema: + example: 62efe4c33e45294d63f585f2 + type: string + style: form + - explode: true + in: query + name: client_types + required: false + schema: + example: + - API_GATEWAY + - DASHBOARD + items: + $ref: '#/components/schemas/InvoiceClientType' + type: array + style: form + - explode: true + in: query + name: payment_channels + required: false + schema: + example: + - BNI + - BRI + items: + type: string + type: array + style: form + - explode: true + in: query + name: on_demand_link + required: false + schema: + example: test-link + type: string + style: form + - explode: true + in: query + name: recurring_payment_id + required: false + schema: + example: 62efe4c33e45294d63f585f2 + type: string + style: form + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/Invoice' + type: array + description: OK + "401": + content: + application/json: + examples: + INVALID_API_KEY: + summary: INVALID_API_KEY + value: + error_code: INVALID_API_KEY + message: Your API key is invalid + schema: + $ref: '#/components/schemas/UnauthorizedError' + description: Unauthorized + "500": + content: + application/json: + examples: + Internal Server error: + $ref: '#/components/examples/ServerErrorExample' + value: null + schema: + $ref: '#/components/schemas/ServerError' + description: Internal server error + security: + - {} + summary: Get all Invoices + tags: + - invoice + /invoices/{invoice_id}/expire!: + post: + operationId: expireInvoice + parameters: + - description: Invoice ID to be expired + explode: false + in: path + name: invoice_id + required: true + schema: + example: 5f4708b7bd394b0400b96276 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + Successfully expire Invoice: + $ref: '#/components/examples/InvoiceExample' + value: null + schema: + $ref: '#/components/schemas/Invoice' + description: OK + "404": + content: + application/json: + examples: + Invoice not found: + $ref: '#/components/examples/InvoiceNotFoundErrorExample' + value: null + schema: + $ref: '#/components/schemas/InvoiceNotFoundError' + description: Not found + "500": + content: + application/json: + examples: + Internal Server error: + $ref: '#/components/examples/ServerErrorExample' + value: null + schema: + $ref: '#/components/schemas/ServerError' + description: Internal server error + security: + - {} + summary: Manually expire an invoice + tags: + - invoice +components: + examples: + InvoiceExample: + summary: Example of Invoice + value: + id: 64e44c42cf6ba3554184a337 + external_id: invoice-1692683329 + user_id: 5f4708b7bd394b0400b96276 + status: PENDING + merchant_name: Boxify + merchant_profile_picture_url: https://xnd-companies.s3.amazonaws.com/prod/1633484308963_880.jpg + amount: 1800000 + payer_email: customer@domain.com + description: "Invoice Demo #123" + expiry_date: 2023-08-22T07:48:50.150Z + invoice_url: https://checkout-staging.xendit.co/v2/64e44c42cf6ba3554184a337 + available_banks: + - bank_code: MANDIRI + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BRI + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BNI + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: PERMATA + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BCA + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BSI + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BJB + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: CIMB + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: SAHABAT_SAMPOERNA + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + - bank_code: BNC + collection_type: POOL + transfer_amount: 1800000 + bank_branch: Virtual Account + account_holder_name: BOXIFY + available_retail_outlets: + - retail_outlet_name: ALFAMART + - retail_outlet_name: INDOMARET + available_ewallets: + - ewallet_type: OVO + - ewallet_type: DANA + - ewallet_type: SHOPEEPAY + - ewallet_type: LINKAJA + - ewallet_type: ASTRAPAY + - ewallet_type: NEXCASH + - ewallet_type: JENIUSPAY + available_qr_codes: + - qr_code_type: QRIS + available_direct_debits: + - direct_debit_type: DD_BRI + - direct_debit_type: DD_BCA_KLIKPAY + - direct_debit_type: DD_MANDIRI + available_paylaters: + - paylater_type: KREDIVO + - paylater_type: UANGME + - paylater_type: AKULAKU + - paylater_type: ATOME + should_exclude_credit_card: false + should_send_email: false + created: 2023-08-22T05:48:51.105Z + updated: 2023-08-22T05:48:51.105Z + currency: IDR + reminder_date: 2023-08-22T06:48:50.150Z + customer_notification_preference: + invoice_created: + - email + invoice_paid: + - email + InvalidApiKeyExample: + summary: Example of Invalid API Key error + value: + error_code: INVALID_API_KEY + message: Your API key is invalid + AccessSuspendedErrorExample: + summary: Example of Access Suspended error + value: + error_code: ACCESS_SUSPENDED + message: "Access to API has been suspended temporarily due to indication of\ + \ fraudulent activities. If you believe this is inaccurate, kindly contact\ + \ our Customer Success for resolution." + InvoiceNotFoundErrorExample: + summary: Example of Invoice not found error + value: + error_code: INVOICE_NOT_FOUND_ERROR + message: Invoice not found. + ServerErrorExample: + summary: Example of Server Error + value: + error_code: INTERNAL_SERVER_ERROR + message: Something unxpected happened. + schemas: + UnauthorizedError: + description: An error object used to indicate unauthorized access to an invoice-related + resource. + properties: + error_code: + description: The specific error code associated with the unauthorized access. + enum: + - INVALID_API_KEY + type: string + message: + description: A human-readable error message providing additional context + about the unauthorized access. + type: string + required: + - error_code + - message + type: object + ForbiddenError: + description: An error object used to indicate a 403 Forbidden response related + to invoice operations. + properties: + error_code: + description: The specific error code indicating that access to the invoice + operation is suspended. + enum: + - ACCESS_SUSPENDED + type: string + message: + description: A human-readable error message providing additional context + about the 403 Forbidden response. + type: string + required: + - error_code + - message + type: object + InvoiceError404ResponseDefinition: + description: "An error object used to indicate that the requested resource,\ + \ in this case, an invoice, was not found." + properties: + error_code: + description: The specific error code indicating that the requested invoice + was not found. + enum: + - INVOICE_NOT_FOUND_ERROR + type: string + message: + description: A human-readable error message providing additional context + about the resource not being found. + type: string + required: + - error_code + - message + type: object + Datetime: + description: Representing a date and time in ISO 8601 format. + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + NotificationChannel: + description: Representing a notification channel for sending messages. + enum: + - email + - sms + - whatsapp + - viber + type: string + InvoiceStatus: + description: Representing the status of an invoice. + enum: + - PENDING + - PAID + - SETTLED + - EXPIRED + type: string + InvoiceCurrency: + description: Representing the currency used for an invoice. + enum: + - IDR + - USD + - PHP + type: string + InvoiceClientType: + description: Representing the client type or source of an invoice. + enum: + - DASHBOARD + - API_GATEWAY + - INTEGRATION + - ON_DEMAND + - RECURRING + - MOBILE + type: string + InvoicePaymentMethod: + description: Representing the payment method used for an invoice. + enum: + - POOL + - CALLBACK_VIRTUAL_ACCOUNT + - CREDIT_CARD + - RETAIL_OUTLET + - QR_CODE + - QRIS + - EWALLET + - DIRECT_DEBIT + - BANK_TRANSFER + - PAYLATER + type: string + BankCode: + description: Representing the available bank channels used for invoice-related + transactions. + enum: + - BCA + - BNI + - BRI + - MANDIRI + - PERMATA + - BSI + - BJB + type: string + RetailOutletName: + description: Representing the available retail outlet channels used for invoice-related + transactions. + enum: + - ALFAMART + - INDOMARET + - 7ELEVEN + - CEBUANA + - DP_ECPAY_LOAN + - DP_MLHUILLIER + - DP_PALAWAN + - DP_ECPAY_SCHOOL + - LBC + type: string + EwalletType: + description: Representing the available eWallet channels used for invoice-related + transactions. + enum: + - OVO + - DANA + - LINKAJA + - PAYMAYA + - SHOPEEPAY + - GCASH + - GRABPAY + type: string + QrCodeType: + description: Representing the available QR Code channels used for invoice-related + transactions. + enum: + - QRIS + - PROMPTPAY + type: string + DirectDebitType: + description: Representing the available Direct Debit channels used for invoice-related + transactions. + enum: + - BA_BRI + - DC_BRI + - DD_BRI + - DD_MANDIRI + - BA_BPI + - DC_BPI + - DD_BPI + - BA_UBP + - DC_UBP + - DD_UBP + - BCA_KLIKPAY + - BA_BCA_KLIKPAY + - DC_BCA_KLIKPAY + - DD_BCA_KLIKPAY + type: string + PaylaterType: + description: Representing the available paylater channels used for invoice-related + transactions. + enum: + - KREDIVO + - AKULAKU + - UANGME + - BILLEASE + - CASHALO + - ATOME + type: string + AddressObject: + description: An object representing an address with various properties. + example: + country: country + province: province + city: city + street_line2: street_line2 + street_line1: street_line1 + state: state + postal_code: postal_code + properties: + country: + description: The country where the address is located. + nullable: true + type: string + street_line1: + description: The first line of the street address. + nullable: true + type: string + street_line2: + description: The second line of the street address. + nullable: true + type: string + city: + description: The city or locality within the address. + nullable: true + type: string + province: + description: The province or region within the country. + nullable: true + type: string + state: + description: The state or administrative division within the country. + nullable: true + type: string + postal_code: + description: The postal code or ZIP code for the address. + nullable: true + type: string + type: object + CustomerObject: + description: "An object representing a customer with various properties, including\ + \ addresses." + example: + addresses: + - country: country + province: province + city: city + street_line2: street_line2 + street_line1: street_line1 + state: state + postal_code: postal_code + - country: country + province: province + city: city + street_line2: street_line2 + street_line1: street_line1 + state: state + postal_code: postal_code + surname: surname + phone_number: phone_number + id: id + given_names: given_names + mobile_number: mobile_number + customer_id: customer_id + email: email + properties: + id: + description: The unique identifier for the customer. + nullable: true + type: string + phone_number: + description: The customer's phone number. + nullable: true + type: string + given_names: + description: The customer's given names or first names. + nullable: true + type: string + surname: + description: The customer's surname or last name. + nullable: true + type: string + email: + description: The customer's email address. + nullable: true + type: string + mobile_number: + description: The customer's mobile phone number. + nullable: true + type: string + customer_id: + description: An additional identifier for the customer. + nullable: true + type: string + addresses: + description: An array of addresses associated with the customer. + items: + $ref: '#/components/schemas/AddressObject' + nullable: true + type: array + type: object + NotificationPreference: + description: An object representing notification preferences for different invoice + events. + example: + invoice_expired: + - null + - null + invoice_paid: + - null + - null + invoice_reminder: + - null + - null + invoice_created: + - null + - null + properties: + invoice_created: + description: Notification channels for when an invoice is created. + items: + $ref: '#/components/schemas/NotificationChannel' + type: array + invoice_reminder: + description: Notification channels for invoice reminders. + items: + $ref: '#/components/schemas/NotificationChannel' + type: array + invoice_expired: + description: Notification channels for expired invoices. + items: + $ref: '#/components/schemas/NotificationChannel' + type: array + invoice_paid: + description: Notification channels for when an invoice is paid. + items: + $ref: '#/components/schemas/NotificationChannel' + type: array + type: object + AlternativeDisplayItem: + description: An object representing alternative display of a VA. + example: + type: type + value: value + properties: + type: + description: Represent type of alternative display. + type: string + value: + description: Represent value of alternative display value. + type: string + type: object + Bank: + description: An object representing bank details for invoices. + example: + bank_code: null + bank_branch: bank_branch + bank_account_number: bank_account_number + transfer_amount: 6.027456183070403 + account_holder_name: account_holder_name + alternative_displays: + - type: type + value: value + - type: type + value: value + collection_type: collection_type + properties: + bank_code: + $ref: '#/components/schemas/BankCode' + collection_type: + description: The collection type for the bank details. + type: string + bank_branch: + description: The branch of the bank. + type: string + bank_account_number: + description: The bank account number. + type: string + account_holder_name: + description: The name of the account holder. + type: string + transfer_amount: + description: The transfer amount. + type: number + alternative_displays: + items: + $ref: '#/components/schemas/AlternativeDisplayItem' + type: array + required: + - account_holder_name + - bank_code + - collection_type + type: object + RetailOutlet: + description: An object representing retail outlet details for invoices. + example: + retail_outlet_name: null + transfer_amount: 1.4658129805029452 + merchant_name: merchant_name + payment_code: payment_code + properties: + retail_outlet_name: + $ref: '#/components/schemas/RetailOutletName' + payment_code: + description: The payment code. + type: string + transfer_amount: + description: The transfer amount. + type: number + merchant_name: + description: The name of the merchant. + type: string + required: + - retail_outlet_name + type: object + Ewallet: + description: An object representing e-wallet details for invoices. + example: + ewallet_type: null + properties: + ewallet_type: + $ref: '#/components/schemas/EwalletType' + required: + - ewallet_type + type: object + QrCode: + description: An object representing QR code details for invoices. + example: + qr_code_type: null + properties: + qr_code_type: + $ref: '#/components/schemas/QrCodeType' + required: + - qr_code_type + type: object + DirectDebit: + description: An object representing direct debit details for invoices. + example: + direct_debit_type: null + properties: + direct_debit_type: + $ref: '#/components/schemas/DirectDebitType' + required: + - direct_debit_type + type: object + Paylater: + description: An object representing paylater details for invoices. + example: + paylater_type: null + should_exclude: true + properties: + paylater_type: + $ref: '#/components/schemas/PaylaterType' + should_exclude: + description: Indicates whether this paylater option should be excluded. + type: boolean + required: + - paylater_type + type: object + InvoiceItem: + description: An object representing an item within an invoice. + example: + quantity: 0.5637376656633328 + reference_id: reference_id + price: 5.962133916683182 + name: name + category: category + url: url + properties: + name: + description: The name of the item. + type: string + price: + description: The price of the item. + type: number + quantity: + description: The quantity of the item. Must be greater than or equal to + 0. + exclusiveMinimum: true + minimum: 0 + type: number + reference_id: + description: The reference ID of the item. + type: string + url: + description: The URL associated with the item. + type: string + category: + description: The category of the item. + type: string + required: + - name + - price + - quantity + type: object + InvoiceFee: + description: An object representing internal details for a fee associated with + an invoice. + example: + type: type + value: 2.3021358869347655 + properties: + type: + description: The type of fee. + type: string + value: + description: The value or amount of the fee. + type: number + required: + - type + - value + type: object + Invoice: + description: An object representing details for an invoice. + example: + available_paylaters: + - paylater_type: null + should_exclude: true + - paylater_type: null + should_exclude: true + fees: + - type: type + value: 2.3021358869347655 + - type: type + value: 2.3021358869347655 + payer_email: payer_email + reminder_date: 2016-08-29T09:12:33.001Z + description: description + external_id: external_id + locale: locale + should_send_email: true + customer_notification_preference: + invoice_expired: + - null + - null + invoice_paid: + - null + - null + invoice_reminder: + - null + - null + invoice_created: + - null + - null + currency: null + id: id + failure_redirect_url: failure_redirect_url + payment_method: null + amount: 0.8008281904610115 + available_banks: + - bank_code: null + bank_branch: bank_branch + bank_account_number: bank_account_number + transfer_amount: 6.027456183070403 + account_holder_name: account_holder_name + alternative_displays: + - type: type + value: value + - type: type + value: value + collection_type: collection_type + - bank_code: null + bank_branch: bank_branch + bank_account_number: bank_account_number + transfer_amount: 6.027456183070403 + account_holder_name: account_holder_name + alternative_displays: + - type: type + value: value + - type: type + value: value + collection_type: collection_type + available_ewallets: + - ewallet_type: null + - ewallet_type: null + available_retail_outlets: + - retail_outlet_name: null + transfer_amount: 1.4658129805029452 + merchant_name: merchant_name + payment_code: payment_code + - retail_outlet_name: null + transfer_amount: 1.4658129805029452 + merchant_name: merchant_name + payment_code: payment_code + created: 2016-08-29T09:12:33.001Z + expiry_date: 2016-08-29T09:12:33.001Z + merchant_name: merchant_name + available_qr_codes: + - qr_code_type: null + - qr_code_type: null + available_direct_debits: + - direct_debit_type: null + - direct_debit_type: null + merchant_profile_picture_url: merchant_profile_picture_url + should_authenticate_credit_card: true + user_id: user_id + success_redirect_url: success_redirect_url + should_exclude_credit_card: true + updated: 2016-08-29T09:12:33.001Z + items: + - quantity: 0.5637376656633328 + reference_id: reference_id + price: 5.962133916683182 + name: name + category: category + url: url + - quantity: 0.5637376656633328 + reference_id: reference_id + price: 5.962133916683182 + name: name + category: category + url: url + invoice_url: invoice_url + status: null + fixed_va: true + customer: + addresses: + - country: country + province: province + city: city + street_line2: street_line2 + street_line1: street_line1 + state: state + postal_code: postal_code + - country: country + province: province + city: city + street_line2: street_line2 + street_line1: street_line1 + state: state + postal_code: postal_code + surname: surname + phone_number: phone_number + id: id + given_names: given_names + mobile_number: mobile_number + customer_id: customer_id + email: email + properties: + id: + description: The unique identifier for the invoice. + type: string + external_id: + description: The external identifier for the invoice. + type: string + user_id: + description: The user ID associated with the invoice. + type: string + payer_email: + description: The email address of the payer. + type: string + description: + description: A description of the invoice. + type: string + payment_method: + $ref: '#/components/schemas/InvoicePaymentMethod' + status: + $ref: '#/components/schemas/InvoiceStatus' + merchant_name: + description: The name of the merchant. + type: string + merchant_profile_picture_url: + description: The URL of the merchant's profile picture. + type: string + locale: + description: The locale or language used for the invoice. + type: string + amount: + description: The total amount of the invoice. + type: number + expiry_date: + description: Representing a date and time in ISO 8601 format. + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + invoice_url: + description: The URL to view the invoice. + type: string + available_banks: + description: An array of available banks for payment. + items: + $ref: '#/components/schemas/Bank' + type: array + available_retail_outlets: + description: An array of available retail outlets for payment. + items: + $ref: '#/components/schemas/RetailOutlet' + type: array + available_ewallets: + description: An array of available e-wallets for payment. + items: + $ref: '#/components/schemas/Ewallet' + type: array + available_qr_codes: + description: An array of available QR codes for payment. + items: + $ref: '#/components/schemas/QrCode' + type: array + available_direct_debits: + description: An array of available direct debit options for payment. + items: + $ref: '#/components/schemas/DirectDebit' + type: array + available_paylaters: + description: An array of available pay-later options for payment. + items: + $ref: '#/components/schemas/Paylater' + type: array + should_exclude_credit_card: + description: Indicates whether credit card payments should be excluded. + type: boolean + should_send_email: + description: Indicates whether email notifications should be sent. + type: boolean + created: + description: Representing a date and time in ISO 8601 format. + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + updated: + description: Representing a date and time in ISO 8601 format. + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + success_redirect_url: + description: The URL to redirect to on successful payment. + type: string + failure_redirect_url: + description: The URL to redirect to on payment failure. + type: string + should_authenticate_credit_card: + description: Indicates whether credit card authentication is required. + type: boolean + currency: + $ref: '#/components/schemas/InvoiceCurrency' + items: + description: An array of items included in the invoice. + items: + $ref: '#/components/schemas/InvoiceItem' + type: array + fixed_va: + description: Indicates whether the virtual account is fixed. + type: boolean + reminder_date: + description: Representing a date and time in ISO 8601 format. + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + customer: + $ref: '#/components/schemas/CustomerObject' + customer_notification_preference: + $ref: '#/components/schemas/NotificationPreference' + fees: + description: An array of fees associated with the invoice. + items: + $ref: '#/components/schemas/InvoiceFee' + type: array + required: + - amount + - available_banks + - available_direct_debits + - available_ewallets + - available_paylaters + - available_qr_codes + - available_retail_outlets + - created + - expiry_date + - external_id + - invoice_url + - merchant_name + - merchant_profile_picture_url + - should_send_email + - status + - status_updated + - updated + - user_id + type: object + CreateInvoiceRequest: + description: An object representing for an invoice creation request. + example: + external_id: invoice-external-id-1 + amount: 10000 + description: Payment for PSN subscription + properties: + external_id: + description: The external ID of the invoice. + type: string + amount: + description: The invoice amount. + type: number + payer_email: + description: The email address of the payer. + type: string + description: + description: A description of the payment. + type: string + invoice_duration: + description: The duration of the invoice. + type: string + callback_virtual_account_id: + description: The ID of the callback virtual account. + type: string + should_send_email: + description: Indicates whether email notifications should be sent. + type: boolean + customer: + $ref: '#/components/schemas/CustomerObject' + customer_notification_preference: + $ref: '#/components/schemas/NotificationPreference' + success_redirect_url: + description: The URL to redirect to on successful payment. + type: string + failure_redirect_url: + description: The URL to redirect to on payment failure. + type: string + payment_methods: + description: An array of available payment methods. + items: + type: string + type: array + mid_label: + description: The middle label. + type: string + should_authenticate_credit_card: + description: Indicates whether credit card authentication is required. + type: boolean + currency: + description: The currency of the invoice. + type: string + reminder_time: + description: The reminder time. + type: number + local: + description: The local. + type: string + reminder_time_unit: + description: The unit of the reminder time. + type: string + items: + description: An array of items included in the invoice. + items: + $ref: '#/components/schemas/InvoiceItem' + type: array + fees: + description: An array of fees associated with the invoice. + items: + $ref: '#/components/schemas/InvoiceFee' + type: array + required: + - amount + - external_id + type: object + BadRequestError: + description: Response definition for a 400 Bad Request error when creating an + invoice. + properties: + error_code: + description: The error code indicating the type of error that occurred. + enum: + - MAXIMUM_TRANSFER_AMOUNT_ERROR + - NO_COLLECTION_METHODS_ERROR + - EMAIL_FORMAT_ERROR + - UNAVAILABLE_PAYMENT_METHOD_ERROR + - UNSUPPORTED_CURRENCY + - MISMATCH_CURRENCY_ERROR + - INVALID_REMINDER_TIME + type: string + message: + description: A human-readable error message that provides additional information + about the error. + type: string + required: + - error_code + - message + type: object + InvoiceNotFoundError: + description: Response definition for a 404 Not Found error when creating an + invoice. + properties: + error_code: + description: The error code indicating the type of error that occurred. + enum: + - CALLBACK_VIRTUAL_ACCOUNT_NOT_FOUND_ERROR + - UNIQUE_ACCOUNT_NUMBER_UNAVAILABLE_ERROR + - PAYMENT_CODE_NOT_AVAILABLE_ERROR + type: string + message: + description: A human-readable error message that provides additional information + about the error. + type: string + required: + - error_code + - message + type: object + ServerError: + properties: + error_code: + enum: + - SERVER_ERROR + type: string + message: + type: string + required: + - error_code + - message + type: object + securitySchemes: + ApiKeyAuth: + in: header + name: x-api-key + type: apiKey diff --git a/docs/invoice/AddressObject.md b/docs/invoice/AddressObject.md new file mode 100644 index 00000000..22fb2f08 --- /dev/null +++ b/docs/invoice/AddressObject.md @@ -0,0 +1,282 @@ +# AddressObject + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Country** | Pointer to **NullableString** | The country where the address is located. | [optional] | +| **StreetLine1** | Pointer to **NullableString** | The first line of the street address. | [optional] | +| **StreetLine2** | Pointer to **NullableString** | The second line of the street address. | [optional] | +| **City** | Pointer to **NullableString** | The city or locality within the address. | [optional] | +| **Province** | Pointer to **NullableString** | The province or region within the country. | [optional] | +| **State** | Pointer to **NullableString** | The state or administrative division within the country. | [optional] | +| **PostalCode** | Pointer to **NullableString** | The postal code or ZIP code for the address. | [optional] | + +## Methods + +### NewAddressObject + +`func NewAddressObject() *AddressObject` + +NewAddressObject instantiates a new AddressObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddressObjectWithDefaults + +`func NewAddressObjectWithDefaults() *AddressObject` + +NewAddressObjectWithDefaults instantiates a new AddressObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCountry + +`func (o *AddressObject) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *AddressObject) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *AddressObject) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *AddressObject) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### SetCountryNil + +`func (o *AddressObject) SetCountryNil(b bool)` + + SetCountryNil sets the value for Country to be an explicit nil + +### UnsetCountry +`func (o *AddressObject) UnsetCountry()` + +UnsetCountry ensures that no value is present for Country, not even an explicit nil +### GetStreetLine1 + +`func (o *AddressObject) GetStreetLine1() string` + +GetStreetLine1 returns the StreetLine1 field if non-nil, zero value otherwise. + +### GetStreetLine1Ok + +`func (o *AddressObject) GetStreetLine1Ok() (*string, bool)` + +GetStreetLine1Ok returns a tuple with the StreetLine1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine1 + +`func (o *AddressObject) SetStreetLine1(v string)` + +SetStreetLine1 sets StreetLine1 field to given value. + +### HasStreetLine1 + +`func (o *AddressObject) HasStreetLine1() bool` + +HasStreetLine1 returns a boolean if a field has been set. + +### SetStreetLine1Nil + +`func (o *AddressObject) SetStreetLine1Nil(b bool)` + + SetStreetLine1Nil sets the value for StreetLine1 to be an explicit nil + +### UnsetStreetLine1 +`func (o *AddressObject) UnsetStreetLine1()` + +UnsetStreetLine1 ensures that no value is present for StreetLine1, not even an explicit nil +### GetStreetLine2 + +`func (o *AddressObject) GetStreetLine2() string` + +GetStreetLine2 returns the StreetLine2 field if non-nil, zero value otherwise. + +### GetStreetLine2Ok + +`func (o *AddressObject) GetStreetLine2Ok() (*string, bool)` + +GetStreetLine2Ok returns a tuple with the StreetLine2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine2 + +`func (o *AddressObject) SetStreetLine2(v string)` + +SetStreetLine2 sets StreetLine2 field to given value. + +### HasStreetLine2 + +`func (o *AddressObject) HasStreetLine2() bool` + +HasStreetLine2 returns a boolean if a field has been set. + +### SetStreetLine2Nil + +`func (o *AddressObject) SetStreetLine2Nil(b bool)` + + SetStreetLine2Nil sets the value for StreetLine2 to be an explicit nil + +### UnsetStreetLine2 +`func (o *AddressObject) UnsetStreetLine2()` + +UnsetStreetLine2 ensures that no value is present for StreetLine2, not even an explicit nil +### GetCity + +`func (o *AddressObject) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *AddressObject) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *AddressObject) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *AddressObject) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### SetCityNil + +`func (o *AddressObject) SetCityNil(b bool)` + + SetCityNil sets the value for City to be an explicit nil + +### UnsetCity +`func (o *AddressObject) UnsetCity()` + +UnsetCity ensures that no value is present for City, not even an explicit nil +### GetProvince + +`func (o *AddressObject) GetProvince() string` + +GetProvince returns the Province field if non-nil, zero value otherwise. + +### GetProvinceOk + +`func (o *AddressObject) GetProvinceOk() (*string, bool)` + +GetProvinceOk returns a tuple with the Province field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvince + +`func (o *AddressObject) SetProvince(v string)` + +SetProvince sets Province field to given value. + +### HasProvince + +`func (o *AddressObject) HasProvince() bool` + +HasProvince returns a boolean if a field has been set. + +### SetProvinceNil + +`func (o *AddressObject) SetProvinceNil(b bool)` + + SetProvinceNil sets the value for Province to be an explicit nil + +### UnsetProvince +`func (o *AddressObject) UnsetProvince()` + +UnsetProvince ensures that no value is present for Province, not even an explicit nil +### GetState + +`func (o *AddressObject) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *AddressObject) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *AddressObject) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *AddressObject) HasState() bool` + +HasState returns a boolean if a field has been set. + +### SetStateNil + +`func (o *AddressObject) SetStateNil(b bool)` + + SetStateNil sets the value for State to be an explicit nil + +### UnsetState +`func (o *AddressObject) UnsetState()` + +UnsetState ensures that no value is present for State, not even an explicit nil +### GetPostalCode + +`func (o *AddressObject) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *AddressObject) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *AddressObject) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *AddressObject) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + +### SetPostalCodeNil + +`func (o *AddressObject) SetPostalCodeNil(b bool)` + + SetPostalCodeNil sets the value for PostalCode to be an explicit nil + +### UnsetPostalCode +`func (o *AddressObject) UnsetPostalCode()` + +UnsetPostalCode ensures that no value is present for PostalCode, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/AlternativeDisplayItem.md b/docs/invoice/AlternativeDisplayItem.md new file mode 100644 index 00000000..080ba2ed --- /dev/null +++ b/docs/invoice/AlternativeDisplayItem.md @@ -0,0 +1,82 @@ +# AlternativeDisplayItem + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | Pointer to **string** | Represent type of alternative display. | [optional] | +| **Value** | Pointer to **string** | Represent value of alternative display value. | [optional] | + +## Methods + +### NewAlternativeDisplayItem + +`func NewAlternativeDisplayItem() *AlternativeDisplayItem` + +NewAlternativeDisplayItem instantiates a new AlternativeDisplayItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAlternativeDisplayItemWithDefaults + +`func NewAlternativeDisplayItemWithDefaults() *AlternativeDisplayItem` + +NewAlternativeDisplayItemWithDefaults instantiates a new AlternativeDisplayItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *AlternativeDisplayItem) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *AlternativeDisplayItem) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *AlternativeDisplayItem) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *AlternativeDisplayItem) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetValue + +`func (o *AlternativeDisplayItem) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *AlternativeDisplayItem) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *AlternativeDisplayItem) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *AlternativeDisplayItem) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/BadRequestError.md b/docs/invoice/BadRequestError.md new file mode 100644 index 00000000..72e527b2 --- /dev/null +++ b/docs/invoice/BadRequestError.md @@ -0,0 +1,72 @@ +# BadRequestError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | The error code indicating the type of error that occurred. | | +| **Message** | **string** | A human-readable error message that provides additional information about the error. | | + +## Methods + +### NewBadRequestError + +`func NewBadRequestError(errorCode string, message string, ) *BadRequestError` + +NewBadRequestError instantiates a new BadRequestError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBadRequestErrorWithDefaults + +`func NewBadRequestErrorWithDefaults() *BadRequestError` + +NewBadRequestErrorWithDefaults instantiates a new BadRequestError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *BadRequestError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *BadRequestError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *BadRequestError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *BadRequestError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *BadRequestError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *BadRequestError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/Bank.md b/docs/invoice/Bank.md new file mode 100644 index 00000000..1573cfe3 --- /dev/null +++ b/docs/invoice/Bank.md @@ -0,0 +1,197 @@ +# Bank + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **BankCode** | [**BankCode**](BankCode.md) | | | +| **CollectionType** | **string** | The collection type for the bank details. | | +| **BankBranch** | Pointer to **string** | The branch of the bank. | [optional] | +| **BankAccountNumber** | Pointer to **string** | The bank account number. | [optional] | +| **AccountHolderName** | **string** | The name of the account holder. | | +| **TransferAmount** | Pointer to **float32** | The transfer amount. | [optional] | +| **AlternativeDisplays** | Pointer to [**AlternativeDisplayItem[]**](AlternativeDisplayItem.md) | | [optional] | + +## Methods + +### NewBank + +`func NewBank(bankCode BankCode, collectionType string, accountHolderName string, ) *Bank` + +NewBank instantiates a new Bank object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBankWithDefaults + +`func NewBankWithDefaults() *Bank` + +NewBankWithDefaults instantiates a new Bank object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBankCode + +`func (o *Bank) GetBankCode() BankCode` + +GetBankCode returns the BankCode field if non-nil, zero value otherwise. + +### GetBankCodeOk + +`func (o *Bank) GetBankCodeOk() (*BankCode, bool)` + +GetBankCodeOk returns a tuple with the BankCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankCode + +`func (o *Bank) SetBankCode(v BankCode)` + +SetBankCode sets BankCode field to given value. + + +### GetCollectionType + +`func (o *Bank) GetCollectionType() string` + +GetCollectionType returns the CollectionType field if non-nil, zero value otherwise. + +### GetCollectionTypeOk + +`func (o *Bank) GetCollectionTypeOk() (*string, bool)` + +GetCollectionTypeOk returns a tuple with the CollectionType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCollectionType + +`func (o *Bank) SetCollectionType(v string)` + +SetCollectionType sets CollectionType field to given value. + + +### GetBankBranch + +`func (o *Bank) GetBankBranch() string` + +GetBankBranch returns the BankBranch field if non-nil, zero value otherwise. + +### GetBankBranchOk + +`func (o *Bank) GetBankBranchOk() (*string, bool)` + +GetBankBranchOk returns a tuple with the BankBranch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankBranch + +`func (o *Bank) SetBankBranch(v string)` + +SetBankBranch sets BankBranch field to given value. + +### HasBankBranch + +`func (o *Bank) HasBankBranch() bool` + +HasBankBranch returns a boolean if a field has been set. + +### GetBankAccountNumber + +`func (o *Bank) GetBankAccountNumber() string` + +GetBankAccountNumber returns the BankAccountNumber field if non-nil, zero value otherwise. + +### GetBankAccountNumberOk + +`func (o *Bank) GetBankAccountNumberOk() (*string, bool)` + +GetBankAccountNumberOk returns a tuple with the BankAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccountNumber + +`func (o *Bank) SetBankAccountNumber(v string)` + +SetBankAccountNumber sets BankAccountNumber field to given value. + +### HasBankAccountNumber + +`func (o *Bank) HasBankAccountNumber() bool` + +HasBankAccountNumber returns a boolean if a field has been set. + +### GetAccountHolderName + +`func (o *Bank) GetAccountHolderName() string` + +GetAccountHolderName returns the AccountHolderName field if non-nil, zero value otherwise. + +### GetAccountHolderNameOk + +`func (o *Bank) GetAccountHolderNameOk() (*string, bool)` + +GetAccountHolderNameOk returns a tuple with the AccountHolderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountHolderName + +`func (o *Bank) SetAccountHolderName(v string)` + +SetAccountHolderName sets AccountHolderName field to given value. + + +### GetTransferAmount + +`func (o *Bank) GetTransferAmount() float32` + +GetTransferAmount returns the TransferAmount field if non-nil, zero value otherwise. + +### GetTransferAmountOk + +`func (o *Bank) GetTransferAmountOk() (*float32, bool)` + +GetTransferAmountOk returns a tuple with the TransferAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransferAmount + +`func (o *Bank) SetTransferAmount(v float32)` + +SetTransferAmount sets TransferAmount field to given value. + +### HasTransferAmount + +`func (o *Bank) HasTransferAmount() bool` + +HasTransferAmount returns a boolean if a field has been set. + +### GetAlternativeDisplays + +`func (o *Bank) GetAlternativeDisplays() []AlternativeDisplayItem` + +GetAlternativeDisplays returns the AlternativeDisplays field if non-nil, zero value otherwise. + +### GetAlternativeDisplaysOk + +`func (o *Bank) GetAlternativeDisplaysOk() (*[]AlternativeDisplayItem, bool)` + +GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplays + +`func (o *Bank) SetAlternativeDisplays(v []AlternativeDisplayItem)` + +SetAlternativeDisplays sets AlternativeDisplays field to given value. + +### HasAlternativeDisplays + +`func (o *Bank) HasAlternativeDisplays() bool` + +HasAlternativeDisplays returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/BankCode.md b/docs/invoice/BankCode.md new file mode 100644 index 00000000..4bdf0ce7 --- /dev/null +++ b/docs/invoice/BankCode.md @@ -0,0 +1,23 @@ +# BankCode + +## Enum + + +* `BCA` (value: `"BCA"`) + +* `BNI` (value: `"BNI"`) + +* `BRI` (value: `"BRI"`) + +* `MANDIRI` (value: `"MANDIRI"`) + +* `PERMATA` (value: `"PERMATA"`) + +* `BSI` (value: `"BSI"`) + +* `BJB` (value: `"BJB"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/CreateInvoiceRequest.md b/docs/invoice/CreateInvoiceRequest.md new file mode 100644 index 00000000..c6efb8c8 --- /dev/null +++ b/docs/invoice/CreateInvoiceRequest.md @@ -0,0 +1,540 @@ +# CreateInvoiceRequest + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ExternalId** | **string** | The external ID of the invoice. | | +| **Amount** | **float32** | The invoice amount. | | +| **PayerEmail** | Pointer to **string** | The email address of the payer. | [optional] | +| **Description** | Pointer to **string** | A description of the payment. | [optional] | +| **InvoiceDuration** | Pointer to **string** | The duration of the invoice. | [optional] | +| **CallbackVirtualAccountId** | Pointer to **string** | The ID of the callback virtual account. | [optional] | +| **ShouldSendEmail** | Pointer to **bool** | Indicates whether email notifications should be sent. | [optional] | +| **Customer** | Pointer to [**CustomerObject**](CustomerObject.md) | | [optional] | +| **CustomerNotificationPreference** | Pointer to [**NotificationPreference**](NotificationPreference.md) | | [optional] | +| **SuccessRedirectUrl** | Pointer to **string** | The URL to redirect to on successful payment. | [optional] | +| **FailureRedirectUrl** | Pointer to **string** | The URL to redirect to on payment failure. | [optional] | +| **PaymentMethods** | Pointer to **string[]** | An array of available payment methods. | [optional] | +| **MidLabel** | Pointer to **string** | The middle label. | [optional] | +| **ShouldAuthenticateCreditCard** | Pointer to **bool** | Indicates whether credit card authentication is required. | [optional] | +| **Currency** | Pointer to **string** | The currency of the invoice. | [optional] | +| **ReminderTime** | Pointer to **float32** | The reminder time. | [optional] | +| **Local** | Pointer to **string** | The local. | [optional] | +| **ReminderTimeUnit** | Pointer to **string** | The unit of the reminder time. | [optional] | +| **Items** | Pointer to [**InvoiceItem[]**](InvoiceItem.md) | An array of items included in the invoice. | [optional] | +| **Fees** | Pointer to [**InvoiceFee[]**](InvoiceFee.md) | An array of fees associated with the invoice. | [optional] | + +## Methods + +### NewCreateInvoiceRequest + +`func NewCreateInvoiceRequest(externalId string, amount float32, ) *CreateInvoiceRequest` + +NewCreateInvoiceRequest instantiates a new CreateInvoiceRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateInvoiceRequestWithDefaults + +`func NewCreateInvoiceRequestWithDefaults() *CreateInvoiceRequest` + +NewCreateInvoiceRequestWithDefaults instantiates a new CreateInvoiceRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExternalId + +`func (o *CreateInvoiceRequest) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *CreateInvoiceRequest) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *CreateInvoiceRequest) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + + +### GetAmount + +`func (o *CreateInvoiceRequest) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *CreateInvoiceRequest) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *CreateInvoiceRequest) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetPayerEmail + +`func (o *CreateInvoiceRequest) GetPayerEmail() string` + +GetPayerEmail returns the PayerEmail field if non-nil, zero value otherwise. + +### GetPayerEmailOk + +`func (o *CreateInvoiceRequest) GetPayerEmailOk() (*string, bool)` + +GetPayerEmailOk returns a tuple with the PayerEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerEmail + +`func (o *CreateInvoiceRequest) SetPayerEmail(v string)` + +SetPayerEmail sets PayerEmail field to given value. + +### HasPayerEmail + +`func (o *CreateInvoiceRequest) HasPayerEmail() bool` + +HasPayerEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *CreateInvoiceRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *CreateInvoiceRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *CreateInvoiceRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *CreateInvoiceRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetInvoiceDuration + +`func (o *CreateInvoiceRequest) GetInvoiceDuration() string` + +GetInvoiceDuration returns the InvoiceDuration field if non-nil, zero value otherwise. + +### GetInvoiceDurationOk + +`func (o *CreateInvoiceRequest) GetInvoiceDurationOk() (*string, bool)` + +GetInvoiceDurationOk returns a tuple with the InvoiceDuration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceDuration + +`func (o *CreateInvoiceRequest) SetInvoiceDuration(v string)` + +SetInvoiceDuration sets InvoiceDuration field to given value. + +### HasInvoiceDuration + +`func (o *CreateInvoiceRequest) HasInvoiceDuration() bool` + +HasInvoiceDuration returns a boolean if a field has been set. + +### GetCallbackVirtualAccountId + +`func (o *CreateInvoiceRequest) GetCallbackVirtualAccountId() string` + +GetCallbackVirtualAccountId returns the CallbackVirtualAccountId field if non-nil, zero value otherwise. + +### GetCallbackVirtualAccountIdOk + +`func (o *CreateInvoiceRequest) GetCallbackVirtualAccountIdOk() (*string, bool)` + +GetCallbackVirtualAccountIdOk returns a tuple with the CallbackVirtualAccountId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCallbackVirtualAccountId + +`func (o *CreateInvoiceRequest) SetCallbackVirtualAccountId(v string)` + +SetCallbackVirtualAccountId sets CallbackVirtualAccountId field to given value. + +### HasCallbackVirtualAccountId + +`func (o *CreateInvoiceRequest) HasCallbackVirtualAccountId() bool` + +HasCallbackVirtualAccountId returns a boolean if a field has been set. + +### GetShouldSendEmail + +`func (o *CreateInvoiceRequest) GetShouldSendEmail() bool` + +GetShouldSendEmail returns the ShouldSendEmail field if non-nil, zero value otherwise. + +### GetShouldSendEmailOk + +`func (o *CreateInvoiceRequest) GetShouldSendEmailOk() (*bool, bool)` + +GetShouldSendEmailOk returns a tuple with the ShouldSendEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldSendEmail + +`func (o *CreateInvoiceRequest) SetShouldSendEmail(v bool)` + +SetShouldSendEmail sets ShouldSendEmail field to given value. + +### HasShouldSendEmail + +`func (o *CreateInvoiceRequest) HasShouldSendEmail() bool` + +HasShouldSendEmail returns a boolean if a field has been set. + +### GetCustomer + +`func (o *CreateInvoiceRequest) GetCustomer() CustomerObject` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *CreateInvoiceRequest) GetCustomerOk() (*CustomerObject, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *CreateInvoiceRequest) SetCustomer(v CustomerObject)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *CreateInvoiceRequest) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetCustomerNotificationPreference + +`func (o *CreateInvoiceRequest) GetCustomerNotificationPreference() NotificationPreference` + +GetCustomerNotificationPreference returns the CustomerNotificationPreference field if non-nil, zero value otherwise. + +### GetCustomerNotificationPreferenceOk + +`func (o *CreateInvoiceRequest) GetCustomerNotificationPreferenceOk() (*NotificationPreference, bool)` + +GetCustomerNotificationPreferenceOk returns a tuple with the CustomerNotificationPreference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerNotificationPreference + +`func (o *CreateInvoiceRequest) SetCustomerNotificationPreference(v NotificationPreference)` + +SetCustomerNotificationPreference sets CustomerNotificationPreference field to given value. + +### HasCustomerNotificationPreference + +`func (o *CreateInvoiceRequest) HasCustomerNotificationPreference() bool` + +HasCustomerNotificationPreference returns a boolean if a field has been set. + +### GetSuccessRedirectUrl + +`func (o *CreateInvoiceRequest) GetSuccessRedirectUrl() string` + +GetSuccessRedirectUrl returns the SuccessRedirectUrl field if non-nil, zero value otherwise. + +### GetSuccessRedirectUrlOk + +`func (o *CreateInvoiceRequest) GetSuccessRedirectUrlOk() (*string, bool)` + +GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessRedirectUrl + +`func (o *CreateInvoiceRequest) SetSuccessRedirectUrl(v string)` + +SetSuccessRedirectUrl sets SuccessRedirectUrl field to given value. + +### HasSuccessRedirectUrl + +`func (o *CreateInvoiceRequest) HasSuccessRedirectUrl() bool` + +HasSuccessRedirectUrl returns a boolean if a field has been set. + +### GetFailureRedirectUrl + +`func (o *CreateInvoiceRequest) GetFailureRedirectUrl() string` + +GetFailureRedirectUrl returns the FailureRedirectUrl field if non-nil, zero value otherwise. + +### GetFailureRedirectUrlOk + +`func (o *CreateInvoiceRequest) GetFailureRedirectUrlOk() (*string, bool)` + +GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureRedirectUrl + +`func (o *CreateInvoiceRequest) SetFailureRedirectUrl(v string)` + +SetFailureRedirectUrl sets FailureRedirectUrl field to given value. + +### HasFailureRedirectUrl + +`func (o *CreateInvoiceRequest) HasFailureRedirectUrl() bool` + +HasFailureRedirectUrl returns a boolean if a field has been set. + +### GetPaymentMethods + +`func (o *CreateInvoiceRequest) GetPaymentMethods() []string` + +GetPaymentMethods returns the PaymentMethods field if non-nil, zero value otherwise. + +### GetPaymentMethodsOk + +`func (o *CreateInvoiceRequest) GetPaymentMethodsOk() (*[]string, bool)` + +GetPaymentMethodsOk returns a tuple with the PaymentMethods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethods + +`func (o *CreateInvoiceRequest) SetPaymentMethods(v []string)` + +SetPaymentMethods sets PaymentMethods field to given value. + +### HasPaymentMethods + +`func (o *CreateInvoiceRequest) HasPaymentMethods() bool` + +HasPaymentMethods returns a boolean if a field has been set. + +### GetMidLabel + +`func (o *CreateInvoiceRequest) GetMidLabel() string` + +GetMidLabel returns the MidLabel field if non-nil, zero value otherwise. + +### GetMidLabelOk + +`func (o *CreateInvoiceRequest) GetMidLabelOk() (*string, bool)` + +GetMidLabelOk returns a tuple with the MidLabel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMidLabel + +`func (o *CreateInvoiceRequest) SetMidLabel(v string)` + +SetMidLabel sets MidLabel field to given value. + +### HasMidLabel + +`func (o *CreateInvoiceRequest) HasMidLabel() bool` + +HasMidLabel returns a boolean if a field has been set. + +### GetShouldAuthenticateCreditCard + +`func (o *CreateInvoiceRequest) GetShouldAuthenticateCreditCard() bool` + +GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field if non-nil, zero value otherwise. + +### GetShouldAuthenticateCreditCardOk + +`func (o *CreateInvoiceRequest) GetShouldAuthenticateCreditCardOk() (*bool, bool)` + +GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldAuthenticateCreditCard + +`func (o *CreateInvoiceRequest) SetShouldAuthenticateCreditCard(v bool)` + +SetShouldAuthenticateCreditCard sets ShouldAuthenticateCreditCard field to given value. + +### HasShouldAuthenticateCreditCard + +`func (o *CreateInvoiceRequest) HasShouldAuthenticateCreditCard() bool` + +HasShouldAuthenticateCreditCard returns a boolean if a field has been set. + +### GetCurrency + +`func (o *CreateInvoiceRequest) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *CreateInvoiceRequest) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *CreateInvoiceRequest) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *CreateInvoiceRequest) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetReminderTime + +`func (o *CreateInvoiceRequest) GetReminderTime() float32` + +GetReminderTime returns the ReminderTime field if non-nil, zero value otherwise. + +### GetReminderTimeOk + +`func (o *CreateInvoiceRequest) GetReminderTimeOk() (*float32, bool)` + +GetReminderTimeOk returns a tuple with the ReminderTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReminderTime + +`func (o *CreateInvoiceRequest) SetReminderTime(v float32)` + +SetReminderTime sets ReminderTime field to given value. + +### HasReminderTime + +`func (o *CreateInvoiceRequest) HasReminderTime() bool` + +HasReminderTime returns a boolean if a field has been set. + +### GetLocal + +`func (o *CreateInvoiceRequest) GetLocal() string` + +GetLocal returns the Local field if non-nil, zero value otherwise. + +### GetLocalOk + +`func (o *CreateInvoiceRequest) GetLocalOk() (*string, bool)` + +GetLocalOk returns a tuple with the Local field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocal + +`func (o *CreateInvoiceRequest) SetLocal(v string)` + +SetLocal sets Local field to given value. + +### HasLocal + +`func (o *CreateInvoiceRequest) HasLocal() bool` + +HasLocal returns a boolean if a field has been set. + +### GetReminderTimeUnit + +`func (o *CreateInvoiceRequest) GetReminderTimeUnit() string` + +GetReminderTimeUnit returns the ReminderTimeUnit field if non-nil, zero value otherwise. + +### GetReminderTimeUnitOk + +`func (o *CreateInvoiceRequest) GetReminderTimeUnitOk() (*string, bool)` + +GetReminderTimeUnitOk returns a tuple with the ReminderTimeUnit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReminderTimeUnit + +`func (o *CreateInvoiceRequest) SetReminderTimeUnit(v string)` + +SetReminderTimeUnit sets ReminderTimeUnit field to given value. + +### HasReminderTimeUnit + +`func (o *CreateInvoiceRequest) HasReminderTimeUnit() bool` + +HasReminderTimeUnit returns a boolean if a field has been set. + +### GetItems + +`func (o *CreateInvoiceRequest) GetItems() []InvoiceItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *CreateInvoiceRequest) GetItemsOk() (*[]InvoiceItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *CreateInvoiceRequest) SetItems(v []InvoiceItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *CreateInvoiceRequest) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetFees + +`func (o *CreateInvoiceRequest) GetFees() []InvoiceFee` + +GetFees returns the Fees field if non-nil, zero value otherwise. + +### GetFeesOk + +`func (o *CreateInvoiceRequest) GetFeesOk() (*[]InvoiceFee, bool)` + +GetFeesOk returns a tuple with the Fees field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFees + +`func (o *CreateInvoiceRequest) SetFees(v []InvoiceFee)` + +SetFees sets Fees field to given value. + +### HasFees + +`func (o *CreateInvoiceRequest) HasFees() bool` + +HasFees returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/CustomerObject.md b/docs/invoice/CustomerObject.md new file mode 100644 index 00000000..d5e3dcba --- /dev/null +++ b/docs/invoice/CustomerObject.md @@ -0,0 +1,318 @@ +# CustomerObject + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | Pointer to **NullableString** | The unique identifier for the customer. | [optional] | +| **PhoneNumber** | Pointer to **NullableString** | The customer's phone number. | [optional] | +| **GivenNames** | Pointer to **NullableString** | The customer's given names or first names. | [optional] | +| **Surname** | Pointer to **NullableString** | The customer's surname or last name. | [optional] | +| **Email** | Pointer to **NullableString** | The customer's email address. | [optional] | +| **MobileNumber** | Pointer to **NullableString** | The customer's mobile phone number. | [optional] | +| **CustomerId** | Pointer to **NullableString** | An additional identifier for the customer. | [optional] | +| **Addresses** | Pointer to [**AddressObject[]**](AddressObject.md) | An array of addresses associated with the customer. | [optional] | + +## Methods + +### NewCustomerObject + +`func NewCustomerObject() *CustomerObject` + +NewCustomerObject instantiates a new CustomerObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCustomerObjectWithDefaults + +`func NewCustomerObjectWithDefaults() *CustomerObject` + +NewCustomerObjectWithDefaults instantiates a new CustomerObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *CustomerObject) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *CustomerObject) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *CustomerObject) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *CustomerObject) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetIdNil + +`func (o *CustomerObject) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *CustomerObject) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil +### GetPhoneNumber + +`func (o *CustomerObject) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *CustomerObject) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *CustomerObject) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *CustomerObject) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### SetPhoneNumberNil + +`func (o *CustomerObject) SetPhoneNumberNil(b bool)` + + SetPhoneNumberNil sets the value for PhoneNumber to be an explicit nil + +### UnsetPhoneNumber +`func (o *CustomerObject) UnsetPhoneNumber()` + +UnsetPhoneNumber ensures that no value is present for PhoneNumber, not even an explicit nil +### GetGivenNames + +`func (o *CustomerObject) GetGivenNames() string` + +GetGivenNames returns the GivenNames field if non-nil, zero value otherwise. + +### GetGivenNamesOk + +`func (o *CustomerObject) GetGivenNamesOk() (*string, bool)` + +GetGivenNamesOk returns a tuple with the GivenNames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGivenNames + +`func (o *CustomerObject) SetGivenNames(v string)` + +SetGivenNames sets GivenNames field to given value. + +### HasGivenNames + +`func (o *CustomerObject) HasGivenNames() bool` + +HasGivenNames returns a boolean if a field has been set. + +### SetGivenNamesNil + +`func (o *CustomerObject) SetGivenNamesNil(b bool)` + + SetGivenNamesNil sets the value for GivenNames to be an explicit nil + +### UnsetGivenNames +`func (o *CustomerObject) UnsetGivenNames()` + +UnsetGivenNames ensures that no value is present for GivenNames, not even an explicit nil +### GetSurname + +`func (o *CustomerObject) GetSurname() string` + +GetSurname returns the Surname field if non-nil, zero value otherwise. + +### GetSurnameOk + +`func (o *CustomerObject) GetSurnameOk() (*string, bool)` + +GetSurnameOk returns a tuple with the Surname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSurname + +`func (o *CustomerObject) SetSurname(v string)` + +SetSurname sets Surname field to given value. + +### HasSurname + +`func (o *CustomerObject) HasSurname() bool` + +HasSurname returns a boolean if a field has been set. + +### SetSurnameNil + +`func (o *CustomerObject) SetSurnameNil(b bool)` + + SetSurnameNil sets the value for Surname to be an explicit nil + +### UnsetSurname +`func (o *CustomerObject) UnsetSurname()` + +UnsetSurname ensures that no value is present for Surname, not even an explicit nil +### GetEmail + +`func (o *CustomerObject) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *CustomerObject) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *CustomerObject) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *CustomerObject) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmailNil + +`func (o *CustomerObject) SetEmailNil(b bool)` + + SetEmailNil sets the value for Email to be an explicit nil + +### UnsetEmail +`func (o *CustomerObject) UnsetEmail()` + +UnsetEmail ensures that no value is present for Email, not even an explicit nil +### GetMobileNumber + +`func (o *CustomerObject) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *CustomerObject) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *CustomerObject) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *CustomerObject) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### SetMobileNumberNil + +`func (o *CustomerObject) SetMobileNumberNil(b bool)` + + SetMobileNumberNil sets the value for MobileNumber to be an explicit nil + +### UnsetMobileNumber +`func (o *CustomerObject) UnsetMobileNumber()` + +UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +### GetCustomerId + +`func (o *CustomerObject) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *CustomerObject) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *CustomerObject) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *CustomerObject) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *CustomerObject) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *CustomerObject) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetAddresses + +`func (o *CustomerObject) GetAddresses() []AddressObject` + +GetAddresses returns the Addresses field if non-nil, zero value otherwise. + +### GetAddressesOk + +`func (o *CustomerObject) GetAddressesOk() (*[]AddressObject, bool)` + +GetAddressesOk returns a tuple with the Addresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddresses + +`func (o *CustomerObject) SetAddresses(v []AddressObject)` + +SetAddresses sets Addresses field to given value. + +### HasAddresses + +`func (o *CustomerObject) HasAddresses() bool` + +HasAddresses returns a boolean if a field has been set. + +### SetAddressesNil + +`func (o *CustomerObject) SetAddressesNil(b bool)` + + SetAddressesNil sets the value for Addresses to be an explicit nil + +### UnsetAddresses +`func (o *CustomerObject) UnsetAddresses()` + +UnsetAddresses ensures that no value is present for Addresses, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/DirectDebit.md b/docs/invoice/DirectDebit.md new file mode 100644 index 00000000..2e70e313 --- /dev/null +++ b/docs/invoice/DirectDebit.md @@ -0,0 +1,51 @@ +# DirectDebit + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **DirectDebitType** | [**DirectDebitType**](DirectDebitType.md) | | | + +## Methods + +### NewDirectDebit + +`func NewDirectDebit(directDebitType DirectDebitType, ) *DirectDebit` + +NewDirectDebit instantiates a new DirectDebit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitWithDefaults + +`func NewDirectDebitWithDefaults() *DirectDebit` + +NewDirectDebitWithDefaults instantiates a new DirectDebit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDirectDebitType + +`func (o *DirectDebit) GetDirectDebitType() DirectDebitType` + +GetDirectDebitType returns the DirectDebitType field if non-nil, zero value otherwise. + +### GetDirectDebitTypeOk + +`func (o *DirectDebit) GetDirectDebitTypeOk() (*DirectDebitType, bool)` + +GetDirectDebitTypeOk returns a tuple with the DirectDebitType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectDebitType + +`func (o *DirectDebit) SetDirectDebitType(v DirectDebitType)` + +SetDirectDebitType sets DirectDebitType field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/DirectDebitType.md b/docs/invoice/DirectDebitType.md new file mode 100644 index 00000000..55fa9891 --- /dev/null +++ b/docs/invoice/DirectDebitType.md @@ -0,0 +1,37 @@ +# DirectDebitType + +## Enum + + +* `BA_BRI` (value: `"BA_BRI"`) + +* `DC_BRI` (value: `"DC_BRI"`) + +* `DD_BRI` (value: `"DD_BRI"`) + +* `DD_MANDIRI` (value: `"DD_MANDIRI"`) + +* `BA_BPI` (value: `"BA_BPI"`) + +* `DC_BPI` (value: `"DC_BPI"`) + +* `DD_BPI` (value: `"DD_BPI"`) + +* `BA_UBP` (value: `"BA_UBP"`) + +* `DC_UBP` (value: `"DC_UBP"`) + +* `DD_UBP` (value: `"DD_UBP"`) + +* `BCA_KLIKPAY` (value: `"BCA_KLIKPAY"`) + +* `BA_BCA_KLIKPAY` (value: `"BA_BCA_KLIKPAY"`) + +* `DC_BCA_KLIKPAY` (value: `"DC_BCA_KLIKPAY"`) + +* `DD_BCA_KLIKPAY` (value: `"DD_BCA_KLIKPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/Ewallet.md b/docs/invoice/Ewallet.md new file mode 100644 index 00000000..5f9f66b6 --- /dev/null +++ b/docs/invoice/Ewallet.md @@ -0,0 +1,51 @@ +# Ewallet + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **EwalletType** | [**EwalletType**](EwalletType.md) | | | + +## Methods + +### NewEwallet + +`func NewEwallet(ewalletType EwalletType, ) *Ewallet` + +NewEwallet instantiates a new Ewallet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEwalletWithDefaults + +`func NewEwalletWithDefaults() *Ewallet` + +NewEwalletWithDefaults instantiates a new Ewallet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEwalletType + +`func (o *Ewallet) GetEwalletType() EwalletType` + +GetEwalletType returns the EwalletType field if non-nil, zero value otherwise. + +### GetEwalletTypeOk + +`func (o *Ewallet) GetEwalletTypeOk() (*EwalletType, bool)` + +GetEwalletTypeOk returns a tuple with the EwalletType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwalletType + +`func (o *Ewallet) SetEwalletType(v EwalletType)` + +SetEwalletType sets EwalletType field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/EwalletType.md b/docs/invoice/EwalletType.md new file mode 100644 index 00000000..5d279018 --- /dev/null +++ b/docs/invoice/EwalletType.md @@ -0,0 +1,23 @@ +# EwalletType + +## Enum + + +* `OVO` (value: `"OVO"`) + +* `DANA` (value: `"DANA"`) + +* `LINKAJA` (value: `"LINKAJA"`) + +* `PAYMAYA` (value: `"PAYMAYA"`) + +* `SHOPEEPAY` (value: `"SHOPEEPAY"`) + +* `GCASH` (value: `"GCASH"`) + +* `GRABPAY` (value: `"GRABPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/ForbiddenError.md b/docs/invoice/ForbiddenError.md new file mode 100644 index 00000000..6ecfeb6e --- /dev/null +++ b/docs/invoice/ForbiddenError.md @@ -0,0 +1,72 @@ +# ForbiddenError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | The specific error code indicating that access to the invoice operation is suspended. | | +| **Message** | **string** | A human-readable error message providing additional context about the 403 Forbidden response. | | + +## Methods + +### NewForbiddenError + +`func NewForbiddenError(errorCode string, message string, ) *ForbiddenError` + +NewForbiddenError instantiates a new ForbiddenError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewForbiddenErrorWithDefaults + +`func NewForbiddenErrorWithDefaults() *ForbiddenError` + +NewForbiddenErrorWithDefaults instantiates a new ForbiddenError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *ForbiddenError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *ForbiddenError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *ForbiddenError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *ForbiddenError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ForbiddenError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ForbiddenError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/Invoice.md b/docs/invoice/Invoice.md new file mode 100644 index 00000000..eff88d54 --- /dev/null +++ b/docs/invoice/Invoice.md @@ -0,0 +1,803 @@ +# Invoice + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | Pointer to **string** | The unique identifier for the invoice. | [optional] | +| **ExternalId** | **string** | The external identifier for the invoice. | | +| **UserId** | **string** | The user ID associated with the invoice. | | +| **PayerEmail** | Pointer to **string** | The email address of the payer. | [optional] | +| **Description** | Pointer to **string** | A description of the invoice. | [optional] | +| **PaymentMethod** | Pointer to [**InvoicePaymentMethod**](InvoicePaymentMethod.md) | | [optional] | +| **Status** | [**InvoiceStatus**](InvoiceStatus.md) | | | +| **MerchantName** | **string** | The name of the merchant. | | +| **MerchantProfilePictureUrl** | **string** | The URL of the merchant's profile picture. | | +| **Locale** | Pointer to **string** | The locale or language used for the invoice. | [optional] | +| **Amount** | **float32** | The total amount of the invoice. | | +| **ExpiryDate** | **time.Time** | Representing a date and time in ISO 8601 format. | | +| **InvoiceUrl** | **string** | The URL to view the invoice. | | +| **AvailableBanks** | [**Bank[]**](Bank.md) | An array of available banks for payment. | | +| **AvailableRetailOutlets** | [**RetailOutlet[]**](RetailOutlet.md) | An array of available retail outlets for payment. | | +| **AvailableEwallets** | [**Ewallet[]**](Ewallet.md) | An array of available e-wallets for payment. | | +| **AvailableQrCodes** | [**QrCode[]**](QrCode.md) | An array of available QR codes for payment. | | +| **AvailableDirectDebits** | [**DirectDebit[]**](DirectDebit.md) | An array of available direct debit options for payment. | | +| **AvailablePaylaters** | [**Paylater[]**](Paylater.md) | An array of available pay-later options for payment. | | +| **ShouldExcludeCreditCard** | Pointer to **bool** | Indicates whether credit card payments should be excluded. | [optional] | +| **ShouldSendEmail** | **bool** | Indicates whether email notifications should be sent. | | +| **Created** | **time.Time** | Representing a date and time in ISO 8601 format. | | +| **Updated** | **time.Time** | Representing a date and time in ISO 8601 format. | | +| **SuccessRedirectUrl** | Pointer to **string** | The URL to redirect to on successful payment. | [optional] | +| **FailureRedirectUrl** | Pointer to **string** | The URL to redirect to on payment failure. | [optional] | +| **ShouldAuthenticateCreditCard** | Pointer to **bool** | Indicates whether credit card authentication is required. | [optional] | +| **Currency** | Pointer to [**InvoiceCurrency**](InvoiceCurrency.md) | | [optional] | +| **Items** | Pointer to [**InvoiceItem[]**](InvoiceItem.md) | An array of items included in the invoice. | [optional] | +| **FixedVa** | Pointer to **bool** | Indicates whether the virtual account is fixed. | [optional] | +| **ReminderDate** | Pointer to **time.Time** | Representing a date and time in ISO 8601 format. | [optional] | +| **Customer** | Pointer to [**CustomerObject**](CustomerObject.md) | | [optional] | +| **CustomerNotificationPreference** | Pointer to [**NotificationPreference**](NotificationPreference.md) | | [optional] | +| **Fees** | Pointer to [**InvoiceFee[]**](InvoiceFee.md) | An array of fees associated with the invoice. | [optional] | + +## Methods + +### NewInvoice + +`func NewInvoice(externalId string, userId string, status InvoiceStatus, merchantName string, merchantProfilePictureUrl string, amount float32, expiryDate time.Time, invoiceUrl string, availableBanks []Bank, availableRetailOutlets []RetailOutlet, availableEwallets []Ewallet, availableQrCodes []QrCode, availableDirectDebits []DirectDebit, availablePaylaters []Paylater, shouldSendEmail bool, created time.Time, updated time.Time, ) *Invoice` + +NewInvoice instantiates a new Invoice object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceWithDefaults + +`func NewInvoiceWithDefaults() *Invoice` + +NewInvoiceWithDefaults instantiates a new Invoice object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Invoice) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Invoice) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Invoice) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Invoice) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetExternalId + +`func (o *Invoice) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *Invoice) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *Invoice) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + + +### GetUserId + +`func (o *Invoice) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *Invoice) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *Invoice) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetPayerEmail + +`func (o *Invoice) GetPayerEmail() string` + +GetPayerEmail returns the PayerEmail field if non-nil, zero value otherwise. + +### GetPayerEmailOk + +`func (o *Invoice) GetPayerEmailOk() (*string, bool)` + +GetPayerEmailOk returns a tuple with the PayerEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerEmail + +`func (o *Invoice) SetPayerEmail(v string)` + +SetPayerEmail sets PayerEmail field to given value. + +### HasPayerEmail + +`func (o *Invoice) HasPayerEmail() bool` + +HasPayerEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *Invoice) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Invoice) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Invoice) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Invoice) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *Invoice) GetPaymentMethod() InvoicePaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *Invoice) GetPaymentMethodOk() (*InvoicePaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *Invoice) SetPaymentMethod(v InvoicePaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *Invoice) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetStatus + +`func (o *Invoice) GetStatus() InvoiceStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Invoice) GetStatusOk() (*InvoiceStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Invoice) SetStatus(v InvoiceStatus)` + +SetStatus sets Status field to given value. + + +### GetMerchantName + +`func (o *Invoice) GetMerchantName() string` + +GetMerchantName returns the MerchantName field if non-nil, zero value otherwise. + +### GetMerchantNameOk + +`func (o *Invoice) GetMerchantNameOk() (*string, bool)` + +GetMerchantNameOk returns a tuple with the MerchantName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantName + +`func (o *Invoice) SetMerchantName(v string)` + +SetMerchantName sets MerchantName field to given value. + + +### GetMerchantProfilePictureUrl + +`func (o *Invoice) GetMerchantProfilePictureUrl() string` + +GetMerchantProfilePictureUrl returns the MerchantProfilePictureUrl field if non-nil, zero value otherwise. + +### GetMerchantProfilePictureUrlOk + +`func (o *Invoice) GetMerchantProfilePictureUrlOk() (*string, bool)` + +GetMerchantProfilePictureUrlOk returns a tuple with the MerchantProfilePictureUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantProfilePictureUrl + +`func (o *Invoice) SetMerchantProfilePictureUrl(v string)` + +SetMerchantProfilePictureUrl sets MerchantProfilePictureUrl field to given value. + + +### GetLocale + +`func (o *Invoice) GetLocale() string` + +GetLocale returns the Locale field if non-nil, zero value otherwise. + +### GetLocaleOk + +`func (o *Invoice) GetLocaleOk() (*string, bool)` + +GetLocaleOk returns a tuple with the Locale field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocale + +`func (o *Invoice) SetLocale(v string)` + +SetLocale sets Locale field to given value. + +### HasLocale + +`func (o *Invoice) HasLocale() bool` + +HasLocale returns a boolean if a field has been set. + +### GetAmount + +`func (o *Invoice) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Invoice) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Invoice) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetExpiryDate + +`func (o *Invoice) GetExpiryDate() time.Time` + +GetExpiryDate returns the ExpiryDate field if non-nil, zero value otherwise. + +### GetExpiryDateOk + +`func (o *Invoice) GetExpiryDateOk() (*time.Time, bool)` + +GetExpiryDateOk returns a tuple with the ExpiryDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryDate + +`func (o *Invoice) SetExpiryDate(v time.Time)` + +SetExpiryDate sets ExpiryDate field to given value. + + +### GetInvoiceUrl + +`func (o *Invoice) GetInvoiceUrl() string` + +GetInvoiceUrl returns the InvoiceUrl field if non-nil, zero value otherwise. + +### GetInvoiceUrlOk + +`func (o *Invoice) GetInvoiceUrlOk() (*string, bool)` + +GetInvoiceUrlOk returns a tuple with the InvoiceUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceUrl + +`func (o *Invoice) SetInvoiceUrl(v string)` + +SetInvoiceUrl sets InvoiceUrl field to given value. + + +### GetAvailableBanks + +`func (o *Invoice) GetAvailableBanks() []Bank` + +GetAvailableBanks returns the AvailableBanks field if non-nil, zero value otherwise. + +### GetAvailableBanksOk + +`func (o *Invoice) GetAvailableBanksOk() (*[]Bank, bool)` + +GetAvailableBanksOk returns a tuple with the AvailableBanks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableBanks + +`func (o *Invoice) SetAvailableBanks(v []Bank)` + +SetAvailableBanks sets AvailableBanks field to given value. + + +### GetAvailableRetailOutlets + +`func (o *Invoice) GetAvailableRetailOutlets() []RetailOutlet` + +GetAvailableRetailOutlets returns the AvailableRetailOutlets field if non-nil, zero value otherwise. + +### GetAvailableRetailOutletsOk + +`func (o *Invoice) GetAvailableRetailOutletsOk() (*[]RetailOutlet, bool)` + +GetAvailableRetailOutletsOk returns a tuple with the AvailableRetailOutlets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableRetailOutlets + +`func (o *Invoice) SetAvailableRetailOutlets(v []RetailOutlet)` + +SetAvailableRetailOutlets sets AvailableRetailOutlets field to given value. + + +### GetAvailableEwallets + +`func (o *Invoice) GetAvailableEwallets() []Ewallet` + +GetAvailableEwallets returns the AvailableEwallets field if non-nil, zero value otherwise. + +### GetAvailableEwalletsOk + +`func (o *Invoice) GetAvailableEwalletsOk() (*[]Ewallet, bool)` + +GetAvailableEwalletsOk returns a tuple with the AvailableEwallets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableEwallets + +`func (o *Invoice) SetAvailableEwallets(v []Ewallet)` + +SetAvailableEwallets sets AvailableEwallets field to given value. + + +### GetAvailableQrCodes + +`func (o *Invoice) GetAvailableQrCodes() []QrCode` + +GetAvailableQrCodes returns the AvailableQrCodes field if non-nil, zero value otherwise. + +### GetAvailableQrCodesOk + +`func (o *Invoice) GetAvailableQrCodesOk() (*[]QrCode, bool)` + +GetAvailableQrCodesOk returns a tuple with the AvailableQrCodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableQrCodes + +`func (o *Invoice) SetAvailableQrCodes(v []QrCode)` + +SetAvailableQrCodes sets AvailableQrCodes field to given value. + + +### GetAvailableDirectDebits + +`func (o *Invoice) GetAvailableDirectDebits() []DirectDebit` + +GetAvailableDirectDebits returns the AvailableDirectDebits field if non-nil, zero value otherwise. + +### GetAvailableDirectDebitsOk + +`func (o *Invoice) GetAvailableDirectDebitsOk() (*[]DirectDebit, bool)` + +GetAvailableDirectDebitsOk returns a tuple with the AvailableDirectDebits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableDirectDebits + +`func (o *Invoice) SetAvailableDirectDebits(v []DirectDebit)` + +SetAvailableDirectDebits sets AvailableDirectDebits field to given value. + + +### GetAvailablePaylaters + +`func (o *Invoice) GetAvailablePaylaters() []Paylater` + +GetAvailablePaylaters returns the AvailablePaylaters field if non-nil, zero value otherwise. + +### GetAvailablePaylatersOk + +`func (o *Invoice) GetAvailablePaylatersOk() (*[]Paylater, bool)` + +GetAvailablePaylatersOk returns a tuple with the AvailablePaylaters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailablePaylaters + +`func (o *Invoice) SetAvailablePaylaters(v []Paylater)` + +SetAvailablePaylaters sets AvailablePaylaters field to given value. + + +### GetShouldExcludeCreditCard + +`func (o *Invoice) GetShouldExcludeCreditCard() bool` + +GetShouldExcludeCreditCard returns the ShouldExcludeCreditCard field if non-nil, zero value otherwise. + +### GetShouldExcludeCreditCardOk + +`func (o *Invoice) GetShouldExcludeCreditCardOk() (*bool, bool)` + +GetShouldExcludeCreditCardOk returns a tuple with the ShouldExcludeCreditCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldExcludeCreditCard + +`func (o *Invoice) SetShouldExcludeCreditCard(v bool)` + +SetShouldExcludeCreditCard sets ShouldExcludeCreditCard field to given value. + +### HasShouldExcludeCreditCard + +`func (o *Invoice) HasShouldExcludeCreditCard() bool` + +HasShouldExcludeCreditCard returns a boolean if a field has been set. + +### GetShouldSendEmail + +`func (o *Invoice) GetShouldSendEmail() bool` + +GetShouldSendEmail returns the ShouldSendEmail field if non-nil, zero value otherwise. + +### GetShouldSendEmailOk + +`func (o *Invoice) GetShouldSendEmailOk() (*bool, bool)` + +GetShouldSendEmailOk returns a tuple with the ShouldSendEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldSendEmail + +`func (o *Invoice) SetShouldSendEmail(v bool)` + +SetShouldSendEmail sets ShouldSendEmail field to given value. + + +### GetCreated + +`func (o *Invoice) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *Invoice) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *Invoice) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *Invoice) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *Invoice) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *Invoice) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + + +### GetSuccessRedirectUrl + +`func (o *Invoice) GetSuccessRedirectUrl() string` + +GetSuccessRedirectUrl returns the SuccessRedirectUrl field if non-nil, zero value otherwise. + +### GetSuccessRedirectUrlOk + +`func (o *Invoice) GetSuccessRedirectUrlOk() (*string, bool)` + +GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessRedirectUrl + +`func (o *Invoice) SetSuccessRedirectUrl(v string)` + +SetSuccessRedirectUrl sets SuccessRedirectUrl field to given value. + +### HasSuccessRedirectUrl + +`func (o *Invoice) HasSuccessRedirectUrl() bool` + +HasSuccessRedirectUrl returns a boolean if a field has been set. + +### GetFailureRedirectUrl + +`func (o *Invoice) GetFailureRedirectUrl() string` + +GetFailureRedirectUrl returns the FailureRedirectUrl field if non-nil, zero value otherwise. + +### GetFailureRedirectUrlOk + +`func (o *Invoice) GetFailureRedirectUrlOk() (*string, bool)` + +GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureRedirectUrl + +`func (o *Invoice) SetFailureRedirectUrl(v string)` + +SetFailureRedirectUrl sets FailureRedirectUrl field to given value. + +### HasFailureRedirectUrl + +`func (o *Invoice) HasFailureRedirectUrl() bool` + +HasFailureRedirectUrl returns a boolean if a field has been set. + +### GetShouldAuthenticateCreditCard + +`func (o *Invoice) GetShouldAuthenticateCreditCard() bool` + +GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field if non-nil, zero value otherwise. + +### GetShouldAuthenticateCreditCardOk + +`func (o *Invoice) GetShouldAuthenticateCreditCardOk() (*bool, bool)` + +GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldAuthenticateCreditCard + +`func (o *Invoice) SetShouldAuthenticateCreditCard(v bool)` + +SetShouldAuthenticateCreditCard sets ShouldAuthenticateCreditCard field to given value. + +### HasShouldAuthenticateCreditCard + +`func (o *Invoice) HasShouldAuthenticateCreditCard() bool` + +HasShouldAuthenticateCreditCard returns a boolean if a field has been set. + +### GetCurrency + +`func (o *Invoice) GetCurrency() InvoiceCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Invoice) GetCurrencyOk() (*InvoiceCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Invoice) SetCurrency(v InvoiceCurrency)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *Invoice) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetItems + +`func (o *Invoice) GetItems() []InvoiceItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *Invoice) GetItemsOk() (*[]InvoiceItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *Invoice) SetItems(v []InvoiceItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *Invoice) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetFixedVa + +`func (o *Invoice) GetFixedVa() bool` + +GetFixedVa returns the FixedVa field if non-nil, zero value otherwise. + +### GetFixedVaOk + +`func (o *Invoice) GetFixedVaOk() (*bool, bool)` + +GetFixedVaOk returns a tuple with the FixedVa field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFixedVa + +`func (o *Invoice) SetFixedVa(v bool)` + +SetFixedVa sets FixedVa field to given value. + +### HasFixedVa + +`func (o *Invoice) HasFixedVa() bool` + +HasFixedVa returns a boolean if a field has been set. + +### GetReminderDate + +`func (o *Invoice) GetReminderDate() time.Time` + +GetReminderDate returns the ReminderDate field if non-nil, zero value otherwise. + +### GetReminderDateOk + +`func (o *Invoice) GetReminderDateOk() (*time.Time, bool)` + +GetReminderDateOk returns a tuple with the ReminderDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReminderDate + +`func (o *Invoice) SetReminderDate(v time.Time)` + +SetReminderDate sets ReminderDate field to given value. + +### HasReminderDate + +`func (o *Invoice) HasReminderDate() bool` + +HasReminderDate returns a boolean if a field has been set. + +### GetCustomer + +`func (o *Invoice) GetCustomer() CustomerObject` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *Invoice) GetCustomerOk() (*CustomerObject, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *Invoice) SetCustomer(v CustomerObject)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *Invoice) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetCustomerNotificationPreference + +`func (o *Invoice) GetCustomerNotificationPreference() NotificationPreference` + +GetCustomerNotificationPreference returns the CustomerNotificationPreference field if non-nil, zero value otherwise. + +### GetCustomerNotificationPreferenceOk + +`func (o *Invoice) GetCustomerNotificationPreferenceOk() (*NotificationPreference, bool)` + +GetCustomerNotificationPreferenceOk returns a tuple with the CustomerNotificationPreference field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerNotificationPreference + +`func (o *Invoice) SetCustomerNotificationPreference(v NotificationPreference)` + +SetCustomerNotificationPreference sets CustomerNotificationPreference field to given value. + +### HasCustomerNotificationPreference + +`func (o *Invoice) HasCustomerNotificationPreference() bool` + +HasCustomerNotificationPreference returns a boolean if a field has been set. + +### GetFees + +`func (o *Invoice) GetFees() []InvoiceFee` + +GetFees returns the Fees field if non-nil, zero value otherwise. + +### GetFeesOk + +`func (o *Invoice) GetFeesOk() (*[]InvoiceFee, bool)` + +GetFeesOk returns a tuple with the Fees field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFees + +`func (o *Invoice) SetFees(v []InvoiceFee)` + +SetFees sets Fees field to given value. + +### HasFees + +`func (o *Invoice) HasFees() bool` + +HasFees returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceClientType.md b/docs/invoice/InvoiceClientType.md new file mode 100644 index 00000000..7aea8262 --- /dev/null +++ b/docs/invoice/InvoiceClientType.md @@ -0,0 +1,21 @@ +# InvoiceClientType + +## Enum + + +* `DASHBOARD` (value: `"DASHBOARD"`) + +* `API_GATEWAY` (value: `"API_GATEWAY"`) + +* `INTEGRATION` (value: `"INTEGRATION"`) + +* `ON_DEMAND` (value: `"ON_DEMAND"`) + +* `RECURRING` (value: `"RECURRING"`) + +* `MOBILE` (value: `"MOBILE"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceCurrency.md b/docs/invoice/InvoiceCurrency.md new file mode 100644 index 00000000..b4cd5a55 --- /dev/null +++ b/docs/invoice/InvoiceCurrency.md @@ -0,0 +1,15 @@ +# InvoiceCurrency + +## Enum + + +* `IDR` (value: `"IDR"`) + +* `USD` (value: `"USD"`) + +* `PHP` (value: `"PHP"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceError404ResponseDefinition.md b/docs/invoice/InvoiceError404ResponseDefinition.md new file mode 100644 index 00000000..40ed5de4 --- /dev/null +++ b/docs/invoice/InvoiceError404ResponseDefinition.md @@ -0,0 +1,72 @@ +# InvoiceError404ResponseDefinition + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | The specific error code indicating that the requested invoice was not found. | | +| **Message** | **string** | A human-readable error message providing additional context about the resource not being found. | | + +## Methods + +### NewInvoiceError404ResponseDefinition + +`func NewInvoiceError404ResponseDefinition(errorCode string, message string, ) *InvoiceError404ResponseDefinition` + +NewInvoiceError404ResponseDefinition instantiates a new InvoiceError404ResponseDefinition object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceError404ResponseDefinitionWithDefaults + +`func NewInvoiceError404ResponseDefinitionWithDefaults() *InvoiceError404ResponseDefinition` + +NewInvoiceError404ResponseDefinitionWithDefaults instantiates a new InvoiceError404ResponseDefinition object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *InvoiceError404ResponseDefinition) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *InvoiceError404ResponseDefinition) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *InvoiceError404ResponseDefinition) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *InvoiceError404ResponseDefinition) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InvoiceError404ResponseDefinition) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InvoiceError404ResponseDefinition) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceFee.md b/docs/invoice/InvoiceFee.md new file mode 100644 index 00000000..5bad6d59 --- /dev/null +++ b/docs/invoice/InvoiceFee.md @@ -0,0 +1,72 @@ +# InvoiceFee + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | **string** | The type of fee. | | +| **Value** | **float32** | The value or amount of the fee. | | + +## Methods + +### NewInvoiceFee + +`func NewInvoiceFee(type_ string, value float32, ) *InvoiceFee` + +NewInvoiceFee instantiates a new InvoiceFee object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceFeeWithDefaults + +`func NewInvoiceFeeWithDefaults() *InvoiceFee` + +NewInvoiceFeeWithDefaults instantiates a new InvoiceFee object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *InvoiceFee) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *InvoiceFee) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *InvoiceFee) SetType(v string)` + +SetType sets Type field to given value. + + +### GetValue + +`func (o *InvoiceFee) GetValue() float32` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *InvoiceFee) GetValueOk() (*float32, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *InvoiceFee) SetValue(v float32)` + +SetValue sets Value field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceItem.md b/docs/invoice/InvoiceItem.md new file mode 100644 index 00000000..eba66f95 --- /dev/null +++ b/docs/invoice/InvoiceItem.md @@ -0,0 +1,171 @@ +# InvoiceItem + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Name** | **string** | The name of the item. | | +| **Price** | **float32** | The price of the item. | | +| **Quantity** | **float32** | The quantity of the item. Must be greater than or equal to 0. | | +| **ReferenceId** | Pointer to **string** | The reference ID of the item. | [optional] | +| **Url** | Pointer to **string** | The URL associated with the item. | [optional] | +| **Category** | Pointer to **string** | The category of the item. | [optional] | + +## Methods + +### NewInvoiceItem + +`func NewInvoiceItem(name string, price float32, quantity float32, ) *InvoiceItem` + +NewInvoiceItem instantiates a new InvoiceItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceItemWithDefaults + +`func NewInvoiceItemWithDefaults() *InvoiceItem` + +NewInvoiceItemWithDefaults instantiates a new InvoiceItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *InvoiceItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InvoiceItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InvoiceItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPrice + +`func (o *InvoiceItem) GetPrice() float32` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *InvoiceItem) GetPriceOk() (*float32, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *InvoiceItem) SetPrice(v float32)` + +SetPrice sets Price field to given value. + + +### GetQuantity + +`func (o *InvoiceItem) GetQuantity() float32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *InvoiceItem) GetQuantityOk() (*float32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *InvoiceItem) SetQuantity(v float32)` + +SetQuantity sets Quantity field to given value. + + +### GetReferenceId + +`func (o *InvoiceItem) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *InvoiceItem) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *InvoiceItem) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *InvoiceItem) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetUrl + +`func (o *InvoiceItem) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *InvoiceItem) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *InvoiceItem) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *InvoiceItem) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetCategory + +`func (o *InvoiceItem) GetCategory() string` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *InvoiceItem) GetCategoryOk() (*string, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *InvoiceItem) SetCategory(v string)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *InvoiceItem) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceNotFoundError.md b/docs/invoice/InvoiceNotFoundError.md new file mode 100644 index 00000000..e500677a --- /dev/null +++ b/docs/invoice/InvoiceNotFoundError.md @@ -0,0 +1,72 @@ +# InvoiceNotFoundError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | The error code indicating the type of error that occurred. | | +| **Message** | **string** | A human-readable error message that provides additional information about the error. | | + +## Methods + +### NewInvoiceNotFoundError + +`func NewInvoiceNotFoundError(errorCode string, message string, ) *InvoiceNotFoundError` + +NewInvoiceNotFoundError instantiates a new InvoiceNotFoundError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceNotFoundErrorWithDefaults + +`func NewInvoiceNotFoundErrorWithDefaults() *InvoiceNotFoundError` + +NewInvoiceNotFoundErrorWithDefaults instantiates a new InvoiceNotFoundError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *InvoiceNotFoundError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *InvoiceNotFoundError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *InvoiceNotFoundError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *InvoiceNotFoundError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InvoiceNotFoundError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InvoiceNotFoundError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoicePaymentMethod.md b/docs/invoice/InvoicePaymentMethod.md new file mode 100644 index 00000000..559f8647 --- /dev/null +++ b/docs/invoice/InvoicePaymentMethod.md @@ -0,0 +1,29 @@ +# InvoicePaymentMethod + +## Enum + + +* `POOL` (value: `"POOL"`) + +* `CALLBACK_VIRTUAL_ACCOUNT` (value: `"CALLBACK_VIRTUAL_ACCOUNT"`) + +* `CREDIT_CARD` (value: `"CREDIT_CARD"`) + +* `RETAIL_OUTLET` (value: `"RETAIL_OUTLET"`) + +* `QR_CODE` (value: `"QR_CODE"`) + +* `QRIS` (value: `"QRIS"`) + +* `EWALLET` (value: `"EWALLET"`) + +* `DIRECT_DEBIT` (value: `"DIRECT_DEBIT"`) + +* `BANK_TRANSFER` (value: `"BANK_TRANSFER"`) + +* `PAYLATER` (value: `"PAYLATER"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceStatus.md b/docs/invoice/InvoiceStatus.md new file mode 100644 index 00000000..7c7605b6 --- /dev/null +++ b/docs/invoice/InvoiceStatus.md @@ -0,0 +1,17 @@ +# InvoiceStatus + +## Enum + + +* `PENDING` (value: `"PENDING"`) + +* `PAID` (value: `"PAID"`) + +* `SETTLED` (value: `"SETTLED"`) + +* `EXPIRED` (value: `"EXPIRED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/NotificationChannel.md b/docs/invoice/NotificationChannel.md new file mode 100644 index 00000000..0f3a2456 --- /dev/null +++ b/docs/invoice/NotificationChannel.md @@ -0,0 +1,17 @@ +# NotificationChannel + +## Enum + + +* `EMAIL` (value: `"email"`) + +* `SMS` (value: `"sms"`) + +* `WHATSAPP` (value: `"whatsapp"`) + +* `VIBER` (value: `"viber"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/NotificationPreference.md b/docs/invoice/NotificationPreference.md new file mode 100644 index 00000000..d23d33c3 --- /dev/null +++ b/docs/invoice/NotificationPreference.md @@ -0,0 +1,134 @@ +# NotificationPreference + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **InvoiceCreated** | Pointer to [**NotificationChannel[]**](NotificationChannel.md) | Notification channels for when an invoice is created. | [optional] | +| **InvoiceReminder** | Pointer to [**NotificationChannel[]**](NotificationChannel.md) | Notification channels for invoice reminders. | [optional] | +| **InvoiceExpired** | Pointer to [**NotificationChannel[]**](NotificationChannel.md) | Notification channels for expired invoices. | [optional] | +| **InvoicePaid** | Pointer to [**NotificationChannel[]**](NotificationChannel.md) | Notification channels for when an invoice is paid. | [optional] | + +## Methods + +### NewNotificationPreference + +`func NewNotificationPreference() *NotificationPreference` + +NewNotificationPreference instantiates a new NotificationPreference object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNotificationPreferenceWithDefaults + +`func NewNotificationPreferenceWithDefaults() *NotificationPreference` + +NewNotificationPreferenceWithDefaults instantiates a new NotificationPreference object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInvoiceCreated + +`func (o *NotificationPreference) GetInvoiceCreated() []NotificationChannel` + +GetInvoiceCreated returns the InvoiceCreated field if non-nil, zero value otherwise. + +### GetInvoiceCreatedOk + +`func (o *NotificationPreference) GetInvoiceCreatedOk() (*[]NotificationChannel, bool)` + +GetInvoiceCreatedOk returns a tuple with the InvoiceCreated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceCreated + +`func (o *NotificationPreference) SetInvoiceCreated(v []NotificationChannel)` + +SetInvoiceCreated sets InvoiceCreated field to given value. + +### HasInvoiceCreated + +`func (o *NotificationPreference) HasInvoiceCreated() bool` + +HasInvoiceCreated returns a boolean if a field has been set. + +### GetInvoiceReminder + +`func (o *NotificationPreference) GetInvoiceReminder() []NotificationChannel` + +GetInvoiceReminder returns the InvoiceReminder field if non-nil, zero value otherwise. + +### GetInvoiceReminderOk + +`func (o *NotificationPreference) GetInvoiceReminderOk() (*[]NotificationChannel, bool)` + +GetInvoiceReminderOk returns a tuple with the InvoiceReminder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceReminder + +`func (o *NotificationPreference) SetInvoiceReminder(v []NotificationChannel)` + +SetInvoiceReminder sets InvoiceReminder field to given value. + +### HasInvoiceReminder + +`func (o *NotificationPreference) HasInvoiceReminder() bool` + +HasInvoiceReminder returns a boolean if a field has been set. + +### GetInvoiceExpired + +`func (o *NotificationPreference) GetInvoiceExpired() []NotificationChannel` + +GetInvoiceExpired returns the InvoiceExpired field if non-nil, zero value otherwise. + +### GetInvoiceExpiredOk + +`func (o *NotificationPreference) GetInvoiceExpiredOk() (*[]NotificationChannel, bool)` + +GetInvoiceExpiredOk returns a tuple with the InvoiceExpired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceExpired + +`func (o *NotificationPreference) SetInvoiceExpired(v []NotificationChannel)` + +SetInvoiceExpired sets InvoiceExpired field to given value. + +### HasInvoiceExpired + +`func (o *NotificationPreference) HasInvoiceExpired() bool` + +HasInvoiceExpired returns a boolean if a field has been set. + +### GetInvoicePaid + +`func (o *NotificationPreference) GetInvoicePaid() []NotificationChannel` + +GetInvoicePaid returns the InvoicePaid field if non-nil, zero value otherwise. + +### GetInvoicePaidOk + +`func (o *NotificationPreference) GetInvoicePaidOk() (*[]NotificationChannel, bool)` + +GetInvoicePaidOk returns a tuple with the InvoicePaid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoicePaid + +`func (o *NotificationPreference) SetInvoicePaid(v []NotificationChannel)` + +SetInvoicePaid sets InvoicePaid field to given value. + +### HasInvoicePaid + +`func (o *NotificationPreference) HasInvoicePaid() bool` + +HasInvoicePaid returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/Paylater.md b/docs/invoice/Paylater.md new file mode 100644 index 00000000..c8fa41e4 --- /dev/null +++ b/docs/invoice/Paylater.md @@ -0,0 +1,77 @@ +# Paylater + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **PaylaterType** | [**PaylaterType**](PaylaterType.md) | | | +| **ShouldExclude** | Pointer to **bool** | Indicates whether this paylater option should be excluded. | [optional] | + +## Methods + +### NewPaylater + +`func NewPaylater(paylaterType PaylaterType, ) *Paylater` + +NewPaylater instantiates a new Paylater object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaylaterWithDefaults + +`func NewPaylaterWithDefaults() *Paylater` + +NewPaylaterWithDefaults instantiates a new Paylater object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPaylaterType + +`func (o *Paylater) GetPaylaterType() PaylaterType` + +GetPaylaterType returns the PaylaterType field if non-nil, zero value otherwise. + +### GetPaylaterTypeOk + +`func (o *Paylater) GetPaylaterTypeOk() (*PaylaterType, bool)` + +GetPaylaterTypeOk returns a tuple with the PaylaterType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaylaterType + +`func (o *Paylater) SetPaylaterType(v PaylaterType)` + +SetPaylaterType sets PaylaterType field to given value. + + +### GetShouldExclude + +`func (o *Paylater) GetShouldExclude() bool` + +GetShouldExclude returns the ShouldExclude field if non-nil, zero value otherwise. + +### GetShouldExcludeOk + +`func (o *Paylater) GetShouldExcludeOk() (*bool, bool)` + +GetShouldExcludeOk returns a tuple with the ShouldExclude field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldExclude + +`func (o *Paylater) SetShouldExclude(v bool)` + +SetShouldExclude sets ShouldExclude field to given value. + +### HasShouldExclude + +`func (o *Paylater) HasShouldExclude() bool` + +HasShouldExclude returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/PaylaterType.md b/docs/invoice/PaylaterType.md new file mode 100644 index 00000000..f9fbcf9e --- /dev/null +++ b/docs/invoice/PaylaterType.md @@ -0,0 +1,21 @@ +# PaylaterType + +## Enum + + +* `KREDIVO` (value: `"KREDIVO"`) + +* `AKULAKU` (value: `"AKULAKU"`) + +* `UANGME` (value: `"UANGME"`) + +* `BILLEASE` (value: `"BILLEASE"`) + +* `CASHALO` (value: `"CASHALO"`) + +* `ATOME` (value: `"ATOME"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/QrCode.md b/docs/invoice/QrCode.md new file mode 100644 index 00000000..118975e9 --- /dev/null +++ b/docs/invoice/QrCode.md @@ -0,0 +1,51 @@ +# QrCode + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **QrCodeType** | [**QrCodeType**](QrCodeType.md) | | | + +## Methods + +### NewQrCode + +`func NewQrCode(qrCodeType QrCodeType, ) *QrCode` + +NewQrCode instantiates a new QrCode object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQrCodeWithDefaults + +`func NewQrCodeWithDefaults() *QrCode` + +NewQrCodeWithDefaults instantiates a new QrCode object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQrCodeType + +`func (o *QrCode) GetQrCodeType() QrCodeType` + +GetQrCodeType returns the QrCodeType field if non-nil, zero value otherwise. + +### GetQrCodeTypeOk + +`func (o *QrCode) GetQrCodeTypeOk() (*QrCodeType, bool)` + +GetQrCodeTypeOk returns a tuple with the QrCodeType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCodeType + +`func (o *QrCode) SetQrCodeType(v QrCodeType)` + +SetQrCodeType sets QrCodeType field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/QrCodeType.md b/docs/invoice/QrCodeType.md new file mode 100644 index 00000000..753f75a8 --- /dev/null +++ b/docs/invoice/QrCodeType.md @@ -0,0 +1,13 @@ +# QrCodeType + +## Enum + + +* `QRIS` (value: `"QRIS"`) + +* `PROMPTPAY` (value: `"PROMPTPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/RetailOutlet.md b/docs/invoice/RetailOutlet.md new file mode 100644 index 00000000..1ecbadb0 --- /dev/null +++ b/docs/invoice/RetailOutlet.md @@ -0,0 +1,129 @@ +# RetailOutlet + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **RetailOutletName** | [**RetailOutletName**](RetailOutletName.md) | | | +| **PaymentCode** | Pointer to **string** | The payment code. | [optional] | +| **TransferAmount** | Pointer to **float32** | The transfer amount. | [optional] | +| **MerchantName** | Pointer to **string** | The name of the merchant. | [optional] | + +## Methods + +### NewRetailOutlet + +`func NewRetailOutlet(retailOutletName RetailOutletName, ) *RetailOutlet` + +NewRetailOutlet instantiates a new RetailOutlet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRetailOutletWithDefaults + +`func NewRetailOutletWithDefaults() *RetailOutlet` + +NewRetailOutletWithDefaults instantiates a new RetailOutlet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRetailOutletName + +`func (o *RetailOutlet) GetRetailOutletName() RetailOutletName` + +GetRetailOutletName returns the RetailOutletName field if non-nil, zero value otherwise. + +### GetRetailOutletNameOk + +`func (o *RetailOutlet) GetRetailOutletNameOk() (*RetailOutletName, bool)` + +GetRetailOutletNameOk returns a tuple with the RetailOutletName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetailOutletName + +`func (o *RetailOutlet) SetRetailOutletName(v RetailOutletName)` + +SetRetailOutletName sets RetailOutletName field to given value. + + +### GetPaymentCode + +`func (o *RetailOutlet) GetPaymentCode() string` + +GetPaymentCode returns the PaymentCode field if non-nil, zero value otherwise. + +### GetPaymentCodeOk + +`func (o *RetailOutlet) GetPaymentCodeOk() (*string, bool)` + +GetPaymentCodeOk returns a tuple with the PaymentCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentCode + +`func (o *RetailOutlet) SetPaymentCode(v string)` + +SetPaymentCode sets PaymentCode field to given value. + +### HasPaymentCode + +`func (o *RetailOutlet) HasPaymentCode() bool` + +HasPaymentCode returns a boolean if a field has been set. + +### GetTransferAmount + +`func (o *RetailOutlet) GetTransferAmount() float32` + +GetTransferAmount returns the TransferAmount field if non-nil, zero value otherwise. + +### GetTransferAmountOk + +`func (o *RetailOutlet) GetTransferAmountOk() (*float32, bool)` + +GetTransferAmountOk returns a tuple with the TransferAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransferAmount + +`func (o *RetailOutlet) SetTransferAmount(v float32)` + +SetTransferAmount sets TransferAmount field to given value. + +### HasTransferAmount + +`func (o *RetailOutlet) HasTransferAmount() bool` + +HasTransferAmount returns a boolean if a field has been set. + +### GetMerchantName + +`func (o *RetailOutlet) GetMerchantName() string` + +GetMerchantName returns the MerchantName field if non-nil, zero value otherwise. + +### GetMerchantNameOk + +`func (o *RetailOutlet) GetMerchantNameOk() (*string, bool)` + +GetMerchantNameOk returns a tuple with the MerchantName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantName + +`func (o *RetailOutlet) SetMerchantName(v string)` + +SetMerchantName sets MerchantName field to given value. + +### HasMerchantName + +`func (o *RetailOutlet) HasMerchantName() bool` + +HasMerchantName returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/RetailOutletName.md b/docs/invoice/RetailOutletName.md new file mode 100644 index 00000000..85e166a5 --- /dev/null +++ b/docs/invoice/RetailOutletName.md @@ -0,0 +1,27 @@ +# RetailOutletName + +## Enum + + +* `ALFAMART` (value: `"ALFAMART"`) + +* `INDOMARET` (value: `"INDOMARET"`) + +* `_7_ELEVEN` (value: `"7ELEVEN"`) + +* `CEBUANA` (value: `"CEBUANA"`) + +* `DP_ECPAY_LOAN` (value: `"DP_ECPAY_LOAN"`) + +* `DP_MLHUILLIER` (value: `"DP_MLHUILLIER"`) + +* `DP_PALAWAN` (value: `"DP_PALAWAN"`) + +* `DP_ECPAY_SCHOOL` (value: `"DP_ECPAY_SCHOOL"`) + +* `LBC` (value: `"LBC"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/ServerError.md b/docs/invoice/ServerError.md new file mode 100644 index 00000000..3bcdf350 --- /dev/null +++ b/docs/invoice/ServerError.md @@ -0,0 +1,72 @@ +# ServerError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | | | +| **Message** | **string** | | | + +## Methods + +### NewServerError + +`func NewServerError(errorCode string, message string, ) *ServerError` + +NewServerError instantiates a new ServerError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServerErrorWithDefaults + +`func NewServerErrorWithDefaults() *ServerError` + +NewServerErrorWithDefaults instantiates a new ServerError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *ServerError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *ServerError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *ServerError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *ServerError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ServerError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ServerError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/UnauthorizedError.md b/docs/invoice/UnauthorizedError.md new file mode 100644 index 00000000..a988f3c3 --- /dev/null +++ b/docs/invoice/UnauthorizedError.md @@ -0,0 +1,72 @@ +# UnauthorizedError + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | The specific error code associated with the unauthorized access. | | +| **Message** | **string** | A human-readable error message providing additional context about the unauthorized access. | | + +## Methods + +### NewUnauthorizedError + +`func NewUnauthorizedError(errorCode string, message string, ) *UnauthorizedError` + +NewUnauthorizedError instantiates a new UnauthorizedError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUnauthorizedErrorWithDefaults + +`func NewUnauthorizedErrorWithDefaults() *UnauthorizedError` + +NewUnauthorizedErrorWithDefaults instantiates a new UnauthorizedError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *UnauthorizedError) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *UnauthorizedError) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *UnauthorizedError) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *UnauthorizedError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *UnauthorizedError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *UnauthorizedError) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method.yaml b/docs/payment_method.yaml new file mode 100644 index 00000000..b8da9979 --- /dev/null +++ b/docs/payment_method.yaml @@ -0,0 +1,2408 @@ +openapi: 3.0.0 +info: + description: This API is used for Payment Method Service v2 + title: Payment Method Service v2 + version: 2.87.2 +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /v2/payment_methods: + get: + description: Get all payment methods by filters + operationId: getAllPaymentMethods + parameters: + - explode: true + in: query + name: id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: type + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: status + required: false + schema: + items: + $ref: '#/components/schemas/PaymentMethodStatus' + type: array + style: form + - explode: true + in: query + name: reusability + required: false + schema: + $ref: '#/components/schemas/PaymentMethodReusability' + style: form + - explode: true + in: query + name: customer_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: reference_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: after_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: before_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: limit + required: false + schema: + minimum: 1 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodList' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Get all payment methods by filters + tags: + - payment_method + post: + description: This endpoint initiates creation of payment method + operationId: createPaymentMethod + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodParameters' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_409_response' + description: Request causes conflict + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Creates payment method + tags: + - payment_method + /v2/payment_methods/{paymentMethodId}: + get: + description: Get payment method by ID + operationId: getPaymentMethodByID + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + Account linking for PH Direct Debit: + value: + type: DIRECT_DEBIT + direct_debit: + channel_code: BPI + channel_properties: + success_return_url: https://redirect.me/success + failure_return_url: https://redirect.me/failure + reusability: MULTIPLE_USE + customer: + reference_id: customer-123 + type: INDIVIDUAL + individual_detail: + given_names: John + surname: Doe + email: testemail@email.com + mobile_number: 628774494404 + Account linking for E-Wallet: + value: + type: EWALLET + reusability: MULTIPLE_USE + customer: + reference_id: customer-123 + type: INDIVIDUAL + individual_detail: + given_names: John + surname: Doe + ewallet: + channel_code: OVO + channel_properties: + success_return_url: https://redirect.me/success + failure_return_url: https://redirect.me/failure + cancel_return_url: https://redirect.me/cancel + metadata: + sku: example-1234 + schema: + $ref: '#/components/schemas/PaymentMethod' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Get payment method by ID + tags: + - payment_method + patch: + description: This endpoint is used to toggle the ```status``` of an e-Wallet + or a Direct Debit payment method to ```ACTIVE``` or ```INACTIVE```. This + is also used to update the details of an Over-the-Counter or a Virtual Account + payment method. + operationId: patchPaymentMethod + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodUpdateParameters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Patch payment methods + tags: + - payment_method + /v2/payment_methods/{paymentMethodId}/expire: + post: + description: This endpoint expires a payment method and performs unlinking if + necessary + operationId: expirePaymentMethod + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodExpireParameters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Expires a payment method + tags: + - payment_method + /v2/payment_methods/{paymentMethodId}/auth: + post: + description: This endpoint validates a payment method linking OTP + operationId: authPaymentMethod + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethodAuthParameters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMethod' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_409_response' + description: Request causes conflict + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Validate a payment method's linking OTP + tags: + - payment_method + /v2/payment_methods/{paymentMethodId}/payments: + get: + description: Returns payments with matching PaymentMethodID. + operationId: getPaymentsByPaymentMethodId + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + - explode: true + in: query + name: payment_request_id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: payment_method_id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: reference_id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: payment_method_type + required: false + schema: + items: + $ref: '#/components/schemas/PaymentMethodType' + type: array + style: form + - explode: true + in: query + name: channel_code + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: status + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: currency + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: "created[gte]" + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: "created[lte]" + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: "updated[gte]" + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: "updated[lte]" + required: false + schema: + $ref: '#/components/schemas/Datetime' + style: form + - explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - explode: true + in: query + name: after_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: before_id + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + type: object + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Returns payments with matching PaymentMethodID. + tags: + - payment_method + /v2/payment_methods/channels: + get: + description: Get all payment channels + operationId: getAllPaymentChannels + parameters: + - explode: true + in: query + name: is_activated + required: false + schema: + default: true + enum: + - true + - false + type: boolean + style: form + - explode: true + in: query + name: type + required: false + schema: + example: DIRECT_DEBIT + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentChannelList' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Get all payment channels + tags: + - payment_method + /v2/payment_methods/{paymentMethodId}/payments/simulate: + post: + description: Makes payment with matching PaymentMethodID. + operationId: simulatePayment + parameters: + - explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/simulatePayment_request' + responses: + "200": + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + summary: Makes payment with matching PaymentMethodID. + tags: + - payment_method +components: + parameters: + PaymentMethodID: + explode: false + in: path + name: paymentMethodId + required: true + schema: + example: pm-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + responses: + InternalServerError: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_default_response' + description: Internal server error + StatusBadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_400_response' + description: Bad request + StatusForbidden: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_403_response' + description: Forbidden due to permissions + StatusNotFound: + content: + application/json: + schema: + $ref: '#/components/schemas/getAllPaymentMethods_404_response' + description: Data not found + StatusConflict: + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_409_response' + description: Request causes conflict + StatusServiceUnavailable: + content: + application/json: + schema: + $ref: '#/components/schemas/createPaymentMethod_503_response' + description: Service is unavailable due to dependencies + schemas: + PaymentMethodStatus: + enum: + - ACTIVE + - EXPIRED + - INACTIVE + - PENDING + - REQUIRES_ACTION + - FAILED + type: string + PaymentMethodReusability: + enum: + - MULTIPLE_USE + - ONE_TIME_USE + type: string + PaymentMethodType: + enum: + - CARD + - CRYPTOCURRENCY + - DIRECT_BANK_TRANSFER + - DIRECT_DEBIT + - EWALLET + - OVER_THE_COUNTER + - QR_CODE + - VIRTUAL_ACCOUNT + type: string + PaymentMethodCountry: + enum: + - PH + - ID + - VN + - TH + - MY + type: string + PaymentMethodAction: + example: + method: method + url_type: url_type + action: action + url: url + properties: + action: + type: string + method: + type: string + url: + type: string + url_type: + type: string + type: object + Object: + nullable: true + type: object + BillingInformation: + description: Billing Information + example: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + nullable: true + properties: + country: + maxLength: 2 + type: string + street_line1: + maxLength: 255 + nullable: true + type: string + street_line2: + maxLength: 255 + nullable: true + type: string + city: + maxLength: 255 + nullable: true + type: string + province_state: + maxLength: 255 + nullable: true + type: string + postal_code: + maxLength: 255 + nullable: true + type: string + required: + - country + type: object + Datetime: + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + EWalletChannelCode: + description: EWallet Channel Code + enum: + - GCASH + - GRABPAY + - PAYMAYA + - OVO + - DANA + - LINKAJA + - SHOPEEPAY + - SAKUKU + - NEXCASH + - ASTRAPAY + - JENIUSPAY + - APPOTA + - MOMO + - VNPTWALLET + - VIETTELPAY + - ZALOPAY + - WECHATPAY + - LINEPAY + - TRUEMONEY + - ALIPAY + example: PAYMAYA + type: string + EWalletChannelProperties: + description: EWallet Channel Properties + example: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + nullable: false + properties: + success_return_url: + description: URL where the end-customer is redirected if the authorization + is successful + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + failure_return_url: + description: URL where the end-customer is redirected if the authorization + failed + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + cancel_return_url: + description: URL where the end-customer is redirected if the authorization + cancelled + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + mobile_number: + description: Mobile number of customer in E.164 format (e.g. +628123123123). + For OVO one time payment use only. + example: +628123123123 + type: string + redeem_points: + description: "REDEEM_NONE will not use any point, REDEEM_ALL will use all\ + \ available points before cash balance is used. For OVO and ShopeePay\ + \ tokenized payment use only." + example: REDEEM_NONE + type: string + cashtag: + description: Available for JENIUSPAY only + example: $abc1234 + pattern: "^[$][a-zA-Z0-9_]{3,15}$" + type: string + type: object + EWalletAccount: + description: EWallet Account Properties + example: + name: John Peter Doe + account_details: +63(2)123456XXXX + balance: null + point_balance: null + nullable: false + properties: + name: + description: Name of the eWallet account holder. The value is null if unavailableName + of the eWallet account holder. The value is null if unavailable + nullable: true + type: string + account_details: + description: Identifier from eWallet provider e.g. phone number. The value + is null if unavailable + nullable: true + type: string + balance: + description: The main balance amount on eWallet account provided from eWallet + provider. The value is null if unavailable + format: double + nullable: true + type: number + point_balance: + description: The point balance amount on eWallet account. Applicable only + on some eWallet provider that has point system. The value is null if unavailabl + format: double + nullable: true + type: number + type: object + EWalletParameters: + example: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + channel_code: PAYMAYA + account: + name: John Peter Doe + account_details: +63(2)123456XXXX + balance: null + point_balance: null + properties: + channel_code: + $ref: '#/components/schemas/EWalletChannelCode' + channel_properties: + $ref: '#/components/schemas/EWalletChannelProperties' + account: + $ref: '#/components/schemas/EWalletAccount' + required: + - channel_code + type: object + EWallet: + allOf: + - $ref: '#/components/schemas/EWalletParameters' + description: Ewallet Payment Method Details + nullable: true + type: object + DirectDebitChannelCode: + description: Direct Debit Channel Code + enum: + - BCA_KLIKPAY + - BCA_ONEKLIK + - BDO + - BPI + - BRI + - BNI + - CHINABANK + - CIMBNIAGA + - MTB + - RCBC + - UBP + - MANDIRI + - BBL + - SCB + - KTB + - BAY + - KBANK_MB + - BAY_MB + - KTB_MB + - BBL_MB + - SCB_MB + - BDO_EPAY + - AUTODEBIT_UBP + - AFFIN_FPX + - AGRO_FPX + - ALLIANCE_FPX + - AMBANK_FPX + - ISLAM_FPX + - MUAMALAT_FPX + - BOC_FPX + - RAKYAT_FPX + - BSN_FPX + - CIMB_FPX + - HLB_FPX + - HSBC_FPX + - KFH_FPX + - MAYB2E_FPX + - MAYB2U_FPX + - OCBC_FPX + - PUBLIC_FPX + - RHB_FPX + - SCH_FPX + - UOB_FPX + - AFFIN_FPX_BUSINESS + - AGRO_FPX_BUSINESS + - ALLIANCE_FPX_BUSINESS + - AMBANK_FPX_BUSINESS + - ISLAM_FPX_BUSINESS + - MUAMALAT_FPX_BUSINESS + - BNP_FPX_BUSINESS + - CIMB_FPX_BUSINESS + - CITIBANK_FPX_BUSINESS + - DEUTSCHE_FPX_BUSINESS + - HLB_FPX_BUSINESS + - HSBC_FPX_BUSINESS + - RAKYAT_FPX_BUSINESS + - KFH_FPX_BUSINESS + - MAYB2E_FPX_BUSINESS + - OCBC_FPX_BUSINESS + - PUBLIC_FPX_BUSINESS + - RHB_FPX_BUSINESS + - SCH_FPX_BUSINESS + - UOB_FPX_BUSINESS + example: BRI + type: string + DirectDebitChannelProperties: + description: Direct Debit Channel Properties + example: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + nullable: true + properties: + success_return_url: + format: uri + type: string + failure_return_url: + format: uri + nullable: true + type: string + mobile_number: + description: Mobile number of the customer registered to the partner channel + example: +62818555988 + nullable: true + type: string + card_last_four: + description: Last four digits of the debit card + example: "8888" + nullable: true + type: string + card_expiry: + description: Expiry month and year of the debit card (in MM/YY format) + example: 06/24 + nullable: true + type: string + email: + description: Email address of the customer that is registered to the partner + channel + example: test.email@xendit.co + nullable: true + type: string + identity_document_number: + description: Identity number of the customer registered to the partner channel + example: "1234567891113" + nullable: true + type: string + require_auth: + nullable: true + type: boolean + type: object + DirectDebitParameters: + example: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + channel_code: BRI + properties: + channel_code: + $ref: '#/components/schemas/DirectDebitChannelCode' + channel_properties: + $ref: '#/components/schemas/DirectDebitChannelProperties' + required: + - channel_code + - channel_properties + type: object + DirectDebitType: + enum: + - DEBIT_CARD + - BANK_ACCOUNT + - BANK_REDIRECT + type: string + DirectDebitBankAccount: + nullable: true + properties: + masked_bank_account_number: + example: 233eca40ff303ba15bf39052ca3102c6 + nullable: true + type: string + bank_account_hash: + example: 233eca40ff303ba15bf39052ca3102c6 + nullable: true + type: string + mobile_number: + description: Mobile number of the customer registered to the partner channel + example: +62818555988 + nullable: true + type: string + identity_document_number: + description: Identity number of the customer registered to the partner channel + example: "1234567891113" + nullable: true + type: string + type: object + DirectDebitDebitCard: + nullable: true + properties: + mobile_number: + description: Mobile number of the customer registered to the partner channel + example: +62818555988 + nullable: true + type: string + card_last_four: + description: Last four digits of the debit card + example: "8888" + nullable: true + type: string + card_expiry: + description: Expiry month and year of the debit card (in MM/YY format) + example: 06/24 + nullable: true + type: string + email: + description: Email address of the customer that is registered to the partner + channel + example: test.email@xendit.co + nullable: true + type: string + type: object + DirectDebit: + allOf: + - $ref: '#/components/schemas/DirectDebitParameters' + - $ref: '#/components/schemas/DirectDebit_allOf' + description: Direct Debit Payment Method Details + nullable: true + type: object + OverTheCounterChannelCode: + description: Over The Counter Channel Code + enum: + - 7ELEVEN + - 7ELEVEN_CLIQQ + - CEBUANA + - ECPAY + - PALAWAN + - MLHUILLIER + - ECPAY_DRAGONLOAN + - LBC + - ECPAY_SCHOOL + - RD_PAWNSHOP + - CVM + - USSC + - SM_BILLS + - ROBINSONS_BILLS + - ALFAMART + - INDOMARET + example: 7ELEVEN_CLIQQ + type: string + OverTheCounterChannelProperties: + description: Over The Counter Channel Properties + example: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + nullable: false + properties: + payment_code: + description: "The payment code that you want to assign, e.g 12345. If you\ + \ do not send one, one will be picked at random." + example: "12345" + type: string + customer_name: + description: Name of customer. + example: Rika Sutanto + type: string + expires_at: + description: The time when the payment code will be expired. The minimum + is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date + will be 2 days from payment code generated. + example: 2022-01-01T00:00:00Z + format: date-time + type: string + required: + - customer_name + type: object + OverTheCounterParameters: + example: + amount: 0.8008281904610115 + currency: currency + channel_properties: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + channel_code: 7ELEVEN_CLIQQ + properties: + amount: + format: double + nullable: true + type: number + currency: + type: string + channel_code: + $ref: '#/components/schemas/OverTheCounterChannelCode' + channel_properties: + $ref: '#/components/schemas/OverTheCounterChannelProperties' + required: + - channel_code + - channel_properties + type: object + OverTheCounter: + allOf: + - $ref: '#/components/schemas/OverTheCounterParameters' + description: Over The Counter Payment Method Details + nullable: true + type: object + CardChannelProperties: + description: Card Channel Properties + example: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + nullable: true + properties: + skip_three_d_secure: + description: This field value is only being used for reusability = MULTIPLE_USE. + To indicate whether to perform 3DS during the linking phase. Defaults + to false. + example: false + nullable: true + type: boolean + success_return_url: + description: URL where the end-customer is redirected if the authorization + is successful + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + nullable: true + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + failure_return_url: + description: URL where the end-customer is redirected if the authorization + failed + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + nullable: true + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + cardonfile_type: + description: Type of “credential-on-file” / “card-on-file” payment being + made. Indicate that this payment uses a previously linked Payment Method + for charging. + enum: + - MERCHANT_UNSCHEDULED + - CUSTOMER_UNSCHEDULED + - RECURRING + example: RECURRING + nullable: true + type: string + type: object + TokenizedCardInformation: + description: Tokenized Card Information + example: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: network + nullable: false + properties: + token_id: + type: string + masked_card_number: + description: 1st 6 and last 4 digits of the card + type: string + cardholder_name: + description: Cardholder name is optional but recommended for 3DS 2 / AVS + verification + nullable: true + type: string + expiry_month: + description: Card expiry month in MM format + type: string + expiry_year: + description: Card expiry month in YY format + type: string + fingerprint: + description: "Xendit-generated identifier for the unique card number. Multiple\ + \ payment method objects can be created for the same account - e.g. if\ + \ the user first creates a one-time payment request, and then later on\ + \ creates a multiple-use payment method using the same account. The\ + \ fingerprint helps to identify the unique account being used." + type: string + type: + description: Whether the card is a credit or debit card + type: string + network: + description: "Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA" + type: string + country: + description: Country where the card was issued ISO 3166-1 Alpha-2 + type: string + issuer: + description: "Issuer of the card, most often an issuing bank For example,\ + \ “BCA”, “MANDIRI”" + type: string + required: + - country + - expiry_month + - expiry_year + - fingerprint + - issuer + - masked_card_number + - network + - token_id + - type + type: object + CardVerificationResultsThreeDSecure: + example: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + three_d_secure_flow: + enum: + - CHALLENGE + - FRICTIONLESS + nullable: true + type: string + eci_code: + nullable: true + type: string + three_d_secure_result: + nullable: true + type: string + three_d_secure_result_reason: + nullable: true + type: string + three_d_secure_version: + nullable: true + type: string + type: object + CardVerificationResults: + example: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + three_d_secure: + $ref: '#/components/schemas/CardVerificationResultsThreeDSecure' + cvv_result: + nullable: true + type: string + address_verification_result: + nullable: true + type: string + required: + - three_d_secure + type: object + Card: + description: Card Payment Method Details + example: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: network + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + currency: + nullable: true + type: string + channel_properties: + $ref: '#/components/schemas/CardChannelProperties' + card_information: + $ref: '#/components/schemas/TokenizedCardInformation' + card_verification_results: + $ref: '#/components/schemas/CardVerificationResults' + required: + - channel_properties + - currency + type: object + QRCodeChannelCode: + description: QR Code Channel Code + enum: + - QRIS + - DANA + - RCBC + - PROMPTPAY + - LINKAJA + example: QRIS + nullable: true + type: string + QRCodeChannelProperties: + description: QR Code Channel Properties + example: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + nullable: true + properties: + qr_string: + description: "QR string to be rendered for display to end users. QR string\ + \ to image rendering are commonly available in software libraries (e.g\ + \ Nodejs, PHP, Java)" + example: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + type: string + expires_at: + example: 2022-01-01T00:00:00Z + format: date-time + type: string + type: object + QRCodeParameters: + example: + amount: 5.637376656633329 + currency: currency + channel_properties: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + channel_code: QRIS + properties: + amount: + format: double + nullable: true + type: number + currency: + type: string + channel_code: + $ref: '#/components/schemas/QRCodeChannelCode' + channel_properties: + $ref: '#/components/schemas/QRCodeChannelProperties' + type: object + QRCode: + allOf: + - $ref: '#/components/schemas/QRCodeParameters' + description: QR Code Payment Method Details + nullable: true + type: object + VirtualAccountChannelCode: + description: Virtual Account Channel Code + enum: + - BCA + - BJB + - BNI + - BRI + - MANDIRI + - PERMATA + - BSI + - CIMB + - SAHABAT_SAMPOERNA + - ARTAJASA + - PV + - VIETCAPITAL + - WOORI + - MSB + - STANDARD_CHARTERED + example: BCA + type: string + VirtualAccountChannelProperties: + description: Virtual Account Channel Properties + example: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + nullable: false + properties: + customer_name: + description: Name of customer. + example: Rika Sutanto + type: string + virtual_account_number: + description: "You can assign specific Virtual Account number using this\ + \ parameter. If you do not send one, one will be picked at random. Make\ + \ sure the number you specify is within your Virtual Account range." + example: "262159999999999" + type: string + expires_at: + description: "The date and time in ISO 8601 UTC+0 when the virtual account\ + \ number will be expired. Default: The default expiration date will be\ + \ 31 years from creation date." + example: 2022-01-01T00:00:00Z + format: date-time + type: string + suggested_amount: + description: "The suggested amount you want to assign. Note: Suggested amounts\ + \ is the amounts that can see as a suggestion, but user can still put\ + \ any numbers (only supported for Mandiri and BRI)" + example: 100000 + format: double + type: number + type: object + VirtualAccountParameters: + example: + amount: 6.027456183070403 + min_amount: 1.1465812980502945 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 1.5962133916683183 + currency: currency + channel_properties: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + channel_code: BCA + properties: + amount: + format: double + nullable: true + type: number + min_amount: + format: double + minimum: 1 + nullable: true + type: number + max_amount: + format: double + minimum: 1 + nullable: true + type: number + currency: + type: string + channel_code: + $ref: '#/components/schemas/VirtualAccountChannelCode' + channel_properties: + $ref: '#/components/schemas/VirtualAccountChannelProperties' + alternative_display_types: + description: "For payments in Vietnam only, alternative display requested\ + \ for the virtual account" + items: + enum: + - QR_STRING + type: string + type: array + required: + - channel_code + - channel_properties + type: object + VirtualAccountAlternativeDisplay: + description: Alternative Display Object + properties: + type: + description: Type of the alternative display + enum: + - QR_STRING + readOnly: true + type: string + data: + description: Data payload of the given alternative display + type: string + type: object + VirtualAccount: + allOf: + - $ref: '#/components/schemas/VirtualAccountParameters' + - $ref: '#/components/schemas/VirtualAccount_allOf' + description: Virtual Account Payment Method Details + nullable: true + type: object + PaymentMethod: + example: + billing_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + country: null + metadata: "{}" + failure_code: failure_code + reference_id: reference_id + created: 2016-08-29T09:12:33.001Z + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + customer_id: customer_id + business_id: business_id + actions: + - method: method + url_type: url_type + action: action + url: url + - method: method + url_type: url_type + action: action + url: url + updated: 2016-08-29T09:12:33.001Z + card: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: network + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + customer: "{}" + status: null + nullable: false + properties: + id: + type: string + business_id: + type: string + type: + $ref: '#/components/schemas/PaymentMethodType' + country: + $ref: '#/components/schemas/PaymentMethodCountry' + customer_id: + nullable: true + type: string + customer: + nullable: true + type: object + reference_id: + type: string + description: + nullable: true + type: string + status: + $ref: '#/components/schemas/PaymentMethodStatus' + reusability: + $ref: '#/components/schemas/PaymentMethodReusability' + actions: + items: + $ref: '#/components/schemas/PaymentMethodAction' + type: array + metadata: + nullable: true + type: object + billing_information: + $ref: '#/components/schemas/BillingInformation' + failure_code: + nullable: true + type: string + created: + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + updated: + example: 2016-08-29T09:12:33.001Z + format: date-time + type: string + ewallet: + $ref: '#/components/schemas/EWallet' + direct_debit: + $ref: '#/components/schemas/DirectDebit' + over_the_counter: + $ref: '#/components/schemas/OverTheCounter' + card: + $ref: '#/components/schemas/Card' + qr_code: + $ref: '#/components/schemas/QRCode' + virtual_account: + $ref: '#/components/schemas/VirtualAccount' + required: + - id + type: object + PaymentMethodList: + example: + data: + - billing_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + country: null + metadata: "{}" + failure_code: failure_code + reference_id: reference_id + created: 2016-08-29T09:12:33.001Z + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + customer_id: customer_id + business_id: business_id + actions: + - method: method + url_type: url_type + action: action + url: url + - method: method + url_type: url_type + action: action + url: url + updated: 2016-08-29T09:12:33.001Z + card: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: network + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + customer: "{}" + status: null + - billing_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + country: null + metadata: "{}" + failure_code: failure_code + reference_id: reference_id + created: 2016-08-29T09:12:33.001Z + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + customer_id: customer_id + business_id: business_id + actions: + - method: method + url_type: url_type + action: action + url: url + - method: method + url_type: url_type + action: action + url: url + updated: 2016-08-29T09:12:33.001Z + card: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: network + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + customer: "{}" + status: null + has_more: true + nullable: false + properties: + data: + items: + $ref: '#/components/schemas/PaymentMethod' + type: array + has_more: + type: boolean + required: + - data + type: object + CardParameters: + example: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + cvv: cvv + card_number: card_number + cardholder_name: cardholder_name + expiry_year: expiry_year + properties: + currency: + type: string + channel_properties: + $ref: '#/components/schemas/CardChannelProperties' + card_information: + $ref: '#/components/schemas/CardParameters_card_information' + required: + - currency + type: object + PaymentMethodParameters: + example: + billing_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + country: country + metadata: "{}" + reference_id: reference_id + over_the_counter: + amount: 0.8008281904610115 + currency: currency + channel_properties: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + channel_code: 7ELEVEN_CLIQQ + reusability: null + description: description + type: null + direct_debit: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + channel_code: BRI + ewallet: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + channel_code: PAYMAYA + account: + name: John Peter Doe + account_details: +63(2)123456XXXX + balance: null + point_balance: null + virtual_account: + amount: 6.027456183070403 + min_amount: 1.1465812980502945 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 1.5962133916683183 + currency: currency + channel_properties: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + channel_code: BCA + qr_code: + amount: 5.637376656633329 + currency: currency + channel_properties: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + channel_code: QRIS + customer_id: customer_id + card: + currency: currency + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + cvv: cvv + card_number: card_number + cardholder_name: cardholder_name + expiry_year: expiry_year + nullable: false + properties: + type: + $ref: '#/components/schemas/PaymentMethodType' + country: + nullable: true + type: string + reusability: + $ref: '#/components/schemas/PaymentMethodReusability' + customer_id: + nullable: true + type: string + reference_id: + type: string + description: + nullable: true + type: string + card: + $ref: '#/components/schemas/CardParameters' + direct_debit: + $ref: '#/components/schemas/DirectDebitParameters' + ewallet: + $ref: '#/components/schemas/EWalletParameters' + over_the_counter: + $ref: '#/components/schemas/OverTheCounterParameters' + virtual_account: + $ref: '#/components/schemas/VirtualAccountParameters' + qr_code: + $ref: '#/components/schemas/QRCodeParameters' + metadata: + nullable: true + type: object + billing_information: + $ref: '#/components/schemas/BillingInformation' + required: + - reusability + - type + type: object + OverTheCounterChannelPropertiesUpdate: + description: Over The Counter Channel properties that can be updated + example: + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + nullable: false + properties: + customer_name: + description: Name of customer. + example: Rika Sutanto + type: string + expires_at: + description: The time when the payment code will be expired. The minimum + is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date + will be 2 days from payment code generated. + example: 2022-01-01T00:00:00Z + format: date-time + type: string + type: object + OverTheCounterUpdateParameters: + example: + amount: 0.8008281904610115 + channel_properties: + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + properties: + amount: + format: double + nullable: true + type: number + channel_properties: + $ref: '#/components/schemas/OverTheCounterChannelPropertiesUpdate' + type: object + VirtualAccountChannelPropertiesPatch: + description: Virtual Account Channel Properties + example: + expires_at: 2022-01-01T00:00:00Z + suggested_amount: 100000 + nullable: false + properties: + expires_at: + description: "The date and time in ISO 8601 UTC+0 when the virtual account\ + \ number will be expired. Default: The default expiration date will be\ + \ 31 years from creation date." + example: 2022-01-01T00:00:00Z + format: date-time + type: string + suggested_amount: + description: "The suggested amount you want to assign. Note: Suggested amounts\ + \ is the amounts that can see as a suggestion, but user can still put\ + \ any numbers (only supported for Mandiri and BRI)" + example: 100000 + format: double + minimum: 1 + type: number + type: object + VirtualAccountUpdateParameters: + example: + amount: 6.027456183070403 + min_amount: 1.1465812980502945 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 1.5962133916683183 + channel_properties: + expires_at: 2022-01-01T00:00:00Z + suggested_amount: 100000 + properties: + amount: + format: double + nullable: true + type: number + min_amount: + format: double + minimum: 1 + nullable: true + type: number + max_amount: + format: double + minimum: 1 + nullable: true + type: number + channel_properties: + $ref: '#/components/schemas/VirtualAccountChannelPropertiesPatch' + alternative_display_types: + description: "For payments in Vietnam only, alternative display requested\ + \ for the virtual account" + items: + enum: + - QR_STRING + type: string + type: array + type: object + PaymentMethodUpdateParameters: + example: + reference_id: reference_id + over_the_counter: + amount: 0.8008281904610115 + channel_properties: + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + virtual_account: + amount: 6.027456183070403 + min_amount: 1.1465812980502945 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 1.5962133916683183 + channel_properties: + expires_at: 2022-01-01T00:00:00Z + suggested_amount: 100000 + description: description + reusability: null + status: null + properties: + description: + type: string + reference_id: + type: string + reusability: + $ref: '#/components/schemas/PaymentMethodReusability' + status: + $ref: '#/components/schemas/PaymentMethodStatus' + over_the_counter: + $ref: '#/components/schemas/OverTheCounterUpdateParameters' + virtual_account: + $ref: '#/components/schemas/VirtualAccountUpdateParameters' + type: object + PaymentMethodExpireParameters: + example: + failure_return_url: failure_return_url + success_return_url: success_return_url + nullable: true + properties: + success_return_url: + description: URL where the end customer is redirected if the unlinking authorization + is successful. + nullable: true + type: string + failure_return_url: + description: URL where the end customer is redirected if the unlinking authorization + is failed. + nullable: true + type: string + type: object + PaymentMethodAuthParameters: + example: + auth_code: auth_code + nullable: false + properties: + auth_code: + maxLength: 6 + minLength: 6 + type: string + required: + - auth_code + type: object + ChannelProperty: + allOf: + - $ref: '#/components/schemas/ChannelProperty_allOf' + ChannelAmountLimits: + allOf: + - $ref: '#/components/schemas/ChannelAmountLimits_allOf' + PaymentChannel: + allOf: + - $ref: '#/components/schemas/PaymentChannel_allOf' + PaymentChannelList: + example: + data: + - null + - null + links: + - null + - null + has_more: true + properties: + data: + description: Array of resources that match the provided filters + items: + $ref: '#/components/schemas/PaymentChannel' + type: array + links: + description: Array of objects that can be used to assist on navigating through + the data + items: + $ref: '#/components/schemas/PaymentChannelList_links_inner' + type: array + has_more: + description: Indicates whether there are more items in the list + type: boolean + type: object + getAllPaymentMethods_400_response: + properties: + error_code: + enum: + - API_VALIDATION_ERROR + - NOT_SUPPORTED_BY_CHANNEL + - EXPIRED_OTP_ERROR + - INVALID_ACCOUNT_DETAILS + - INVALID_OTP_ERROR + - INVALID_PAYMENT_METHOD + - MAX_OTP_ATTEMPTS_ERROR + - CUSTOMER_NOT_FOUND_ERROR + - ACCOUNT_ACCESS_BLOCKED + - MAX_ACCOUNT_LINKING + - INACTIVE_PAYMENT_METHOD + - PAYMENT_METHOD_NOT_SUPPORTED + - INCORRECT_AMOUNT + - DUPLICATED_FIXED_PAYMENT_INSTRUMENT + type: string + message: + example: An internal server error occurred + type: string + type: object + getAllPaymentMethods_403_response: + properties: + error_code: + enum: + - UNAUTHORIZED + - CHANNEL_NOT_ACTIVATED + type: string + message: + example: An internal server error occurred + type: string + type: object + getAllPaymentMethods_404_response: + properties: + error_code: + enum: + - DATA_NOT_FOUND + type: string + message: + example: An internal server error occurred + type: string + type: object + getAllPaymentMethods_default_response: + properties: + error_code: + type: string + message: + example: An internal server error occurred + type: string + type: object + createPaymentMethod_409_response: + properties: + error_code: + enum: + - PAYMENT_METHOD_ALREADY_ACTIVE + - PAYMENT_METHOD_ALREADY_FAILED + - DUPLICATE_ERROR + - IDEMPOTENCY_ERROR + type: string + message: + example: An internal server error occurred + type: string + type: object + createPaymentMethod_503_response: + properties: + error_code: + enum: + - CHANNEL_UNAVAILABLE + - OTP_DELIVERY_ERROR + type: string + message: + example: An internal server error occurred + type: string + type: object + simulatePayment_request: + properties: + amount: + format: double + nullable: false + type: number + type: object + DirectDebit_allOf: + properties: + type: + $ref: '#/components/schemas/DirectDebitType' + bank_account: + $ref: '#/components/schemas/DirectDebitBankAccount' + debit_card: + $ref: '#/components/schemas/DirectDebitDebitCard' + required: + - type + type: object + example: null + VirtualAccount_allOf: + properties: + alternative_displays: + items: + $ref: '#/components/schemas/VirtualAccountAlternativeDisplay' + type: array + type: object + example: null + CardParameters_card_information: + description: Card Information + example: + expiry_month: expiry_month + cvv: cvv + card_number: card_number + cardholder_name: cardholder_name + expiry_year: expiry_year + nullable: false + properties: + card_number: + type: string + expiry_month: + description: Card expiry month in MM format + type: string + expiry_year: + description: Card expiry month in YY format + type: string + cardholder_name: + description: Cardholder name + nullable: true + type: string + cvv: + nullable: true + type: string + required: + - card_number + - expiry_month + - expiry_year + type: object + ChannelProperty_allOf: + description: Objects that enumerate the parameters needed as `channel_properties` + when creating a Payment Method + properties: + name: + description: The corresponding parameter name + type: string + type: + description: Data type of the parameter + type: string + is_required: + description: Indicates whether or not the parameter is required + type: boolean + type: object + example: null + ChannelAmountLimits_allOf: + description: Contains objects of the support currencies and its respective limits + per transaction + properties: + currency: + description: Currency supported by the payment channel + type: string + min_limit: + description: The minimum allowed transaction amount for the payment channel + type: number + max_limit: + description: The minimum allowed transaction amount for the payment channel + type: number + type: object + example: null + PaymentChannel_allOf: + properties: + channel_code: + description: The specific Xendit code used to identify the partner channel + example: BPI + type: string + type: + description: The payment method type + example: DIRECT_DEBIT + type: string + country: + description: The country where the channel operates in ISO 3166-2 country + code + example: PH + type: string + channel_name: + description: Official parter name of the payment channel + example: Bank of the Philippine Islands + type: string + channel_properties: + items: + $ref: '#/components/schemas/ChannelProperty' + type: array + logo_url: + description: "If available, this contains a URL to the logo of the partner\ + \ channel" + type: string + amount_limits: + items: + $ref: '#/components/schemas/ChannelAmountLimits' + type: array + type: object + example: null + PaymentChannelList_links_inner_allOf: + properties: + href: + description: Target URI that should contain a target to Internationalized + Resource Identifiers (IRI) + example: /v2/payment_methods/channels?is_activated=true + type: string + rel: + description: The link relation type described how the current context (source) + is related to target resource + enum: + - first + - last + - next + - prev + example: next + type: string + method: + description: The HTTP method to be used to call `href` + example: GET + type: string + type: object + PaymentChannelList_links_inner: + allOf: + - $ref: '#/components/schemas/PaymentChannelList_links_inner_allOf' diff --git a/docs/payment_method/BillingInformation.md b/docs/payment_method/BillingInformation.md new file mode 100644 index 00000000..169d55a0 --- /dev/null +++ b/docs/payment_method/BillingInformation.md @@ -0,0 +1,231 @@ +# BillingInformation + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Country** | **string** | | | +| **StreetLine1** | Pointer to **NullableString** | | [optional] | +| **StreetLine2** | Pointer to **NullableString** | | [optional] | +| **City** | Pointer to **NullableString** | | [optional] | +| **ProvinceState** | Pointer to **NullableString** | | [optional] | +| **PostalCode** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewBillingInformation + +`func NewBillingInformation(country string, ) *BillingInformation` + +NewBillingInformation instantiates a new BillingInformation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBillingInformationWithDefaults + +`func NewBillingInformationWithDefaults() *BillingInformation` + +NewBillingInformationWithDefaults instantiates a new BillingInformation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCountry + +`func (o *BillingInformation) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *BillingInformation) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *BillingInformation) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetStreetLine1 + +`func (o *BillingInformation) GetStreetLine1() string` + +GetStreetLine1 returns the StreetLine1 field if non-nil, zero value otherwise. + +### GetStreetLine1Ok + +`func (o *BillingInformation) GetStreetLine1Ok() (*string, bool)` + +GetStreetLine1Ok returns a tuple with the StreetLine1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine1 + +`func (o *BillingInformation) SetStreetLine1(v string)` + +SetStreetLine1 sets StreetLine1 field to given value. + +### HasStreetLine1 + +`func (o *BillingInformation) HasStreetLine1() bool` + +HasStreetLine1 returns a boolean if a field has been set. + +### SetStreetLine1Nil + +`func (o *BillingInformation) SetStreetLine1Nil(b bool)` + + SetStreetLine1Nil sets the value for StreetLine1 to be an explicit nil + +### UnsetStreetLine1 +`func (o *BillingInformation) UnsetStreetLine1()` + +UnsetStreetLine1 ensures that no value is present for StreetLine1, not even an explicit nil +### GetStreetLine2 + +`func (o *BillingInformation) GetStreetLine2() string` + +GetStreetLine2 returns the StreetLine2 field if non-nil, zero value otherwise. + +### GetStreetLine2Ok + +`func (o *BillingInformation) GetStreetLine2Ok() (*string, bool)` + +GetStreetLine2Ok returns a tuple with the StreetLine2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine2 + +`func (o *BillingInformation) SetStreetLine2(v string)` + +SetStreetLine2 sets StreetLine2 field to given value. + +### HasStreetLine2 + +`func (o *BillingInformation) HasStreetLine2() bool` + +HasStreetLine2 returns a boolean if a field has been set. + +### SetStreetLine2Nil + +`func (o *BillingInformation) SetStreetLine2Nil(b bool)` + + SetStreetLine2Nil sets the value for StreetLine2 to be an explicit nil + +### UnsetStreetLine2 +`func (o *BillingInformation) UnsetStreetLine2()` + +UnsetStreetLine2 ensures that no value is present for StreetLine2, not even an explicit nil +### GetCity + +`func (o *BillingInformation) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *BillingInformation) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *BillingInformation) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *BillingInformation) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### SetCityNil + +`func (o *BillingInformation) SetCityNil(b bool)` + + SetCityNil sets the value for City to be an explicit nil + +### UnsetCity +`func (o *BillingInformation) UnsetCity()` + +UnsetCity ensures that no value is present for City, not even an explicit nil +### GetProvinceState + +`func (o *BillingInformation) GetProvinceState() string` + +GetProvinceState returns the ProvinceState field if non-nil, zero value otherwise. + +### GetProvinceStateOk + +`func (o *BillingInformation) GetProvinceStateOk() (*string, bool)` + +GetProvinceStateOk returns a tuple with the ProvinceState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvinceState + +`func (o *BillingInformation) SetProvinceState(v string)` + +SetProvinceState sets ProvinceState field to given value. + +### HasProvinceState + +`func (o *BillingInformation) HasProvinceState() bool` + +HasProvinceState returns a boolean if a field has been set. + +### SetProvinceStateNil + +`func (o *BillingInformation) SetProvinceStateNil(b bool)` + + SetProvinceStateNil sets the value for ProvinceState to be an explicit nil + +### UnsetProvinceState +`func (o *BillingInformation) UnsetProvinceState()` + +UnsetProvinceState ensures that no value is present for ProvinceState, not even an explicit nil +### GetPostalCode + +`func (o *BillingInformation) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *BillingInformation) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *BillingInformation) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *BillingInformation) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + +### SetPostalCodeNil + +`func (o *BillingInformation) SetPostalCodeNil(b bool)` + + SetPostalCodeNil sets the value for PostalCode to be an explicit nil + +### UnsetPostalCode +`func (o *BillingInformation) UnsetPostalCode()` + +UnsetPostalCode ensures that no value is present for PostalCode, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/Card.md b/docs/payment_method/Card.md new file mode 100644 index 00000000..d50d229f --- /dev/null +++ b/docs/payment_method/Card.md @@ -0,0 +1,154 @@ +# Card + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Currency** | **NullableString** | | | +| **ChannelProperties** | [**NullableCardChannelProperties**](CardChannelProperties.md) | | | +| **CardInformation** | Pointer to [**TokenizedCardInformation**](TokenizedCardInformation.md) | | [optional] | +| **CardVerificationResults** | Pointer to [**NullableCardVerificationResults**](CardVerificationResults.md) | | [optional] | + +## Methods + +### NewCard + +`func NewCard(currency NullableString, channelProperties NullableCardChannelProperties, ) *Card` + +NewCard instantiates a new Card object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardWithDefaults + +`func NewCardWithDefaults() *Card` + +NewCardWithDefaults instantiates a new Card object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *Card) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Card) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Card) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### SetCurrencyNil + +`func (o *Card) SetCurrencyNil(b bool)` + + SetCurrencyNil sets the value for Currency to be an explicit nil + +### UnsetCurrency +`func (o *Card) UnsetCurrency()` + +UnsetCurrency ensures that no value is present for Currency, not even an explicit nil +### GetChannelProperties + +`func (o *Card) GetChannelProperties() CardChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *Card) GetChannelPropertiesOk() (*CardChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *Card) SetChannelProperties(v CardChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *Card) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *Card) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetCardInformation + +`func (o *Card) GetCardInformation() TokenizedCardInformation` + +GetCardInformation returns the CardInformation field if non-nil, zero value otherwise. + +### GetCardInformationOk + +`func (o *Card) GetCardInformationOk() (*TokenizedCardInformation, bool)` + +GetCardInformationOk returns a tuple with the CardInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardInformation + +`func (o *Card) SetCardInformation(v TokenizedCardInformation)` + +SetCardInformation sets CardInformation field to given value. + +### HasCardInformation + +`func (o *Card) HasCardInformation() bool` + +HasCardInformation returns a boolean if a field has been set. + +### GetCardVerificationResults + +`func (o *Card) GetCardVerificationResults() CardVerificationResults` + +GetCardVerificationResults returns the CardVerificationResults field if non-nil, zero value otherwise. + +### GetCardVerificationResultsOk + +`func (o *Card) GetCardVerificationResultsOk() (*CardVerificationResults, bool)` + +GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardVerificationResults + +`func (o *Card) SetCardVerificationResults(v CardVerificationResults)` + +SetCardVerificationResults sets CardVerificationResults field to given value. + +### HasCardVerificationResults + +`func (o *Card) HasCardVerificationResults() bool` + +HasCardVerificationResults returns a boolean if a field has been set. + +### SetCardVerificationResultsNil + +`func (o *Card) SetCardVerificationResultsNil(b bool)` + + SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil + +### UnsetCardVerificationResults +`func (o *Card) UnsetCardVerificationResults()` + +UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CardChannelProperties.md b/docs/payment_method/CardChannelProperties.md new file mode 100644 index 00000000..14776e7d --- /dev/null +++ b/docs/payment_method/CardChannelProperties.md @@ -0,0 +1,174 @@ +# CardChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SkipThreeDSecure** | Pointer to **NullableBool** | This field value is only being used for reusability = MULTIPLE_USE. To indicate whether to perform 3DS during the linking phase. Defaults to false. | [optional] | +| **SuccessReturnUrl** | Pointer to **NullableString** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **NullableString** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CardonfileType** | Pointer to **NullableString** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] | + +## Methods + +### NewCardChannelProperties + +`func NewCardChannelProperties() *CardChannelProperties` + +NewCardChannelProperties instantiates a new CardChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardChannelPropertiesWithDefaults + +`func NewCardChannelPropertiesWithDefaults() *CardChannelProperties` + +NewCardChannelPropertiesWithDefaults instantiates a new CardChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSkipThreeDSecure + +`func (o *CardChannelProperties) GetSkipThreeDSecure() bool` + +GetSkipThreeDSecure returns the SkipThreeDSecure field if non-nil, zero value otherwise. + +### GetSkipThreeDSecureOk + +`func (o *CardChannelProperties) GetSkipThreeDSecureOk() (*bool, bool)` + +GetSkipThreeDSecureOk returns a tuple with the SkipThreeDSecure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSkipThreeDSecure + +`func (o *CardChannelProperties) SetSkipThreeDSecure(v bool)` + +SetSkipThreeDSecure sets SkipThreeDSecure field to given value. + +### HasSkipThreeDSecure + +`func (o *CardChannelProperties) HasSkipThreeDSecure() bool` + +HasSkipThreeDSecure returns a boolean if a field has been set. + +### SetSkipThreeDSecureNil + +`func (o *CardChannelProperties) SetSkipThreeDSecureNil(b bool)` + + SetSkipThreeDSecureNil sets the value for SkipThreeDSecure to be an explicit nil + +### UnsetSkipThreeDSecure +`func (o *CardChannelProperties) UnsetSkipThreeDSecure()` + +UnsetSkipThreeDSecure ensures that no value is present for SkipThreeDSecure, not even an explicit nil +### GetSuccessReturnUrl + +`func (o *CardChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *CardChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *CardChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *CardChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### SetSuccessReturnUrlNil + +`func (o *CardChannelProperties) SetSuccessReturnUrlNil(b bool)` + + SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil + +### UnsetSuccessReturnUrl +`func (o *CardChannelProperties) UnsetSuccessReturnUrl()` + +UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +### GetFailureReturnUrl + +`func (o *CardChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *CardChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *CardChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *CardChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### SetFailureReturnUrlNil + +`func (o *CardChannelProperties) SetFailureReturnUrlNil(b bool)` + + SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil + +### UnsetFailureReturnUrl +`func (o *CardChannelProperties) UnsetFailureReturnUrl()` + +UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +### GetCardonfileType + +`func (o *CardChannelProperties) GetCardonfileType() string` + +GetCardonfileType returns the CardonfileType field if non-nil, zero value otherwise. + +### GetCardonfileTypeOk + +`func (o *CardChannelProperties) GetCardonfileTypeOk() (*string, bool)` + +GetCardonfileTypeOk returns a tuple with the CardonfileType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardonfileType + +`func (o *CardChannelProperties) SetCardonfileType(v string)` + +SetCardonfileType sets CardonfileType field to given value. + +### HasCardonfileType + +`func (o *CardChannelProperties) HasCardonfileType() bool` + +HasCardonfileType returns a boolean if a field has been set. + +### SetCardonfileTypeNil + +`func (o *CardChannelProperties) SetCardonfileTypeNil(b bool)` + + SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil + +### UnsetCardonfileType +`func (o *CardChannelProperties) UnsetCardonfileType()` + +UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CardParameters.md b/docs/payment_method/CardParameters.md new file mode 100644 index 00000000..c7a642ef --- /dev/null +++ b/docs/payment_method/CardParameters.md @@ -0,0 +1,113 @@ +# CardParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Currency** | **string** | | | +| **ChannelProperties** | Pointer to [**NullableCardChannelProperties**](CardChannelProperties.md) | | [optional] | +| **CardInformation** | Pointer to [**CardParametersCardInformation**](CardParametersCardInformation.md) | | [optional] | + +## Methods + +### NewCardParameters + +`func NewCardParameters(currency string, ) *CardParameters` + +NewCardParameters instantiates a new CardParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardParametersWithDefaults + +`func NewCardParametersWithDefaults() *CardParameters` + +NewCardParametersWithDefaults instantiates a new CardParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *CardParameters) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *CardParameters) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *CardParameters) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetChannelProperties + +`func (o *CardParameters) GetChannelProperties() CardChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *CardParameters) GetChannelPropertiesOk() (*CardChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *CardParameters) SetChannelProperties(v CardChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *CardParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### SetChannelPropertiesNil + +`func (o *CardParameters) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *CardParameters) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetCardInformation + +`func (o *CardParameters) GetCardInformation() CardParametersCardInformation` + +GetCardInformation returns the CardInformation field if non-nil, zero value otherwise. + +### GetCardInformationOk + +`func (o *CardParameters) GetCardInformationOk() (*CardParametersCardInformation, bool)` + +GetCardInformationOk returns a tuple with the CardInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardInformation + +`func (o *CardParameters) SetCardInformation(v CardParametersCardInformation)` + +SetCardInformation sets CardInformation field to given value. + +### HasCardInformation + +`func (o *CardParameters) HasCardInformation() bool` + +HasCardInformation returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CardParametersCardInformation.md b/docs/payment_method/CardParametersCardInformation.md new file mode 100644 index 00000000..ab49a39b --- /dev/null +++ b/docs/payment_method/CardParametersCardInformation.md @@ -0,0 +1,165 @@ +# CardParametersCardInformation + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **CardNumber** | **string** | | | +| **ExpiryMonth** | **string** | Card expiry month in MM format | | +| **ExpiryYear** | **string** | Card expiry month in YY format | | +| **CardholderName** | Pointer to **NullableString** | Cardholder name | [optional] | +| **Cvv** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewCardParametersCardInformation + +`func NewCardParametersCardInformation(cardNumber string, expiryMonth string, expiryYear string, ) *CardParametersCardInformation` + +NewCardParametersCardInformation instantiates a new CardParametersCardInformation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardParametersCardInformationWithDefaults + +`func NewCardParametersCardInformationWithDefaults() *CardParametersCardInformation` + +NewCardParametersCardInformationWithDefaults instantiates a new CardParametersCardInformation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCardNumber + +`func (o *CardParametersCardInformation) GetCardNumber() string` + +GetCardNumber returns the CardNumber field if non-nil, zero value otherwise. + +### GetCardNumberOk + +`func (o *CardParametersCardInformation) GetCardNumberOk() (*string, bool)` + +GetCardNumberOk returns a tuple with the CardNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardNumber + +`func (o *CardParametersCardInformation) SetCardNumber(v string)` + +SetCardNumber sets CardNumber field to given value. + + +### GetExpiryMonth + +`func (o *CardParametersCardInformation) GetExpiryMonth() string` + +GetExpiryMonth returns the ExpiryMonth field if non-nil, zero value otherwise. + +### GetExpiryMonthOk + +`func (o *CardParametersCardInformation) GetExpiryMonthOk() (*string, bool)` + +GetExpiryMonthOk returns a tuple with the ExpiryMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryMonth + +`func (o *CardParametersCardInformation) SetExpiryMonth(v string)` + +SetExpiryMonth sets ExpiryMonth field to given value. + + +### GetExpiryYear + +`func (o *CardParametersCardInformation) GetExpiryYear() string` + +GetExpiryYear returns the ExpiryYear field if non-nil, zero value otherwise. + +### GetExpiryYearOk + +`func (o *CardParametersCardInformation) GetExpiryYearOk() (*string, bool)` + +GetExpiryYearOk returns a tuple with the ExpiryYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryYear + +`func (o *CardParametersCardInformation) SetExpiryYear(v string)` + +SetExpiryYear sets ExpiryYear field to given value. + + +### GetCardholderName + +`func (o *CardParametersCardInformation) GetCardholderName() string` + +GetCardholderName returns the CardholderName field if non-nil, zero value otherwise. + +### GetCardholderNameOk + +`func (o *CardParametersCardInformation) GetCardholderNameOk() (*string, bool)` + +GetCardholderNameOk returns a tuple with the CardholderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardholderName + +`func (o *CardParametersCardInformation) SetCardholderName(v string)` + +SetCardholderName sets CardholderName field to given value. + +### HasCardholderName + +`func (o *CardParametersCardInformation) HasCardholderName() bool` + +HasCardholderName returns a boolean if a field has been set. + +### SetCardholderNameNil + +`func (o *CardParametersCardInformation) SetCardholderNameNil(b bool)` + + SetCardholderNameNil sets the value for CardholderName to be an explicit nil + +### UnsetCardholderName +`func (o *CardParametersCardInformation) UnsetCardholderName()` + +UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +### GetCvv + +`func (o *CardParametersCardInformation) GetCvv() string` + +GetCvv returns the Cvv field if non-nil, zero value otherwise. + +### GetCvvOk + +`func (o *CardParametersCardInformation) GetCvvOk() (*string, bool)` + +GetCvvOk returns a tuple with the Cvv field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvv + +`func (o *CardParametersCardInformation) SetCvv(v string)` + +SetCvv sets Cvv field to given value. + +### HasCvv + +`func (o *CardParametersCardInformation) HasCvv() bool` + +HasCvv returns a boolean if a field has been set. + +### SetCvvNil + +`func (o *CardParametersCardInformation) SetCvvNil(b bool)` + + SetCvvNil sets the value for Cvv to be an explicit nil + +### UnsetCvv +`func (o *CardParametersCardInformation) UnsetCvv()` + +UnsetCvv ensures that no value is present for Cvv, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CardVerificationResults.md b/docs/payment_method/CardVerificationResults.md new file mode 100644 index 00000000..9b9e9bfe --- /dev/null +++ b/docs/payment_method/CardVerificationResults.md @@ -0,0 +1,133 @@ +# CardVerificationResults + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecure** | [**NullableCardVerificationResultsThreeDSecure**](CardVerificationResultsThreeDSecure.md) | | | +| **CvvResult** | Pointer to **NullableString** | | [optional] | +| **AddressVerificationResult** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewCardVerificationResults + +`func NewCardVerificationResults(threeDSecure NullableCardVerificationResultsThreeDSecure, ) *CardVerificationResults` + +NewCardVerificationResults instantiates a new CardVerificationResults object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardVerificationResultsWithDefaults + +`func NewCardVerificationResultsWithDefaults() *CardVerificationResults` + +NewCardVerificationResultsWithDefaults instantiates a new CardVerificationResults object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecure + +`func (o *CardVerificationResults) GetThreeDSecure() CardVerificationResultsThreeDSecure` + +GetThreeDSecure returns the ThreeDSecure field if non-nil, zero value otherwise. + +### GetThreeDSecureOk + +`func (o *CardVerificationResults) GetThreeDSecureOk() (*CardVerificationResultsThreeDSecure, bool)` + +GetThreeDSecureOk returns a tuple with the ThreeDSecure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecure + +`func (o *CardVerificationResults) SetThreeDSecure(v CardVerificationResultsThreeDSecure)` + +SetThreeDSecure sets ThreeDSecure field to given value. + + +### SetThreeDSecureNil + +`func (o *CardVerificationResults) SetThreeDSecureNil(b bool)` + + SetThreeDSecureNil sets the value for ThreeDSecure to be an explicit nil + +### UnsetThreeDSecure +`func (o *CardVerificationResults) UnsetThreeDSecure()` + +UnsetThreeDSecure ensures that no value is present for ThreeDSecure, not even an explicit nil +### GetCvvResult + +`func (o *CardVerificationResults) GetCvvResult() string` + +GetCvvResult returns the CvvResult field if non-nil, zero value otherwise. + +### GetCvvResultOk + +`func (o *CardVerificationResults) GetCvvResultOk() (*string, bool)` + +GetCvvResultOk returns a tuple with the CvvResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvvResult + +`func (o *CardVerificationResults) SetCvvResult(v string)` + +SetCvvResult sets CvvResult field to given value. + +### HasCvvResult + +`func (o *CardVerificationResults) HasCvvResult() bool` + +HasCvvResult returns a boolean if a field has been set. + +### SetCvvResultNil + +`func (o *CardVerificationResults) SetCvvResultNil(b bool)` + + SetCvvResultNil sets the value for CvvResult to be an explicit nil + +### UnsetCvvResult +`func (o *CardVerificationResults) UnsetCvvResult()` + +UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +### GetAddressVerificationResult + +`func (o *CardVerificationResults) GetAddressVerificationResult() string` + +GetAddressVerificationResult returns the AddressVerificationResult field if non-nil, zero value otherwise. + +### GetAddressVerificationResultOk + +`func (o *CardVerificationResults) GetAddressVerificationResultOk() (*string, bool)` + +GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressVerificationResult + +`func (o *CardVerificationResults) SetAddressVerificationResult(v string)` + +SetAddressVerificationResult sets AddressVerificationResult field to given value. + +### HasAddressVerificationResult + +`func (o *CardVerificationResults) HasAddressVerificationResult() bool` + +HasAddressVerificationResult returns a boolean if a field has been set. + +### SetAddressVerificationResultNil + +`func (o *CardVerificationResults) SetAddressVerificationResultNil(b bool)` + + SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil + +### UnsetAddressVerificationResult +`func (o *CardVerificationResults) UnsetAddressVerificationResult()` + +UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CardVerificationResultsThreeDSecure.md b/docs/payment_method/CardVerificationResultsThreeDSecure.md new file mode 100644 index 00000000..bbdbeacb --- /dev/null +++ b/docs/payment_method/CardVerificationResultsThreeDSecure.md @@ -0,0 +1,210 @@ +# CardVerificationResultsThreeDSecure + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecureFlow** | Pointer to **NullableString** | | [optional] | +| **EciCode** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureResult** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureResultReason** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureVersion** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewCardVerificationResultsThreeDSecure + +`func NewCardVerificationResultsThreeDSecure() *CardVerificationResultsThreeDSecure` + +NewCardVerificationResultsThreeDSecure instantiates a new CardVerificationResultsThreeDSecure object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardVerificationResultsThreeDSecureWithDefaults + +`func NewCardVerificationResultsThreeDSecureWithDefaults() *CardVerificationResultsThreeDSecure` + +NewCardVerificationResultsThreeDSecureWithDefaults instantiates a new CardVerificationResultsThreeDSecure object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlow() string` + +GetThreeDSecureFlow returns the ThreeDSecureFlow field if non-nil, zero value otherwise. + +### GetThreeDSecureFlowOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlowOk() (*string, bool)` + +GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlow(v string)` + +SetThreeDSecureFlow sets ThreeDSecureFlow field to given value. + +### HasThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureFlow() bool` + +HasThreeDSecureFlow returns a boolean if a field has been set. + +### SetThreeDSecureFlowNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlowNil(b bool)` + + SetThreeDSecureFlowNil sets the value for ThreeDSecureFlow to be an explicit nil + +### UnsetThreeDSecureFlow +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureFlow()` + +UnsetThreeDSecureFlow ensures that no value is present for ThreeDSecureFlow, not even an explicit nil +### GetEciCode + +`func (o *CardVerificationResultsThreeDSecure) GetEciCode() string` + +GetEciCode returns the EciCode field if non-nil, zero value otherwise. + +### GetEciCodeOk + +`func (o *CardVerificationResultsThreeDSecure) GetEciCodeOk() (*string, bool)` + +GetEciCodeOk returns a tuple with the EciCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEciCode + +`func (o *CardVerificationResultsThreeDSecure) SetEciCode(v string)` + +SetEciCode sets EciCode field to given value. + +### HasEciCode + +`func (o *CardVerificationResultsThreeDSecure) HasEciCode() bool` + +HasEciCode returns a boolean if a field has been set. + +### SetEciCodeNil + +`func (o *CardVerificationResultsThreeDSecure) SetEciCodeNil(b bool)` + + SetEciCodeNil sets the value for EciCode to be an explicit nil + +### UnsetEciCode +`func (o *CardVerificationResultsThreeDSecure) UnsetEciCode()` + +UnsetEciCode ensures that no value is present for EciCode, not even an explicit nil +### GetThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResult() string` + +GetThreeDSecureResult returns the ThreeDSecureResult field if non-nil, zero value otherwise. + +### GetThreeDSecureResultOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultOk() (*string, bool)` + +GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResult(v string)` + +SetThreeDSecureResult sets ThreeDSecureResult field to given value. + +### HasThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResult() bool` + +HasThreeDSecureResult returns a boolean if a field has been set. + +### SetThreeDSecureResultNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultNil(b bool)` + + SetThreeDSecureResultNil sets the value for ThreeDSecureResult to be an explicit nil + +### UnsetThreeDSecureResult +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResult()` + +UnsetThreeDSecureResult ensures that no value is present for ThreeDSecureResult, not even an explicit nil +### GetThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReason() string` + +GetThreeDSecureResultReason returns the ThreeDSecureResultReason field if non-nil, zero value otherwise. + +### GetThreeDSecureResultReasonOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReasonOk() (*string, bool)` + +GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReason(v string)` + +SetThreeDSecureResultReason sets ThreeDSecureResultReason field to given value. + +### HasThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResultReason() bool` + +HasThreeDSecureResultReason returns a boolean if a field has been set. + +### SetThreeDSecureResultReasonNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReasonNil(b bool)` + + SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil + +### UnsetThreeDSecureResultReason +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResultReason()` + +UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +### GetThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersion() string` + +GetThreeDSecureVersion returns the ThreeDSecureVersion field if non-nil, zero value otherwise. + +### GetThreeDSecureVersionOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersionOk() (*string, bool)` + +GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersion(v string)` + +SetThreeDSecureVersion sets ThreeDSecureVersion field to given value. + +### HasThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureVersion() bool` + +HasThreeDSecureVersion returns a boolean if a field has been set. + +### SetThreeDSecureVersionNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersionNil(b bool)` + + SetThreeDSecureVersionNil sets the value for ThreeDSecureVersion to be an explicit nil + +### UnsetThreeDSecureVersion +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureVersion()` + +UnsetThreeDSecureVersion ensures that no value is present for ThreeDSecureVersion, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/ChannelAmountLimits.md b/docs/payment_method/ChannelAmountLimits.md new file mode 100644 index 00000000..d0a96649 --- /dev/null +++ b/docs/payment_method/ChannelAmountLimits.md @@ -0,0 +1,108 @@ +# ChannelAmountLimits + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Currency** | Pointer to **string** | Currency supported by the payment channel | [optional] | +| **MinLimit** | Pointer to **float32** | The minimum allowed transaction amount for the payment channel | [optional] | +| **MaxLimit** | Pointer to **float32** | The minimum allowed transaction amount for the payment channel | [optional] | + +## Methods + +### NewChannelAmountLimits + +`func NewChannelAmountLimits() *ChannelAmountLimits` + +NewChannelAmountLimits instantiates a new ChannelAmountLimits object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelAmountLimitsWithDefaults + +`func NewChannelAmountLimitsWithDefaults() *ChannelAmountLimits` + +NewChannelAmountLimitsWithDefaults instantiates a new ChannelAmountLimits object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *ChannelAmountLimits) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *ChannelAmountLimits) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *ChannelAmountLimits) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *ChannelAmountLimits) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetMinLimit + +`func (o *ChannelAmountLimits) GetMinLimit() float32` + +GetMinLimit returns the MinLimit field if non-nil, zero value otherwise. + +### GetMinLimitOk + +`func (o *ChannelAmountLimits) GetMinLimitOk() (*float32, bool)` + +GetMinLimitOk returns a tuple with the MinLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinLimit + +`func (o *ChannelAmountLimits) SetMinLimit(v float32)` + +SetMinLimit sets MinLimit field to given value. + +### HasMinLimit + +`func (o *ChannelAmountLimits) HasMinLimit() bool` + +HasMinLimit returns a boolean if a field has been set. + +### GetMaxLimit + +`func (o *ChannelAmountLimits) GetMaxLimit() float32` + +GetMaxLimit returns the MaxLimit field if non-nil, zero value otherwise. + +### GetMaxLimitOk + +`func (o *ChannelAmountLimits) GetMaxLimitOk() (*float32, bool)` + +GetMaxLimitOk returns a tuple with the MaxLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxLimit + +`func (o *ChannelAmountLimits) SetMaxLimit(v float32)` + +SetMaxLimit sets MaxLimit field to given value. + +### HasMaxLimit + +`func (o *ChannelAmountLimits) HasMaxLimit() bool` + +HasMaxLimit returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/ChannelAmountLimitsAllOf.md b/docs/payment_method/ChannelAmountLimitsAllOf.md new file mode 100644 index 00000000..4544e427 --- /dev/null +++ b/docs/payment_method/ChannelAmountLimitsAllOf.md @@ -0,0 +1,108 @@ +# ChannelAmountLimitsAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Currency** | Pointer to **string** | Currency supported by the payment channel | [optional] | +| **MinLimit** | Pointer to **float32** | The minimum allowed transaction amount for the payment channel | [optional] | +| **MaxLimit** | Pointer to **float32** | The minimum allowed transaction amount for the payment channel | [optional] | + +## Methods + +### NewChannelAmountLimitsAllOf + +`func NewChannelAmountLimitsAllOf() *ChannelAmountLimitsAllOf` + +NewChannelAmountLimitsAllOf instantiates a new ChannelAmountLimitsAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelAmountLimitsAllOfWithDefaults + +`func NewChannelAmountLimitsAllOfWithDefaults() *ChannelAmountLimitsAllOf` + +NewChannelAmountLimitsAllOfWithDefaults instantiates a new ChannelAmountLimitsAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *ChannelAmountLimitsAllOf) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *ChannelAmountLimitsAllOf) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *ChannelAmountLimitsAllOf) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *ChannelAmountLimitsAllOf) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetMinLimit + +`func (o *ChannelAmountLimitsAllOf) GetMinLimit() float32` + +GetMinLimit returns the MinLimit field if non-nil, zero value otherwise. + +### GetMinLimitOk + +`func (o *ChannelAmountLimitsAllOf) GetMinLimitOk() (*float32, bool)` + +GetMinLimitOk returns a tuple with the MinLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinLimit + +`func (o *ChannelAmountLimitsAllOf) SetMinLimit(v float32)` + +SetMinLimit sets MinLimit field to given value. + +### HasMinLimit + +`func (o *ChannelAmountLimitsAllOf) HasMinLimit() bool` + +HasMinLimit returns a boolean if a field has been set. + +### GetMaxLimit + +`func (o *ChannelAmountLimitsAllOf) GetMaxLimit() float32` + +GetMaxLimit returns the MaxLimit field if non-nil, zero value otherwise. + +### GetMaxLimitOk + +`func (o *ChannelAmountLimitsAllOf) GetMaxLimitOk() (*float32, bool)` + +GetMaxLimitOk returns a tuple with the MaxLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxLimit + +`func (o *ChannelAmountLimitsAllOf) SetMaxLimit(v float32)` + +SetMaxLimit sets MaxLimit field to given value. + +### HasMaxLimit + +`func (o *ChannelAmountLimitsAllOf) HasMaxLimit() bool` + +HasMaxLimit returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/ChannelProperty.md b/docs/payment_method/ChannelProperty.md new file mode 100644 index 00000000..8023ab12 --- /dev/null +++ b/docs/payment_method/ChannelProperty.md @@ -0,0 +1,108 @@ +# ChannelProperty + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Name** | Pointer to **string** | The corresponding parameter name | [optional] | +| **Type** | Pointer to **string** | Data type of the parameter | [optional] | +| **IsRequired** | Pointer to **bool** | Indicates whether or not the parameter is required | [optional] | + +## Methods + +### NewChannelProperty + +`func NewChannelProperty() *ChannelProperty` + +NewChannelProperty instantiates a new ChannelProperty object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelPropertyWithDefaults + +`func NewChannelPropertyWithDefaults() *ChannelProperty` + +NewChannelPropertyWithDefaults instantiates a new ChannelProperty object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ChannelProperty) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ChannelProperty) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ChannelProperty) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ChannelProperty) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetType + +`func (o *ChannelProperty) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ChannelProperty) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ChannelProperty) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ChannelProperty) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetIsRequired + +`func (o *ChannelProperty) GetIsRequired() bool` + +GetIsRequired returns the IsRequired field if non-nil, zero value otherwise. + +### GetIsRequiredOk + +`func (o *ChannelProperty) GetIsRequiredOk() (*bool, bool)` + +GetIsRequiredOk returns a tuple with the IsRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsRequired + +`func (o *ChannelProperty) SetIsRequired(v bool)` + +SetIsRequired sets IsRequired field to given value. + +### HasIsRequired + +`func (o *ChannelProperty) HasIsRequired() bool` + +HasIsRequired returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/ChannelPropertyAllOf.md b/docs/payment_method/ChannelPropertyAllOf.md new file mode 100644 index 00000000..0624c4b4 --- /dev/null +++ b/docs/payment_method/ChannelPropertyAllOf.md @@ -0,0 +1,108 @@ +# ChannelPropertyAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Name** | Pointer to **string** | The corresponding parameter name | [optional] | +| **Type** | Pointer to **string** | Data type of the parameter | [optional] | +| **IsRequired** | Pointer to **bool** | Indicates whether or not the parameter is required | [optional] | + +## Methods + +### NewChannelPropertyAllOf + +`func NewChannelPropertyAllOf() *ChannelPropertyAllOf` + +NewChannelPropertyAllOf instantiates a new ChannelPropertyAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelPropertyAllOfWithDefaults + +`func NewChannelPropertyAllOfWithDefaults() *ChannelPropertyAllOf` + +NewChannelPropertyAllOfWithDefaults instantiates a new ChannelPropertyAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ChannelPropertyAllOf) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ChannelPropertyAllOf) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ChannelPropertyAllOf) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ChannelPropertyAllOf) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetType + +`func (o *ChannelPropertyAllOf) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ChannelPropertyAllOf) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ChannelPropertyAllOf) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ChannelPropertyAllOf) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetIsRequired + +`func (o *ChannelPropertyAllOf) GetIsRequired() bool` + +GetIsRequired returns the IsRequired field if non-nil, zero value otherwise. + +### GetIsRequiredOk + +`func (o *ChannelPropertyAllOf) GetIsRequiredOk() (*bool, bool)` + +GetIsRequiredOk returns a tuple with the IsRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsRequired + +`func (o *ChannelPropertyAllOf) SetIsRequired(v bool)` + +SetIsRequired sets IsRequired field to given value. + +### HasIsRequired + +`func (o *ChannelPropertyAllOf) HasIsRequired() bool` + +HasIsRequired returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CreatePaymentMethod409Response.md b/docs/payment_method/CreatePaymentMethod409Response.md new file mode 100644 index 00000000..815580b8 --- /dev/null +++ b/docs/payment_method/CreatePaymentMethod409Response.md @@ -0,0 +1,82 @@ +# CreatePaymentMethod409Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreatePaymentMethod409Response + +`func NewCreatePaymentMethod409Response() *CreatePaymentMethod409Response` + +NewCreatePaymentMethod409Response instantiates a new CreatePaymentMethod409Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreatePaymentMethod409ResponseWithDefaults + +`func NewCreatePaymentMethod409ResponseWithDefaults() *CreatePaymentMethod409Response` + +NewCreatePaymentMethod409ResponseWithDefaults instantiates a new CreatePaymentMethod409Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreatePaymentMethod409Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreatePaymentMethod409Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreatePaymentMethod409Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreatePaymentMethod409Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreatePaymentMethod409Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreatePaymentMethod409Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreatePaymentMethod409Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreatePaymentMethod409Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/CreatePaymentMethod503Response.md b/docs/payment_method/CreatePaymentMethod503Response.md new file mode 100644 index 00000000..a7613651 --- /dev/null +++ b/docs/payment_method/CreatePaymentMethod503Response.md @@ -0,0 +1,82 @@ +# CreatePaymentMethod503Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreatePaymentMethod503Response + +`func NewCreatePaymentMethod503Response() *CreatePaymentMethod503Response` + +NewCreatePaymentMethod503Response instantiates a new CreatePaymentMethod503Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreatePaymentMethod503ResponseWithDefaults + +`func NewCreatePaymentMethod503ResponseWithDefaults() *CreatePaymentMethod503Response` + +NewCreatePaymentMethod503ResponseWithDefaults instantiates a new CreatePaymentMethod503Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreatePaymentMethod503Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreatePaymentMethod503Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreatePaymentMethod503Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreatePaymentMethod503Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreatePaymentMethod503Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreatePaymentMethod503Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreatePaymentMethod503Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreatePaymentMethod503Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebit.md b/docs/payment_method/DirectDebit.md new file mode 100644 index 00000000..bac4f451 --- /dev/null +++ b/docs/payment_method/DirectDebit.md @@ -0,0 +1,175 @@ +# DirectDebit + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | | +| **ChannelProperties** | [**NullableDirectDebitChannelProperties**](DirectDebitChannelProperties.md) | | | +| **Type** | [**DirectDebitType**](DirectDebitType.md) | | | +| **BankAccount** | Pointer to [**NullableDirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] | +| **DebitCard** | Pointer to [**NullableDirectDebitDebitCard**](DirectDebitDebitCard.md) | | [optional] | + +## Methods + +### NewDirectDebit + +`func NewDirectDebit(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, type_ DirectDebitType, ) *DirectDebit` + +NewDirectDebit instantiates a new DirectDebit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitWithDefaults + +`func NewDirectDebitWithDefaults() *DirectDebit` + +NewDirectDebitWithDefaults instantiates a new DirectDebit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *DirectDebit) GetChannelCode() DirectDebitChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *DirectDebit) GetChannelCodeOk() (*DirectDebitChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *DirectDebit) SetChannelCode(v DirectDebitChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *DirectDebit) GetChannelProperties() DirectDebitChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *DirectDebit) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *DirectDebit) SetChannelProperties(v DirectDebitChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *DirectDebit) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *DirectDebit) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetType + +`func (o *DirectDebit) GetType() DirectDebitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DirectDebit) GetTypeOk() (*DirectDebitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DirectDebit) SetType(v DirectDebitType)` + +SetType sets Type field to given value. + + +### GetBankAccount + +`func (o *DirectDebit) GetBankAccount() DirectDebitBankAccount` + +GetBankAccount returns the BankAccount field if non-nil, zero value otherwise. + +### GetBankAccountOk + +`func (o *DirectDebit) GetBankAccountOk() (*DirectDebitBankAccount, bool)` + +GetBankAccountOk returns a tuple with the BankAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccount + +`func (o *DirectDebit) SetBankAccount(v DirectDebitBankAccount)` + +SetBankAccount sets BankAccount field to given value. + +### HasBankAccount + +`func (o *DirectDebit) HasBankAccount() bool` + +HasBankAccount returns a boolean if a field has been set. + +### SetBankAccountNil + +`func (o *DirectDebit) SetBankAccountNil(b bool)` + + SetBankAccountNil sets the value for BankAccount to be an explicit nil + +### UnsetBankAccount +`func (o *DirectDebit) UnsetBankAccount()` + +UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +### GetDebitCard + +`func (o *DirectDebit) GetDebitCard() DirectDebitDebitCard` + +GetDebitCard returns the DebitCard field if non-nil, zero value otherwise. + +### GetDebitCardOk + +`func (o *DirectDebit) GetDebitCardOk() (*DirectDebitDebitCard, bool)` + +GetDebitCardOk returns a tuple with the DebitCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDebitCard + +`func (o *DirectDebit) SetDebitCard(v DirectDebitDebitCard)` + +SetDebitCard sets DebitCard field to given value. + +### HasDebitCard + +`func (o *DirectDebit) HasDebitCard() bool` + +HasDebitCard returns a boolean if a field has been set. + +### SetDebitCardNil + +`func (o *DirectDebit) SetDebitCardNil(b bool)` + + SetDebitCardNil sets the value for DebitCard to be an explicit nil + +### UnsetDebitCard +`func (o *DirectDebit) UnsetDebitCard()` + +UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitAllOf.md b/docs/payment_method/DirectDebitAllOf.md new file mode 100644 index 00000000..a3f8b08e --- /dev/null +++ b/docs/payment_method/DirectDebitAllOf.md @@ -0,0 +1,123 @@ +# DirectDebitAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | [**DirectDebitType**](DirectDebitType.md) | | | +| **BankAccount** | Pointer to [**NullableDirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] | +| **DebitCard** | Pointer to [**NullableDirectDebitDebitCard**](DirectDebitDebitCard.md) | | [optional] | + +## Methods + +### NewDirectDebitAllOf + +`func NewDirectDebitAllOf(type_ DirectDebitType, ) *DirectDebitAllOf` + +NewDirectDebitAllOf instantiates a new DirectDebitAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitAllOfWithDefaults + +`func NewDirectDebitAllOfWithDefaults() *DirectDebitAllOf` + +NewDirectDebitAllOfWithDefaults instantiates a new DirectDebitAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *DirectDebitAllOf) GetType() DirectDebitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DirectDebitAllOf) GetTypeOk() (*DirectDebitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DirectDebitAllOf) SetType(v DirectDebitType)` + +SetType sets Type field to given value. + + +### GetBankAccount + +`func (o *DirectDebitAllOf) GetBankAccount() DirectDebitBankAccount` + +GetBankAccount returns the BankAccount field if non-nil, zero value otherwise. + +### GetBankAccountOk + +`func (o *DirectDebitAllOf) GetBankAccountOk() (*DirectDebitBankAccount, bool)` + +GetBankAccountOk returns a tuple with the BankAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccount + +`func (o *DirectDebitAllOf) SetBankAccount(v DirectDebitBankAccount)` + +SetBankAccount sets BankAccount field to given value. + +### HasBankAccount + +`func (o *DirectDebitAllOf) HasBankAccount() bool` + +HasBankAccount returns a boolean if a field has been set. + +### SetBankAccountNil + +`func (o *DirectDebitAllOf) SetBankAccountNil(b bool)` + + SetBankAccountNil sets the value for BankAccount to be an explicit nil + +### UnsetBankAccount +`func (o *DirectDebitAllOf) UnsetBankAccount()` + +UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +### GetDebitCard + +`func (o *DirectDebitAllOf) GetDebitCard() DirectDebitDebitCard` + +GetDebitCard returns the DebitCard field if non-nil, zero value otherwise. + +### GetDebitCardOk + +`func (o *DirectDebitAllOf) GetDebitCardOk() (*DirectDebitDebitCard, bool)` + +GetDebitCardOk returns a tuple with the DebitCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDebitCard + +`func (o *DirectDebitAllOf) SetDebitCard(v DirectDebitDebitCard)` + +SetDebitCard sets DebitCard field to given value. + +### HasDebitCard + +`func (o *DirectDebitAllOf) HasDebitCard() bool` + +HasDebitCard returns a boolean if a field has been set. + +### SetDebitCardNil + +`func (o *DirectDebitAllOf) SetDebitCardNil(b bool)` + + SetDebitCardNil sets the value for DebitCard to be an explicit nil + +### UnsetDebitCard +`func (o *DirectDebitAllOf) UnsetDebitCard()` + +UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitBankAccount.md b/docs/payment_method/DirectDebitBankAccount.md new file mode 100644 index 00000000..5b439e73 --- /dev/null +++ b/docs/payment_method/DirectDebitBankAccount.md @@ -0,0 +1,174 @@ +# DirectDebitBankAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MaskedBankAccountNumber** | Pointer to **NullableString** | | [optional] | +| **BankAccountHash** | Pointer to **NullableString** | | [optional] | +| **MobileNumber** | Pointer to **NullableString** | Mobile number of the customer registered to the partner channel | [optional] | +| **IdentityDocumentNumber** | Pointer to **NullableString** | Identity number of the customer registered to the partner channel | [optional] | + +## Methods + +### NewDirectDebitBankAccount + +`func NewDirectDebitBankAccount() *DirectDebitBankAccount` + +NewDirectDebitBankAccount instantiates a new DirectDebitBankAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitBankAccountWithDefaults + +`func NewDirectDebitBankAccountWithDefaults() *DirectDebitBankAccount` + +NewDirectDebitBankAccountWithDefaults instantiates a new DirectDebitBankAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) GetMaskedBankAccountNumber() string` + +GetMaskedBankAccountNumber returns the MaskedBankAccountNumber field if non-nil, zero value otherwise. + +### GetMaskedBankAccountNumberOk + +`func (o *DirectDebitBankAccount) GetMaskedBankAccountNumberOk() (*string, bool)` + +GetMaskedBankAccountNumberOk returns a tuple with the MaskedBankAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) SetMaskedBankAccountNumber(v string)` + +SetMaskedBankAccountNumber sets MaskedBankAccountNumber field to given value. + +### HasMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) HasMaskedBankAccountNumber() bool` + +HasMaskedBankAccountNumber returns a boolean if a field has been set. + +### SetMaskedBankAccountNumberNil + +`func (o *DirectDebitBankAccount) SetMaskedBankAccountNumberNil(b bool)` + + SetMaskedBankAccountNumberNil sets the value for MaskedBankAccountNumber to be an explicit nil + +### UnsetMaskedBankAccountNumber +`func (o *DirectDebitBankAccount) UnsetMaskedBankAccountNumber()` + +UnsetMaskedBankAccountNumber ensures that no value is present for MaskedBankAccountNumber, not even an explicit nil +### GetBankAccountHash + +`func (o *DirectDebitBankAccount) GetBankAccountHash() string` + +GetBankAccountHash returns the BankAccountHash field if non-nil, zero value otherwise. + +### GetBankAccountHashOk + +`func (o *DirectDebitBankAccount) GetBankAccountHashOk() (*string, bool)` + +GetBankAccountHashOk returns a tuple with the BankAccountHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccountHash + +`func (o *DirectDebitBankAccount) SetBankAccountHash(v string)` + +SetBankAccountHash sets BankAccountHash field to given value. + +### HasBankAccountHash + +`func (o *DirectDebitBankAccount) HasBankAccountHash() bool` + +HasBankAccountHash returns a boolean if a field has been set. + +### SetBankAccountHashNil + +`func (o *DirectDebitBankAccount) SetBankAccountHashNil(b bool)` + + SetBankAccountHashNil sets the value for BankAccountHash to be an explicit nil + +### UnsetBankAccountHash +`func (o *DirectDebitBankAccount) UnsetBankAccountHash()` + +UnsetBankAccountHash ensures that no value is present for BankAccountHash, not even an explicit nil +### GetMobileNumber + +`func (o *DirectDebitBankAccount) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitBankAccount) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitBankAccount) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitBankAccount) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### SetMobileNumberNil + +`func (o *DirectDebitBankAccount) SetMobileNumberNil(b bool)` + + SetMobileNumberNil sets the value for MobileNumber to be an explicit nil + +### UnsetMobileNumber +`func (o *DirectDebitBankAccount) UnsetMobileNumber()` + +UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +### GetIdentityDocumentNumber + +`func (o *DirectDebitBankAccount) GetIdentityDocumentNumber() string` + +GetIdentityDocumentNumber returns the IdentityDocumentNumber field if non-nil, zero value otherwise. + +### GetIdentityDocumentNumberOk + +`func (o *DirectDebitBankAccount) GetIdentityDocumentNumberOk() (*string, bool)` + +GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentityDocumentNumber + +`func (o *DirectDebitBankAccount) SetIdentityDocumentNumber(v string)` + +SetIdentityDocumentNumber sets IdentityDocumentNumber field to given value. + +### HasIdentityDocumentNumber + +`func (o *DirectDebitBankAccount) HasIdentityDocumentNumber() bool` + +HasIdentityDocumentNumber returns a boolean if a field has been set. + +### SetIdentityDocumentNumberNil + +`func (o *DirectDebitBankAccount) SetIdentityDocumentNumberNil(b bool)` + + SetIdentityDocumentNumberNil sets the value for IdentityDocumentNumber to be an explicit nil + +### UnsetIdentityDocumentNumber +`func (o *DirectDebitBankAccount) UnsetIdentityDocumentNumber()` + +UnsetIdentityDocumentNumber ensures that no value is present for IdentityDocumentNumber, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitChannelCode.md b/docs/payment_method/DirectDebitChannelCode.md new file mode 100644 index 00000000..098db8e1 --- /dev/null +++ b/docs/payment_method/DirectDebitChannelCode.md @@ -0,0 +1,135 @@ +# DirectDebitChannelCode + +## Enum + + +* `BCA_KLIKPAY` (value: `"BCA_KLIKPAY"`) + +* `BCA_ONEKLIK` (value: `"BCA_ONEKLIK"`) + +* `BDO` (value: `"BDO"`) + +* `BPI` (value: `"BPI"`) + +* `BRI` (value: `"BRI"`) + +* `BNI` (value: `"BNI"`) + +* `CHINABANK` (value: `"CHINABANK"`) + +* `CIMBNIAGA` (value: `"CIMBNIAGA"`) + +* `MTB` (value: `"MTB"`) + +* `RCBC` (value: `"RCBC"`) + +* `UBP` (value: `"UBP"`) + +* `MANDIRI` (value: `"MANDIRI"`) + +* `BBL` (value: `"BBL"`) + +* `SCB` (value: `"SCB"`) + +* `KTB` (value: `"KTB"`) + +* `BAY` (value: `"BAY"`) + +* `KBANK_MB` (value: `"KBANK_MB"`) + +* `BAY_MB` (value: `"BAY_MB"`) + +* `KTB_MB` (value: `"KTB_MB"`) + +* `BBL_MB` (value: `"BBL_MB"`) + +* `SCB_MB` (value: `"SCB_MB"`) + +* `BDO_EPAY` (value: `"BDO_EPAY"`) + +* `AUTODEBIT_UBP` (value: `"AUTODEBIT_UBP"`) + +* `AFFIN_FPX` (value: `"AFFIN_FPX"`) + +* `AGRO_FPX` (value: `"AGRO_FPX"`) + +* `ALLIANCE_FPX` (value: `"ALLIANCE_FPX"`) + +* `AMBANK_FPX` (value: `"AMBANK_FPX"`) + +* `ISLAM_FPX` (value: `"ISLAM_FPX"`) + +* `MUAMALAT_FPX` (value: `"MUAMALAT_FPX"`) + +* `BOC_FPX` (value: `"BOC_FPX"`) + +* `RAKYAT_FPX` (value: `"RAKYAT_FPX"`) + +* `BSN_FPX` (value: `"BSN_FPX"`) + +* `CIMB_FPX` (value: `"CIMB_FPX"`) + +* `HLB_FPX` (value: `"HLB_FPX"`) + +* `HSBC_FPX` (value: `"HSBC_FPX"`) + +* `KFH_FPX` (value: `"KFH_FPX"`) + +* `MAYB2_E_FPX` (value: `"MAYB2E_FPX"`) + +* `MAYB2_U_FPX` (value: `"MAYB2U_FPX"`) + +* `OCBC_FPX` (value: `"OCBC_FPX"`) + +* `PUBLIC_FPX` (value: `"PUBLIC_FPX"`) + +* `RHB_FPX` (value: `"RHB_FPX"`) + +* `SCH_FPX` (value: `"SCH_FPX"`) + +* `UOB_FPX` (value: `"UOB_FPX"`) + +* `AFFIN_FPX_BUSINESS` (value: `"AFFIN_FPX_BUSINESS"`) + +* `AGRO_FPX_BUSINESS` (value: `"AGRO_FPX_BUSINESS"`) + +* `ALLIANCE_FPX_BUSINESS` (value: `"ALLIANCE_FPX_BUSINESS"`) + +* `AMBANK_FPX_BUSINESS` (value: `"AMBANK_FPX_BUSINESS"`) + +* `ISLAM_FPX_BUSINESS` (value: `"ISLAM_FPX_BUSINESS"`) + +* `MUAMALAT_FPX_BUSINESS` (value: `"MUAMALAT_FPX_BUSINESS"`) + +* `BNP_FPX_BUSINESS` (value: `"BNP_FPX_BUSINESS"`) + +* `CIMB_FPX_BUSINESS` (value: `"CIMB_FPX_BUSINESS"`) + +* `CITIBANK_FPX_BUSINESS` (value: `"CITIBANK_FPX_BUSINESS"`) + +* `DEUTSCHE_FPX_BUSINESS` (value: `"DEUTSCHE_FPX_BUSINESS"`) + +* `HLB_FPX_BUSINESS` (value: `"HLB_FPX_BUSINESS"`) + +* `HSBC_FPX_BUSINESS` (value: `"HSBC_FPX_BUSINESS"`) + +* `RAKYAT_FPX_BUSINESS` (value: `"RAKYAT_FPX_BUSINESS"`) + +* `KFH_FPX_BUSINESS` (value: `"KFH_FPX_BUSINESS"`) + +* `MAYB2_E_FPX_BUSINESS` (value: `"MAYB2E_FPX_BUSINESS"`) + +* `OCBC_FPX_BUSINESS` (value: `"OCBC_FPX_BUSINESS"`) + +* `PUBLIC_FPX_BUSINESS` (value: `"PUBLIC_FPX_BUSINESS"`) + +* `RHB_FPX_BUSINESS` (value: `"RHB_FPX_BUSINESS"`) + +* `SCH_FPX_BUSINESS` (value: `"SCH_FPX_BUSINESS"`) + +* `UOB_FPX_BUSINESS` (value: `"UOB_FPX_BUSINESS"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitChannelProperties.md b/docs/payment_method/DirectDebitChannelProperties.md new file mode 100644 index 00000000..092f0953 --- /dev/null +++ b/docs/payment_method/DirectDebitChannelProperties.md @@ -0,0 +1,308 @@ +# DirectDebitChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | | [optional] | +| **FailureReturnUrl** | Pointer to **NullableString** | | [optional] | +| **MobileNumber** | Pointer to **NullableString** | Mobile number of the customer registered to the partner channel | [optional] | +| **CardLastFour** | Pointer to **NullableString** | Last four digits of the debit card | [optional] | +| **CardExpiry** | Pointer to **NullableString** | Expiry month and year of the debit card (in MM/YY format) | [optional] | +| **Email** | Pointer to **NullableString** | Email address of the customer that is registered to the partner channel | [optional] | +| **IdentityDocumentNumber** | Pointer to **NullableString** | Identity number of the customer registered to the partner channel | [optional] | +| **RequireAuth** | Pointer to **NullableBool** | | [optional] | + +## Methods + +### NewDirectDebitChannelProperties + +`func NewDirectDebitChannelProperties() *DirectDebitChannelProperties` + +NewDirectDebitChannelProperties instantiates a new DirectDebitChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitChannelPropertiesWithDefaults + +`func NewDirectDebitChannelPropertiesWithDefaults() *DirectDebitChannelProperties` + +NewDirectDebitChannelPropertiesWithDefaults instantiates a new DirectDebitChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *DirectDebitChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *DirectDebitChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *DirectDebitChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *DirectDebitChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *DirectDebitChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### SetFailureReturnUrlNil + +`func (o *DirectDebitChannelProperties) SetFailureReturnUrlNil(b bool)` + + SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil + +### UnsetFailureReturnUrl +`func (o *DirectDebitChannelProperties) UnsetFailureReturnUrl()` + +UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +### GetMobileNumber + +`func (o *DirectDebitChannelProperties) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitChannelProperties) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitChannelProperties) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitChannelProperties) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### SetMobileNumberNil + +`func (o *DirectDebitChannelProperties) SetMobileNumberNil(b bool)` + + SetMobileNumberNil sets the value for MobileNumber to be an explicit nil + +### UnsetMobileNumber +`func (o *DirectDebitChannelProperties) UnsetMobileNumber()` + +UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +### GetCardLastFour + +`func (o *DirectDebitChannelProperties) GetCardLastFour() string` + +GetCardLastFour returns the CardLastFour field if non-nil, zero value otherwise. + +### GetCardLastFourOk + +`func (o *DirectDebitChannelProperties) GetCardLastFourOk() (*string, bool)` + +GetCardLastFourOk returns a tuple with the CardLastFour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardLastFour + +`func (o *DirectDebitChannelProperties) SetCardLastFour(v string)` + +SetCardLastFour sets CardLastFour field to given value. + +### HasCardLastFour + +`func (o *DirectDebitChannelProperties) HasCardLastFour() bool` + +HasCardLastFour returns a boolean if a field has been set. + +### SetCardLastFourNil + +`func (o *DirectDebitChannelProperties) SetCardLastFourNil(b bool)` + + SetCardLastFourNil sets the value for CardLastFour to be an explicit nil + +### UnsetCardLastFour +`func (o *DirectDebitChannelProperties) UnsetCardLastFour()` + +UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +### GetCardExpiry + +`func (o *DirectDebitChannelProperties) GetCardExpiry() string` + +GetCardExpiry returns the CardExpiry field if non-nil, zero value otherwise. + +### GetCardExpiryOk + +`func (o *DirectDebitChannelProperties) GetCardExpiryOk() (*string, bool)` + +GetCardExpiryOk returns a tuple with the CardExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardExpiry + +`func (o *DirectDebitChannelProperties) SetCardExpiry(v string)` + +SetCardExpiry sets CardExpiry field to given value. + +### HasCardExpiry + +`func (o *DirectDebitChannelProperties) HasCardExpiry() bool` + +HasCardExpiry returns a boolean if a field has been set. + +### SetCardExpiryNil + +`func (o *DirectDebitChannelProperties) SetCardExpiryNil(b bool)` + + SetCardExpiryNil sets the value for CardExpiry to be an explicit nil + +### UnsetCardExpiry +`func (o *DirectDebitChannelProperties) UnsetCardExpiry()` + +UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +### GetEmail + +`func (o *DirectDebitChannelProperties) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DirectDebitChannelProperties) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DirectDebitChannelProperties) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DirectDebitChannelProperties) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmailNil + +`func (o *DirectDebitChannelProperties) SetEmailNil(b bool)` + + SetEmailNil sets the value for Email to be an explicit nil + +### UnsetEmail +`func (o *DirectDebitChannelProperties) UnsetEmail()` + +UnsetEmail ensures that no value is present for Email, not even an explicit nil +### GetIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) GetIdentityDocumentNumber() string` + +GetIdentityDocumentNumber returns the IdentityDocumentNumber field if non-nil, zero value otherwise. + +### GetIdentityDocumentNumberOk + +`func (o *DirectDebitChannelProperties) GetIdentityDocumentNumberOk() (*string, bool)` + +GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) SetIdentityDocumentNumber(v string)` + +SetIdentityDocumentNumber sets IdentityDocumentNumber field to given value. + +### HasIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) HasIdentityDocumentNumber() bool` + +HasIdentityDocumentNumber returns a boolean if a field has been set. + +### SetIdentityDocumentNumberNil + +`func (o *DirectDebitChannelProperties) SetIdentityDocumentNumberNil(b bool)` + + SetIdentityDocumentNumberNil sets the value for IdentityDocumentNumber to be an explicit nil + +### UnsetIdentityDocumentNumber +`func (o *DirectDebitChannelProperties) UnsetIdentityDocumentNumber()` + +UnsetIdentityDocumentNumber ensures that no value is present for IdentityDocumentNumber, not even an explicit nil +### GetRequireAuth + +`func (o *DirectDebitChannelProperties) GetRequireAuth() bool` + +GetRequireAuth returns the RequireAuth field if non-nil, zero value otherwise. + +### GetRequireAuthOk + +`func (o *DirectDebitChannelProperties) GetRequireAuthOk() (*bool, bool)` + +GetRequireAuthOk returns a tuple with the RequireAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequireAuth + +`func (o *DirectDebitChannelProperties) SetRequireAuth(v bool)` + +SetRequireAuth sets RequireAuth field to given value. + +### HasRequireAuth + +`func (o *DirectDebitChannelProperties) HasRequireAuth() bool` + +HasRequireAuth returns a boolean if a field has been set. + +### SetRequireAuthNil + +`func (o *DirectDebitChannelProperties) SetRequireAuthNil(b bool)` + + SetRequireAuthNil sets the value for RequireAuth to be an explicit nil + +### UnsetRequireAuth +`func (o *DirectDebitChannelProperties) UnsetRequireAuth()` + +UnsetRequireAuth ensures that no value is present for RequireAuth, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitDebitCard.md b/docs/payment_method/DirectDebitDebitCard.md new file mode 100644 index 00000000..550522e8 --- /dev/null +++ b/docs/payment_method/DirectDebitDebitCard.md @@ -0,0 +1,174 @@ +# DirectDebitDebitCard + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MobileNumber** | Pointer to **NullableString** | Mobile number of the customer registered to the partner channel | [optional] | +| **CardLastFour** | Pointer to **NullableString** | Last four digits of the debit card | [optional] | +| **CardExpiry** | Pointer to **NullableString** | Expiry month and year of the debit card (in MM/YY format) | [optional] | +| **Email** | Pointer to **NullableString** | Email address of the customer that is registered to the partner channel | [optional] | + +## Methods + +### NewDirectDebitDebitCard + +`func NewDirectDebitDebitCard() *DirectDebitDebitCard` + +NewDirectDebitDebitCard instantiates a new DirectDebitDebitCard object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitDebitCardWithDefaults + +`func NewDirectDebitDebitCardWithDefaults() *DirectDebitDebitCard` + +NewDirectDebitDebitCardWithDefaults instantiates a new DirectDebitDebitCard object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMobileNumber + +`func (o *DirectDebitDebitCard) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitDebitCard) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitDebitCard) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitDebitCard) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### SetMobileNumberNil + +`func (o *DirectDebitDebitCard) SetMobileNumberNil(b bool)` + + SetMobileNumberNil sets the value for MobileNumber to be an explicit nil + +### UnsetMobileNumber +`func (o *DirectDebitDebitCard) UnsetMobileNumber()` + +UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +### GetCardLastFour + +`func (o *DirectDebitDebitCard) GetCardLastFour() string` + +GetCardLastFour returns the CardLastFour field if non-nil, zero value otherwise. + +### GetCardLastFourOk + +`func (o *DirectDebitDebitCard) GetCardLastFourOk() (*string, bool)` + +GetCardLastFourOk returns a tuple with the CardLastFour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardLastFour + +`func (o *DirectDebitDebitCard) SetCardLastFour(v string)` + +SetCardLastFour sets CardLastFour field to given value. + +### HasCardLastFour + +`func (o *DirectDebitDebitCard) HasCardLastFour() bool` + +HasCardLastFour returns a boolean if a field has been set. + +### SetCardLastFourNil + +`func (o *DirectDebitDebitCard) SetCardLastFourNil(b bool)` + + SetCardLastFourNil sets the value for CardLastFour to be an explicit nil + +### UnsetCardLastFour +`func (o *DirectDebitDebitCard) UnsetCardLastFour()` + +UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +### GetCardExpiry + +`func (o *DirectDebitDebitCard) GetCardExpiry() string` + +GetCardExpiry returns the CardExpiry field if non-nil, zero value otherwise. + +### GetCardExpiryOk + +`func (o *DirectDebitDebitCard) GetCardExpiryOk() (*string, bool)` + +GetCardExpiryOk returns a tuple with the CardExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardExpiry + +`func (o *DirectDebitDebitCard) SetCardExpiry(v string)` + +SetCardExpiry sets CardExpiry field to given value. + +### HasCardExpiry + +`func (o *DirectDebitDebitCard) HasCardExpiry() bool` + +HasCardExpiry returns a boolean if a field has been set. + +### SetCardExpiryNil + +`func (o *DirectDebitDebitCard) SetCardExpiryNil(b bool)` + + SetCardExpiryNil sets the value for CardExpiry to be an explicit nil + +### UnsetCardExpiry +`func (o *DirectDebitDebitCard) UnsetCardExpiry()` + +UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +### GetEmail + +`func (o *DirectDebitDebitCard) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DirectDebitDebitCard) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DirectDebitDebitCard) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DirectDebitDebitCard) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmailNil + +`func (o *DirectDebitDebitCard) SetEmailNil(b bool)` + + SetEmailNil sets the value for Email to be an explicit nil + +### UnsetEmail +`func (o *DirectDebitDebitCard) UnsetEmail()` + +UnsetEmail ensures that no value is present for Email, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitParameters.md b/docs/payment_method/DirectDebitParameters.md new file mode 100644 index 00000000..245be890 --- /dev/null +++ b/docs/payment_method/DirectDebitParameters.md @@ -0,0 +1,82 @@ +# DirectDebitParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | | +| **ChannelProperties** | [**NullableDirectDebitChannelProperties**](DirectDebitChannelProperties.md) | | | + +## Methods + +### NewDirectDebitParameters + +`func NewDirectDebitParameters(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, ) *DirectDebitParameters` + +NewDirectDebitParameters instantiates a new DirectDebitParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitParametersWithDefaults + +`func NewDirectDebitParametersWithDefaults() *DirectDebitParameters` + +NewDirectDebitParametersWithDefaults instantiates a new DirectDebitParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *DirectDebitParameters) GetChannelCode() DirectDebitChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *DirectDebitParameters) GetChannelCodeOk() (*DirectDebitChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *DirectDebitParameters) SetChannelCode(v DirectDebitChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *DirectDebitParameters) GetChannelProperties() DirectDebitChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *DirectDebitParameters) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *DirectDebitParameters) SetChannelProperties(v DirectDebitChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *DirectDebitParameters) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *DirectDebitParameters) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/DirectDebitType.md b/docs/payment_method/DirectDebitType.md new file mode 100644 index 00000000..e307caa2 --- /dev/null +++ b/docs/payment_method/DirectDebitType.md @@ -0,0 +1,15 @@ +# DirectDebitType + +## Enum + + +* `DEBIT_CARD` (value: `"DEBIT_CARD"`) + +* `BANK_ACCOUNT` (value: `"BANK_ACCOUNT"`) + +* `BANK_REDIRECT` (value: `"BANK_REDIRECT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/EWallet.md b/docs/payment_method/EWallet.md new file mode 100644 index 00000000..2d3adae2 --- /dev/null +++ b/docs/payment_method/EWallet.md @@ -0,0 +1,103 @@ +# EWallet + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**EWalletChannelCode**](EWalletChannelCode.md) | | | +| **ChannelProperties** | Pointer to [**EWalletChannelProperties**](EWalletChannelProperties.md) | | [optional] | +| **Account** | Pointer to [**EWalletAccount**](EWalletAccount.md) | | [optional] | + +## Methods + +### NewEWallet + +`func NewEWallet(channelCode EWalletChannelCode, ) *EWallet` + +NewEWallet instantiates a new EWallet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletWithDefaults + +`func NewEWalletWithDefaults() *EWallet` + +NewEWalletWithDefaults instantiates a new EWallet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *EWallet) GetChannelCode() EWalletChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *EWallet) GetChannelCodeOk() (*EWalletChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *EWallet) SetChannelCode(v EWalletChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *EWallet) GetChannelProperties() EWalletChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *EWallet) GetChannelPropertiesOk() (*EWalletChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *EWallet) SetChannelProperties(v EWalletChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *EWallet) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetAccount + +`func (o *EWallet) GetAccount() EWalletAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *EWallet) GetAccountOk() (*EWalletAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *EWallet) SetAccount(v EWalletAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *EWallet) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/EWalletAccount.md b/docs/payment_method/EWalletAccount.md new file mode 100644 index 00000000..445abbb5 --- /dev/null +++ b/docs/payment_method/EWalletAccount.md @@ -0,0 +1,174 @@ +# EWalletAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Name** | Pointer to **NullableString** | Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable | [optional] | +| **AccountDetails** | Pointer to **NullableString** | Identifier from eWallet provider e.g. phone number. The value is null if unavailable | [optional] | +| **Balance** | Pointer to **NullableFloat64** | The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable | [optional] | +| **PointBalance** | Pointer to **NullableFloat64** | The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl | [optional] | + +## Methods + +### NewEWalletAccount + +`func NewEWalletAccount() *EWalletAccount` + +NewEWalletAccount instantiates a new EWalletAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletAccountWithDefaults + +`func NewEWalletAccountWithDefaults() *EWalletAccount` + +NewEWalletAccountWithDefaults instantiates a new EWalletAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *EWalletAccount) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *EWalletAccount) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *EWalletAccount) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *EWalletAccount) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *EWalletAccount) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *EWalletAccount) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetAccountDetails + +`func (o *EWalletAccount) GetAccountDetails() string` + +GetAccountDetails returns the AccountDetails field if non-nil, zero value otherwise. + +### GetAccountDetailsOk + +`func (o *EWalletAccount) GetAccountDetailsOk() (*string, bool)` + +GetAccountDetailsOk returns a tuple with the AccountDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountDetails + +`func (o *EWalletAccount) SetAccountDetails(v string)` + +SetAccountDetails sets AccountDetails field to given value. + +### HasAccountDetails + +`func (o *EWalletAccount) HasAccountDetails() bool` + +HasAccountDetails returns a boolean if a field has been set. + +### SetAccountDetailsNil + +`func (o *EWalletAccount) SetAccountDetailsNil(b bool)` + + SetAccountDetailsNil sets the value for AccountDetails to be an explicit nil + +### UnsetAccountDetails +`func (o *EWalletAccount) UnsetAccountDetails()` + +UnsetAccountDetails ensures that no value is present for AccountDetails, not even an explicit nil +### GetBalance + +`func (o *EWalletAccount) GetBalance() float64` + +GetBalance returns the Balance field if non-nil, zero value otherwise. + +### GetBalanceOk + +`func (o *EWalletAccount) GetBalanceOk() (*float64, bool)` + +GetBalanceOk returns a tuple with the Balance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBalance + +`func (o *EWalletAccount) SetBalance(v float64)` + +SetBalance sets Balance field to given value. + +### HasBalance + +`func (o *EWalletAccount) HasBalance() bool` + +HasBalance returns a boolean if a field has been set. + +### SetBalanceNil + +`func (o *EWalletAccount) SetBalanceNil(b bool)` + + SetBalanceNil sets the value for Balance to be an explicit nil + +### UnsetBalance +`func (o *EWalletAccount) UnsetBalance()` + +UnsetBalance ensures that no value is present for Balance, not even an explicit nil +### GetPointBalance + +`func (o *EWalletAccount) GetPointBalance() float64` + +GetPointBalance returns the PointBalance field if non-nil, zero value otherwise. + +### GetPointBalanceOk + +`func (o *EWalletAccount) GetPointBalanceOk() (*float64, bool)` + +GetPointBalanceOk returns a tuple with the PointBalance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPointBalance + +`func (o *EWalletAccount) SetPointBalance(v float64)` + +SetPointBalance sets PointBalance field to given value. + +### HasPointBalance + +`func (o *EWalletAccount) HasPointBalance() bool` + +HasPointBalance returns a boolean if a field has been set. + +### SetPointBalanceNil + +`func (o *EWalletAccount) SetPointBalanceNil(b bool)` + + SetPointBalanceNil sets the value for PointBalance to be an explicit nil + +### UnsetPointBalance +`func (o *EWalletAccount) UnsetPointBalance()` + +UnsetPointBalance ensures that no value is present for PointBalance, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/EWalletChannelCode.md b/docs/payment_method/EWalletChannelCode.md new file mode 100644 index 00000000..f5f921e6 --- /dev/null +++ b/docs/payment_method/EWalletChannelCode.md @@ -0,0 +1,49 @@ +# EWalletChannelCode + +## Enum + + +* `GCASH` (value: `"GCASH"`) + +* `GRABPAY` (value: `"GRABPAY"`) + +* `PAYMAYA` (value: `"PAYMAYA"`) + +* `OVO` (value: `"OVO"`) + +* `DANA` (value: `"DANA"`) + +* `LINKAJA` (value: `"LINKAJA"`) + +* `SHOPEEPAY` (value: `"SHOPEEPAY"`) + +* `SAKUKU` (value: `"SAKUKU"`) + +* `NEXCASH` (value: `"NEXCASH"`) + +* `ASTRAPAY` (value: `"ASTRAPAY"`) + +* `JENIUSPAY` (value: `"JENIUSPAY"`) + +* `APPOTA` (value: `"APPOTA"`) + +* `MOMO` (value: `"MOMO"`) + +* `VNPTWALLET` (value: `"VNPTWALLET"`) + +* `VIETTELPAY` (value: `"VIETTELPAY"`) + +* `ZALOPAY` (value: `"ZALOPAY"`) + +* `WECHATPAY` (value: `"WECHATPAY"`) + +* `LINEPAY` (value: `"LINEPAY"`) + +* `TRUEMONEY` (value: `"TRUEMONEY"`) + +* `ALIPAY` (value: `"ALIPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/EWalletChannelProperties.md b/docs/payment_method/EWalletChannelProperties.md new file mode 100644 index 00000000..34a1c9cc --- /dev/null +++ b/docs/payment_method/EWalletChannelProperties.md @@ -0,0 +1,186 @@ +# EWalletChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CancelReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization cancelled | [optional] | +| **MobileNumber** | Pointer to **string** | Mobile number of customer in E.164 format (e.g. +628123123123). For OVO one time payment use only. | [optional] | +| **RedeemPoints** | Pointer to **string** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] | +| **Cashtag** | Pointer to **string** | Available for JENIUSPAY only | [optional] | + +## Methods + +### NewEWalletChannelProperties + +`func NewEWalletChannelProperties() *EWalletChannelProperties` + +NewEWalletChannelProperties instantiates a new EWalletChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletChannelPropertiesWithDefaults + +`func NewEWalletChannelPropertiesWithDefaults() *EWalletChannelProperties` + +NewEWalletChannelPropertiesWithDefaults instantiates a new EWalletChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *EWalletChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *EWalletChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *EWalletChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *EWalletChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *EWalletChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *EWalletChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *EWalletChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *EWalletChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetCancelReturnUrl + +`func (o *EWalletChannelProperties) GetCancelReturnUrl() string` + +GetCancelReturnUrl returns the CancelReturnUrl field if non-nil, zero value otherwise. + +### GetCancelReturnUrlOk + +`func (o *EWalletChannelProperties) GetCancelReturnUrlOk() (*string, bool)` + +GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelReturnUrl + +`func (o *EWalletChannelProperties) SetCancelReturnUrl(v string)` + +SetCancelReturnUrl sets CancelReturnUrl field to given value. + +### HasCancelReturnUrl + +`func (o *EWalletChannelProperties) HasCancelReturnUrl() bool` + +HasCancelReturnUrl returns a boolean if a field has been set. + +### GetMobileNumber + +`func (o *EWalletChannelProperties) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *EWalletChannelProperties) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *EWalletChannelProperties) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *EWalletChannelProperties) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### GetRedeemPoints + +`func (o *EWalletChannelProperties) GetRedeemPoints() string` + +GetRedeemPoints returns the RedeemPoints field if non-nil, zero value otherwise. + +### GetRedeemPointsOk + +`func (o *EWalletChannelProperties) GetRedeemPointsOk() (*string, bool)` + +GetRedeemPointsOk returns a tuple with the RedeemPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedeemPoints + +`func (o *EWalletChannelProperties) SetRedeemPoints(v string)` + +SetRedeemPoints sets RedeemPoints field to given value. + +### HasRedeemPoints + +`func (o *EWalletChannelProperties) HasRedeemPoints() bool` + +HasRedeemPoints returns a boolean if a field has been set. + +### GetCashtag + +`func (o *EWalletChannelProperties) GetCashtag() string` + +GetCashtag returns the Cashtag field if non-nil, zero value otherwise. + +### GetCashtagOk + +`func (o *EWalletChannelProperties) GetCashtagOk() (*string, bool)` + +GetCashtagOk returns a tuple with the Cashtag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCashtag + +`func (o *EWalletChannelProperties) SetCashtag(v string)` + +SetCashtag sets Cashtag field to given value. + +### HasCashtag + +`func (o *EWalletChannelProperties) HasCashtag() bool` + +HasCashtag returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/EWalletParameters.md b/docs/payment_method/EWalletParameters.md new file mode 100644 index 00000000..7bddbc71 --- /dev/null +++ b/docs/payment_method/EWalletParameters.md @@ -0,0 +1,103 @@ +# EWalletParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**EWalletChannelCode**](EWalletChannelCode.md) | | | +| **ChannelProperties** | Pointer to [**EWalletChannelProperties**](EWalletChannelProperties.md) | | [optional] | +| **Account** | Pointer to [**EWalletAccount**](EWalletAccount.md) | | [optional] | + +## Methods + +### NewEWalletParameters + +`func NewEWalletParameters(channelCode EWalletChannelCode, ) *EWalletParameters` + +NewEWalletParameters instantiates a new EWalletParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletParametersWithDefaults + +`func NewEWalletParametersWithDefaults() *EWalletParameters` + +NewEWalletParametersWithDefaults instantiates a new EWalletParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *EWalletParameters) GetChannelCode() EWalletChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *EWalletParameters) GetChannelCodeOk() (*EWalletChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *EWalletParameters) SetChannelCode(v EWalletChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *EWalletParameters) GetChannelProperties() EWalletChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *EWalletParameters) GetChannelPropertiesOk() (*EWalletChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *EWalletParameters) SetChannelProperties(v EWalletChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *EWalletParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetAccount + +`func (o *EWalletParameters) GetAccount() EWalletAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *EWalletParameters) GetAccountOk() (*EWalletAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *EWalletParameters) SetAccount(v EWalletAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *EWalletParameters) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/GetAllPaymentMethods400Response.md b/docs/payment_method/GetAllPaymentMethods400Response.md new file mode 100644 index 00000000..93ee6fc9 --- /dev/null +++ b/docs/payment_method/GetAllPaymentMethods400Response.md @@ -0,0 +1,82 @@ +# GetAllPaymentMethods400Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetAllPaymentMethods400Response + +`func NewGetAllPaymentMethods400Response() *GetAllPaymentMethods400Response` + +NewGetAllPaymentMethods400Response instantiates a new GetAllPaymentMethods400Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetAllPaymentMethods400ResponseWithDefaults + +`func NewGetAllPaymentMethods400ResponseWithDefaults() *GetAllPaymentMethods400Response` + +NewGetAllPaymentMethods400ResponseWithDefaults instantiates a new GetAllPaymentMethods400Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *GetAllPaymentMethods400Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *GetAllPaymentMethods400Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *GetAllPaymentMethods400Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *GetAllPaymentMethods400Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *GetAllPaymentMethods400Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *GetAllPaymentMethods400Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *GetAllPaymentMethods400Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *GetAllPaymentMethods400Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/GetAllPaymentMethods403Response.md b/docs/payment_method/GetAllPaymentMethods403Response.md new file mode 100644 index 00000000..bd3cbcc9 --- /dev/null +++ b/docs/payment_method/GetAllPaymentMethods403Response.md @@ -0,0 +1,82 @@ +# GetAllPaymentMethods403Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetAllPaymentMethods403Response + +`func NewGetAllPaymentMethods403Response() *GetAllPaymentMethods403Response` + +NewGetAllPaymentMethods403Response instantiates a new GetAllPaymentMethods403Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetAllPaymentMethods403ResponseWithDefaults + +`func NewGetAllPaymentMethods403ResponseWithDefaults() *GetAllPaymentMethods403Response` + +NewGetAllPaymentMethods403ResponseWithDefaults instantiates a new GetAllPaymentMethods403Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *GetAllPaymentMethods403Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *GetAllPaymentMethods403Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *GetAllPaymentMethods403Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *GetAllPaymentMethods403Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *GetAllPaymentMethods403Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *GetAllPaymentMethods403Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *GetAllPaymentMethods403Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *GetAllPaymentMethods403Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/GetAllPaymentMethods404Response.md b/docs/payment_method/GetAllPaymentMethods404Response.md new file mode 100644 index 00000000..0bd0a022 --- /dev/null +++ b/docs/payment_method/GetAllPaymentMethods404Response.md @@ -0,0 +1,82 @@ +# GetAllPaymentMethods404Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetAllPaymentMethods404Response + +`func NewGetAllPaymentMethods404Response() *GetAllPaymentMethods404Response` + +NewGetAllPaymentMethods404Response instantiates a new GetAllPaymentMethods404Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetAllPaymentMethods404ResponseWithDefaults + +`func NewGetAllPaymentMethods404ResponseWithDefaults() *GetAllPaymentMethods404Response` + +NewGetAllPaymentMethods404ResponseWithDefaults instantiates a new GetAllPaymentMethods404Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *GetAllPaymentMethods404Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *GetAllPaymentMethods404Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *GetAllPaymentMethods404Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *GetAllPaymentMethods404Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *GetAllPaymentMethods404Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *GetAllPaymentMethods404Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *GetAllPaymentMethods404Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *GetAllPaymentMethods404Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/GetAllPaymentMethodsDefaultResponse.md b/docs/payment_method/GetAllPaymentMethodsDefaultResponse.md new file mode 100644 index 00000000..de1936bd --- /dev/null +++ b/docs/payment_method/GetAllPaymentMethodsDefaultResponse.md @@ -0,0 +1,82 @@ +# GetAllPaymentMethodsDefaultResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetAllPaymentMethodsDefaultResponse + +`func NewGetAllPaymentMethodsDefaultResponse() *GetAllPaymentMethodsDefaultResponse` + +NewGetAllPaymentMethodsDefaultResponse instantiates a new GetAllPaymentMethodsDefaultResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetAllPaymentMethodsDefaultResponseWithDefaults + +`func NewGetAllPaymentMethodsDefaultResponseWithDefaults() *GetAllPaymentMethodsDefaultResponse` + +NewGetAllPaymentMethodsDefaultResponseWithDefaults instantiates a new GetAllPaymentMethodsDefaultResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *GetAllPaymentMethodsDefaultResponse) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *GetAllPaymentMethodsDefaultResponse) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *GetAllPaymentMethodsDefaultResponse) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *GetAllPaymentMethodsDefaultResponse) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *GetAllPaymentMethodsDefaultResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *GetAllPaymentMethodsDefaultResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *GetAllPaymentMethodsDefaultResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *GetAllPaymentMethodsDefaultResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounter.md b/docs/payment_method/OverTheCounter.md new file mode 100644 index 00000000..20cb98cc --- /dev/null +++ b/docs/payment_method/OverTheCounter.md @@ -0,0 +1,134 @@ +# OverTheCounter + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | | +| **ChannelProperties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | | + +## Methods + +### NewOverTheCounter + +`func NewOverTheCounter(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties, ) *OverTheCounter` + +NewOverTheCounter instantiates a new OverTheCounter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterWithDefaults + +`func NewOverTheCounterWithDefaults() *OverTheCounter` + +NewOverTheCounterWithDefaults instantiates a new OverTheCounter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *OverTheCounter) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *OverTheCounter) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *OverTheCounter) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *OverTheCounter) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *OverTheCounter) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *OverTheCounter) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *OverTheCounter) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *OverTheCounter) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *OverTheCounter) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *OverTheCounter) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *OverTheCounter) GetChannelCode() OverTheCounterChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *OverTheCounter) GetChannelCodeOk() (*OverTheCounterChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *OverTheCounter) SetChannelCode(v OverTheCounterChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *OverTheCounter) GetChannelProperties() OverTheCounterChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *OverTheCounter) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *OverTheCounter) SetChannelProperties(v OverTheCounterChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounterChannelCode.md b/docs/payment_method/OverTheCounterChannelCode.md new file mode 100644 index 00000000..340f17cc --- /dev/null +++ b/docs/payment_method/OverTheCounterChannelCode.md @@ -0,0 +1,41 @@ +# OverTheCounterChannelCode + +## Enum + + +* `_7_ELEVEN` (value: `"7ELEVEN"`) + +* `_7_ELEVEN_CLIQQ` (value: `"7ELEVEN_CLIQQ"`) + +* `CEBUANA` (value: `"CEBUANA"`) + +* `ECPAY` (value: `"ECPAY"`) + +* `PALAWAN` (value: `"PALAWAN"`) + +* `MLHUILLIER` (value: `"MLHUILLIER"`) + +* `ECPAY_DRAGONLOAN` (value: `"ECPAY_DRAGONLOAN"`) + +* `LBC` (value: `"LBC"`) + +* `ECPAY_SCHOOL` (value: `"ECPAY_SCHOOL"`) + +* `RD_PAWNSHOP` (value: `"RD_PAWNSHOP"`) + +* `CVM` (value: `"CVM"`) + +* `USSC` (value: `"USSC"`) + +* `SM_BILLS` (value: `"SM_BILLS"`) + +* `ROBINSONS_BILLS` (value: `"ROBINSONS_BILLS"`) + +* `ALFAMART` (value: `"ALFAMART"`) + +* `INDOMARET` (value: `"INDOMARET"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounterChannelProperties.md b/docs/payment_method/OverTheCounterChannelProperties.md new file mode 100644 index 00000000..5454d548 --- /dev/null +++ b/docs/payment_method/OverTheCounterChannelProperties.md @@ -0,0 +1,103 @@ +# OverTheCounterChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **PaymentCode** | Pointer to **string** | The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random. | [optional] | +| **CustomerName** | **string** | Name of customer. | | +| **ExpiresAt** | Pointer to **time.Time** | The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. | [optional] | + +## Methods + +### NewOverTheCounterChannelProperties + +`func NewOverTheCounterChannelProperties(customerName string, ) *OverTheCounterChannelProperties` + +NewOverTheCounterChannelProperties instantiates a new OverTheCounterChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterChannelPropertiesWithDefaults + +`func NewOverTheCounterChannelPropertiesWithDefaults() *OverTheCounterChannelProperties` + +NewOverTheCounterChannelPropertiesWithDefaults instantiates a new OverTheCounterChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPaymentCode + +`func (o *OverTheCounterChannelProperties) GetPaymentCode() string` + +GetPaymentCode returns the PaymentCode field if non-nil, zero value otherwise. + +### GetPaymentCodeOk + +`func (o *OverTheCounterChannelProperties) GetPaymentCodeOk() (*string, bool)` + +GetPaymentCodeOk returns a tuple with the PaymentCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentCode + +`func (o *OverTheCounterChannelProperties) SetPaymentCode(v string)` + +SetPaymentCode sets PaymentCode field to given value. + +### HasPaymentCode + +`func (o *OverTheCounterChannelProperties) HasPaymentCode() bool` + +HasPaymentCode returns a boolean if a field has been set. + +### GetCustomerName + +`func (o *OverTheCounterChannelProperties) GetCustomerName() string` + +GetCustomerName returns the CustomerName field if non-nil, zero value otherwise. + +### GetCustomerNameOk + +`func (o *OverTheCounterChannelProperties) GetCustomerNameOk() (*string, bool)` + +GetCustomerNameOk returns a tuple with the CustomerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerName + +`func (o *OverTheCounterChannelProperties) SetCustomerName(v string)` + +SetCustomerName sets CustomerName field to given value. + + +### GetExpiresAt + +`func (o *OverTheCounterChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *OverTheCounterChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *OverTheCounterChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *OverTheCounterChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounterChannelPropertiesUpdate.md b/docs/payment_method/OverTheCounterChannelPropertiesUpdate.md new file mode 100644 index 00000000..946ab2e2 --- /dev/null +++ b/docs/payment_method/OverTheCounterChannelPropertiesUpdate.md @@ -0,0 +1,82 @@ +# OverTheCounterChannelPropertiesUpdate + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **CustomerName** | Pointer to **string** | Name of customer. | [optional] | +| **ExpiresAt** | Pointer to **time.Time** | The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. | [optional] | + +## Methods + +### NewOverTheCounterChannelPropertiesUpdate + +`func NewOverTheCounterChannelPropertiesUpdate() *OverTheCounterChannelPropertiesUpdate` + +NewOverTheCounterChannelPropertiesUpdate instantiates a new OverTheCounterChannelPropertiesUpdate object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterChannelPropertiesUpdateWithDefaults + +`func NewOverTheCounterChannelPropertiesUpdateWithDefaults() *OverTheCounterChannelPropertiesUpdate` + +NewOverTheCounterChannelPropertiesUpdateWithDefaults instantiates a new OverTheCounterChannelPropertiesUpdate object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerName + +`func (o *OverTheCounterChannelPropertiesUpdate) GetCustomerName() string` + +GetCustomerName returns the CustomerName field if non-nil, zero value otherwise. + +### GetCustomerNameOk + +`func (o *OverTheCounterChannelPropertiesUpdate) GetCustomerNameOk() (*string, bool)` + +GetCustomerNameOk returns a tuple with the CustomerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerName + +`func (o *OverTheCounterChannelPropertiesUpdate) SetCustomerName(v string)` + +SetCustomerName sets CustomerName field to given value. + +### HasCustomerName + +`func (o *OverTheCounterChannelPropertiesUpdate) HasCustomerName() bool` + +HasCustomerName returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *OverTheCounterChannelPropertiesUpdate) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *OverTheCounterChannelPropertiesUpdate) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *OverTheCounterChannelPropertiesUpdate) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *OverTheCounterChannelPropertiesUpdate) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounterParameters.md b/docs/payment_method/OverTheCounterParameters.md new file mode 100644 index 00000000..5d68b8d2 --- /dev/null +++ b/docs/payment_method/OverTheCounterParameters.md @@ -0,0 +1,134 @@ +# OverTheCounterParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | | +| **ChannelProperties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | | + +## Methods + +### NewOverTheCounterParameters + +`func NewOverTheCounterParameters(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties, ) *OverTheCounterParameters` + +NewOverTheCounterParameters instantiates a new OverTheCounterParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterParametersWithDefaults + +`func NewOverTheCounterParametersWithDefaults() *OverTheCounterParameters` + +NewOverTheCounterParametersWithDefaults instantiates a new OverTheCounterParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *OverTheCounterParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *OverTheCounterParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *OverTheCounterParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *OverTheCounterParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *OverTheCounterParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *OverTheCounterParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *OverTheCounterParameters) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *OverTheCounterParameters) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *OverTheCounterParameters) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *OverTheCounterParameters) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *OverTheCounterParameters) GetChannelCode() OverTheCounterChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *OverTheCounterParameters) GetChannelCodeOk() (*OverTheCounterChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *OverTheCounterParameters) SetChannelCode(v OverTheCounterChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *OverTheCounterParameters) GetChannelProperties() OverTheCounterChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *OverTheCounterParameters) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *OverTheCounterParameters) SetChannelProperties(v OverTheCounterChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/OverTheCounterUpdateParameters.md b/docs/payment_method/OverTheCounterUpdateParameters.md new file mode 100644 index 00000000..9110e40d --- /dev/null +++ b/docs/payment_method/OverTheCounterUpdateParameters.md @@ -0,0 +1,92 @@ +# OverTheCounterUpdateParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **ChannelProperties** | Pointer to [**OverTheCounterChannelPropertiesUpdate**](OverTheCounterChannelPropertiesUpdate.md) | | [optional] | + +## Methods + +### NewOverTheCounterUpdateParameters + +`func NewOverTheCounterUpdateParameters() *OverTheCounterUpdateParameters` + +NewOverTheCounterUpdateParameters instantiates a new OverTheCounterUpdateParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterUpdateParametersWithDefaults + +`func NewOverTheCounterUpdateParametersWithDefaults() *OverTheCounterUpdateParameters` + +NewOverTheCounterUpdateParametersWithDefaults instantiates a new OverTheCounterUpdateParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *OverTheCounterUpdateParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *OverTheCounterUpdateParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *OverTheCounterUpdateParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *OverTheCounterUpdateParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *OverTheCounterUpdateParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *OverTheCounterUpdateParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetChannelProperties + +`func (o *OverTheCounterUpdateParameters) GetChannelProperties() OverTheCounterChannelPropertiesUpdate` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *OverTheCounterUpdateParameters) GetChannelPropertiesOk() (*OverTheCounterChannelPropertiesUpdate, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *OverTheCounterUpdateParameters) SetChannelProperties(v OverTheCounterChannelPropertiesUpdate)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *OverTheCounterUpdateParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentChannel.md b/docs/payment_method/PaymentChannel.md new file mode 100644 index 00000000..74530869 --- /dev/null +++ b/docs/payment_method/PaymentChannel.md @@ -0,0 +1,212 @@ +# PaymentChannel + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to **string** | The specific Xendit code used to identify the partner channel | [optional] | +| **Type** | Pointer to **string** | The payment method type | [optional] | +| **Country** | Pointer to **string** | The country where the channel operates in ISO 3166-2 country code | [optional] | +| **ChannelName** | Pointer to **string** | Official parter name of the payment channel | [optional] | +| **ChannelProperties** | Pointer to [**ChannelProperty[]**](ChannelProperty.md) | | [optional] | +| **LogoUrl** | Pointer to **string** | If available, this contains a URL to the logo of the partner channel | [optional] | +| **AmountLimits** | Pointer to [**ChannelAmountLimits[]**](ChannelAmountLimits.md) | | [optional] | + +## Methods + +### NewPaymentChannel + +`func NewPaymentChannel() *PaymentChannel` + +NewPaymentChannel instantiates a new PaymentChannel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentChannelWithDefaults + +`func NewPaymentChannelWithDefaults() *PaymentChannel` + +NewPaymentChannelWithDefaults instantiates a new PaymentChannel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *PaymentChannel) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *PaymentChannel) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *PaymentChannel) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *PaymentChannel) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### GetType + +`func (o *PaymentChannel) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentChannel) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentChannel) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PaymentChannel) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCountry + +`func (o *PaymentChannel) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentChannel) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentChannel) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PaymentChannel) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetChannelName + +`func (o *PaymentChannel) GetChannelName() string` + +GetChannelName returns the ChannelName field if non-nil, zero value otherwise. + +### GetChannelNameOk + +`func (o *PaymentChannel) GetChannelNameOk() (*string, bool)` + +GetChannelNameOk returns a tuple with the ChannelName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelName + +`func (o *PaymentChannel) SetChannelName(v string)` + +SetChannelName sets ChannelName field to given value. + +### HasChannelName + +`func (o *PaymentChannel) HasChannelName() bool` + +HasChannelName returns a boolean if a field has been set. + +### GetChannelProperties + +`func (o *PaymentChannel) GetChannelProperties() []ChannelProperty` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *PaymentChannel) GetChannelPropertiesOk() (*[]ChannelProperty, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *PaymentChannel) SetChannelProperties(v []ChannelProperty)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *PaymentChannel) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetLogoUrl + +`func (o *PaymentChannel) GetLogoUrl() string` + +GetLogoUrl returns the LogoUrl field if non-nil, zero value otherwise. + +### GetLogoUrlOk + +`func (o *PaymentChannel) GetLogoUrlOk() (*string, bool)` + +GetLogoUrlOk returns a tuple with the LogoUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogoUrl + +`func (o *PaymentChannel) SetLogoUrl(v string)` + +SetLogoUrl sets LogoUrl field to given value. + +### HasLogoUrl + +`func (o *PaymentChannel) HasLogoUrl() bool` + +HasLogoUrl returns a boolean if a field has been set. + +### GetAmountLimits + +`func (o *PaymentChannel) GetAmountLimits() []ChannelAmountLimits` + +GetAmountLimits returns the AmountLimits field if non-nil, zero value otherwise. + +### GetAmountLimitsOk + +`func (o *PaymentChannel) GetAmountLimitsOk() (*[]ChannelAmountLimits, bool)` + +GetAmountLimitsOk returns a tuple with the AmountLimits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountLimits + +`func (o *PaymentChannel) SetAmountLimits(v []ChannelAmountLimits)` + +SetAmountLimits sets AmountLimits field to given value. + +### HasAmountLimits + +`func (o *PaymentChannel) HasAmountLimits() bool` + +HasAmountLimits returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentChannelAllOf.md b/docs/payment_method/PaymentChannelAllOf.md new file mode 100644 index 00000000..692ad34a --- /dev/null +++ b/docs/payment_method/PaymentChannelAllOf.md @@ -0,0 +1,212 @@ +# PaymentChannelAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to **string** | The specific Xendit code used to identify the partner channel | [optional] | +| **Type** | Pointer to **string** | The payment method type | [optional] | +| **Country** | Pointer to **string** | The country where the channel operates in ISO 3166-2 country code | [optional] | +| **ChannelName** | Pointer to **string** | Official parter name of the payment channel | [optional] | +| **ChannelProperties** | Pointer to [**ChannelProperty[]**](ChannelProperty.md) | | [optional] | +| **LogoUrl** | Pointer to **string** | If available, this contains a URL to the logo of the partner channel | [optional] | +| **AmountLimits** | Pointer to [**ChannelAmountLimits[]**](ChannelAmountLimits.md) | | [optional] | + +## Methods + +### NewPaymentChannelAllOf + +`func NewPaymentChannelAllOf() *PaymentChannelAllOf` + +NewPaymentChannelAllOf instantiates a new PaymentChannelAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentChannelAllOfWithDefaults + +`func NewPaymentChannelAllOfWithDefaults() *PaymentChannelAllOf` + +NewPaymentChannelAllOfWithDefaults instantiates a new PaymentChannelAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *PaymentChannelAllOf) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *PaymentChannelAllOf) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *PaymentChannelAllOf) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *PaymentChannelAllOf) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### GetType + +`func (o *PaymentChannelAllOf) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentChannelAllOf) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentChannelAllOf) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PaymentChannelAllOf) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCountry + +`func (o *PaymentChannelAllOf) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentChannelAllOf) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentChannelAllOf) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PaymentChannelAllOf) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetChannelName + +`func (o *PaymentChannelAllOf) GetChannelName() string` + +GetChannelName returns the ChannelName field if non-nil, zero value otherwise. + +### GetChannelNameOk + +`func (o *PaymentChannelAllOf) GetChannelNameOk() (*string, bool)` + +GetChannelNameOk returns a tuple with the ChannelName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelName + +`func (o *PaymentChannelAllOf) SetChannelName(v string)` + +SetChannelName sets ChannelName field to given value. + +### HasChannelName + +`func (o *PaymentChannelAllOf) HasChannelName() bool` + +HasChannelName returns a boolean if a field has been set. + +### GetChannelProperties + +`func (o *PaymentChannelAllOf) GetChannelProperties() []ChannelProperty` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *PaymentChannelAllOf) GetChannelPropertiesOk() (*[]ChannelProperty, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *PaymentChannelAllOf) SetChannelProperties(v []ChannelProperty)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *PaymentChannelAllOf) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetLogoUrl + +`func (o *PaymentChannelAllOf) GetLogoUrl() string` + +GetLogoUrl returns the LogoUrl field if non-nil, zero value otherwise. + +### GetLogoUrlOk + +`func (o *PaymentChannelAllOf) GetLogoUrlOk() (*string, bool)` + +GetLogoUrlOk returns a tuple with the LogoUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogoUrl + +`func (o *PaymentChannelAllOf) SetLogoUrl(v string)` + +SetLogoUrl sets LogoUrl field to given value. + +### HasLogoUrl + +`func (o *PaymentChannelAllOf) HasLogoUrl() bool` + +HasLogoUrl returns a boolean if a field has been set. + +### GetAmountLimits + +`func (o *PaymentChannelAllOf) GetAmountLimits() []ChannelAmountLimits` + +GetAmountLimits returns the AmountLimits field if non-nil, zero value otherwise. + +### GetAmountLimitsOk + +`func (o *PaymentChannelAllOf) GetAmountLimitsOk() (*[]ChannelAmountLimits, bool)` + +GetAmountLimitsOk returns a tuple with the AmountLimits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountLimits + +`func (o *PaymentChannelAllOf) SetAmountLimits(v []ChannelAmountLimits)` + +SetAmountLimits sets AmountLimits field to given value. + +### HasAmountLimits + +`func (o *PaymentChannelAllOf) HasAmountLimits() bool` + +HasAmountLimits returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentChannelList.md b/docs/payment_method/PaymentChannelList.md new file mode 100644 index 00000000..8640f817 --- /dev/null +++ b/docs/payment_method/PaymentChannelList.md @@ -0,0 +1,108 @@ +# PaymentChannelList + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | Pointer to [**PaymentChannel[]**](PaymentChannel.md) | Array of resources that match the provided filters | [optional] | +| **Links** | Pointer to [**PaymentChannelListLinksInner[]**](PaymentChannelListLinksInner.md) | Array of objects that can be used to assist on navigating through the data | [optional] | +| **HasMore** | Pointer to **bool** | Indicates whether there are more items in the list | [optional] | + +## Methods + +### NewPaymentChannelList + +`func NewPaymentChannelList() *PaymentChannelList` + +NewPaymentChannelList instantiates a new PaymentChannelList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentChannelListWithDefaults + +`func NewPaymentChannelListWithDefaults() *PaymentChannelList` + +NewPaymentChannelListWithDefaults instantiates a new PaymentChannelList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *PaymentChannelList) GetData() []PaymentChannel` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PaymentChannelList) GetDataOk() (*[]PaymentChannel, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PaymentChannelList) SetData(v []PaymentChannel)` + +SetData sets Data field to given value. + +### HasData + +`func (o *PaymentChannelList) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetLinks + +`func (o *PaymentChannelList) GetLinks() []PaymentChannelListLinksInner` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *PaymentChannelList) GetLinksOk() (*[]PaymentChannelListLinksInner, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *PaymentChannelList) SetLinks(v []PaymentChannelListLinksInner)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *PaymentChannelList) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + +### GetHasMore + +`func (o *PaymentChannelList) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *PaymentChannelList) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *PaymentChannelList) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + +### HasHasMore + +`func (o *PaymentChannelList) HasHasMore() bool` + +HasHasMore returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentChannelListLinksInner.md b/docs/payment_method/PaymentChannelListLinksInner.md new file mode 100644 index 00000000..a5e7095a --- /dev/null +++ b/docs/payment_method/PaymentChannelListLinksInner.md @@ -0,0 +1,108 @@ +# PaymentChannelListLinksInner + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Href** | Pointer to **string** | Target URI that should contain a target to Internationalized Resource Identifiers (IRI) | [optional] | +| **Rel** | Pointer to **string** | The link relation type described how the current context (source) is related to target resource | [optional] | +| **Method** | Pointer to **string** | The HTTP method to be used to call `href` | [optional] | + +## Methods + +### NewPaymentChannelListLinksInner + +`func NewPaymentChannelListLinksInner() *PaymentChannelListLinksInner` + +NewPaymentChannelListLinksInner instantiates a new PaymentChannelListLinksInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentChannelListLinksInnerWithDefaults + +`func NewPaymentChannelListLinksInnerWithDefaults() *PaymentChannelListLinksInner` + +NewPaymentChannelListLinksInnerWithDefaults instantiates a new PaymentChannelListLinksInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *PaymentChannelListLinksInner) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PaymentChannelListLinksInner) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PaymentChannelListLinksInner) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PaymentChannelListLinksInner) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetRel + +`func (o *PaymentChannelListLinksInner) GetRel() string` + +GetRel returns the Rel field if non-nil, zero value otherwise. + +### GetRelOk + +`func (o *PaymentChannelListLinksInner) GetRelOk() (*string, bool)` + +GetRelOk returns a tuple with the Rel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRel + +`func (o *PaymentChannelListLinksInner) SetRel(v string)` + +SetRel sets Rel field to given value. + +### HasRel + +`func (o *PaymentChannelListLinksInner) HasRel() bool` + +HasRel returns a boolean if a field has been set. + +### GetMethod + +`func (o *PaymentChannelListLinksInner) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *PaymentChannelListLinksInner) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *PaymentChannelListLinksInner) SetMethod(v string)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *PaymentChannelListLinksInner) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentChannelListLinksInnerAllOf.md b/docs/payment_method/PaymentChannelListLinksInnerAllOf.md new file mode 100644 index 00000000..3ee84f30 --- /dev/null +++ b/docs/payment_method/PaymentChannelListLinksInnerAllOf.md @@ -0,0 +1,108 @@ +# PaymentChannelListLinksInnerAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Href** | Pointer to **string** | Target URI that should contain a target to Internationalized Resource Identifiers (IRI) | [optional] | +| **Rel** | Pointer to **string** | The link relation type described how the current context (source) is related to target resource | [optional] | +| **Method** | Pointer to **string** | The HTTP method to be used to call `href` | [optional] | + +## Methods + +### NewPaymentChannelListLinksInnerAllOf + +`func NewPaymentChannelListLinksInnerAllOf() *PaymentChannelListLinksInnerAllOf` + +NewPaymentChannelListLinksInnerAllOf instantiates a new PaymentChannelListLinksInnerAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentChannelListLinksInnerAllOfWithDefaults + +`func NewPaymentChannelListLinksInnerAllOfWithDefaults() *PaymentChannelListLinksInnerAllOf` + +NewPaymentChannelListLinksInnerAllOfWithDefaults instantiates a new PaymentChannelListLinksInnerAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *PaymentChannelListLinksInnerAllOf) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PaymentChannelListLinksInnerAllOf) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PaymentChannelListLinksInnerAllOf) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PaymentChannelListLinksInnerAllOf) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetRel + +`func (o *PaymentChannelListLinksInnerAllOf) GetRel() string` + +GetRel returns the Rel field if non-nil, zero value otherwise. + +### GetRelOk + +`func (o *PaymentChannelListLinksInnerAllOf) GetRelOk() (*string, bool)` + +GetRelOk returns a tuple with the Rel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRel + +`func (o *PaymentChannelListLinksInnerAllOf) SetRel(v string)` + +SetRel sets Rel field to given value. + +### HasRel + +`func (o *PaymentChannelListLinksInnerAllOf) HasRel() bool` + +HasRel returns a boolean if a field has been set. + +### GetMethod + +`func (o *PaymentChannelListLinksInnerAllOf) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *PaymentChannelListLinksInnerAllOf) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *PaymentChannelListLinksInnerAllOf) SetMethod(v string)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *PaymentChannelListLinksInnerAllOf) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethod.md b/docs/payment_method/PaymentMethod.md new file mode 100644 index 00000000..5ee7976a --- /dev/null +++ b/docs/payment_method/PaymentMethod.md @@ -0,0 +1,717 @@ +# PaymentMethod + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | | | +| **BusinessId** | Pointer to **string** | | [optional] | +| **Type** | Pointer to [**PaymentMethodType**](PaymentMethodType.md) | | [optional] | +| **Country** | Pointer to [**PaymentMethodCountry**](PaymentMethodCountry.md) | | [optional] | +| **CustomerId** | Pointer to **NullableString** | | [optional] | +| **Customer** | Pointer to **map[string]interface{}** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Description** | Pointer to **NullableString** | | [optional] | +| **Status** | Pointer to [**PaymentMethodStatus**](PaymentMethodStatus.md) | | [optional] | +| **Reusability** | Pointer to [**PaymentMethodReusability**](PaymentMethodReusability.md) | | [optional] | +| **Actions** | Pointer to [**PaymentMethodAction[]**](PaymentMethodAction.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | +| **BillingInformation** | Pointer to [**NullableBillingInformation**](BillingInformation.md) | | [optional] | +| **FailureCode** | Pointer to **NullableString** | | [optional] | +| **Created** | Pointer to **time.Time** | | [optional] | +| **Updated** | Pointer to **time.Time** | | [optional] | +| **Ewallet** | Pointer to [**NullableEWallet**](EWallet.md) | | [optional] | +| **DirectDebit** | Pointer to [**NullableDirectDebit**](DirectDebit.md) | | [optional] | +| **OverTheCounter** | Pointer to [**NullableOverTheCounter**](OverTheCounter.md) | | [optional] | +| **Card** | Pointer to [**NullableCard**](Card.md) | | [optional] | +| **QrCode** | Pointer to [**NullableQRCode**](QRCode.md) | | [optional] | +| **VirtualAccount** | Pointer to [**NullableVirtualAccount**](VirtualAccount.md) | | [optional] | + +## Methods + +### NewPaymentMethod + +`func NewPaymentMethod(id string, ) *PaymentMethod` + +NewPaymentMethod instantiates a new PaymentMethod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodWithDefaults + +`func NewPaymentMethodWithDefaults() *PaymentMethod` + +NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PaymentMethod) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PaymentMethod) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PaymentMethod) SetId(v string)` + +SetId sets Id field to given value. + + +### GetBusinessId + +`func (o *PaymentMethod) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *PaymentMethod) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *PaymentMethod) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + +### HasBusinessId + +`func (o *PaymentMethod) HasBusinessId() bool` + +HasBusinessId returns a boolean if a field has been set. + +### GetType + +`func (o *PaymentMethod) GetType() PaymentMethodType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentMethod) GetTypeOk() (*PaymentMethodType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentMethod) SetType(v PaymentMethodType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PaymentMethod) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCountry + +`func (o *PaymentMethod) GetCountry() PaymentMethodCountry` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentMethod) GetCountryOk() (*PaymentMethodCountry, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentMethod) SetCountry(v PaymentMethodCountry)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PaymentMethod) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCustomerId + +`func (o *PaymentMethod) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *PaymentMethod) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *PaymentMethod) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *PaymentMethod) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *PaymentMethod) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *PaymentMethod) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetCustomer + +`func (o *PaymentMethod) GetCustomer() map[string]interface{}` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *PaymentMethod) GetCustomerOk() (*map[string]interface{}, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *PaymentMethod) SetCustomer(v map[string]interface{})` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *PaymentMethod) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### SetCustomerNil + +`func (o *PaymentMethod) SetCustomerNil(b bool)` + + SetCustomerNil sets the value for Customer to be an explicit nil + +### UnsetCustomer +`func (o *PaymentMethod) UnsetCustomer()` + +UnsetCustomer ensures that no value is present for Customer, not even an explicit nil +### GetReferenceId + +`func (o *PaymentMethod) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentMethod) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentMethod) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentMethod) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetDescription + +`func (o *PaymentMethod) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentMethod) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentMethod) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentMethod) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentMethod) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentMethod) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetStatus + +`func (o *PaymentMethod) GetStatus() PaymentMethodStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PaymentMethod) GetStatusOk() (*PaymentMethodStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PaymentMethod) SetStatus(v PaymentMethodStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *PaymentMethod) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetReusability + +`func (o *PaymentMethod) GetReusability() PaymentMethodReusability` + +GetReusability returns the Reusability field if non-nil, zero value otherwise. + +### GetReusabilityOk + +`func (o *PaymentMethod) GetReusabilityOk() (*PaymentMethodReusability, bool)` + +GetReusabilityOk returns a tuple with the Reusability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReusability + +`func (o *PaymentMethod) SetReusability(v PaymentMethodReusability)` + +SetReusability sets Reusability field to given value. + +### HasReusability + +`func (o *PaymentMethod) HasReusability() bool` + +HasReusability returns a boolean if a field has been set. + +### GetActions + +`func (o *PaymentMethod) GetActions() []PaymentMethodAction` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *PaymentMethod) GetActionsOk() (*[]PaymentMethodAction, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *PaymentMethod) SetActions(v []PaymentMethodAction)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *PaymentMethod) HasActions() bool` + +HasActions returns a boolean if a field has been set. + +### GetMetadata + +`func (o *PaymentMethod) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentMethod) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentMethod) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentMethod) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentMethod) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentMethod) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil +### GetBillingInformation + +`func (o *PaymentMethod) GetBillingInformation() BillingInformation` + +GetBillingInformation returns the BillingInformation field if non-nil, zero value otherwise. + +### GetBillingInformationOk + +`func (o *PaymentMethod) GetBillingInformationOk() (*BillingInformation, bool)` + +GetBillingInformationOk returns a tuple with the BillingInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingInformation + +`func (o *PaymentMethod) SetBillingInformation(v BillingInformation)` + +SetBillingInformation sets BillingInformation field to given value. + +### HasBillingInformation + +`func (o *PaymentMethod) HasBillingInformation() bool` + +HasBillingInformation returns a boolean if a field has been set. + +### SetBillingInformationNil + +`func (o *PaymentMethod) SetBillingInformationNil(b bool)` + + SetBillingInformationNil sets the value for BillingInformation to be an explicit nil + +### UnsetBillingInformation +`func (o *PaymentMethod) UnsetBillingInformation()` + +UnsetBillingInformation ensures that no value is present for BillingInformation, not even an explicit nil +### GetFailureCode + +`func (o *PaymentMethod) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *PaymentMethod) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *PaymentMethod) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *PaymentMethod) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### SetFailureCodeNil + +`func (o *PaymentMethod) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *PaymentMethod) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetCreated + +`func (o *PaymentMethod) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentMethod) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentMethod) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *PaymentMethod) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetUpdated + +`func (o *PaymentMethod) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *PaymentMethod) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *PaymentMethod) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + +### HasUpdated + +`func (o *PaymentMethod) HasUpdated() bool` + +HasUpdated returns a boolean if a field has been set. + +### GetEwallet + +`func (o *PaymentMethod) GetEwallet() EWallet` + +GetEwallet returns the Ewallet field if non-nil, zero value otherwise. + +### GetEwalletOk + +`func (o *PaymentMethod) GetEwalletOk() (*EWallet, bool)` + +GetEwalletOk returns a tuple with the Ewallet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwallet + +`func (o *PaymentMethod) SetEwallet(v EWallet)` + +SetEwallet sets Ewallet field to given value. + +### HasEwallet + +`func (o *PaymentMethod) HasEwallet() bool` + +HasEwallet returns a boolean if a field has been set. + +### SetEwalletNil + +`func (o *PaymentMethod) SetEwalletNil(b bool)` + + SetEwalletNil sets the value for Ewallet to be an explicit nil + +### UnsetEwallet +`func (o *PaymentMethod) UnsetEwallet()` + +UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +### GetDirectDebit + +`func (o *PaymentMethod) GetDirectDebit() DirectDebit` + +GetDirectDebit returns the DirectDebit field if non-nil, zero value otherwise. + +### GetDirectDebitOk + +`func (o *PaymentMethod) GetDirectDebitOk() (*DirectDebit, bool)` + +GetDirectDebitOk returns a tuple with the DirectDebit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectDebit + +`func (o *PaymentMethod) SetDirectDebit(v DirectDebit)` + +SetDirectDebit sets DirectDebit field to given value. + +### HasDirectDebit + +`func (o *PaymentMethod) HasDirectDebit() bool` + +HasDirectDebit returns a boolean if a field has been set. + +### SetDirectDebitNil + +`func (o *PaymentMethod) SetDirectDebitNil(b bool)` + + SetDirectDebitNil sets the value for DirectDebit to be an explicit nil + +### UnsetDirectDebit +`func (o *PaymentMethod) UnsetDirectDebit()` + +UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +### GetOverTheCounter + +`func (o *PaymentMethod) GetOverTheCounter() OverTheCounter` + +GetOverTheCounter returns the OverTheCounter field if non-nil, zero value otherwise. + +### GetOverTheCounterOk + +`func (o *PaymentMethod) GetOverTheCounterOk() (*OverTheCounter, bool)` + +GetOverTheCounterOk returns a tuple with the OverTheCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverTheCounter + +`func (o *PaymentMethod) SetOverTheCounter(v OverTheCounter)` + +SetOverTheCounter sets OverTheCounter field to given value. + +### HasOverTheCounter + +`func (o *PaymentMethod) HasOverTheCounter() bool` + +HasOverTheCounter returns a boolean if a field has been set. + +### SetOverTheCounterNil + +`func (o *PaymentMethod) SetOverTheCounterNil(b bool)` + + SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil + +### UnsetOverTheCounter +`func (o *PaymentMethod) UnsetOverTheCounter()` + +UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +### GetCard + +`func (o *PaymentMethod) GetCard() Card` + +GetCard returns the Card field if non-nil, zero value otherwise. + +### GetCardOk + +`func (o *PaymentMethod) GetCardOk() (*Card, bool)` + +GetCardOk returns a tuple with the Card field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCard + +`func (o *PaymentMethod) SetCard(v Card)` + +SetCard sets Card field to given value. + +### HasCard + +`func (o *PaymentMethod) HasCard() bool` + +HasCard returns a boolean if a field has been set. + +### SetCardNil + +`func (o *PaymentMethod) SetCardNil(b bool)` + + SetCardNil sets the value for Card to be an explicit nil + +### UnsetCard +`func (o *PaymentMethod) UnsetCard()` + +UnsetCard ensures that no value is present for Card, not even an explicit nil +### GetQrCode + +`func (o *PaymentMethod) GetQrCode() QRCode` + +GetQrCode returns the QrCode field if non-nil, zero value otherwise. + +### GetQrCodeOk + +`func (o *PaymentMethod) GetQrCodeOk() (*QRCode, bool)` + +GetQrCodeOk returns a tuple with the QrCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCode + +`func (o *PaymentMethod) SetQrCode(v QRCode)` + +SetQrCode sets QrCode field to given value. + +### HasQrCode + +`func (o *PaymentMethod) HasQrCode() bool` + +HasQrCode returns a boolean if a field has been set. + +### SetQrCodeNil + +`func (o *PaymentMethod) SetQrCodeNil(b bool)` + + SetQrCodeNil sets the value for QrCode to be an explicit nil + +### UnsetQrCode +`func (o *PaymentMethod) UnsetQrCode()` + +UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil +### GetVirtualAccount + +`func (o *PaymentMethod) GetVirtualAccount() VirtualAccount` + +GetVirtualAccount returns the VirtualAccount field if non-nil, zero value otherwise. + +### GetVirtualAccountOk + +`func (o *PaymentMethod) GetVirtualAccountOk() (*VirtualAccount, bool)` + +GetVirtualAccountOk returns a tuple with the VirtualAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccount + +`func (o *PaymentMethod) SetVirtualAccount(v VirtualAccount)` + +SetVirtualAccount sets VirtualAccount field to given value. + +### HasVirtualAccount + +`func (o *PaymentMethod) HasVirtualAccount() bool` + +HasVirtualAccount returns a boolean if a field has been set. + +### SetVirtualAccountNil + +`func (o *PaymentMethod) SetVirtualAccountNil(b bool)` + + SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil + +### UnsetVirtualAccount +`func (o *PaymentMethod) UnsetVirtualAccount()` + +UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodAction.md b/docs/payment_method/PaymentMethodAction.md new file mode 100644 index 00000000..36a22386 --- /dev/null +++ b/docs/payment_method/PaymentMethodAction.md @@ -0,0 +1,134 @@ +# PaymentMethodAction + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Action** | Pointer to **string** | | [optional] | +| **Method** | Pointer to **string** | | [optional] | +| **Url** | Pointer to **string** | | [optional] | +| **UrlType** | Pointer to **string** | | [optional] | + +## Methods + +### NewPaymentMethodAction + +`func NewPaymentMethodAction() *PaymentMethodAction` + +NewPaymentMethodAction instantiates a new PaymentMethodAction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodActionWithDefaults + +`func NewPaymentMethodActionWithDefaults() *PaymentMethodAction` + +NewPaymentMethodActionWithDefaults instantiates a new PaymentMethodAction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *PaymentMethodAction) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *PaymentMethodAction) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *PaymentMethodAction) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *PaymentMethodAction) HasAction() bool` + +HasAction returns a boolean if a field has been set. + +### GetMethod + +`func (o *PaymentMethodAction) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *PaymentMethodAction) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *PaymentMethodAction) SetMethod(v string)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *PaymentMethodAction) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + +### GetUrl + +`func (o *PaymentMethodAction) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *PaymentMethodAction) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *PaymentMethodAction) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *PaymentMethodAction) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetUrlType + +`func (o *PaymentMethodAction) GetUrlType() string` + +GetUrlType returns the UrlType field if non-nil, zero value otherwise. + +### GetUrlTypeOk + +`func (o *PaymentMethodAction) GetUrlTypeOk() (*string, bool)` + +GetUrlTypeOk returns a tuple with the UrlType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrlType + +`func (o *PaymentMethodAction) SetUrlType(v string)` + +SetUrlType sets UrlType field to given value. + +### HasUrlType + +`func (o *PaymentMethodAction) HasUrlType() bool` + +HasUrlType returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodAuthParameters.md b/docs/payment_method/PaymentMethodAuthParameters.md new file mode 100644 index 00000000..8278b88c --- /dev/null +++ b/docs/payment_method/PaymentMethodAuthParameters.md @@ -0,0 +1,51 @@ +# PaymentMethodAuthParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **AuthCode** | **string** | | | + +## Methods + +### NewPaymentMethodAuthParameters + +`func NewPaymentMethodAuthParameters(authCode string, ) *PaymentMethodAuthParameters` + +NewPaymentMethodAuthParameters instantiates a new PaymentMethodAuthParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodAuthParametersWithDefaults + +`func NewPaymentMethodAuthParametersWithDefaults() *PaymentMethodAuthParameters` + +NewPaymentMethodAuthParametersWithDefaults instantiates a new PaymentMethodAuthParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAuthCode + +`func (o *PaymentMethodAuthParameters) GetAuthCode() string` + +GetAuthCode returns the AuthCode field if non-nil, zero value otherwise. + +### GetAuthCodeOk + +`func (o *PaymentMethodAuthParameters) GetAuthCodeOk() (*string, bool)` + +GetAuthCodeOk returns a tuple with the AuthCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthCode + +`func (o *PaymentMethodAuthParameters) SetAuthCode(v string)` + +SetAuthCode sets AuthCode field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodCountry.md b/docs/payment_method/PaymentMethodCountry.md new file mode 100644 index 00000000..385d02a8 --- /dev/null +++ b/docs/payment_method/PaymentMethodCountry.md @@ -0,0 +1,19 @@ +# PaymentMethodCountry + +## Enum + + +* `PH` (value: `"PH"`) + +* `ID` (value: `"ID"`) + +* `VN` (value: `"VN"`) + +* `TH` (value: `"TH"`) + +* `MY` (value: `"MY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodExpireParameters.md b/docs/payment_method/PaymentMethodExpireParameters.md new file mode 100644 index 00000000..f6538c86 --- /dev/null +++ b/docs/payment_method/PaymentMethodExpireParameters.md @@ -0,0 +1,102 @@ +# PaymentMethodExpireParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **NullableString** | URL where the end customer is redirected if the unlinking authorization is successful. | [optional] | +| **FailureReturnUrl** | Pointer to **NullableString** | URL where the end customer is redirected if the unlinking authorization is failed. | [optional] | + +## Methods + +### NewPaymentMethodExpireParameters + +`func NewPaymentMethodExpireParameters() *PaymentMethodExpireParameters` + +NewPaymentMethodExpireParameters instantiates a new PaymentMethodExpireParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodExpireParametersWithDefaults + +`func NewPaymentMethodExpireParametersWithDefaults() *PaymentMethodExpireParameters` + +NewPaymentMethodExpireParametersWithDefaults instantiates a new PaymentMethodExpireParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *PaymentMethodExpireParameters) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *PaymentMethodExpireParameters) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *PaymentMethodExpireParameters) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *PaymentMethodExpireParameters) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### SetSuccessReturnUrlNil + +`func (o *PaymentMethodExpireParameters) SetSuccessReturnUrlNil(b bool)` + + SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil + +### UnsetSuccessReturnUrl +`func (o *PaymentMethodExpireParameters) UnsetSuccessReturnUrl()` + +UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +### GetFailureReturnUrl + +`func (o *PaymentMethodExpireParameters) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *PaymentMethodExpireParameters) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *PaymentMethodExpireParameters) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *PaymentMethodExpireParameters) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### SetFailureReturnUrlNil + +`func (o *PaymentMethodExpireParameters) SetFailureReturnUrlNil(b bool)` + + SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil + +### UnsetFailureReturnUrl +`func (o *PaymentMethodExpireParameters) UnsetFailureReturnUrl()` + +UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodList.md b/docs/payment_method/PaymentMethodList.md new file mode 100644 index 00000000..1ab66ab5 --- /dev/null +++ b/docs/payment_method/PaymentMethodList.md @@ -0,0 +1,77 @@ +# PaymentMethodList + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | [**PaymentMethod[]**](PaymentMethod.md) | | | +| **HasMore** | Pointer to **bool** | | [optional] | + +## Methods + +### NewPaymentMethodList + +`func NewPaymentMethodList(data []PaymentMethod, ) *PaymentMethodList` + +NewPaymentMethodList instantiates a new PaymentMethodList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodListWithDefaults + +`func NewPaymentMethodListWithDefaults() *PaymentMethodList` + +NewPaymentMethodListWithDefaults instantiates a new PaymentMethodList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *PaymentMethodList) GetData() []PaymentMethod` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PaymentMethodList) GetDataOk() (*[]PaymentMethod, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PaymentMethodList) SetData(v []PaymentMethod)` + +SetData sets Data field to given value. + + +### GetHasMore + +`func (o *PaymentMethodList) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *PaymentMethodList) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *PaymentMethodList) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + +### HasHasMore + +`func (o *PaymentMethodList) HasHasMore() bool` + +HasHasMore returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodParameters.md b/docs/payment_method/PaymentMethodParameters.md new file mode 100644 index 00000000..b0bd8e6c --- /dev/null +++ b/docs/payment_method/PaymentMethodParameters.md @@ -0,0 +1,434 @@ +# PaymentMethodParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | [**PaymentMethodType**](PaymentMethodType.md) | | | +| **Country** | Pointer to **NullableString** | | [optional] | +| **Reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | | +| **CustomerId** | Pointer to **NullableString** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Description** | Pointer to **NullableString** | | [optional] | +| **Card** | Pointer to [**CardParameters**](CardParameters.md) | | [optional] | +| **DirectDebit** | Pointer to [**DirectDebitParameters**](DirectDebitParameters.md) | | [optional] | +| **Ewallet** | Pointer to [**EWalletParameters**](EWalletParameters.md) | | [optional] | +| **OverTheCounter** | Pointer to [**OverTheCounterParameters**](OverTheCounterParameters.md) | | [optional] | +| **VirtualAccount** | Pointer to [**VirtualAccountParameters**](VirtualAccountParameters.md) | | [optional] | +| **QrCode** | Pointer to [**QRCodeParameters**](QRCodeParameters.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | +| **BillingInformation** | Pointer to [**NullableBillingInformation**](BillingInformation.md) | | [optional] | + +## Methods + +### NewPaymentMethodParameters + +`func NewPaymentMethodParameters(type_ PaymentMethodType, reusability PaymentMethodReusability, ) *PaymentMethodParameters` + +NewPaymentMethodParameters instantiates a new PaymentMethodParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodParametersWithDefaults + +`func NewPaymentMethodParametersWithDefaults() *PaymentMethodParameters` + +NewPaymentMethodParametersWithDefaults instantiates a new PaymentMethodParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *PaymentMethodParameters) GetType() PaymentMethodType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentMethodParameters) GetTypeOk() (*PaymentMethodType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentMethodParameters) SetType(v PaymentMethodType)` + +SetType sets Type field to given value. + + +### GetCountry + +`func (o *PaymentMethodParameters) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentMethodParameters) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentMethodParameters) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PaymentMethodParameters) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### SetCountryNil + +`func (o *PaymentMethodParameters) SetCountryNil(b bool)` + + SetCountryNil sets the value for Country to be an explicit nil + +### UnsetCountry +`func (o *PaymentMethodParameters) UnsetCountry()` + +UnsetCountry ensures that no value is present for Country, not even an explicit nil +### GetReusability + +`func (o *PaymentMethodParameters) GetReusability() PaymentMethodReusability` + +GetReusability returns the Reusability field if non-nil, zero value otherwise. + +### GetReusabilityOk + +`func (o *PaymentMethodParameters) GetReusabilityOk() (*PaymentMethodReusability, bool)` + +GetReusabilityOk returns a tuple with the Reusability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReusability + +`func (o *PaymentMethodParameters) SetReusability(v PaymentMethodReusability)` + +SetReusability sets Reusability field to given value. + + +### GetCustomerId + +`func (o *PaymentMethodParameters) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *PaymentMethodParameters) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *PaymentMethodParameters) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *PaymentMethodParameters) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *PaymentMethodParameters) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *PaymentMethodParameters) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetReferenceId + +`func (o *PaymentMethodParameters) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentMethodParameters) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentMethodParameters) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentMethodParameters) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetDescription + +`func (o *PaymentMethodParameters) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentMethodParameters) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentMethodParameters) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentMethodParameters) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentMethodParameters) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentMethodParameters) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetCard + +`func (o *PaymentMethodParameters) GetCard() CardParameters` + +GetCard returns the Card field if non-nil, zero value otherwise. + +### GetCardOk + +`func (o *PaymentMethodParameters) GetCardOk() (*CardParameters, bool)` + +GetCardOk returns a tuple with the Card field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCard + +`func (o *PaymentMethodParameters) SetCard(v CardParameters)` + +SetCard sets Card field to given value. + +### HasCard + +`func (o *PaymentMethodParameters) HasCard() bool` + +HasCard returns a boolean if a field has been set. + +### GetDirectDebit + +`func (o *PaymentMethodParameters) GetDirectDebit() DirectDebitParameters` + +GetDirectDebit returns the DirectDebit field if non-nil, zero value otherwise. + +### GetDirectDebitOk + +`func (o *PaymentMethodParameters) GetDirectDebitOk() (*DirectDebitParameters, bool)` + +GetDirectDebitOk returns a tuple with the DirectDebit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectDebit + +`func (o *PaymentMethodParameters) SetDirectDebit(v DirectDebitParameters)` + +SetDirectDebit sets DirectDebit field to given value. + +### HasDirectDebit + +`func (o *PaymentMethodParameters) HasDirectDebit() bool` + +HasDirectDebit returns a boolean if a field has been set. + +### GetEwallet + +`func (o *PaymentMethodParameters) GetEwallet() EWalletParameters` + +GetEwallet returns the Ewallet field if non-nil, zero value otherwise. + +### GetEwalletOk + +`func (o *PaymentMethodParameters) GetEwalletOk() (*EWalletParameters, bool)` + +GetEwalletOk returns a tuple with the Ewallet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwallet + +`func (o *PaymentMethodParameters) SetEwallet(v EWalletParameters)` + +SetEwallet sets Ewallet field to given value. + +### HasEwallet + +`func (o *PaymentMethodParameters) HasEwallet() bool` + +HasEwallet returns a boolean if a field has been set. + +### GetOverTheCounter + +`func (o *PaymentMethodParameters) GetOverTheCounter() OverTheCounterParameters` + +GetOverTheCounter returns the OverTheCounter field if non-nil, zero value otherwise. + +### GetOverTheCounterOk + +`func (o *PaymentMethodParameters) GetOverTheCounterOk() (*OverTheCounterParameters, bool)` + +GetOverTheCounterOk returns a tuple with the OverTheCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverTheCounter + +`func (o *PaymentMethodParameters) SetOverTheCounter(v OverTheCounterParameters)` + +SetOverTheCounter sets OverTheCounter field to given value. + +### HasOverTheCounter + +`func (o *PaymentMethodParameters) HasOverTheCounter() bool` + +HasOverTheCounter returns a boolean if a field has been set. + +### GetVirtualAccount + +`func (o *PaymentMethodParameters) GetVirtualAccount() VirtualAccountParameters` + +GetVirtualAccount returns the VirtualAccount field if non-nil, zero value otherwise. + +### GetVirtualAccountOk + +`func (o *PaymentMethodParameters) GetVirtualAccountOk() (*VirtualAccountParameters, bool)` + +GetVirtualAccountOk returns a tuple with the VirtualAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccount + +`func (o *PaymentMethodParameters) SetVirtualAccount(v VirtualAccountParameters)` + +SetVirtualAccount sets VirtualAccount field to given value. + +### HasVirtualAccount + +`func (o *PaymentMethodParameters) HasVirtualAccount() bool` + +HasVirtualAccount returns a boolean if a field has been set. + +### GetQrCode + +`func (o *PaymentMethodParameters) GetQrCode() QRCodeParameters` + +GetQrCode returns the QrCode field if non-nil, zero value otherwise. + +### GetQrCodeOk + +`func (o *PaymentMethodParameters) GetQrCodeOk() (*QRCodeParameters, bool)` + +GetQrCodeOk returns a tuple with the QrCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCode + +`func (o *PaymentMethodParameters) SetQrCode(v QRCodeParameters)` + +SetQrCode sets QrCode field to given value. + +### HasQrCode + +`func (o *PaymentMethodParameters) HasQrCode() bool` + +HasQrCode returns a boolean if a field has been set. + +### GetMetadata + +`func (o *PaymentMethodParameters) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentMethodParameters) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentMethodParameters) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentMethodParameters) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentMethodParameters) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentMethodParameters) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil +### GetBillingInformation + +`func (o *PaymentMethodParameters) GetBillingInformation() BillingInformation` + +GetBillingInformation returns the BillingInformation field if non-nil, zero value otherwise. + +### GetBillingInformationOk + +`func (o *PaymentMethodParameters) GetBillingInformationOk() (*BillingInformation, bool)` + +GetBillingInformationOk returns a tuple with the BillingInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingInformation + +`func (o *PaymentMethodParameters) SetBillingInformation(v BillingInformation)` + +SetBillingInformation sets BillingInformation field to given value. + +### HasBillingInformation + +`func (o *PaymentMethodParameters) HasBillingInformation() bool` + +HasBillingInformation returns a boolean if a field has been set. + +### SetBillingInformationNil + +`func (o *PaymentMethodParameters) SetBillingInformationNil(b bool)` + + SetBillingInformationNil sets the value for BillingInformation to be an explicit nil + +### UnsetBillingInformation +`func (o *PaymentMethodParameters) UnsetBillingInformation()` + +UnsetBillingInformation ensures that no value is present for BillingInformation, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodReusability.md b/docs/payment_method/PaymentMethodReusability.md new file mode 100644 index 00000000..b1184bbf --- /dev/null +++ b/docs/payment_method/PaymentMethodReusability.md @@ -0,0 +1,13 @@ +# PaymentMethodReusability + +## Enum + + +* `MULTIPLE_USE` (value: `"MULTIPLE_USE"`) + +* `ONE_TIME_USE` (value: `"ONE_TIME_USE"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodStatus.md b/docs/payment_method/PaymentMethodStatus.md new file mode 100644 index 00000000..3ecec1b0 --- /dev/null +++ b/docs/payment_method/PaymentMethodStatus.md @@ -0,0 +1,21 @@ +# PaymentMethodStatus + +## Enum + + +* `ACTIVE` (value: `"ACTIVE"`) + +* `EXPIRED` (value: `"EXPIRED"`) + +* `INACTIVE` (value: `"INACTIVE"`) + +* `PENDING` (value: `"PENDING"`) + +* `REQUIRES_ACTION` (value: `"REQUIRES_ACTION"`) + +* `FAILED` (value: `"FAILED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodType.md b/docs/payment_method/PaymentMethodType.md new file mode 100644 index 00000000..0b5c0f48 --- /dev/null +++ b/docs/payment_method/PaymentMethodType.md @@ -0,0 +1,25 @@ +# PaymentMethodType + +## Enum + + +* `CARD` (value: `"CARD"`) + +* `CRYPTOCURRENCY` (value: `"CRYPTOCURRENCY"`) + +* `DIRECT_BANK_TRANSFER` (value: `"DIRECT_BANK_TRANSFER"`) + +* `DIRECT_DEBIT` (value: `"DIRECT_DEBIT"`) + +* `EWALLET` (value: `"EWALLET"`) + +* `OVER_THE_COUNTER` (value: `"OVER_THE_COUNTER"`) + +* `QR_CODE` (value: `"QR_CODE"`) + +* `VIRTUAL_ACCOUNT` (value: `"VIRTUAL_ACCOUNT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodUpdateParameters.md b/docs/payment_method/PaymentMethodUpdateParameters.md new file mode 100644 index 00000000..4fe26d5b --- /dev/null +++ b/docs/payment_method/PaymentMethodUpdateParameters.md @@ -0,0 +1,186 @@ +# PaymentMethodUpdateParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Description** | Pointer to **string** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Reusability** | Pointer to [**PaymentMethodReusability**](PaymentMethodReusability.md) | | [optional] | +| **Status** | Pointer to [**PaymentMethodStatus**](PaymentMethodStatus.md) | | [optional] | +| **OverTheCounter** | Pointer to [**OverTheCounterUpdateParameters**](OverTheCounterUpdateParameters.md) | | [optional] | +| **VirtualAccount** | Pointer to [**VirtualAccountUpdateParameters**](VirtualAccountUpdateParameters.md) | | [optional] | + +## Methods + +### NewPaymentMethodUpdateParameters + +`func NewPaymentMethodUpdateParameters() *PaymentMethodUpdateParameters` + +NewPaymentMethodUpdateParameters instantiates a new PaymentMethodUpdateParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodUpdateParametersWithDefaults + +`func NewPaymentMethodUpdateParametersWithDefaults() *PaymentMethodUpdateParameters` + +NewPaymentMethodUpdateParametersWithDefaults instantiates a new PaymentMethodUpdateParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *PaymentMethodUpdateParameters) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentMethodUpdateParameters) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentMethodUpdateParameters) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentMethodUpdateParameters) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetReferenceId + +`func (o *PaymentMethodUpdateParameters) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentMethodUpdateParameters) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentMethodUpdateParameters) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentMethodUpdateParameters) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetReusability + +`func (o *PaymentMethodUpdateParameters) GetReusability() PaymentMethodReusability` + +GetReusability returns the Reusability field if non-nil, zero value otherwise. + +### GetReusabilityOk + +`func (o *PaymentMethodUpdateParameters) GetReusabilityOk() (*PaymentMethodReusability, bool)` + +GetReusabilityOk returns a tuple with the Reusability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReusability + +`func (o *PaymentMethodUpdateParameters) SetReusability(v PaymentMethodReusability)` + +SetReusability sets Reusability field to given value. + +### HasReusability + +`func (o *PaymentMethodUpdateParameters) HasReusability() bool` + +HasReusability returns a boolean if a field has been set. + +### GetStatus + +`func (o *PaymentMethodUpdateParameters) GetStatus() PaymentMethodStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PaymentMethodUpdateParameters) GetStatusOk() (*PaymentMethodStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PaymentMethodUpdateParameters) SetStatus(v PaymentMethodStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *PaymentMethodUpdateParameters) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetOverTheCounter + +`func (o *PaymentMethodUpdateParameters) GetOverTheCounter() OverTheCounterUpdateParameters` + +GetOverTheCounter returns the OverTheCounter field if non-nil, zero value otherwise. + +### GetOverTheCounterOk + +`func (o *PaymentMethodUpdateParameters) GetOverTheCounterOk() (*OverTheCounterUpdateParameters, bool)` + +GetOverTheCounterOk returns a tuple with the OverTheCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverTheCounter + +`func (o *PaymentMethodUpdateParameters) SetOverTheCounter(v OverTheCounterUpdateParameters)` + +SetOverTheCounter sets OverTheCounter field to given value. + +### HasOverTheCounter + +`func (o *PaymentMethodUpdateParameters) HasOverTheCounter() bool` + +HasOverTheCounter returns a boolean if a field has been set. + +### GetVirtualAccount + +`func (o *PaymentMethodUpdateParameters) GetVirtualAccount() VirtualAccountUpdateParameters` + +GetVirtualAccount returns the VirtualAccount field if non-nil, zero value otherwise. + +### GetVirtualAccountOk + +`func (o *PaymentMethodUpdateParameters) GetVirtualAccountOk() (*VirtualAccountUpdateParameters, bool)` + +GetVirtualAccountOk returns a tuple with the VirtualAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccount + +`func (o *PaymentMethodUpdateParameters) SetVirtualAccount(v VirtualAccountUpdateParameters)` + +SetVirtualAccount sets VirtualAccount field to given value. + +### HasVirtualAccount + +`func (o *PaymentMethodUpdateParameters) HasVirtualAccount() bool` + +HasVirtualAccount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/QRCode.md b/docs/payment_method/QRCode.md new file mode 100644 index 00000000..d209038a --- /dev/null +++ b/docs/payment_method/QRCode.md @@ -0,0 +1,164 @@ +# QRCode + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | Pointer to [**NullableQRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**NullableQRCodeChannelProperties**](QRCodeChannelProperties.md) | | [optional] | + +## Methods + +### NewQRCode + +`func NewQRCode() *QRCode` + +NewQRCode instantiates a new QRCode object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeWithDefaults + +`func NewQRCodeWithDefaults() *QRCode` + +NewQRCodeWithDefaults instantiates a new QRCode object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *QRCode) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *QRCode) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *QRCode) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *QRCode) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *QRCode) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *QRCode) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *QRCode) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *QRCode) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *QRCode) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *QRCode) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *QRCode) GetChannelCode() QRCodeChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *QRCode) GetChannelCodeOk() (*QRCodeChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *QRCode) SetChannelCode(v QRCodeChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *QRCode) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### SetChannelCodeNil + +`func (o *QRCode) SetChannelCodeNil(b bool)` + + SetChannelCodeNil sets the value for ChannelCode to be an explicit nil + +### UnsetChannelCode +`func (o *QRCode) UnsetChannelCode()` + +UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +### GetChannelProperties + +`func (o *QRCode) GetChannelProperties() QRCodeChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *QRCode) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *QRCode) SetChannelProperties(v QRCodeChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *QRCode) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### SetChannelPropertiesNil + +`func (o *QRCode) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *QRCode) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/QRCodeChannelCode.md b/docs/payment_method/QRCodeChannelCode.md new file mode 100644 index 00000000..3db29275 --- /dev/null +++ b/docs/payment_method/QRCodeChannelCode.md @@ -0,0 +1,19 @@ +# QRCodeChannelCode + +## Enum + + +* `QRIS` (value: `"QRIS"`) + +* `DANA` (value: `"DANA"`) + +* `RCBC` (value: `"RCBC"`) + +* `PROMPTPAY` (value: `"PROMPTPAY"`) + +* `LINKAJA` (value: `"LINKAJA"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/QRCodeChannelProperties.md b/docs/payment_method/QRCodeChannelProperties.md new file mode 100644 index 00000000..1b03ab64 --- /dev/null +++ b/docs/payment_method/QRCodeChannelProperties.md @@ -0,0 +1,82 @@ +# QRCodeChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **QrString** | Pointer to **string** | QR string to be rendered for display to end users. QR string to image rendering are commonly available in software libraries (e.g Nodejs, PHP, Java) | [optional] | +| **ExpiresAt** | Pointer to **time.Time** | | [optional] | + +## Methods + +### NewQRCodeChannelProperties + +`func NewQRCodeChannelProperties() *QRCodeChannelProperties` + +NewQRCodeChannelProperties instantiates a new QRCodeChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeChannelPropertiesWithDefaults + +`func NewQRCodeChannelPropertiesWithDefaults() *QRCodeChannelProperties` + +NewQRCodeChannelPropertiesWithDefaults instantiates a new QRCodeChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQrString + +`func (o *QRCodeChannelProperties) GetQrString() string` + +GetQrString returns the QrString field if non-nil, zero value otherwise. + +### GetQrStringOk + +`func (o *QRCodeChannelProperties) GetQrStringOk() (*string, bool)` + +GetQrStringOk returns a tuple with the QrString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrString + +`func (o *QRCodeChannelProperties) SetQrString(v string)` + +SetQrString sets QrString field to given value. + +### HasQrString + +`func (o *QRCodeChannelProperties) HasQrString() bool` + +HasQrString returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *QRCodeChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *QRCodeChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *QRCodeChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *QRCodeChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/QRCodeParameters.md b/docs/payment_method/QRCodeParameters.md new file mode 100644 index 00000000..75d8714e --- /dev/null +++ b/docs/payment_method/QRCodeParameters.md @@ -0,0 +1,164 @@ +# QRCodeParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | Pointer to [**NullableQRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**NullableQRCodeChannelProperties**](QRCodeChannelProperties.md) | | [optional] | + +## Methods + +### NewQRCodeParameters + +`func NewQRCodeParameters() *QRCodeParameters` + +NewQRCodeParameters instantiates a new QRCodeParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeParametersWithDefaults + +`func NewQRCodeParametersWithDefaults() *QRCodeParameters` + +NewQRCodeParametersWithDefaults instantiates a new QRCodeParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *QRCodeParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *QRCodeParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *QRCodeParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *QRCodeParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *QRCodeParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *QRCodeParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *QRCodeParameters) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *QRCodeParameters) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *QRCodeParameters) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *QRCodeParameters) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *QRCodeParameters) GetChannelCode() QRCodeChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *QRCodeParameters) GetChannelCodeOk() (*QRCodeChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *QRCodeParameters) SetChannelCode(v QRCodeChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *QRCodeParameters) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### SetChannelCodeNil + +`func (o *QRCodeParameters) SetChannelCodeNil(b bool)` + + SetChannelCodeNil sets the value for ChannelCode to be an explicit nil + +### UnsetChannelCode +`func (o *QRCodeParameters) UnsetChannelCode()` + +UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +### GetChannelProperties + +`func (o *QRCodeParameters) GetChannelProperties() QRCodeChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *QRCodeParameters) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *QRCodeParameters) SetChannelProperties(v QRCodeChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *QRCodeParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### SetChannelPropertiesNil + +`func (o *QRCodeParameters) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *QRCodeParameters) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/SimulatePaymentRequest.md b/docs/payment_method/SimulatePaymentRequest.md new file mode 100644 index 00000000..b3fbce6a --- /dev/null +++ b/docs/payment_method/SimulatePaymentRequest.md @@ -0,0 +1,56 @@ +# SimulatePaymentRequest + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **float64** | | [optional] | + +## Methods + +### NewSimulatePaymentRequest + +`func NewSimulatePaymentRequest() *SimulatePaymentRequest` + +NewSimulatePaymentRequest instantiates a new SimulatePaymentRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSimulatePaymentRequestWithDefaults + +`func NewSimulatePaymentRequestWithDefaults() *SimulatePaymentRequest` + +NewSimulatePaymentRequestWithDefaults instantiates a new SimulatePaymentRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *SimulatePaymentRequest) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *SimulatePaymentRequest) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *SimulatePaymentRequest) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *SimulatePaymentRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/TokenizedCardInformation.md b/docs/payment_method/TokenizedCardInformation.md new file mode 100644 index 00000000..d40b6272 --- /dev/null +++ b/docs/payment_method/TokenizedCardInformation.md @@ -0,0 +1,255 @@ +# TokenizedCardInformation + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **TokenId** | **string** | | | +| **MaskedCardNumber** | **string** | 1st 6 and last 4 digits of the card | | +| **CardholderName** | Pointer to **NullableString** | Cardholder name is optional but recommended for 3DS 2 / AVS verification | [optional] | +| **ExpiryMonth** | **string** | Card expiry month in MM format | | +| **ExpiryYear** | **string** | Card expiry month in YY format | | +| **Fingerprint** | **string** | Xendit-generated identifier for the unique card number. Multiple payment method objects can be created for the same account - e.g. if the user first creates a one-time payment request, and then later on creates a multiple-use payment method using the same account. The fingerprint helps to identify the unique account being used. | | +| **Type** | **string** | Whether the card is a credit or debit card | | +| **Network** | **string** | Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA | | +| **Country** | **string** | Country where the card was issued ISO 3166-1 Alpha-2 | | +| **Issuer** | **string** | Issuer of the card, most often an issuing bank For example, “BCA”, “MANDIRI” | | + +## Methods + +### NewTokenizedCardInformation + +`func NewTokenizedCardInformation(tokenId string, maskedCardNumber string, expiryMonth string, expiryYear string, fingerprint string, type_ string, network string, country string, issuer string, ) *TokenizedCardInformation` + +NewTokenizedCardInformation instantiates a new TokenizedCardInformation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTokenizedCardInformationWithDefaults + +`func NewTokenizedCardInformationWithDefaults() *TokenizedCardInformation` + +NewTokenizedCardInformationWithDefaults instantiates a new TokenizedCardInformation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTokenId + +`func (o *TokenizedCardInformation) GetTokenId() string` + +GetTokenId returns the TokenId field if non-nil, zero value otherwise. + +### GetTokenIdOk + +`func (o *TokenizedCardInformation) GetTokenIdOk() (*string, bool)` + +GetTokenIdOk returns a tuple with the TokenId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenId + +`func (o *TokenizedCardInformation) SetTokenId(v string)` + +SetTokenId sets TokenId field to given value. + + +### GetMaskedCardNumber + +`func (o *TokenizedCardInformation) GetMaskedCardNumber() string` + +GetMaskedCardNumber returns the MaskedCardNumber field if non-nil, zero value otherwise. + +### GetMaskedCardNumberOk + +`func (o *TokenizedCardInformation) GetMaskedCardNumberOk() (*string, bool)` + +GetMaskedCardNumberOk returns a tuple with the MaskedCardNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaskedCardNumber + +`func (o *TokenizedCardInformation) SetMaskedCardNumber(v string)` + +SetMaskedCardNumber sets MaskedCardNumber field to given value. + + +### GetCardholderName + +`func (o *TokenizedCardInformation) GetCardholderName() string` + +GetCardholderName returns the CardholderName field if non-nil, zero value otherwise. + +### GetCardholderNameOk + +`func (o *TokenizedCardInformation) GetCardholderNameOk() (*string, bool)` + +GetCardholderNameOk returns a tuple with the CardholderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardholderName + +`func (o *TokenizedCardInformation) SetCardholderName(v string)` + +SetCardholderName sets CardholderName field to given value. + +### HasCardholderName + +`func (o *TokenizedCardInformation) HasCardholderName() bool` + +HasCardholderName returns a boolean if a field has been set. + +### SetCardholderNameNil + +`func (o *TokenizedCardInformation) SetCardholderNameNil(b bool)` + + SetCardholderNameNil sets the value for CardholderName to be an explicit nil + +### UnsetCardholderName +`func (o *TokenizedCardInformation) UnsetCardholderName()` + +UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +### GetExpiryMonth + +`func (o *TokenizedCardInformation) GetExpiryMonth() string` + +GetExpiryMonth returns the ExpiryMonth field if non-nil, zero value otherwise. + +### GetExpiryMonthOk + +`func (o *TokenizedCardInformation) GetExpiryMonthOk() (*string, bool)` + +GetExpiryMonthOk returns a tuple with the ExpiryMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryMonth + +`func (o *TokenizedCardInformation) SetExpiryMonth(v string)` + +SetExpiryMonth sets ExpiryMonth field to given value. + + +### GetExpiryYear + +`func (o *TokenizedCardInformation) GetExpiryYear() string` + +GetExpiryYear returns the ExpiryYear field if non-nil, zero value otherwise. + +### GetExpiryYearOk + +`func (o *TokenizedCardInformation) GetExpiryYearOk() (*string, bool)` + +GetExpiryYearOk returns a tuple with the ExpiryYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryYear + +`func (o *TokenizedCardInformation) SetExpiryYear(v string)` + +SetExpiryYear sets ExpiryYear field to given value. + + +### GetFingerprint + +`func (o *TokenizedCardInformation) GetFingerprint() string` + +GetFingerprint returns the Fingerprint field if non-nil, zero value otherwise. + +### GetFingerprintOk + +`func (o *TokenizedCardInformation) GetFingerprintOk() (*string, bool)` + +GetFingerprintOk returns a tuple with the Fingerprint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFingerprint + +`func (o *TokenizedCardInformation) SetFingerprint(v string)` + +SetFingerprint sets Fingerprint field to given value. + + +### GetType + +`func (o *TokenizedCardInformation) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *TokenizedCardInformation) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *TokenizedCardInformation) SetType(v string)` + +SetType sets Type field to given value. + + +### GetNetwork + +`func (o *TokenizedCardInformation) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *TokenizedCardInformation) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *TokenizedCardInformation) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + + +### GetCountry + +`func (o *TokenizedCardInformation) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *TokenizedCardInformation) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *TokenizedCardInformation) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetIssuer + +`func (o *TokenizedCardInformation) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *TokenizedCardInformation) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *TokenizedCardInformation) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccount.md b/docs/payment_method/VirtualAccount.md new file mode 100644 index 00000000..d9b93d1b --- /dev/null +++ b/docs/payment_method/VirtualAccount.md @@ -0,0 +1,258 @@ +# VirtualAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | | +| **ChannelProperties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | | +| **AlternativeDisplayTypes** | Pointer to **string[]** | For payments in Vietnam only, alternative display requested for the virtual account | [optional] | +| **AlternativeDisplays** | Pointer to [**VirtualAccountAlternativeDisplay[]**](VirtualAccountAlternativeDisplay.md) | | [optional] | + +## Methods + +### NewVirtualAccount + +`func NewVirtualAccount(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties, ) *VirtualAccount` + +NewVirtualAccount instantiates a new VirtualAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountWithDefaults + +`func NewVirtualAccountWithDefaults() *VirtualAccount` + +NewVirtualAccountWithDefaults instantiates a new VirtualAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *VirtualAccount) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *VirtualAccount) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *VirtualAccount) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *VirtualAccount) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *VirtualAccount) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *VirtualAccount) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetMinAmount + +`func (o *VirtualAccount) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *VirtualAccount) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *VirtualAccount) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *VirtualAccount) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *VirtualAccount) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *VirtualAccount) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *VirtualAccount) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *VirtualAccount) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *VirtualAccount) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *VirtualAccount) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *VirtualAccount) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *VirtualAccount) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetCurrency + +`func (o *VirtualAccount) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *VirtualAccount) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *VirtualAccount) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *VirtualAccount) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *VirtualAccount) GetChannelCode() VirtualAccountChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *VirtualAccount) GetChannelCodeOk() (*VirtualAccountChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *VirtualAccount) SetChannelCode(v VirtualAccountChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *VirtualAccount) GetChannelProperties() VirtualAccountChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *VirtualAccount) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *VirtualAccount) SetChannelProperties(v VirtualAccountChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAlternativeDisplayTypes + +`func (o *VirtualAccount) GetAlternativeDisplayTypes() []string` + +GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field if non-nil, zero value otherwise. + +### GetAlternativeDisplayTypesOk + +`func (o *VirtualAccount) GetAlternativeDisplayTypesOk() (*[]string, bool)` + +GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplayTypes + +`func (o *VirtualAccount) SetAlternativeDisplayTypes(v []string)` + +SetAlternativeDisplayTypes sets AlternativeDisplayTypes field to given value. + +### HasAlternativeDisplayTypes + +`func (o *VirtualAccount) HasAlternativeDisplayTypes() bool` + +HasAlternativeDisplayTypes returns a boolean if a field has been set. + +### GetAlternativeDisplays + +`func (o *VirtualAccount) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay` + +GetAlternativeDisplays returns the AlternativeDisplays field if non-nil, zero value otherwise. + +### GetAlternativeDisplaysOk + +`func (o *VirtualAccount) GetAlternativeDisplaysOk() (*[]VirtualAccountAlternativeDisplay, bool)` + +GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplays + +`func (o *VirtualAccount) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay)` + +SetAlternativeDisplays sets AlternativeDisplays field to given value. + +### HasAlternativeDisplays + +`func (o *VirtualAccount) HasAlternativeDisplays() bool` + +HasAlternativeDisplays returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountAllOf.md b/docs/payment_method/VirtualAccountAllOf.md new file mode 100644 index 00000000..792f9b9a --- /dev/null +++ b/docs/payment_method/VirtualAccountAllOf.md @@ -0,0 +1,56 @@ +# VirtualAccountAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **AlternativeDisplays** | Pointer to [**VirtualAccountAlternativeDisplay[]**](VirtualAccountAlternativeDisplay.md) | | [optional] | + +## Methods + +### NewVirtualAccountAllOf + +`func NewVirtualAccountAllOf() *VirtualAccountAllOf` + +NewVirtualAccountAllOf instantiates a new VirtualAccountAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountAllOfWithDefaults + +`func NewVirtualAccountAllOfWithDefaults() *VirtualAccountAllOf` + +NewVirtualAccountAllOfWithDefaults instantiates a new VirtualAccountAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlternativeDisplays + +`func (o *VirtualAccountAllOf) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay` + +GetAlternativeDisplays returns the AlternativeDisplays field if non-nil, zero value otherwise. + +### GetAlternativeDisplaysOk + +`func (o *VirtualAccountAllOf) GetAlternativeDisplaysOk() (*[]VirtualAccountAlternativeDisplay, bool)` + +GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplays + +`func (o *VirtualAccountAllOf) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay)` + +SetAlternativeDisplays sets AlternativeDisplays field to given value. + +### HasAlternativeDisplays + +`func (o *VirtualAccountAllOf) HasAlternativeDisplays() bool` + +HasAlternativeDisplays returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountAlternativeDisplay.md b/docs/payment_method/VirtualAccountAlternativeDisplay.md new file mode 100644 index 00000000..df5b2e6c --- /dev/null +++ b/docs/payment_method/VirtualAccountAlternativeDisplay.md @@ -0,0 +1,82 @@ +# VirtualAccountAlternativeDisplay + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | Pointer to **string** | Type of the alternative display | [optional] [readonly] | +| **Data** | Pointer to **string** | Data payload of the given alternative display | [optional] | + +## Methods + +### NewVirtualAccountAlternativeDisplay + +`func NewVirtualAccountAlternativeDisplay() *VirtualAccountAlternativeDisplay` + +NewVirtualAccountAlternativeDisplay instantiates a new VirtualAccountAlternativeDisplay object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountAlternativeDisplayWithDefaults + +`func NewVirtualAccountAlternativeDisplayWithDefaults() *VirtualAccountAlternativeDisplay` + +NewVirtualAccountAlternativeDisplayWithDefaults instantiates a new VirtualAccountAlternativeDisplay object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *VirtualAccountAlternativeDisplay) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VirtualAccountAlternativeDisplay) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VirtualAccountAlternativeDisplay) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VirtualAccountAlternativeDisplay) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetData + +`func (o *VirtualAccountAlternativeDisplay) GetData() string` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *VirtualAccountAlternativeDisplay) GetDataOk() (*string, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *VirtualAccountAlternativeDisplay) SetData(v string)` + +SetData sets Data field to given value. + +### HasData + +`func (o *VirtualAccountAlternativeDisplay) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountChannelCode.md b/docs/payment_method/VirtualAccountChannelCode.md new file mode 100644 index 00000000..5fabe29e --- /dev/null +++ b/docs/payment_method/VirtualAccountChannelCode.md @@ -0,0 +1,39 @@ +# VirtualAccountChannelCode + +## Enum + + +* `BCA` (value: `"BCA"`) + +* `BJB` (value: `"BJB"`) + +* `BNI` (value: `"BNI"`) + +* `BRI` (value: `"BRI"`) + +* `MANDIRI` (value: `"MANDIRI"`) + +* `PERMATA` (value: `"PERMATA"`) + +* `BSI` (value: `"BSI"`) + +* `CIMB` (value: `"CIMB"`) + +* `SAHABAT_SAMPOERNA` (value: `"SAHABAT_SAMPOERNA"`) + +* `ARTAJASA` (value: `"ARTAJASA"`) + +* `PV` (value: `"PV"`) + +* `VIETCAPITAL` (value: `"VIETCAPITAL"`) + +* `WOORI` (value: `"WOORI"`) + +* `MSB` (value: `"MSB"`) + +* `STANDARD_CHARTERED` (value: `"STANDARD_CHARTERED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountChannelProperties.md b/docs/payment_method/VirtualAccountChannelProperties.md new file mode 100644 index 00000000..5b6de558 --- /dev/null +++ b/docs/payment_method/VirtualAccountChannelProperties.md @@ -0,0 +1,134 @@ +# VirtualAccountChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **CustomerName** | Pointer to **string** | Name of customer. | [optional] | +| **VirtualAccountNumber** | Pointer to **string** | You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range. | [optional] | +| **ExpiresAt** | Pointer to **time.Time** | The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. | [optional] | +| **SuggestedAmount** | Pointer to **float64** | The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) | [optional] | + +## Methods + +### NewVirtualAccountChannelProperties + +`func NewVirtualAccountChannelProperties() *VirtualAccountChannelProperties` + +NewVirtualAccountChannelProperties instantiates a new VirtualAccountChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountChannelPropertiesWithDefaults + +`func NewVirtualAccountChannelPropertiesWithDefaults() *VirtualAccountChannelProperties` + +NewVirtualAccountChannelPropertiesWithDefaults instantiates a new VirtualAccountChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerName + +`func (o *VirtualAccountChannelProperties) GetCustomerName() string` + +GetCustomerName returns the CustomerName field if non-nil, zero value otherwise. + +### GetCustomerNameOk + +`func (o *VirtualAccountChannelProperties) GetCustomerNameOk() (*string, bool)` + +GetCustomerNameOk returns a tuple with the CustomerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerName + +`func (o *VirtualAccountChannelProperties) SetCustomerName(v string)` + +SetCustomerName sets CustomerName field to given value. + +### HasCustomerName + +`func (o *VirtualAccountChannelProperties) HasCustomerName() bool` + +HasCustomerName returns a boolean if a field has been set. + +### GetVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) GetVirtualAccountNumber() string` + +GetVirtualAccountNumber returns the VirtualAccountNumber field if non-nil, zero value otherwise. + +### GetVirtualAccountNumberOk + +`func (o *VirtualAccountChannelProperties) GetVirtualAccountNumberOk() (*string, bool)` + +GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) SetVirtualAccountNumber(v string)` + +SetVirtualAccountNumber sets VirtualAccountNumber field to given value. + +### HasVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) HasVirtualAccountNumber() bool` + +HasVirtualAccountNumber returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *VirtualAccountChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *VirtualAccountChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *VirtualAccountChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *VirtualAccountChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetSuggestedAmount + +`func (o *VirtualAccountChannelProperties) GetSuggestedAmount() float64` + +GetSuggestedAmount returns the SuggestedAmount field if non-nil, zero value otherwise. + +### GetSuggestedAmountOk + +`func (o *VirtualAccountChannelProperties) GetSuggestedAmountOk() (*float64, bool)` + +GetSuggestedAmountOk returns a tuple with the SuggestedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuggestedAmount + +`func (o *VirtualAccountChannelProperties) SetSuggestedAmount(v float64)` + +SetSuggestedAmount sets SuggestedAmount field to given value. + +### HasSuggestedAmount + +`func (o *VirtualAccountChannelProperties) HasSuggestedAmount() bool` + +HasSuggestedAmount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountChannelPropertiesPatch.md b/docs/payment_method/VirtualAccountChannelPropertiesPatch.md new file mode 100644 index 00000000..8a238e65 --- /dev/null +++ b/docs/payment_method/VirtualAccountChannelPropertiesPatch.md @@ -0,0 +1,82 @@ +# VirtualAccountChannelPropertiesPatch + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ExpiresAt** | Pointer to **time.Time** | The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. | [optional] | +| **SuggestedAmount** | Pointer to **float64** | The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) | [optional] | + +## Methods + +### NewVirtualAccountChannelPropertiesPatch + +`func NewVirtualAccountChannelPropertiesPatch() *VirtualAccountChannelPropertiesPatch` + +NewVirtualAccountChannelPropertiesPatch instantiates a new VirtualAccountChannelPropertiesPatch object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountChannelPropertiesPatchWithDefaults + +`func NewVirtualAccountChannelPropertiesPatchWithDefaults() *VirtualAccountChannelPropertiesPatch` + +NewVirtualAccountChannelPropertiesPatchWithDefaults instantiates a new VirtualAccountChannelPropertiesPatch object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExpiresAt + +`func (o *VirtualAccountChannelPropertiesPatch) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *VirtualAccountChannelPropertiesPatch) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *VirtualAccountChannelPropertiesPatch) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *VirtualAccountChannelPropertiesPatch) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetSuggestedAmount + +`func (o *VirtualAccountChannelPropertiesPatch) GetSuggestedAmount() float64` + +GetSuggestedAmount returns the SuggestedAmount field if non-nil, zero value otherwise. + +### GetSuggestedAmountOk + +`func (o *VirtualAccountChannelPropertiesPatch) GetSuggestedAmountOk() (*float64, bool)` + +GetSuggestedAmountOk returns a tuple with the SuggestedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuggestedAmount + +`func (o *VirtualAccountChannelPropertiesPatch) SetSuggestedAmount(v float64)` + +SetSuggestedAmount sets SuggestedAmount field to given value. + +### HasSuggestedAmount + +`func (o *VirtualAccountChannelPropertiesPatch) HasSuggestedAmount() bool` + +HasSuggestedAmount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountParameters.md b/docs/payment_method/VirtualAccountParameters.md new file mode 100644 index 00000000..94ee5156 --- /dev/null +++ b/docs/payment_method/VirtualAccountParameters.md @@ -0,0 +1,232 @@ +# VirtualAccountParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ChannelCode** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | | +| **ChannelProperties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | | +| **AlternativeDisplayTypes** | Pointer to **string[]** | For payments in Vietnam only, alternative display requested for the virtual account | [optional] | + +## Methods + +### NewVirtualAccountParameters + +`func NewVirtualAccountParameters(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties, ) *VirtualAccountParameters` + +NewVirtualAccountParameters instantiates a new VirtualAccountParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountParametersWithDefaults + +`func NewVirtualAccountParametersWithDefaults() *VirtualAccountParameters` + +NewVirtualAccountParametersWithDefaults instantiates a new VirtualAccountParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *VirtualAccountParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *VirtualAccountParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *VirtualAccountParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *VirtualAccountParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *VirtualAccountParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *VirtualAccountParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetMinAmount + +`func (o *VirtualAccountParameters) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *VirtualAccountParameters) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *VirtualAccountParameters) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *VirtualAccountParameters) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *VirtualAccountParameters) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *VirtualAccountParameters) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *VirtualAccountParameters) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *VirtualAccountParameters) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *VirtualAccountParameters) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *VirtualAccountParameters) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *VirtualAccountParameters) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *VirtualAccountParameters) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetCurrency + +`func (o *VirtualAccountParameters) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *VirtualAccountParameters) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *VirtualAccountParameters) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *VirtualAccountParameters) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *VirtualAccountParameters) GetChannelCode() VirtualAccountChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *VirtualAccountParameters) GetChannelCodeOk() (*VirtualAccountChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *VirtualAccountParameters) SetChannelCode(v VirtualAccountChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *VirtualAccountParameters) GetChannelProperties() VirtualAccountChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *VirtualAccountParameters) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *VirtualAccountParameters) SetChannelProperties(v VirtualAccountChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) GetAlternativeDisplayTypes() []string` + +GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field if non-nil, zero value otherwise. + +### GetAlternativeDisplayTypesOk + +`func (o *VirtualAccountParameters) GetAlternativeDisplayTypesOk() (*[]string, bool)` + +GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) SetAlternativeDisplayTypes(v []string)` + +SetAlternativeDisplayTypes sets AlternativeDisplayTypes field to given value. + +### HasAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) HasAlternativeDisplayTypes() bool` + +HasAlternativeDisplayTypes returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/VirtualAccountUpdateParameters.md b/docs/payment_method/VirtualAccountUpdateParameters.md new file mode 100644 index 00000000..3e98a1af --- /dev/null +++ b/docs/payment_method/VirtualAccountUpdateParameters.md @@ -0,0 +1,190 @@ +# VirtualAccountUpdateParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **ChannelProperties** | Pointer to [**VirtualAccountChannelPropertiesPatch**](VirtualAccountChannelPropertiesPatch.md) | | [optional] | +| **AlternativeDisplayTypes** | Pointer to **string[]** | For payments in Vietnam only, alternative display requested for the virtual account | [optional] | + +## Methods + +### NewVirtualAccountUpdateParameters + +`func NewVirtualAccountUpdateParameters() *VirtualAccountUpdateParameters` + +NewVirtualAccountUpdateParameters instantiates a new VirtualAccountUpdateParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountUpdateParametersWithDefaults + +`func NewVirtualAccountUpdateParametersWithDefaults() *VirtualAccountUpdateParameters` + +NewVirtualAccountUpdateParametersWithDefaults instantiates a new VirtualAccountUpdateParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *VirtualAccountUpdateParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *VirtualAccountUpdateParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *VirtualAccountUpdateParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *VirtualAccountUpdateParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *VirtualAccountUpdateParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *VirtualAccountUpdateParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetMinAmount + +`func (o *VirtualAccountUpdateParameters) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *VirtualAccountUpdateParameters) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *VirtualAccountUpdateParameters) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *VirtualAccountUpdateParameters) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *VirtualAccountUpdateParameters) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *VirtualAccountUpdateParameters) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *VirtualAccountUpdateParameters) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *VirtualAccountUpdateParameters) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *VirtualAccountUpdateParameters) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *VirtualAccountUpdateParameters) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *VirtualAccountUpdateParameters) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *VirtualAccountUpdateParameters) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetChannelProperties + +`func (o *VirtualAccountUpdateParameters) GetChannelProperties() VirtualAccountChannelPropertiesPatch` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *VirtualAccountUpdateParameters) GetChannelPropertiesOk() (*VirtualAccountChannelPropertiesPatch, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *VirtualAccountUpdateParameters) SetChannelProperties(v VirtualAccountChannelPropertiesPatch)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *VirtualAccountUpdateParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetAlternativeDisplayTypes + +`func (o *VirtualAccountUpdateParameters) GetAlternativeDisplayTypes() []string` + +GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field if non-nil, zero value otherwise. + +### GetAlternativeDisplayTypesOk + +`func (o *VirtualAccountUpdateParameters) GetAlternativeDisplayTypesOk() (*[]string, bool)` + +GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplayTypes + +`func (o *VirtualAccountUpdateParameters) SetAlternativeDisplayTypes(v []string)` + +SetAlternativeDisplayTypes sets AlternativeDisplayTypes field to given value. + +### HasAlternativeDisplayTypes + +`func (o *VirtualAccountUpdateParameters) HasAlternativeDisplayTypes() bool` + +HasAlternativeDisplayTypes returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request.yaml b/docs/payment_request.yaml new file mode 100644 index 00000000..9c8dc591 --- /dev/null +++ b/docs/payment_request.yaml @@ -0,0 +1,2560 @@ +openapi: 3.0.0 +info: + description: This API is used for Payment Requests + title: Payment Requests + version: 1.42.3 +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /payment_requests: + get: + description: Get all payment requests by filter + operationId: getAllPaymentRequests + parameters: + - explode: true + in: query + name: reference_id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: customer_id + required: false + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - explode: true + in: query + name: before_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: after_id + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequestListResponse' + description: Request successful + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Get all payment requests by filter + tags: + - payment_request + post: + description: Create Payment Request + operationId: createPaymentRequest + parameters: + - explode: false + in: header + name: idempotency-key + required: false + schema: + example: 5f9a3fbd571a1c4068aa40ce + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequestParameters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequest' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Create Payment Request + tags: + - payment_request + /payment_requests/{paymentRequestId}: + get: + description: Get payment request by ID + operationId: getPaymentRequestByID + parameters: + - explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + E-Wallet One Time Payment via Redirect URL: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + country: ID + payment_method: + type: EWALLET + ewallet: + channel_code: SHOPEEPAY + channel_properties: + success_return_url: https://redirect.me/success + reusability: ONE_TIME_USE + Fixed amount dynamic QR: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + payment_method: + type: QR_CODE + reusability: ONE_TIME_USE + qr_code: + channel_code: “QRIS” + metadata: + sku: example-sku-1234 + Fixed amount single use Virtual Account: + value: + reference_id: example-ref-1234 + currency: IDR + amount: 15000 + country: ID + payment_method: + type: VIRTUAL_ACCOUNT + reusability: ONE_TIME_USE + reference_id: example-1234 + virtual_account: + channel_code: BNI + channel_properties: + customer_name: Ahmad Gunawan + expires_at: 2023-01-03T17:00:00Z + metadata: + sku: example-sku-1234 + Subsequent PH Direct Debit payments after account linking: + value: + reference_id: example-ref-1234 + amount: 1500 + currency: PHP + payment_method_id: pm-9685a196-81e9-4c73-8d62-97df5aab2762 + metadata: + sku: example-sku-1234 + Subsequent tokenized E-Wallet payments after account linking: + value: + reference_id: example-ref-1234 + amount: 15000 + currency: IDR + payment_method_id: pm-2b2c6092-2100-4843-a7fc-f5c7edac7efd + metadata: + sku: example-sku-1234 + schema: + $ref: '#/components/schemas/PaymentRequest' + description: Request successful + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Get payment request by ID + tags: + - payment_request + /payment_requests/{paymentRequestId}/auth: + post: + description: Payment Request Authorize + operationId: authorizePaymentRequest + parameters: + - explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequestAuthParameters' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequest' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Payment Request Authorize + tags: + - payment_request + /payment_requests/{paymentRequestId}/auth/resend: + post: + description: Payment Request Resend Auth + operationId: resendPaymentRequestAuth + parameters: + - explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequest' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Payment Request Resend Auth + tags: + - payment_request + /payment_requests/{paymentRequestId}/captures: + get: + description: Get Payment Request Capture + operationId: getPaymentRequestCaptures + parameters: + - explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + - explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - explode: true + in: query + name: after_id + required: false + schema: + type: string + style: form + - explode: true + in: query + name: before_id + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CaptureListResponse' + description: Request successful + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Get Payment Request Capture + tags: + - payment_request + post: + description: Payment Request Capture + operationId: capturePaymentRequest + parameters: + - explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CaptureParameters' + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/Capture' + description: Capture created + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: Payment Request Capture + tags: + - payment_request +components: + parameters: + IdempotencyKey: + explode: false + in: header + name: idempotency-key + required: false + schema: + example: 5f9a3fbd571a1c4068aa40ce + type: string + style: simple + PaymentRequestID: + explode: false + in: path + name: paymentRequestId + required: true + schema: + example: pr-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + responses: + UnexpectedError: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + schemas: + Error: + properties: + error_code: + enum: + - ACCOUNT_ACCESS_BLOCKED + - ADDRESS_VALIDATION_FAILED + - AMOUNT_MISMATCHED + - API_VALIDATION_ERROR + - AUTHENTICATION_FAILED + - AUTHENTICATION_REQUIRED + - CARD_DECLINED + - CHANNEL_CODE_NOT_SUPPORTED_ERROR + - CHANNEL_NOT_ACTIVATED + - CHANNEL_UNAVAILABLE + - COF_COMBINATION_NOT_ALLOWED_ERROR + - CURRENCY_MISMATCHED + - CUSTOMER_NOT_FOUND_ERROR + - CUSTOMER_PAYMENT_METHOD_MISMATCHED + - DATA_NOT_FOUND + - DATA_NOT_FOUND_ERROR + - DECLINED_BY_ISSUER + - DECLINED_BY_PROCESSOR + - DENIED_PERSON_LIST_MATCHED + - DUPLICATE_ERROR + - DUPLICATE_REFERENCE + - EXCEEDS_CAPTURABLE_AMOUNT + - EXPIRED_CARD + - EXPIRED_OTP_ERROR + - FEATURE_NOT_ACTIVATED + - IDEMPOTENCY_ERROR + - INACTIVE_OR_UNAUTHORIZED_CARD + - INSUFFICIENT_BALANCE + - INVALID_ACCOUNT_DETAILS + - INVALID_CVV + - INVALID_OTP_ERROR + - INVALID_PAYMENT_METHOD + - ISSUER_UNAVAILABLE + - MANUAL_CAPTURE_NOT_SUPPORTED + - MAX_ACCOUNT_LINKING + - MAX_AMOUNT_LIMIT_ERROR + - MAX_OTP_ATTEMPTS_ERROR + - OPERATION_NOT_ALLOWED + - OTP_DELIVERY_ERROR + - PAYMENT_METHOD_NOT_FOUND_ERROR + - PAYMENT_REQUEST_ALREADY_COMPLETED + - PAYMENT_REQUEST_ALREADY_FAILED + - PAYMENT_REQUEST_ALREADY_FULLY_CAPTURED + - PAYMENT_STATUS_FAILED + - PROCESSOR_CONFIGURATION_ERROR + - PROCESSOR_ERROR + - PROCESSOR_TEMPORARILY_UNAVAILABLE + - PROCESSOR_TIMEOUT + - REJECTED_BY_ACQUIRER + - SERVER_ERROR + - STOLEN_CARD + - STRONG_CUSTOMER_AUTHENTICATION_REQUIRED + - SUSPECTED_FRAUDULENT + - UNAUTHORIZED + - DUPLICATED_FIXED_PAYMENT_INSTRUMENT + nullable: true + type: string + message: + example: An internal server error occurred + nullable: true + type: string + type: object + PaymentRequestCountry: + enum: + - ID + - PH + - VN + - TH + - MY + type: string + PaymentRequestCurrency: + enum: + - IDR + - PHP + - VND + - THB + - MYR + type: string + PaymentMethodType: + enum: + - CARD + - DIRECT_DEBIT + - EWALLET + - OVER_THE_COUNTER + - QR_CODE + - VIRTUAL_ACCOUNT + type: string + CardChannelProperties: + description: Card Channel Properties + example: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + nullable: false + properties: + skip_three_d_secure: + description: To indicate whether to perform 3DS during the linking phase + example: false + nullable: true + type: boolean + success_return_url: + description: URL where the end-customer is redirected if the authorization + is successful + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + nullable: true + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + failure_return_url: + description: URL where the end-customer is redirected if the authorization + failed + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + nullable: true + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + cardonfile_type: + description: Type of “credential-on-file” / “card-on-file” payment being + made. Indicate that this payment uses a previously linked Payment Method + for charging. + example: RECURRING + nullable: true + type: string + merchant_id_tag: + description: Tag for a Merchant ID that you want to associate this payment + with. For merchants using their own MIDs to specify which MID they want + to use + type: string + type: object + CardInformation: + description: Card Information + example: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + nullable: false + properties: + token_id: + type: string + masked_card_number: + description: 1st 6 and last 4 digits of the card + type: string + expiry_month: + description: Card expiry month in MM format + type: string + expiry_year: + description: Card expiry month in YY format + type: string + cardholder_name: + description: Cardholder name + nullable: true + type: string + fingerprint: + type: string + type: + type: string + network: + enum: + - VISA + - MASTERCARD + - JCB + - AMEX + - DISCOVER + type: string + country: + type: string + issuer: + type: string + required: + - expiry_month + - expiry_year + - masked_card_number + - token_id + type: object + CardVerificationResultsThreeDSecure: + example: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + properties: + three_d_secure_flow: + enum: + - CHALLENGE + - FRICTIONLESS + nullable: true + type: string + eci_code: + nullable: true + type: string + three_d_secure_result: + nullable: true + type: string + three_d_secure_result_reason: + nullable: true + type: string + three_d_secure_version: + nullable: true + type: string + type: object + CardVerificationResults: + example: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + three_d_secure: + $ref: '#/components/schemas/CardVerificationResultsThreeDSecure' + cvv_result: + nullable: true + type: string + address_verification_result: + nullable: true + type: string + type: object + Card: + example: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + currency: + $ref: '#/components/schemas/PaymentRequestCurrency' + channel_properties: + $ref: '#/components/schemas/CardChannelProperties' + card_information: + $ref: '#/components/schemas/CardInformation' + card_verification_results: + $ref: '#/components/schemas/CardVerificationResults' + required: + - card_information + - channel_properties + - currency + type: object + DirectDebitChannelCode: + description: Direct Debit Channel Code + enum: + - BCA_KLIKPAY + - BCA_ONEKLIK + - BRI + - BNI + - MANDIRI + - BPI + - BDO + - CIMBNIAGA + - MTB + - RCBC + - UBP + - AUTODEBIT_UBP + - CHINABANK + - BAY + - KTB + - BBL + - SCB + - KBANK_MB + - BAY_MB + - KTB_MB + - BBL_MB + - SCB_MB + - BDO_EPAY + - AFFIN_FPX + - AGRO_FPX + - ALLIANCE_FPX + - AMBANK_FPX + - ISLAM_FPX + - MUAMALAT_FPX + - BOC_FPX + - RAKYAT_FPX + - BSN_FPX + - CIMB_FPX + - HLB_FPX + - HSBC_FPX + - KFH_FPX + - MAYB2E_FPX + - MAYB2U_FPX + - OCBC_FPX + - PUBLIC_FPX + - RHB_FPX + - SCH_FPX + - UOB_FPX + - AFFIN_FPX_BUSINESS + - AGRO_FPX_BUSINESS + - ALLIANCE_FPX_BUSINESS + - AMBANK_FPX_BUSINESS + - ISLAM_FPX_BUSINESS + - MUAMALAT_FPX_BUSINESS + - BNP_FPX_BUSINESS + - CIMB_FPX_BUSINESS + - CITIBANK_FPX_BUSINESS + - DEUTSCHE_FPX_BUSINESS + - HLB_FPX_BUSINESS + - HSBC_FPX_BUSINESS + - RAKYAT_FPX_BUSINESS + - KFH_FPX_BUSINESS + - MAYB2E_FPX_BUSINESS + - OCBC_FPX_BUSINESS + - PUBLIC_FPX_BUSINESS + - RHB_FPX_BUSINESS + - SCH_FPX_BUSINESS + - UOB_FPX_BUSINESS + example: BRI + type: string + DirectDebitChannelPropertiesBankRedirect: + description: Direct Debit Bank Account Channel Properties + example: + mobile_number: "0812345678" + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + properties: + mobile_number: + description: Mobile number of the customer that is registered to channel + type: string + success_return_url: + format: uri + type: string + failure_return_url: + format: uri + type: string + type: object + DirectDebitChannelPropertiesBankAccount: + description: Direct Debit Bank Account Channel Properties + example: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + properties: + success_return_url: + format: uri + type: string + failure_return_url: + format: uri + type: string + mobile_number: + type: string + identity_document_number: + type: string + type: object + DirectDebitChannelPropertiesDebitCard: + description: Direct Debit Debit Card Channel Properties + example: + mobile_number: +62818555988 + card_last_four: "8888" + card_expiry: 06/24 + email: test.email@xendit.co + properties: + mobile_number: + description: Mobile number of the customer registered to the partner channel + example: +62818555988 + type: string + account_number: + example: "1234567890" + type: string + card_last_four: + description: Last four digits of the debit card + example: "8888" + type: string + card_expiry: + description: Expiry month and year of the debit card (in MM/YY format) + example: 06/24 + type: string + email: + description: Email address of the customer that is registered to the partner + channel + example: test.email@xendit.co + type: string + type: object + DirectDebitChannelProperties: + anyOf: + - $ref: '#/components/schemas/DirectDebitChannelPropertiesBankRedirect' + - $ref: '#/components/schemas/DirectDebitChannelPropertiesBankAccount' + - $ref: '#/components/schemas/DirectDebitChannelPropertiesDebitCard' + nullable: true + DirectDebitType: + enum: + - DEBIT_CARD + - BANK_ACCOUNT + - BANK_REDIRECT + type: string + DirectDebitParameters: + example: + channel_properties: null + channel_code: BRI + type: null + nullable: true + properties: + channel_code: + $ref: '#/components/schemas/DirectDebitChannelCode' + channel_properties: + $ref: '#/components/schemas/DirectDebitChannelProperties' + type: + $ref: '#/components/schemas/DirectDebitType' + required: + - channel_code + - channel_properties + type: object + DirectDebitBankAccount: + nullable: true + properties: + masked_bank_account_number: + example: 233eca40ff303ba15bf39052ca3102c6 + nullable: true + type: string + bank_account_hash: + example: 233eca40ff303ba15bf39052ca3102c6 + nullable: true + type: string + type: object + DirectDebitDebitCard: + nullable: true + properties: + mobile_number: + description: Mobile number of the customer registered to the partner channel + example: +62818555988 + nullable: true + type: string + account_number: + example: "1234567890" + type: string + card_last_four: + description: Last four digits of the debit card + example: "8888" + nullable: true + type: string + card_expiry: + description: Expiry month and year of the debit card (in MM/YY format) + example: 06/24 + nullable: true + type: string + email: + description: Email address of the customer that is registered to the partner + channel + example: test.email@xendit.co + format: email + nullable: true + type: string + type: object + DirectDebit: + allOf: + - $ref: '#/components/schemas/DirectDebitParameters' + - $ref: '#/components/schemas/DirectDebit_allOf' + description: Direct Debit Payment Method Details + nullable: true + type: object + EWalletChannelCode: + description: Ewallet Channel Code + enum: + - GCASH + - GRABPAY + - PAYMAYA + - DANA + - OVO + - LINKAJA + - SHOPEEPAY + - NEXCASH + - ASTRAPAY + - JENIUSPAY + - APPOTA + - MOMO + - VNPTWALLET + - VIETTELPAY + - ZALOPAY + - WECHATPAY + - LINEPAY + - TRUEMONEY + - ALIPAY + example: PAYMAYA + type: string + EWalletChannelProperties: + description: Ewallet Channel Properties + example: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + nullable: false + properties: + success_return_url: + description: URL where the end-customer is redirected if the authorization + is successful + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + failure_return_url: + description: URL where the end-customer is redirected if the authorization + failed + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + cancel_return_url: + description: URL where the end-customer is redirected if the authorization + cancelled + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + redeem_points: + description: "REDEEM_NONE will not use any point, REDEEM_ALL will use all\ + \ available points before cash balance is used. For OVO and ShopeePay\ + \ tokenized payment use only." + example: REDEEM_NONE + type: string + mobile:number: + type: string + cashtag: + type: string + type: object + EWalletParameters: + example: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + channel_code: PAYMAYA + nullable: true + properties: + channel_code: + $ref: '#/components/schemas/EWalletChannelCode' + channel_properties: + $ref: '#/components/schemas/EWalletChannelProperties' + type: object + EWalletAccount: + description: EWallet Account Properties + example: + name: John Peter Doe + account_details: +63(2)123456XXXX + balance: null + point_balance: null + nullable: false + properties: + name: + description: Name of the eWallet account holder. The value is null if unavailableName + of the eWallet account holder. The value is null if unavailable + nullable: true + type: string + account_details: + description: Identifier from eWallet provider e.g. phone number. The value + is null if unavailable + nullable: true + type: string + balance: + description: The main balance amount on eWallet account provided from eWallet + provider. The value is null if unavailable + format: double + nullable: true + type: number + point_balance: + description: The point balance amount on eWallet account. Applicable only + on some eWallet provider that has point system. The value is null if unavailabl + format: double + nullable: true + type: number + type: object + EWallet: + allOf: + - $ref: '#/components/schemas/EWalletParameters' + - $ref: '#/components/schemas/EWallet_allOf' + description: Ewallet Payment Method Details + nullable: true + type: object + OverTheCounterChannelCode: + description: Over The Counter Channel Code + enum: + - 7ELEVEN + - 7ELEVEN_CLIQQ + - CEBUANA + - ECPAY + - PALAWAN + - MLHUILLIER + - ECPAY_DRAGONLOAN + - LBC + - ECPAY_SCHOOL + - RD_PAWNSHOP + - CVM + - USSC + - SM_BILLS + - ROBINSONS_BILLS + - ALFAMART + - INDOMARET + example: 7ELEVEN_CLIQQ + type: string + OverTheCounterChannelProperties: + description: Over The Counter Channel Properties + example: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + properties: + payment_code: + description: "The payment code that you want to assign, e.g 12345. If you\ + \ do not send one, one will be picked at random." + example: "12345" + type: string + customer_name: + description: Name of customer. + example: Rika Sutanto + type: string + expires_at: + description: The time when the payment code will be expired. The minimum + is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date + will be 2 days from payment code generated. + example: 2022-01-01T00:00:00Z + format: date-time + type: string + required: + - customer_name + type: object + OverTheCounterParameters: + example: + amount: 6.027456183070403 + currency: null + channel_properties: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + channel_code: 7ELEVEN_CLIQQ + nullable: true + properties: + amount: + format: double + nullable: true + type: number + currency: + $ref: '#/components/schemas/PaymentRequestCurrency' + channel_code: + $ref: '#/components/schemas/OverTheCounterChannelCode' + channel_properties: + $ref: '#/components/schemas/OverTheCounterChannelProperties' + required: + - channel_code + - channel_properties + type: object + OverTheCounter: + allOf: + - $ref: '#/components/schemas/OverTheCounterParameters' + description: Over the Counter Payment Method Details + nullable: true + type: object + VirtualAccountChannelCode: + description: Virtual Account Channel Code + enum: + - BCA + - BJB + - BNI + - BRI + - MANDIRI + - PERMATA + - BSI + - CIMB + - SAHABAT_SAMPOERNA + - ARTAJASA + - PV + - VIETCAPITAL + - WOORI + - MSB + - STANDARD_CHARTERED + example: BCA + type: string + VirtualAccountChannelProperties: + description: Virtual Account Channel Properties + example: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + properties: + customer_name: + description: Name of customer. + example: Rika Sutanto + type: string + virtual_account_number: + description: "You can assign specific Virtual Account number using this\ + \ parameter. If you do not send one, one will be picked at random. Make\ + \ sure the number you specify is within your Virtual Account range." + example: "262159999999999" + type: string + expires_at: + description: "The date and time in ISO 8601 UTC+0 when the virtual account\ + \ number will be expired. Default: The default expiration date will be\ + \ 31 years from creation date." + example: 2022-01-01T00:00:00Z + format: date-time + type: string + suggested_amount: + description: "The suggested amount you want to assign. Note: Suggested amounts\ + \ is the amounts that can see as a suggestion, but user can still put\ + \ any numbers (only supported for Mandiri and BRI)" + example: 100000 + format: double + type: number + required: + - customer_name + type: object + VirtualAccountParameters: + example: + amount: 5.637376656633329 + min_amount: 1.4658129805029452 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 5.962133916683182 + currency: null + channel_properties: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + channel_code: BCA + nullable: true + properties: + min_amount: + format: double + nullable: true + type: number + max_amount: + format: double + nullable: true + type: number + amount: + format: double + nullable: true + type: number + currency: + $ref: '#/components/schemas/PaymentRequestCurrency' + channel_code: + $ref: '#/components/schemas/VirtualAccountChannelCode' + channel_properties: + $ref: '#/components/schemas/VirtualAccountChannelProperties' + alternative_display_types: + description: Alternative display requested for the virtual account + items: + enum: + - QR_STRING + type: string + type: array + required: + - channel_code + - channel_properties + type: object + VirtualAccountAlternativeDisplay: + description: Alternative Display Object + properties: + type: + description: Type of the alternative display + enum: + - QR_STRING + readOnly: true + type: string + data: + description: Data payload of the given alternative display + type: string + type: object + VirtualAccount: + allOf: + - $ref: '#/components/schemas/VirtualAccountParameters' + - $ref: '#/components/schemas/VirtualAccount_allOf' + description: Virtual Account Payment Method Details + nullable: true + type: object + QRCodeChannelCode: + description: QR Code Channel Code + enum: + - DANA + - RCBC + - LINKAJA + - PROMPTPAY + example: RCBC + nullable: true + type: string + QRCodeChannelProperties: + description: QR Code Channel Properties + example: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + nullable: false + properties: + qr_string: + type: string + expires_at: + example: 2022-01-01T00:00:00Z + format: date-time + type: string + type: object + QRCodeParameters: + example: + channel_properties: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + channel_code: RCBC + nullable: true + properties: + channel_code: + $ref: '#/components/schemas/QRCodeChannelCode' + channel_properties: + $ref: '#/components/schemas/QRCodeChannelProperties' + type: object + QRCode: + allOf: + - $ref: '#/components/schemas/QRCodeParameters' + description: QRCode Payment Method Details + nullable: true + type: object + PaymentMethodReusability: + enum: + - MULTIPLE_USE + - ONE_TIME_USE + type: string + PaymentMethodStatus: + enum: + - ACTIVE + - INACTIVE + - PENDING + - EXPIRED + - FAILED + type: string + Object: + nullable: true + type: object + PaymentMethod: + example: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + nullable: false + properties: + id: + type: string + type: + $ref: '#/components/schemas/PaymentMethodType' + created: + type: string + updated: + type: string + description: + nullable: true + type: string + reference_id: + type: string + card: + $ref: '#/components/schemas/Card' + direct_debit: + $ref: '#/components/schemas/DirectDebit' + ewallet: + $ref: '#/components/schemas/EWallet' + over_the_counter: + $ref: '#/components/schemas/OverTheCounter' + virtual_account: + $ref: '#/components/schemas/VirtualAccount' + qr_code: + $ref: '#/components/schemas/QRCode' + reusability: + $ref: '#/components/schemas/PaymentMethodReusability' + status: + $ref: '#/components/schemas/PaymentMethodStatus' + metadata: + nullable: true + type: object + required: + - id + - reusability + - status + - type + type: object + PaymentRequestCaptureMethod: + enum: + - AUTOMATIC + - MANUAL + nullable: true + type: string + PaymentRequestInitiator: + enum: + - CUSTOMER + - MERCHANT + nullable: true + type: string + PaymentRequestCardVerificationResultsThreeDeeSecure: + example: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: three_d_secure_flow + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + three_d_secure_flow: + type: string + eci_code: + type: string + three_d_secure_result: + type: string + three_d_secure_result_reason: + nullable: true + type: string + three_d_secure_version: + type: string + type: object + PaymentRequestCardVerificationResults: + example: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: three_d_secure_flow + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + nullable: true + properties: + three_d_secure: + $ref: '#/components/schemas/PaymentRequestCardVerificationResultsThreeDeeSecure' + cvv_result: + nullable: true + type: string + address_verification_result: + nullable: true + type: string + required: + - three_d_secure + type: object + PaymentRequestStatus: + enum: + - PENDING + - REQUIRES_ACTION + - CANCELED + - SUCCEEDED + - FAILED + - VOIDED + - UNKNOWN + - AWAITING_CAPTURE + type: string + PaymentRequestAction: + example: + method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + properties: + action: + enum: + - AUTH + - RESEND_AUTH + - CAPTURE + - CANCEL + - PRESENT_TO_CUSTOMER + type: string + url_type: + enum: + - API + - WEB + - MOBILE + - DEEPLINK + type: string + method: + nullable: true + type: string + url: + nullable: true + type: string + qr_code: + nullable: true + type: string + required: + - action + - method + - qr_code + - url + - url_type + type: object + PaymentRequestShippingInformation: + example: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + nullable: true + properties: + country: + type: string + street_line1: + type: string + street_line2: + type: string + city: + type: string + province_state: + type: string + postal_code: + type: string + required: + - country + type: object + PaymentRequestBasketItem: + example: + metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + nullable: true + properties: + reference_id: + type: string + name: + type: string + description: + type: string + type: + type: string + category: + type: string + sub_category: + type: string + currency: + type: string + quantity: + format: double + type: number + price: + format: double + type: number + payer_charged_currency: + type: string + payer_charged_price: + format: double + type: number + url: + type: string + metadata: + type: object + required: + - category + - currency + - name + - price + - quantity + type: object + PaymentRequestBasket: + items: + $ref: '#/components/schemas/PaymentRequestBasketItem' + nullable: true + type: array + PaymentRequest: + example: + capture_method: null + country: null + amount: 0.8008281904610115 + failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + min_amount: 6.027456183070403 + initiator: null + description: description + shipping_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + max_amount: 1.4658129805029452 + currency: null + id: id + customer_id: customer_id + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: three_d_secure_flow + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + updated: updated + business_id: business_id + actions: + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + items: + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + customer: "{}" + status: null + nullable: false + properties: + id: + type: string + created: + type: string + updated: + type: string + reference_id: + type: string + business_id: + type: string + customer_id: + nullable: true + type: string + customer: + nullable: true + type: object + amount: + format: double + type: number + min_amount: + format: double + nullable: true + type: number + max_amount: + format: double + nullable: true + type: number + country: + $ref: '#/components/schemas/PaymentRequestCountry' + currency: + $ref: '#/components/schemas/PaymentRequestCurrency' + payment_method: + $ref: '#/components/schemas/PaymentMethod' + description: + nullable: true + type: string + failure_code: + nullable: true + type: string + capture_method: + $ref: '#/components/schemas/PaymentRequestCaptureMethod' + initiator: + $ref: '#/components/schemas/PaymentRequestInitiator' + card_verification_results: + $ref: '#/components/schemas/PaymentRequestCardVerificationResults' + status: + $ref: '#/components/schemas/PaymentRequestStatus' + actions: + items: + $ref: '#/components/schemas/PaymentRequestAction' + type: array + metadata: + nullable: true + type: object + shipping_information: + $ref: '#/components/schemas/PaymentRequestShippingInformation' + items: + items: + $ref: '#/components/schemas/PaymentRequestBasketItem' + nullable: true + type: array + required: + - business_id + - created + - currency + - id + - payment_method + - reference_id + - status + - updated + type: object + PaymentRequestListResponse: + example: + data: + - capture_method: null + country: null + amount: 0.8008281904610115 + failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + min_amount: 6.027456183070403 + initiator: null + description: description + shipping_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + max_amount: 1.4658129805029452 + currency: null + id: id + customer_id: customer_id + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: three_d_secure_flow + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + updated: updated + business_id: business_id + actions: + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + items: + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + customer: "{}" + status: null + - capture_method: null + country: null + amount: 0.8008281904610115 + failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + min_amount: 6.027456183070403 + initiator: null + description: description + shipping_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + max_amount: 1.4658129805029452 + currency: null + id: id + customer_id: customer_id + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: three_d_secure_flow + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + updated: updated + business_id: business_id + actions: + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + - method: method + url_type: API + action: AUTH + qr_code: qr_code + url: url + items: + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + customer: "{}" + status: null + has_more: true + properties: + data: + items: + $ref: '#/components/schemas/PaymentRequest' + nullable: false + type: array + has_more: + type: boolean + required: + - data + - has_more + type: object + PaymentMethodParameters: + example: + ewallet: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + channel_code: PAYMAYA + reference_id: reference_id + over_the_counter: + amount: 6.027456183070403 + currency: null + channel_properties: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + channel_code: 7ELEVEN_CLIQQ + virtual_account: + amount: 5.637376656633329 + min_amount: 1.4658129805029452 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 5.962133916683182 + currency: null + channel_properties: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + channel_code: BCA + reusability: null + description: description + qr_code: + channel_properties: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + channel_code: RCBC + type: null + direct_debit: + channel_properties: null + channel_code: BRI + type: null + nullable: false + properties: + type: + $ref: '#/components/schemas/PaymentMethodType' + reusability: + $ref: '#/components/schemas/PaymentMethodReusability' + description: + nullable: true + type: string + reference_id: + type: string + direct_debit: + $ref: '#/components/schemas/DirectDebitParameters' + ewallet: + $ref: '#/components/schemas/EWalletParameters' + over_the_counter: + $ref: '#/components/schemas/OverTheCounterParameters' + virtual_account: + $ref: '#/components/schemas/VirtualAccountParameters' + qr_code: + $ref: '#/components/schemas/QRCodeParameters' + required: + - reusability + - type + type: object + PaymentRequestChannelProperties: + nullable: true + properties: + success_return_url: + description: URL where the end-customer is redirected if the authorization + is successful + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + failure_return_url: + description: URL where the end-customer is redirected if the authorization + failed + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + cancel_return_url: + description: URL where the end-customer is redirected if the authorization + cancelled + example: https://webhook.site/f4b755f5-4770-4a11-8c72-cc0b3cc6b882 + pattern: "^\\S{1,255}:\\/\\/\\S{0,1000}$" + type: string + redeem_points: + description: "REDEEM_NONE will not use any point, REDEEM_ALL will use all\ + \ available points before cash balance is used. For OVO and ShopeePay\ + \ tokenized payment use only." + example: REDEEM_NONE + type: string + require_auth: + description: "Toggle used to require end-customer to input undergo OTP validation\ + \ before completing a payment. OTP will always be required for transactions\ + \ greater than 1,000,000 IDR. For BRI tokenized payment use only." + example: false + type: boolean + merchant_id_tag: + description: 'Tag for a Merchant ID that you want to associate this payment + with. For merchants using their own MIDs to specify which MID they want + to use ' + type: string + cardonfile_type: + description: Type of “credential-on-file” / “card-on-file” payment being + made. Indicate that this payment uses a previously linked Payment Method + for charging. + example: RECURRING + nullable: true + type: string + type: object + PaymentRequestParameters: + example: + capture_method: null + amount: 0.8008281904610115 + metadata: "{}" + reference_id: reference_id + initiator: null + description: description + payment_method_id: payment_method_id + shipping_information: + country: country + city: city + province_state: province_state + street_line2: street_line2 + street_line1: street_line1 + postal_code: postal_code + currency: null + channel_properties: null + customer_id: customer_id + items: + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + - metadata: "{}" + quantity: 5.962133916683182 + reference_id: reference_id + sub_category: sub_category + description: description + type: type + url: url + price: 5.637376656633329 + name: name + payer_charged_price: 2.3021358869347655 + currency: currency + payer_charged_currency: payer_charged_currency + category: category + payment_method: + ewallet: + channel_properties: + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + cancel_return_url: https://redirect.me/cancel + channel_code: PAYMAYA + reference_id: reference_id + over_the_counter: + amount: 6.027456183070403 + currency: null + channel_properties: + payment_code: "12345" + customer_name: Rika Sutanto + expires_at: 2022-01-01T00:00:00Z + channel_code: 7ELEVEN_CLIQQ + virtual_account: + amount: 5.637376656633329 + min_amount: 1.4658129805029452 + alternative_display_types: + - QR_STRING + - QR_STRING + max_amount: 5.962133916683182 + currency: null + channel_properties: + customer_name: Rika Sutanto + description: Payment for SSS + expires_at: 2022-01-01T00:00:00Z + channel_code: BCA + reusability: null + description: description + qr_code: + channel_properties: + qr_string: 0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB + expires_at: 2022-01-01T00:00:00Z + channel_code: RCBC + type: null + direct_debit: + channel_properties: null + channel_code: BRI + type: null + customer: "{}" + nullable: false + properties: + reference_id: + type: string + amount: + format: double + type: number + currency: + $ref: '#/components/schemas/PaymentRequestCurrency' + payment_method: + $ref: '#/components/schemas/PaymentMethodParameters' + description: + nullable: true + type: string + capture_method: + $ref: '#/components/schemas/PaymentRequestCaptureMethod' + initiator: + $ref: '#/components/schemas/PaymentRequestInitiator' + payment_method_id: + type: string + channel_properties: + $ref: '#/components/schemas/PaymentRequestParameters_channel_properties' + shipping_information: + $ref: '#/components/schemas/PaymentRequestShippingInformation' + items: + items: + $ref: '#/components/schemas/PaymentRequestBasketItem' + nullable: true + type: array + customer_id: + nullable: true + type: string + customer: + nullable: true + type: object + metadata: + nullable: true + type: object + required: + - currency + type: object + PaymentRequestAuthParameters: + example: + auth_code: auth_code + nullable: false + properties: + auth_code: + type: string + required: + - auth_code + type: object + Capture: + example: + failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + payment_request_id: payment_request_id + payment_id: payment_id + captured_amount: 6.027456183070403 + authorized_amount: 0.8008281904610115 + currency: currency + channel_properties: "{}" + id: id + customer_id: customer_id + updated: updated + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + status: SUCCEEDED + nullable: false + properties: + id: + type: string + payment_request_id: + type: string + payment_id: + type: string + reference_id: + type: string + currency: + type: string + authorized_amount: + format: double + type: number + captured_amount: + format: double + type: number + status: + enum: + - SUCCEEDED + - FAILED + type: string + payment_method: + $ref: '#/components/schemas/PaymentMethod' + failure_code: + nullable: true + type: string + customer_id: + nullable: true + type: string + metadata: + nullable: true + type: object + channel_properties: + nullable: true + type: object + created: + type: string + updated: + type: string + required: + - authorized_amount + - captured_amount + - channel_properties + - created + - currency + - customer_id + - failure_code + - id + - metadata + - payment_id + - payment_method + - payment_request_id + - reference_id + - status + - updated + type: object + CaptureList: + items: + $ref: '#/components/schemas/Capture' + nullable: false + type: array + CaptureListResponse: + example: + data: + - failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + payment_request_id: payment_request_id + payment_id: payment_id + captured_amount: 6.027456183070403 + authorized_amount: 0.8008281904610115 + currency: currency + channel_properties: "{}" + id: id + customer_id: customer_id + updated: updated + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + status: SUCCEEDED + - failure_code: failure_code + metadata: "{}" + reference_id: reference_id + created: created + payment_request_id: payment_request_id + payment_id: payment_id + captured_amount: 6.027456183070403 + authorized_amount: 0.8008281904610115 + currency: currency + channel_properties: "{}" + id: id + customer_id: customer_id + updated: updated + payment_method: + metadata: "{}" + reference_id: reference_id + created: created + over_the_counter: null + description: description + reusability: null + type: null + direct_debit: null + ewallet: null + virtual_account: null + qr_code: null + id: id + updated: updated + card: + currency: null + channel_properties: + cardonfile_type: UNSCHEDULED + success_return_url: https://redirect.me/good + failure_return_url: https://redirect.me/bad + card_information: + expiry_month: expiry_month + country: country + token_id: token_id + fingerprint: fingerprint + masked_card_number: masked_card_number + cardholder_name: cardholder_name + type: type + expiry_year: expiry_year + issuer: issuer + network: VISA + card_verification_results: + cvv_result: cvv_result + address_verification_result: address_verification_result + three_d_secure: + eci_code: eci_code + three_d_secure_version: three_d_secure_version + three_d_secure_flow: CHALLENGE + three_d_secure_result: three_d_secure_result + three_d_secure_result_reason: three_d_secure_result_reason + status: null + status: SUCCEEDED + has_more: true + properties: + data: + items: + $ref: '#/components/schemas/Capture' + nullable: false + type: array + has_more: + type: boolean + required: + - data + - has_more + type: object + CaptureParameters: + example: + reference_id: reference_id + capture_amount: 0.8008281904610115 + nullable: false + properties: + reference_id: + nullable: true + type: string + capture_amount: + format: double + type: number + required: + - capture_amount + type: object + DirectDebit_allOf: + properties: + type: + $ref: '#/components/schemas/DirectDebitType' + bank_account: + $ref: '#/components/schemas/DirectDebitBankAccount' + debit_card: + $ref: '#/components/schemas/DirectDebitDebitCard' + required: + - type + type: object + example: null + EWallet_allOf: + properties: + account: + $ref: '#/components/schemas/EWalletAccount' + type: object + example: null + VirtualAccount_allOf: + properties: + alternative_displays: + items: + $ref: '#/components/schemas/VirtualAccountAlternativeDisplay' + type: array + type: object + example: null + PaymentRequestParameters_channel_properties_allOf: + properties: + cvv: + description: Three digit code written on the back of the card (usually called + CVV/CVN). + example: "123" + type: string + type: object + PaymentRequestParameters_channel_properties: + allOf: + - $ref: '#/components/schemas/PaymentRequestChannelProperties' + - $ref: '#/components/schemas/PaymentRequestParameters_channel_properties_allOf' diff --git a/docs/payment_request/Capture.md b/docs/payment_request/Capture.md new file mode 100644 index 00000000..d47a9486 --- /dev/null +++ b/docs/payment_request/Capture.md @@ -0,0 +1,385 @@ +# Capture + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | | | +| **PaymentRequestId** | **string** | | | +| **PaymentId** | **string** | | | +| **ReferenceId** | **string** | | | +| **Currency** | **string** | | | +| **AuthorizedAmount** | **float64** | | | +| **CapturedAmount** | **float64** | | | +| **Status** | **string** | | | +| **PaymentMethod** | [**PaymentMethod**](PaymentMethod.md) | | | +| **FailureCode** | **NullableString** | | | +| **CustomerId** | **NullableString** | | | +| **Metadata** | **map[string]interface{}** | | | +| **ChannelProperties** | **map[string]interface{}** | | | +| **Created** | **string** | | | +| **Updated** | **string** | | | + +## Methods + +### NewCapture + +`func NewCapture(id string, paymentRequestId string, paymentId string, referenceId string, currency string, authorizedAmount float64, capturedAmount float64, status string, paymentMethod PaymentMethod, failureCode NullableString, customerId NullableString, metadata map[string]interface{}, channelProperties map[string]interface{}, created string, updated string, ) *Capture` + +NewCapture instantiates a new Capture object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCaptureWithDefaults + +`func NewCaptureWithDefaults() *Capture` + +NewCaptureWithDefaults instantiates a new Capture object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Capture) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Capture) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Capture) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPaymentRequestId + +`func (o *Capture) GetPaymentRequestId() string` + +GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. + +### GetPaymentRequestIdOk + +`func (o *Capture) GetPaymentRequestIdOk() (*string, bool)` + +GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentRequestId + +`func (o *Capture) SetPaymentRequestId(v string)` + +SetPaymentRequestId sets PaymentRequestId field to given value. + + +### GetPaymentId + +`func (o *Capture) GetPaymentId() string` + +GetPaymentId returns the PaymentId field if non-nil, zero value otherwise. + +### GetPaymentIdOk + +`func (o *Capture) GetPaymentIdOk() (*string, bool)` + +GetPaymentIdOk returns a tuple with the PaymentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentId + +`func (o *Capture) SetPaymentId(v string)` + +SetPaymentId sets PaymentId field to given value. + + +### GetReferenceId + +`func (o *Capture) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *Capture) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *Capture) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetCurrency + +`func (o *Capture) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Capture) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Capture) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetAuthorizedAmount + +`func (o *Capture) GetAuthorizedAmount() float64` + +GetAuthorizedAmount returns the AuthorizedAmount field if non-nil, zero value otherwise. + +### GetAuthorizedAmountOk + +`func (o *Capture) GetAuthorizedAmountOk() (*float64, bool)` + +GetAuthorizedAmountOk returns a tuple with the AuthorizedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthorizedAmount + +`func (o *Capture) SetAuthorizedAmount(v float64)` + +SetAuthorizedAmount sets AuthorizedAmount field to given value. + + +### GetCapturedAmount + +`func (o *Capture) GetCapturedAmount() float64` + +GetCapturedAmount returns the CapturedAmount field if non-nil, zero value otherwise. + +### GetCapturedAmountOk + +`func (o *Capture) GetCapturedAmountOk() (*float64, bool)` + +GetCapturedAmountOk returns a tuple with the CapturedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapturedAmount + +`func (o *Capture) SetCapturedAmount(v float64)` + +SetCapturedAmount sets CapturedAmount field to given value. + + +### GetStatus + +`func (o *Capture) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Capture) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Capture) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetPaymentMethod + +`func (o *Capture) GetPaymentMethod() PaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *Capture) GetPaymentMethodOk() (*PaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *Capture) SetPaymentMethod(v PaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + + +### GetFailureCode + +`func (o *Capture) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *Capture) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *Capture) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + + +### SetFailureCodeNil + +`func (o *Capture) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *Capture) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetCustomerId + +`func (o *Capture) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *Capture) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *Capture) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + + +### SetCustomerIdNil + +`func (o *Capture) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *Capture) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetMetadata + +`func (o *Capture) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *Capture) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *Capture) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + + +### SetMetadataNil + +`func (o *Capture) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *Capture) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil +### GetChannelProperties + +`func (o *Capture) GetChannelProperties() map[string]interface{}` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *Capture) GetChannelPropertiesOk() (*map[string]interface{}, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *Capture) SetChannelProperties(v map[string]interface{})` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *Capture) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *Capture) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetCreated + +`func (o *Capture) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *Capture) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *Capture) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *Capture) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *Capture) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *Capture) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CaptureListResponse.md b/docs/payment_request/CaptureListResponse.md new file mode 100644 index 00000000..50c4edea --- /dev/null +++ b/docs/payment_request/CaptureListResponse.md @@ -0,0 +1,72 @@ +# CaptureListResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | [**Capture[]**](Capture.md) | | | +| **HasMore** | **bool** | | | + +## Methods + +### NewCaptureListResponse + +`func NewCaptureListResponse(data []Capture, hasMore bool, ) *CaptureListResponse` + +NewCaptureListResponse instantiates a new CaptureListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCaptureListResponseWithDefaults + +`func NewCaptureListResponseWithDefaults() *CaptureListResponse` + +NewCaptureListResponseWithDefaults instantiates a new CaptureListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *CaptureListResponse) GetData() []Capture` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *CaptureListResponse) GetDataOk() (*[]Capture, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *CaptureListResponse) SetData(v []Capture)` + +SetData sets Data field to given value. + + +### GetHasMore + +`func (o *CaptureListResponse) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *CaptureListResponse) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *CaptureListResponse) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CaptureParameters.md b/docs/payment_request/CaptureParameters.md new file mode 100644 index 00000000..cbb8085e --- /dev/null +++ b/docs/payment_request/CaptureParameters.md @@ -0,0 +1,87 @@ +# CaptureParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | Pointer to **NullableString** | | [optional] | +| **CaptureAmount** | **float64** | | | + +## Methods + +### NewCaptureParameters + +`func NewCaptureParameters(captureAmount float64, ) *CaptureParameters` + +NewCaptureParameters instantiates a new CaptureParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCaptureParametersWithDefaults + +`func NewCaptureParametersWithDefaults() *CaptureParameters` + +NewCaptureParametersWithDefaults instantiates a new CaptureParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *CaptureParameters) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *CaptureParameters) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *CaptureParameters) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *CaptureParameters) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### SetReferenceIdNil + +`func (o *CaptureParameters) SetReferenceIdNil(b bool)` + + SetReferenceIdNil sets the value for ReferenceId to be an explicit nil + +### UnsetReferenceId +`func (o *CaptureParameters) UnsetReferenceId()` + +UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +### GetCaptureAmount + +`func (o *CaptureParameters) GetCaptureAmount() float64` + +GetCaptureAmount returns the CaptureAmount field if non-nil, zero value otherwise. + +### GetCaptureAmountOk + +`func (o *CaptureParameters) GetCaptureAmountOk() (*float64, bool)` + +GetCaptureAmountOk returns a tuple with the CaptureAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaptureAmount + +`func (o *CaptureParameters) SetCaptureAmount(v float64)` + +SetCaptureAmount sets CaptureAmount field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/Card.md b/docs/payment_request/Card.md new file mode 100644 index 00000000..f1627160 --- /dev/null +++ b/docs/payment_request/Card.md @@ -0,0 +1,129 @@ +# Card + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | | +| **ChannelProperties** | [**CardChannelProperties**](CardChannelProperties.md) | | | +| **CardInformation** | [**CardInformation**](CardInformation.md) | | | +| **CardVerificationResults** | Pointer to [**NullableCardVerificationResults**](CardVerificationResults.md) | | [optional] | + +## Methods + +### NewCard + +`func NewCard(currency PaymentRequestCurrency, channelProperties CardChannelProperties, cardInformation CardInformation, ) *Card` + +NewCard instantiates a new Card object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardWithDefaults + +`func NewCardWithDefaults() *Card` + +NewCardWithDefaults instantiates a new Card object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrency + +`func (o *Card) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Card) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Card) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + + +### GetChannelProperties + +`func (o *Card) GetChannelProperties() CardChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *Card) GetChannelPropertiesOk() (*CardChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *Card) SetChannelProperties(v CardChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetCardInformation + +`func (o *Card) GetCardInformation() CardInformation` + +GetCardInformation returns the CardInformation field if non-nil, zero value otherwise. + +### GetCardInformationOk + +`func (o *Card) GetCardInformationOk() (*CardInformation, bool)` + +GetCardInformationOk returns a tuple with the CardInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardInformation + +`func (o *Card) SetCardInformation(v CardInformation)` + +SetCardInformation sets CardInformation field to given value. + + +### GetCardVerificationResults + +`func (o *Card) GetCardVerificationResults() CardVerificationResults` + +GetCardVerificationResults returns the CardVerificationResults field if non-nil, zero value otherwise. + +### GetCardVerificationResultsOk + +`func (o *Card) GetCardVerificationResultsOk() (*CardVerificationResults, bool)` + +GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardVerificationResults + +`func (o *Card) SetCardVerificationResults(v CardVerificationResults)` + +SetCardVerificationResults sets CardVerificationResults field to given value. + +### HasCardVerificationResults + +`func (o *Card) HasCardVerificationResults() bool` + +HasCardVerificationResults returns a boolean if a field has been set. + +### SetCardVerificationResultsNil + +`func (o *Card) SetCardVerificationResultsNil(b bool)` + + SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil + +### UnsetCardVerificationResults +`func (o *Card) UnsetCardVerificationResults()` + +UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CardChannelProperties.md b/docs/payment_request/CardChannelProperties.md new file mode 100644 index 00000000..ce889ae6 --- /dev/null +++ b/docs/payment_request/CardChannelProperties.md @@ -0,0 +1,200 @@ +# CardChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SkipThreeDSecure** | Pointer to **NullableBool** | To indicate whether to perform 3DS during the linking phase | [optional] | +| **SuccessReturnUrl** | Pointer to **NullableString** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **NullableString** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CardonfileType** | Pointer to **NullableString** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] | +| **MerchantIdTag** | Pointer to **string** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [optional] | + +## Methods + +### NewCardChannelProperties + +`func NewCardChannelProperties() *CardChannelProperties` + +NewCardChannelProperties instantiates a new CardChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardChannelPropertiesWithDefaults + +`func NewCardChannelPropertiesWithDefaults() *CardChannelProperties` + +NewCardChannelPropertiesWithDefaults instantiates a new CardChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSkipThreeDSecure + +`func (o *CardChannelProperties) GetSkipThreeDSecure() bool` + +GetSkipThreeDSecure returns the SkipThreeDSecure field if non-nil, zero value otherwise. + +### GetSkipThreeDSecureOk + +`func (o *CardChannelProperties) GetSkipThreeDSecureOk() (*bool, bool)` + +GetSkipThreeDSecureOk returns a tuple with the SkipThreeDSecure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSkipThreeDSecure + +`func (o *CardChannelProperties) SetSkipThreeDSecure(v bool)` + +SetSkipThreeDSecure sets SkipThreeDSecure field to given value. + +### HasSkipThreeDSecure + +`func (o *CardChannelProperties) HasSkipThreeDSecure() bool` + +HasSkipThreeDSecure returns a boolean if a field has been set. + +### SetSkipThreeDSecureNil + +`func (o *CardChannelProperties) SetSkipThreeDSecureNil(b bool)` + + SetSkipThreeDSecureNil sets the value for SkipThreeDSecure to be an explicit nil + +### UnsetSkipThreeDSecure +`func (o *CardChannelProperties) UnsetSkipThreeDSecure()` + +UnsetSkipThreeDSecure ensures that no value is present for SkipThreeDSecure, not even an explicit nil +### GetSuccessReturnUrl + +`func (o *CardChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *CardChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *CardChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *CardChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### SetSuccessReturnUrlNil + +`func (o *CardChannelProperties) SetSuccessReturnUrlNil(b bool)` + + SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil + +### UnsetSuccessReturnUrl +`func (o *CardChannelProperties) UnsetSuccessReturnUrl()` + +UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +### GetFailureReturnUrl + +`func (o *CardChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *CardChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *CardChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *CardChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### SetFailureReturnUrlNil + +`func (o *CardChannelProperties) SetFailureReturnUrlNil(b bool)` + + SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil + +### UnsetFailureReturnUrl +`func (o *CardChannelProperties) UnsetFailureReturnUrl()` + +UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +### GetCardonfileType + +`func (o *CardChannelProperties) GetCardonfileType() string` + +GetCardonfileType returns the CardonfileType field if non-nil, zero value otherwise. + +### GetCardonfileTypeOk + +`func (o *CardChannelProperties) GetCardonfileTypeOk() (*string, bool)` + +GetCardonfileTypeOk returns a tuple with the CardonfileType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardonfileType + +`func (o *CardChannelProperties) SetCardonfileType(v string)` + +SetCardonfileType sets CardonfileType field to given value. + +### HasCardonfileType + +`func (o *CardChannelProperties) HasCardonfileType() bool` + +HasCardonfileType returns a boolean if a field has been set. + +### SetCardonfileTypeNil + +`func (o *CardChannelProperties) SetCardonfileTypeNil(b bool)` + + SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil + +### UnsetCardonfileType +`func (o *CardChannelProperties) UnsetCardonfileType()` + +UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +### GetMerchantIdTag + +`func (o *CardChannelProperties) GetMerchantIdTag() string` + +GetMerchantIdTag returns the MerchantIdTag field if non-nil, zero value otherwise. + +### GetMerchantIdTagOk + +`func (o *CardChannelProperties) GetMerchantIdTagOk() (*string, bool)` + +GetMerchantIdTagOk returns a tuple with the MerchantIdTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantIdTag + +`func (o *CardChannelProperties) SetMerchantIdTag(v string)` + +SetMerchantIdTag sets MerchantIdTag field to given value. + +### HasMerchantIdTag + +`func (o *CardChannelProperties) HasMerchantIdTag() bool` + +HasMerchantIdTag returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CardInformation.md b/docs/payment_request/CardInformation.md new file mode 100644 index 00000000..ba6e5101 --- /dev/null +++ b/docs/payment_request/CardInformation.md @@ -0,0 +1,280 @@ +# CardInformation + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **TokenId** | **string** | | | +| **MaskedCardNumber** | **string** | 1st 6 and last 4 digits of the card | | +| **ExpiryMonth** | **string** | Card expiry month in MM format | | +| **ExpiryYear** | **string** | Card expiry month in YY format | | +| **CardholderName** | Pointer to **NullableString** | Cardholder name | [optional] | +| **Fingerprint** | Pointer to **string** | | [optional] | +| **Type** | Pointer to **string** | | [optional] | +| **Network** | Pointer to **string** | | [optional] | +| **Country** | Pointer to **string** | | [optional] | +| **Issuer** | Pointer to **string** | | [optional] | + +## Methods + +### NewCardInformation + +`func NewCardInformation(tokenId string, maskedCardNumber string, expiryMonth string, expiryYear string, ) *CardInformation` + +NewCardInformation instantiates a new CardInformation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardInformationWithDefaults + +`func NewCardInformationWithDefaults() *CardInformation` + +NewCardInformationWithDefaults instantiates a new CardInformation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTokenId + +`func (o *CardInformation) GetTokenId() string` + +GetTokenId returns the TokenId field if non-nil, zero value otherwise. + +### GetTokenIdOk + +`func (o *CardInformation) GetTokenIdOk() (*string, bool)` + +GetTokenIdOk returns a tuple with the TokenId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenId + +`func (o *CardInformation) SetTokenId(v string)` + +SetTokenId sets TokenId field to given value. + + +### GetMaskedCardNumber + +`func (o *CardInformation) GetMaskedCardNumber() string` + +GetMaskedCardNumber returns the MaskedCardNumber field if non-nil, zero value otherwise. + +### GetMaskedCardNumberOk + +`func (o *CardInformation) GetMaskedCardNumberOk() (*string, bool)` + +GetMaskedCardNumberOk returns a tuple with the MaskedCardNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaskedCardNumber + +`func (o *CardInformation) SetMaskedCardNumber(v string)` + +SetMaskedCardNumber sets MaskedCardNumber field to given value. + + +### GetExpiryMonth + +`func (o *CardInformation) GetExpiryMonth() string` + +GetExpiryMonth returns the ExpiryMonth field if non-nil, zero value otherwise. + +### GetExpiryMonthOk + +`func (o *CardInformation) GetExpiryMonthOk() (*string, bool)` + +GetExpiryMonthOk returns a tuple with the ExpiryMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryMonth + +`func (o *CardInformation) SetExpiryMonth(v string)` + +SetExpiryMonth sets ExpiryMonth field to given value. + + +### GetExpiryYear + +`func (o *CardInformation) GetExpiryYear() string` + +GetExpiryYear returns the ExpiryYear field if non-nil, zero value otherwise. + +### GetExpiryYearOk + +`func (o *CardInformation) GetExpiryYearOk() (*string, bool)` + +GetExpiryYearOk returns a tuple with the ExpiryYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiryYear + +`func (o *CardInformation) SetExpiryYear(v string)` + +SetExpiryYear sets ExpiryYear field to given value. + + +### GetCardholderName + +`func (o *CardInformation) GetCardholderName() string` + +GetCardholderName returns the CardholderName field if non-nil, zero value otherwise. + +### GetCardholderNameOk + +`func (o *CardInformation) GetCardholderNameOk() (*string, bool)` + +GetCardholderNameOk returns a tuple with the CardholderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardholderName + +`func (o *CardInformation) SetCardholderName(v string)` + +SetCardholderName sets CardholderName field to given value. + +### HasCardholderName + +`func (o *CardInformation) HasCardholderName() bool` + +HasCardholderName returns a boolean if a field has been set. + +### SetCardholderNameNil + +`func (o *CardInformation) SetCardholderNameNil(b bool)` + + SetCardholderNameNil sets the value for CardholderName to be an explicit nil + +### UnsetCardholderName +`func (o *CardInformation) UnsetCardholderName()` + +UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +### GetFingerprint + +`func (o *CardInformation) GetFingerprint() string` + +GetFingerprint returns the Fingerprint field if non-nil, zero value otherwise. + +### GetFingerprintOk + +`func (o *CardInformation) GetFingerprintOk() (*string, bool)` + +GetFingerprintOk returns a tuple with the Fingerprint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFingerprint + +`func (o *CardInformation) SetFingerprint(v string)` + +SetFingerprint sets Fingerprint field to given value. + +### HasFingerprint + +`func (o *CardInformation) HasFingerprint() bool` + +HasFingerprint returns a boolean if a field has been set. + +### GetType + +`func (o *CardInformation) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CardInformation) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CardInformation) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *CardInformation) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetNetwork + +`func (o *CardInformation) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *CardInformation) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *CardInformation) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *CardInformation) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetCountry + +`func (o *CardInformation) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *CardInformation) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *CardInformation) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *CardInformation) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetIssuer + +`func (o *CardInformation) GetIssuer() string` + +GetIssuer returns the Issuer field if non-nil, zero value otherwise. + +### GetIssuerOk + +`func (o *CardInformation) GetIssuerOk() (*string, bool)` + +GetIssuerOk returns a tuple with the Issuer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIssuer + +`func (o *CardInformation) SetIssuer(v string)` + +SetIssuer sets Issuer field to given value. + +### HasIssuer + +`func (o *CardInformation) HasIssuer() bool` + +HasIssuer returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CardVerificationResults.md b/docs/payment_request/CardVerificationResults.md new file mode 100644 index 00000000..391a4204 --- /dev/null +++ b/docs/payment_request/CardVerificationResults.md @@ -0,0 +1,128 @@ +# CardVerificationResults + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecure** | Pointer to [**CardVerificationResultsThreeDSecure**](CardVerificationResultsThreeDSecure.md) | | [optional] | +| **CvvResult** | Pointer to **NullableString** | | [optional] | +| **AddressVerificationResult** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewCardVerificationResults + +`func NewCardVerificationResults() *CardVerificationResults` + +NewCardVerificationResults instantiates a new CardVerificationResults object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardVerificationResultsWithDefaults + +`func NewCardVerificationResultsWithDefaults() *CardVerificationResults` + +NewCardVerificationResultsWithDefaults instantiates a new CardVerificationResults object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecure + +`func (o *CardVerificationResults) GetThreeDSecure() CardVerificationResultsThreeDSecure` + +GetThreeDSecure returns the ThreeDSecure field if non-nil, zero value otherwise. + +### GetThreeDSecureOk + +`func (o *CardVerificationResults) GetThreeDSecureOk() (*CardVerificationResultsThreeDSecure, bool)` + +GetThreeDSecureOk returns a tuple with the ThreeDSecure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecure + +`func (o *CardVerificationResults) SetThreeDSecure(v CardVerificationResultsThreeDSecure)` + +SetThreeDSecure sets ThreeDSecure field to given value. + +### HasThreeDSecure + +`func (o *CardVerificationResults) HasThreeDSecure() bool` + +HasThreeDSecure returns a boolean if a field has been set. + +### GetCvvResult + +`func (o *CardVerificationResults) GetCvvResult() string` + +GetCvvResult returns the CvvResult field if non-nil, zero value otherwise. + +### GetCvvResultOk + +`func (o *CardVerificationResults) GetCvvResultOk() (*string, bool)` + +GetCvvResultOk returns a tuple with the CvvResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvvResult + +`func (o *CardVerificationResults) SetCvvResult(v string)` + +SetCvvResult sets CvvResult field to given value. + +### HasCvvResult + +`func (o *CardVerificationResults) HasCvvResult() bool` + +HasCvvResult returns a boolean if a field has been set. + +### SetCvvResultNil + +`func (o *CardVerificationResults) SetCvvResultNil(b bool)` + + SetCvvResultNil sets the value for CvvResult to be an explicit nil + +### UnsetCvvResult +`func (o *CardVerificationResults) UnsetCvvResult()` + +UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +### GetAddressVerificationResult + +`func (o *CardVerificationResults) GetAddressVerificationResult() string` + +GetAddressVerificationResult returns the AddressVerificationResult field if non-nil, zero value otherwise. + +### GetAddressVerificationResultOk + +`func (o *CardVerificationResults) GetAddressVerificationResultOk() (*string, bool)` + +GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressVerificationResult + +`func (o *CardVerificationResults) SetAddressVerificationResult(v string)` + +SetAddressVerificationResult sets AddressVerificationResult field to given value. + +### HasAddressVerificationResult + +`func (o *CardVerificationResults) HasAddressVerificationResult() bool` + +HasAddressVerificationResult returns a boolean if a field has been set. + +### SetAddressVerificationResultNil + +`func (o *CardVerificationResults) SetAddressVerificationResultNil(b bool)` + + SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil + +### UnsetAddressVerificationResult +`func (o *CardVerificationResults) UnsetAddressVerificationResult()` + +UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/CardVerificationResultsThreeDSecure.md b/docs/payment_request/CardVerificationResultsThreeDSecure.md new file mode 100644 index 00000000..bbdbeacb --- /dev/null +++ b/docs/payment_request/CardVerificationResultsThreeDSecure.md @@ -0,0 +1,210 @@ +# CardVerificationResultsThreeDSecure + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecureFlow** | Pointer to **NullableString** | | [optional] | +| **EciCode** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureResult** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureResultReason** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureVersion** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewCardVerificationResultsThreeDSecure + +`func NewCardVerificationResultsThreeDSecure() *CardVerificationResultsThreeDSecure` + +NewCardVerificationResultsThreeDSecure instantiates a new CardVerificationResultsThreeDSecure object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCardVerificationResultsThreeDSecureWithDefaults + +`func NewCardVerificationResultsThreeDSecureWithDefaults() *CardVerificationResultsThreeDSecure` + +NewCardVerificationResultsThreeDSecureWithDefaults instantiates a new CardVerificationResultsThreeDSecure object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlow() string` + +GetThreeDSecureFlow returns the ThreeDSecureFlow field if non-nil, zero value otherwise. + +### GetThreeDSecureFlowOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlowOk() (*string, bool)` + +GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlow(v string)` + +SetThreeDSecureFlow sets ThreeDSecureFlow field to given value. + +### HasThreeDSecureFlow + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureFlow() bool` + +HasThreeDSecureFlow returns a boolean if a field has been set. + +### SetThreeDSecureFlowNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlowNil(b bool)` + + SetThreeDSecureFlowNil sets the value for ThreeDSecureFlow to be an explicit nil + +### UnsetThreeDSecureFlow +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureFlow()` + +UnsetThreeDSecureFlow ensures that no value is present for ThreeDSecureFlow, not even an explicit nil +### GetEciCode + +`func (o *CardVerificationResultsThreeDSecure) GetEciCode() string` + +GetEciCode returns the EciCode field if non-nil, zero value otherwise. + +### GetEciCodeOk + +`func (o *CardVerificationResultsThreeDSecure) GetEciCodeOk() (*string, bool)` + +GetEciCodeOk returns a tuple with the EciCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEciCode + +`func (o *CardVerificationResultsThreeDSecure) SetEciCode(v string)` + +SetEciCode sets EciCode field to given value. + +### HasEciCode + +`func (o *CardVerificationResultsThreeDSecure) HasEciCode() bool` + +HasEciCode returns a boolean if a field has been set. + +### SetEciCodeNil + +`func (o *CardVerificationResultsThreeDSecure) SetEciCodeNil(b bool)` + + SetEciCodeNil sets the value for EciCode to be an explicit nil + +### UnsetEciCode +`func (o *CardVerificationResultsThreeDSecure) UnsetEciCode()` + +UnsetEciCode ensures that no value is present for EciCode, not even an explicit nil +### GetThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResult() string` + +GetThreeDSecureResult returns the ThreeDSecureResult field if non-nil, zero value otherwise. + +### GetThreeDSecureResultOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultOk() (*string, bool)` + +GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResult(v string)` + +SetThreeDSecureResult sets ThreeDSecureResult field to given value. + +### HasThreeDSecureResult + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResult() bool` + +HasThreeDSecureResult returns a boolean if a field has been set. + +### SetThreeDSecureResultNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultNil(b bool)` + + SetThreeDSecureResultNil sets the value for ThreeDSecureResult to be an explicit nil + +### UnsetThreeDSecureResult +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResult()` + +UnsetThreeDSecureResult ensures that no value is present for ThreeDSecureResult, not even an explicit nil +### GetThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReason() string` + +GetThreeDSecureResultReason returns the ThreeDSecureResultReason field if non-nil, zero value otherwise. + +### GetThreeDSecureResultReasonOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReasonOk() (*string, bool)` + +GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReason(v string)` + +SetThreeDSecureResultReason sets ThreeDSecureResultReason field to given value. + +### HasThreeDSecureResultReason + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResultReason() bool` + +HasThreeDSecureResultReason returns a boolean if a field has been set. + +### SetThreeDSecureResultReasonNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReasonNil(b bool)` + + SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil + +### UnsetThreeDSecureResultReason +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResultReason()` + +UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +### GetThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersion() string` + +GetThreeDSecureVersion returns the ThreeDSecureVersion field if non-nil, zero value otherwise. + +### GetThreeDSecureVersionOk + +`func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersionOk() (*string, bool)` + +GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersion(v string)` + +SetThreeDSecureVersion sets ThreeDSecureVersion field to given value. + +### HasThreeDSecureVersion + +`func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureVersion() bool` + +HasThreeDSecureVersion returns a boolean if a field has been set. + +### SetThreeDSecureVersionNil + +`func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersionNil(b bool)` + + SetThreeDSecureVersionNil sets the value for ThreeDSecureVersion to be an explicit nil + +### UnsetThreeDSecureVersion +`func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureVersion()` + +UnsetThreeDSecureVersion ensures that no value is present for ThreeDSecureVersion, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebit.md b/docs/payment_request/DirectDebit.md new file mode 100644 index 00000000..bac4f451 --- /dev/null +++ b/docs/payment_request/DirectDebit.md @@ -0,0 +1,175 @@ +# DirectDebit + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | | +| **ChannelProperties** | [**NullableDirectDebitChannelProperties**](DirectDebitChannelProperties.md) | | | +| **Type** | [**DirectDebitType**](DirectDebitType.md) | | | +| **BankAccount** | Pointer to [**NullableDirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] | +| **DebitCard** | Pointer to [**NullableDirectDebitDebitCard**](DirectDebitDebitCard.md) | | [optional] | + +## Methods + +### NewDirectDebit + +`func NewDirectDebit(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, type_ DirectDebitType, ) *DirectDebit` + +NewDirectDebit instantiates a new DirectDebit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitWithDefaults + +`func NewDirectDebitWithDefaults() *DirectDebit` + +NewDirectDebitWithDefaults instantiates a new DirectDebit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *DirectDebit) GetChannelCode() DirectDebitChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *DirectDebit) GetChannelCodeOk() (*DirectDebitChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *DirectDebit) SetChannelCode(v DirectDebitChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *DirectDebit) GetChannelProperties() DirectDebitChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *DirectDebit) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *DirectDebit) SetChannelProperties(v DirectDebitChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *DirectDebit) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *DirectDebit) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetType + +`func (o *DirectDebit) GetType() DirectDebitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DirectDebit) GetTypeOk() (*DirectDebitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DirectDebit) SetType(v DirectDebitType)` + +SetType sets Type field to given value. + + +### GetBankAccount + +`func (o *DirectDebit) GetBankAccount() DirectDebitBankAccount` + +GetBankAccount returns the BankAccount field if non-nil, zero value otherwise. + +### GetBankAccountOk + +`func (o *DirectDebit) GetBankAccountOk() (*DirectDebitBankAccount, bool)` + +GetBankAccountOk returns a tuple with the BankAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccount + +`func (o *DirectDebit) SetBankAccount(v DirectDebitBankAccount)` + +SetBankAccount sets BankAccount field to given value. + +### HasBankAccount + +`func (o *DirectDebit) HasBankAccount() bool` + +HasBankAccount returns a boolean if a field has been set. + +### SetBankAccountNil + +`func (o *DirectDebit) SetBankAccountNil(b bool)` + + SetBankAccountNil sets the value for BankAccount to be an explicit nil + +### UnsetBankAccount +`func (o *DirectDebit) UnsetBankAccount()` + +UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +### GetDebitCard + +`func (o *DirectDebit) GetDebitCard() DirectDebitDebitCard` + +GetDebitCard returns the DebitCard field if non-nil, zero value otherwise. + +### GetDebitCardOk + +`func (o *DirectDebit) GetDebitCardOk() (*DirectDebitDebitCard, bool)` + +GetDebitCardOk returns a tuple with the DebitCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDebitCard + +`func (o *DirectDebit) SetDebitCard(v DirectDebitDebitCard)` + +SetDebitCard sets DebitCard field to given value. + +### HasDebitCard + +`func (o *DirectDebit) HasDebitCard() bool` + +HasDebitCard returns a boolean if a field has been set. + +### SetDebitCardNil + +`func (o *DirectDebit) SetDebitCardNil(b bool)` + + SetDebitCardNil sets the value for DebitCard to be an explicit nil + +### UnsetDebitCard +`func (o *DirectDebit) UnsetDebitCard()` + +UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitAllOf.md b/docs/payment_request/DirectDebitAllOf.md new file mode 100644 index 00000000..a3f8b08e --- /dev/null +++ b/docs/payment_request/DirectDebitAllOf.md @@ -0,0 +1,123 @@ +# DirectDebitAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | [**DirectDebitType**](DirectDebitType.md) | | | +| **BankAccount** | Pointer to [**NullableDirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] | +| **DebitCard** | Pointer to [**NullableDirectDebitDebitCard**](DirectDebitDebitCard.md) | | [optional] | + +## Methods + +### NewDirectDebitAllOf + +`func NewDirectDebitAllOf(type_ DirectDebitType, ) *DirectDebitAllOf` + +NewDirectDebitAllOf instantiates a new DirectDebitAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitAllOfWithDefaults + +`func NewDirectDebitAllOfWithDefaults() *DirectDebitAllOf` + +NewDirectDebitAllOfWithDefaults instantiates a new DirectDebitAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *DirectDebitAllOf) GetType() DirectDebitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DirectDebitAllOf) GetTypeOk() (*DirectDebitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DirectDebitAllOf) SetType(v DirectDebitType)` + +SetType sets Type field to given value. + + +### GetBankAccount + +`func (o *DirectDebitAllOf) GetBankAccount() DirectDebitBankAccount` + +GetBankAccount returns the BankAccount field if non-nil, zero value otherwise. + +### GetBankAccountOk + +`func (o *DirectDebitAllOf) GetBankAccountOk() (*DirectDebitBankAccount, bool)` + +GetBankAccountOk returns a tuple with the BankAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccount + +`func (o *DirectDebitAllOf) SetBankAccount(v DirectDebitBankAccount)` + +SetBankAccount sets BankAccount field to given value. + +### HasBankAccount + +`func (o *DirectDebitAllOf) HasBankAccount() bool` + +HasBankAccount returns a boolean if a field has been set. + +### SetBankAccountNil + +`func (o *DirectDebitAllOf) SetBankAccountNil(b bool)` + + SetBankAccountNil sets the value for BankAccount to be an explicit nil + +### UnsetBankAccount +`func (o *DirectDebitAllOf) UnsetBankAccount()` + +UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +### GetDebitCard + +`func (o *DirectDebitAllOf) GetDebitCard() DirectDebitDebitCard` + +GetDebitCard returns the DebitCard field if non-nil, zero value otherwise. + +### GetDebitCardOk + +`func (o *DirectDebitAllOf) GetDebitCardOk() (*DirectDebitDebitCard, bool)` + +GetDebitCardOk returns a tuple with the DebitCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDebitCard + +`func (o *DirectDebitAllOf) SetDebitCard(v DirectDebitDebitCard)` + +SetDebitCard sets DebitCard field to given value. + +### HasDebitCard + +`func (o *DirectDebitAllOf) HasDebitCard() bool` + +HasDebitCard returns a boolean if a field has been set. + +### SetDebitCardNil + +`func (o *DirectDebitAllOf) SetDebitCardNil(b bool)` + + SetDebitCardNil sets the value for DebitCard to be an explicit nil + +### UnsetDebitCard +`func (o *DirectDebitAllOf) UnsetDebitCard()` + +UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitBankAccount.md b/docs/payment_request/DirectDebitBankAccount.md new file mode 100644 index 00000000..39caeaf3 --- /dev/null +++ b/docs/payment_request/DirectDebitBankAccount.md @@ -0,0 +1,102 @@ +# DirectDebitBankAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MaskedBankAccountNumber** | Pointer to **NullableString** | | [optional] | +| **BankAccountHash** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewDirectDebitBankAccount + +`func NewDirectDebitBankAccount() *DirectDebitBankAccount` + +NewDirectDebitBankAccount instantiates a new DirectDebitBankAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitBankAccountWithDefaults + +`func NewDirectDebitBankAccountWithDefaults() *DirectDebitBankAccount` + +NewDirectDebitBankAccountWithDefaults instantiates a new DirectDebitBankAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) GetMaskedBankAccountNumber() string` + +GetMaskedBankAccountNumber returns the MaskedBankAccountNumber field if non-nil, zero value otherwise. + +### GetMaskedBankAccountNumberOk + +`func (o *DirectDebitBankAccount) GetMaskedBankAccountNumberOk() (*string, bool)` + +GetMaskedBankAccountNumberOk returns a tuple with the MaskedBankAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) SetMaskedBankAccountNumber(v string)` + +SetMaskedBankAccountNumber sets MaskedBankAccountNumber field to given value. + +### HasMaskedBankAccountNumber + +`func (o *DirectDebitBankAccount) HasMaskedBankAccountNumber() bool` + +HasMaskedBankAccountNumber returns a boolean if a field has been set. + +### SetMaskedBankAccountNumberNil + +`func (o *DirectDebitBankAccount) SetMaskedBankAccountNumberNil(b bool)` + + SetMaskedBankAccountNumberNil sets the value for MaskedBankAccountNumber to be an explicit nil + +### UnsetMaskedBankAccountNumber +`func (o *DirectDebitBankAccount) UnsetMaskedBankAccountNumber()` + +UnsetMaskedBankAccountNumber ensures that no value is present for MaskedBankAccountNumber, not even an explicit nil +### GetBankAccountHash + +`func (o *DirectDebitBankAccount) GetBankAccountHash() string` + +GetBankAccountHash returns the BankAccountHash field if non-nil, zero value otherwise. + +### GetBankAccountHashOk + +`func (o *DirectDebitBankAccount) GetBankAccountHashOk() (*string, bool)` + +GetBankAccountHashOk returns a tuple with the BankAccountHash field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankAccountHash + +`func (o *DirectDebitBankAccount) SetBankAccountHash(v string)` + +SetBankAccountHash sets BankAccountHash field to given value. + +### HasBankAccountHash + +`func (o *DirectDebitBankAccount) HasBankAccountHash() bool` + +HasBankAccountHash returns a boolean if a field has been set. + +### SetBankAccountHashNil + +`func (o *DirectDebitBankAccount) SetBankAccountHashNil(b bool)` + + SetBankAccountHashNil sets the value for BankAccountHash to be an explicit nil + +### UnsetBankAccountHash +`func (o *DirectDebitBankAccount) UnsetBankAccountHash()` + +UnsetBankAccountHash ensures that no value is present for BankAccountHash, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitChannelCode.md b/docs/payment_request/DirectDebitChannelCode.md new file mode 100644 index 00000000..8dc0f88d --- /dev/null +++ b/docs/payment_request/DirectDebitChannelCode.md @@ -0,0 +1,135 @@ +# DirectDebitChannelCode + +## Enum + + +* `BCA_KLIKPAY` (value: `"BCA_KLIKPAY"`) + +* `BCA_ONEKLIK` (value: `"BCA_ONEKLIK"`) + +* `BRI` (value: `"BRI"`) + +* `BNI` (value: `"BNI"`) + +* `MANDIRI` (value: `"MANDIRI"`) + +* `BPI` (value: `"BPI"`) + +* `BDO` (value: `"BDO"`) + +* `CIMBNIAGA` (value: `"CIMBNIAGA"`) + +* `MTB` (value: `"MTB"`) + +* `RCBC` (value: `"RCBC"`) + +* `UBP` (value: `"UBP"`) + +* `AUTODEBIT_UBP` (value: `"AUTODEBIT_UBP"`) + +* `CHINABANK` (value: `"CHINABANK"`) + +* `BAY` (value: `"BAY"`) + +* `KTB` (value: `"KTB"`) + +* `BBL` (value: `"BBL"`) + +* `SCB` (value: `"SCB"`) + +* `KBANK_MB` (value: `"KBANK_MB"`) + +* `BAY_MB` (value: `"BAY_MB"`) + +* `KTB_MB` (value: `"KTB_MB"`) + +* `BBL_MB` (value: `"BBL_MB"`) + +* `SCB_MB` (value: `"SCB_MB"`) + +* `BDO_EPAY` (value: `"BDO_EPAY"`) + +* `AFFIN_FPX` (value: `"AFFIN_FPX"`) + +* `AGRO_FPX` (value: `"AGRO_FPX"`) + +* `ALLIANCE_FPX` (value: `"ALLIANCE_FPX"`) + +* `AMBANK_FPX` (value: `"AMBANK_FPX"`) + +* `ISLAM_FPX` (value: `"ISLAM_FPX"`) + +* `MUAMALAT_FPX` (value: `"MUAMALAT_FPX"`) + +* `BOC_FPX` (value: `"BOC_FPX"`) + +* `RAKYAT_FPX` (value: `"RAKYAT_FPX"`) + +* `BSN_FPX` (value: `"BSN_FPX"`) + +* `CIMB_FPX` (value: `"CIMB_FPX"`) + +* `HLB_FPX` (value: `"HLB_FPX"`) + +* `HSBC_FPX` (value: `"HSBC_FPX"`) + +* `KFH_FPX` (value: `"KFH_FPX"`) + +* `MAYB2_E_FPX` (value: `"MAYB2E_FPX"`) + +* `MAYB2_U_FPX` (value: `"MAYB2U_FPX"`) + +* `OCBC_FPX` (value: `"OCBC_FPX"`) + +* `PUBLIC_FPX` (value: `"PUBLIC_FPX"`) + +* `RHB_FPX` (value: `"RHB_FPX"`) + +* `SCH_FPX` (value: `"SCH_FPX"`) + +* `UOB_FPX` (value: `"UOB_FPX"`) + +* `AFFIN_FPX_BUSINESS` (value: `"AFFIN_FPX_BUSINESS"`) + +* `AGRO_FPX_BUSINESS` (value: `"AGRO_FPX_BUSINESS"`) + +* `ALLIANCE_FPX_BUSINESS` (value: `"ALLIANCE_FPX_BUSINESS"`) + +* `AMBANK_FPX_BUSINESS` (value: `"AMBANK_FPX_BUSINESS"`) + +* `ISLAM_FPX_BUSINESS` (value: `"ISLAM_FPX_BUSINESS"`) + +* `MUAMALAT_FPX_BUSINESS` (value: `"MUAMALAT_FPX_BUSINESS"`) + +* `BNP_FPX_BUSINESS` (value: `"BNP_FPX_BUSINESS"`) + +* `CIMB_FPX_BUSINESS` (value: `"CIMB_FPX_BUSINESS"`) + +* `CITIBANK_FPX_BUSINESS` (value: `"CITIBANK_FPX_BUSINESS"`) + +* `DEUTSCHE_FPX_BUSINESS` (value: `"DEUTSCHE_FPX_BUSINESS"`) + +* `HLB_FPX_BUSINESS` (value: `"HLB_FPX_BUSINESS"`) + +* `HSBC_FPX_BUSINESS` (value: `"HSBC_FPX_BUSINESS"`) + +* `RAKYAT_FPX_BUSINESS` (value: `"RAKYAT_FPX_BUSINESS"`) + +* `KFH_FPX_BUSINESS` (value: `"KFH_FPX_BUSINESS"`) + +* `MAYB2_E_FPX_BUSINESS` (value: `"MAYB2E_FPX_BUSINESS"`) + +* `OCBC_FPX_BUSINESS` (value: `"OCBC_FPX_BUSINESS"`) + +* `PUBLIC_FPX_BUSINESS` (value: `"PUBLIC_FPX_BUSINESS"`) + +* `RHB_FPX_BUSINESS` (value: `"RHB_FPX_BUSINESS"`) + +* `SCH_FPX_BUSINESS` (value: `"SCH_FPX_BUSINESS"`) + +* `UOB_FPX_BUSINESS` (value: `"UOB_FPX_BUSINESS"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitChannelProperties.md b/docs/payment_request/DirectDebitChannelProperties.md new file mode 100644 index 00000000..98ad7d4a --- /dev/null +++ b/docs/payment_request/DirectDebitChannelProperties.md @@ -0,0 +1,238 @@ +# DirectDebitChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MobileNumber** | Pointer to **string** | Mobile number of the customer registered to the partner channel | [optional] | +| **SuccessReturnUrl** | Pointer to **string** | | [optional] | +| **FailureReturnUrl** | Pointer to **string** | | [optional] | +| **IdentityDocumentNumber** | Pointer to **string** | | [optional] | +| **AccountNumber** | Pointer to **string** | | [optional] | +| **CardLastFour** | Pointer to **string** | Last four digits of the debit card | [optional] | +| **CardExpiry** | Pointer to **string** | Expiry month and year of the debit card (in MM/YY format) | [optional] | +| **Email** | Pointer to **string** | Email address of the customer that is registered to the partner channel | [optional] | + +## Methods + +### NewDirectDebitChannelProperties + +`func NewDirectDebitChannelProperties() *DirectDebitChannelProperties` + +NewDirectDebitChannelProperties instantiates a new DirectDebitChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitChannelPropertiesWithDefaults + +`func NewDirectDebitChannelPropertiesWithDefaults() *DirectDebitChannelProperties` + +NewDirectDebitChannelPropertiesWithDefaults instantiates a new DirectDebitChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMobileNumber + +`func (o *DirectDebitChannelProperties) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitChannelProperties) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitChannelProperties) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitChannelProperties) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### GetSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *DirectDebitChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *DirectDebitChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *DirectDebitChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *DirectDebitChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *DirectDebitChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *DirectDebitChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) GetIdentityDocumentNumber() string` + +GetIdentityDocumentNumber returns the IdentityDocumentNumber field if non-nil, zero value otherwise. + +### GetIdentityDocumentNumberOk + +`func (o *DirectDebitChannelProperties) GetIdentityDocumentNumberOk() (*string, bool)` + +GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) SetIdentityDocumentNumber(v string)` + +SetIdentityDocumentNumber sets IdentityDocumentNumber field to given value. + +### HasIdentityDocumentNumber + +`func (o *DirectDebitChannelProperties) HasIdentityDocumentNumber() bool` + +HasIdentityDocumentNumber returns a boolean if a field has been set. + +### GetAccountNumber + +`func (o *DirectDebitChannelProperties) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *DirectDebitChannelProperties) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *DirectDebitChannelProperties) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + +### HasAccountNumber + +`func (o *DirectDebitChannelProperties) HasAccountNumber() bool` + +HasAccountNumber returns a boolean if a field has been set. + +### GetCardLastFour + +`func (o *DirectDebitChannelProperties) GetCardLastFour() string` + +GetCardLastFour returns the CardLastFour field if non-nil, zero value otherwise. + +### GetCardLastFourOk + +`func (o *DirectDebitChannelProperties) GetCardLastFourOk() (*string, bool)` + +GetCardLastFourOk returns a tuple with the CardLastFour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardLastFour + +`func (o *DirectDebitChannelProperties) SetCardLastFour(v string)` + +SetCardLastFour sets CardLastFour field to given value. + +### HasCardLastFour + +`func (o *DirectDebitChannelProperties) HasCardLastFour() bool` + +HasCardLastFour returns a boolean if a field has been set. + +### GetCardExpiry + +`func (o *DirectDebitChannelProperties) GetCardExpiry() string` + +GetCardExpiry returns the CardExpiry field if non-nil, zero value otherwise. + +### GetCardExpiryOk + +`func (o *DirectDebitChannelProperties) GetCardExpiryOk() (*string, bool)` + +GetCardExpiryOk returns a tuple with the CardExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardExpiry + +`func (o *DirectDebitChannelProperties) SetCardExpiry(v string)` + +SetCardExpiry sets CardExpiry field to given value. + +### HasCardExpiry + +`func (o *DirectDebitChannelProperties) HasCardExpiry() bool` + +HasCardExpiry returns a boolean if a field has been set. + +### GetEmail + +`func (o *DirectDebitChannelProperties) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DirectDebitChannelProperties) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DirectDebitChannelProperties) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DirectDebitChannelProperties) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitChannelPropertiesBankAccount.md b/docs/payment_request/DirectDebitChannelPropertiesBankAccount.md new file mode 100644 index 00000000..37b212d6 --- /dev/null +++ b/docs/payment_request/DirectDebitChannelPropertiesBankAccount.md @@ -0,0 +1,134 @@ +# DirectDebitChannelPropertiesBankAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | | [optional] | +| **FailureReturnUrl** | Pointer to **string** | | [optional] | +| **MobileNumber** | Pointer to **string** | | [optional] | +| **IdentityDocumentNumber** | Pointer to **string** | | [optional] | + +## Methods + +### NewDirectDebitChannelPropertiesBankAccount + +`func NewDirectDebitChannelPropertiesBankAccount() *DirectDebitChannelPropertiesBankAccount` + +NewDirectDebitChannelPropertiesBankAccount instantiates a new DirectDebitChannelPropertiesBankAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitChannelPropertiesBankAccountWithDefaults + +`func NewDirectDebitChannelPropertiesBankAccountWithDefaults() *DirectDebitChannelPropertiesBankAccount` + +NewDirectDebitChannelPropertiesBankAccountWithDefaults instantiates a new DirectDebitChannelPropertiesBankAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *DirectDebitChannelPropertiesBankAccount) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *DirectDebitChannelPropertiesBankAccount) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankAccount) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetMobileNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitChannelPropertiesBankAccount) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### GetIdentityDocumentNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) GetIdentityDocumentNumber() string` + +GetIdentityDocumentNumber returns the IdentityDocumentNumber field if non-nil, zero value otherwise. + +### GetIdentityDocumentNumberOk + +`func (o *DirectDebitChannelPropertiesBankAccount) GetIdentityDocumentNumberOk() (*string, bool)` + +GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIdentityDocumentNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) SetIdentityDocumentNumber(v string)` + +SetIdentityDocumentNumber sets IdentityDocumentNumber field to given value. + +### HasIdentityDocumentNumber + +`func (o *DirectDebitChannelPropertiesBankAccount) HasIdentityDocumentNumber() bool` + +HasIdentityDocumentNumber returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitChannelPropertiesBankRedirect.md b/docs/payment_request/DirectDebitChannelPropertiesBankRedirect.md new file mode 100644 index 00000000..8b9fc24c --- /dev/null +++ b/docs/payment_request/DirectDebitChannelPropertiesBankRedirect.md @@ -0,0 +1,108 @@ +# DirectDebitChannelPropertiesBankRedirect + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MobileNumber** | Pointer to **string** | Mobile number of the customer that is registered to channel | [optional] | +| **SuccessReturnUrl** | Pointer to **string** | | [optional] | +| **FailureReturnUrl** | Pointer to **string** | | [optional] | + +## Methods + +### NewDirectDebitChannelPropertiesBankRedirect + +`func NewDirectDebitChannelPropertiesBankRedirect() *DirectDebitChannelPropertiesBankRedirect` + +NewDirectDebitChannelPropertiesBankRedirect instantiates a new DirectDebitChannelPropertiesBankRedirect object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitChannelPropertiesBankRedirectWithDefaults + +`func NewDirectDebitChannelPropertiesBankRedirectWithDefaults() *DirectDebitChannelPropertiesBankRedirect` + +NewDirectDebitChannelPropertiesBankRedirectWithDefaults instantiates a new DirectDebitChannelPropertiesBankRedirect object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMobileNumber + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitChannelPropertiesBankRedirect) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitChannelPropertiesBankRedirect) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### GetSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *DirectDebitChannelPropertiesBankRedirect) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *DirectDebitChannelPropertiesBankRedirect) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitChannelPropertiesDebitCard.md b/docs/payment_request/DirectDebitChannelPropertiesDebitCard.md new file mode 100644 index 00000000..09a5092f --- /dev/null +++ b/docs/payment_request/DirectDebitChannelPropertiesDebitCard.md @@ -0,0 +1,160 @@ +# DirectDebitChannelPropertiesDebitCard + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MobileNumber** | Pointer to **string** | Mobile number of the customer registered to the partner channel | [optional] | +| **AccountNumber** | Pointer to **string** | | [optional] | +| **CardLastFour** | Pointer to **string** | Last four digits of the debit card | [optional] | +| **CardExpiry** | Pointer to **string** | Expiry month and year of the debit card (in MM/YY format) | [optional] | +| **Email** | Pointer to **string** | Email address of the customer that is registered to the partner channel | [optional] | + +## Methods + +### NewDirectDebitChannelPropertiesDebitCard + +`func NewDirectDebitChannelPropertiesDebitCard() *DirectDebitChannelPropertiesDebitCard` + +NewDirectDebitChannelPropertiesDebitCard instantiates a new DirectDebitChannelPropertiesDebitCard object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitChannelPropertiesDebitCardWithDefaults + +`func NewDirectDebitChannelPropertiesDebitCardWithDefaults() *DirectDebitChannelPropertiesDebitCard` + +NewDirectDebitChannelPropertiesDebitCardWithDefaults instantiates a new DirectDebitChannelPropertiesDebitCard object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMobileNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitChannelPropertiesDebitCard) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### GetAccountNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *DirectDebitChannelPropertiesDebitCard) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + +### HasAccountNumber + +`func (o *DirectDebitChannelPropertiesDebitCard) HasAccountNumber() bool` + +HasAccountNumber returns a boolean if a field has been set. + +### GetCardLastFour + +`func (o *DirectDebitChannelPropertiesDebitCard) GetCardLastFour() string` + +GetCardLastFour returns the CardLastFour field if non-nil, zero value otherwise. + +### GetCardLastFourOk + +`func (o *DirectDebitChannelPropertiesDebitCard) GetCardLastFourOk() (*string, bool)` + +GetCardLastFourOk returns a tuple with the CardLastFour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardLastFour + +`func (o *DirectDebitChannelPropertiesDebitCard) SetCardLastFour(v string)` + +SetCardLastFour sets CardLastFour field to given value. + +### HasCardLastFour + +`func (o *DirectDebitChannelPropertiesDebitCard) HasCardLastFour() bool` + +HasCardLastFour returns a boolean if a field has been set. + +### GetCardExpiry + +`func (o *DirectDebitChannelPropertiesDebitCard) GetCardExpiry() string` + +GetCardExpiry returns the CardExpiry field if non-nil, zero value otherwise. + +### GetCardExpiryOk + +`func (o *DirectDebitChannelPropertiesDebitCard) GetCardExpiryOk() (*string, bool)` + +GetCardExpiryOk returns a tuple with the CardExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardExpiry + +`func (o *DirectDebitChannelPropertiesDebitCard) SetCardExpiry(v string)` + +SetCardExpiry sets CardExpiry field to given value. + +### HasCardExpiry + +`func (o *DirectDebitChannelPropertiesDebitCard) HasCardExpiry() bool` + +HasCardExpiry returns a boolean if a field has been set. + +### GetEmail + +`func (o *DirectDebitChannelPropertiesDebitCard) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DirectDebitChannelPropertiesDebitCard) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DirectDebitChannelPropertiesDebitCard) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DirectDebitChannelPropertiesDebitCard) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitDebitCard.md b/docs/payment_request/DirectDebitDebitCard.md new file mode 100644 index 00000000..4a38f2f7 --- /dev/null +++ b/docs/payment_request/DirectDebitDebitCard.md @@ -0,0 +1,200 @@ +# DirectDebitDebitCard + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MobileNumber** | Pointer to **NullableString** | Mobile number of the customer registered to the partner channel | [optional] | +| **AccountNumber** | Pointer to **string** | | [optional] | +| **CardLastFour** | Pointer to **NullableString** | Last four digits of the debit card | [optional] | +| **CardExpiry** | Pointer to **NullableString** | Expiry month and year of the debit card (in MM/YY format) | [optional] | +| **Email** | Pointer to **NullableString** | Email address of the customer that is registered to the partner channel | [optional] | + +## Methods + +### NewDirectDebitDebitCard + +`func NewDirectDebitDebitCard() *DirectDebitDebitCard` + +NewDirectDebitDebitCard instantiates a new DirectDebitDebitCard object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitDebitCardWithDefaults + +`func NewDirectDebitDebitCardWithDefaults() *DirectDebitDebitCard` + +NewDirectDebitDebitCardWithDefaults instantiates a new DirectDebitDebitCard object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMobileNumber + +`func (o *DirectDebitDebitCard) GetMobileNumber() string` + +GetMobileNumber returns the MobileNumber field if non-nil, zero value otherwise. + +### GetMobileNumberOk + +`func (o *DirectDebitDebitCard) GetMobileNumberOk() (*string, bool)` + +GetMobileNumberOk returns a tuple with the MobileNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobileNumber + +`func (o *DirectDebitDebitCard) SetMobileNumber(v string)` + +SetMobileNumber sets MobileNumber field to given value. + +### HasMobileNumber + +`func (o *DirectDebitDebitCard) HasMobileNumber() bool` + +HasMobileNumber returns a boolean if a field has been set. + +### SetMobileNumberNil + +`func (o *DirectDebitDebitCard) SetMobileNumberNil(b bool)` + + SetMobileNumberNil sets the value for MobileNumber to be an explicit nil + +### UnsetMobileNumber +`func (o *DirectDebitDebitCard) UnsetMobileNumber()` + +UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +### GetAccountNumber + +`func (o *DirectDebitDebitCard) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *DirectDebitDebitCard) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *DirectDebitDebitCard) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + +### HasAccountNumber + +`func (o *DirectDebitDebitCard) HasAccountNumber() bool` + +HasAccountNumber returns a boolean if a field has been set. + +### GetCardLastFour + +`func (o *DirectDebitDebitCard) GetCardLastFour() string` + +GetCardLastFour returns the CardLastFour field if non-nil, zero value otherwise. + +### GetCardLastFourOk + +`func (o *DirectDebitDebitCard) GetCardLastFourOk() (*string, bool)` + +GetCardLastFourOk returns a tuple with the CardLastFour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardLastFour + +`func (o *DirectDebitDebitCard) SetCardLastFour(v string)` + +SetCardLastFour sets CardLastFour field to given value. + +### HasCardLastFour + +`func (o *DirectDebitDebitCard) HasCardLastFour() bool` + +HasCardLastFour returns a boolean if a field has been set. + +### SetCardLastFourNil + +`func (o *DirectDebitDebitCard) SetCardLastFourNil(b bool)` + + SetCardLastFourNil sets the value for CardLastFour to be an explicit nil + +### UnsetCardLastFour +`func (o *DirectDebitDebitCard) UnsetCardLastFour()` + +UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +### GetCardExpiry + +`func (o *DirectDebitDebitCard) GetCardExpiry() string` + +GetCardExpiry returns the CardExpiry field if non-nil, zero value otherwise. + +### GetCardExpiryOk + +`func (o *DirectDebitDebitCard) GetCardExpiryOk() (*string, bool)` + +GetCardExpiryOk returns a tuple with the CardExpiry field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardExpiry + +`func (o *DirectDebitDebitCard) SetCardExpiry(v string)` + +SetCardExpiry sets CardExpiry field to given value. + +### HasCardExpiry + +`func (o *DirectDebitDebitCard) HasCardExpiry() bool` + +HasCardExpiry returns a boolean if a field has been set. + +### SetCardExpiryNil + +`func (o *DirectDebitDebitCard) SetCardExpiryNil(b bool)` + + SetCardExpiryNil sets the value for CardExpiry to be an explicit nil + +### UnsetCardExpiry +`func (o *DirectDebitDebitCard) UnsetCardExpiry()` + +UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +### GetEmail + +`func (o *DirectDebitDebitCard) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DirectDebitDebitCard) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DirectDebitDebitCard) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DirectDebitDebitCard) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmailNil + +`func (o *DirectDebitDebitCard) SetEmailNil(b bool)` + + SetEmailNil sets the value for Email to be an explicit nil + +### UnsetEmail +`func (o *DirectDebitDebitCard) UnsetEmail()` + +UnsetEmail ensures that no value is present for Email, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitParameters.md b/docs/payment_request/DirectDebitParameters.md new file mode 100644 index 00000000..2bdcf6ac --- /dev/null +++ b/docs/payment_request/DirectDebitParameters.md @@ -0,0 +1,108 @@ +# DirectDebitParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | | +| **ChannelProperties** | [**NullableDirectDebitChannelProperties**](DirectDebitChannelProperties.md) | | | +| **Type** | Pointer to [**DirectDebitType**](DirectDebitType.md) | | [optional] | + +## Methods + +### NewDirectDebitParameters + +`func NewDirectDebitParameters(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, ) *DirectDebitParameters` + +NewDirectDebitParameters instantiates a new DirectDebitParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDirectDebitParametersWithDefaults + +`func NewDirectDebitParametersWithDefaults() *DirectDebitParameters` + +NewDirectDebitParametersWithDefaults instantiates a new DirectDebitParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *DirectDebitParameters) GetChannelCode() DirectDebitChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *DirectDebitParameters) GetChannelCodeOk() (*DirectDebitChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *DirectDebitParameters) SetChannelCode(v DirectDebitChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *DirectDebitParameters) GetChannelProperties() DirectDebitChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *DirectDebitParameters) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *DirectDebitParameters) SetChannelProperties(v DirectDebitChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### SetChannelPropertiesNil + +`func (o *DirectDebitParameters) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *DirectDebitParameters) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetType + +`func (o *DirectDebitParameters) GetType() DirectDebitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DirectDebitParameters) GetTypeOk() (*DirectDebitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DirectDebitParameters) SetType(v DirectDebitType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *DirectDebitParameters) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/DirectDebitType.md b/docs/payment_request/DirectDebitType.md new file mode 100644 index 00000000..e307caa2 --- /dev/null +++ b/docs/payment_request/DirectDebitType.md @@ -0,0 +1,15 @@ +# DirectDebitType + +## Enum + + +* `DEBIT_CARD` (value: `"DEBIT_CARD"`) + +* `BANK_ACCOUNT` (value: `"BANK_ACCOUNT"`) + +* `BANK_REDIRECT` (value: `"BANK_REDIRECT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWallet.md b/docs/payment_request/EWallet.md new file mode 100644 index 00000000..482e7063 --- /dev/null +++ b/docs/payment_request/EWallet.md @@ -0,0 +1,108 @@ +# EWallet + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to [**EWalletChannelCode**](EWalletChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**EWalletChannelProperties**](EWalletChannelProperties.md) | | [optional] | +| **Account** | Pointer to [**EWalletAccount**](EWalletAccount.md) | | [optional] | + +## Methods + +### NewEWallet + +`func NewEWallet() *EWallet` + +NewEWallet instantiates a new EWallet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletWithDefaults + +`func NewEWalletWithDefaults() *EWallet` + +NewEWalletWithDefaults instantiates a new EWallet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *EWallet) GetChannelCode() EWalletChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *EWallet) GetChannelCodeOk() (*EWalletChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *EWallet) SetChannelCode(v EWalletChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *EWallet) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### GetChannelProperties + +`func (o *EWallet) GetChannelProperties() EWalletChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *EWallet) GetChannelPropertiesOk() (*EWalletChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *EWallet) SetChannelProperties(v EWalletChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *EWallet) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetAccount + +`func (o *EWallet) GetAccount() EWalletAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *EWallet) GetAccountOk() (*EWalletAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *EWallet) SetAccount(v EWalletAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *EWallet) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWalletAccount.md b/docs/payment_request/EWalletAccount.md new file mode 100644 index 00000000..445abbb5 --- /dev/null +++ b/docs/payment_request/EWalletAccount.md @@ -0,0 +1,174 @@ +# EWalletAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Name** | Pointer to **NullableString** | Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable | [optional] | +| **AccountDetails** | Pointer to **NullableString** | Identifier from eWallet provider e.g. phone number. The value is null if unavailable | [optional] | +| **Balance** | Pointer to **NullableFloat64** | The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable | [optional] | +| **PointBalance** | Pointer to **NullableFloat64** | The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl | [optional] | + +## Methods + +### NewEWalletAccount + +`func NewEWalletAccount() *EWalletAccount` + +NewEWalletAccount instantiates a new EWalletAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletAccountWithDefaults + +`func NewEWalletAccountWithDefaults() *EWalletAccount` + +NewEWalletAccountWithDefaults instantiates a new EWalletAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *EWalletAccount) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *EWalletAccount) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *EWalletAccount) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *EWalletAccount) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetNameNil + +`func (o *EWalletAccount) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *EWalletAccount) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil +### GetAccountDetails + +`func (o *EWalletAccount) GetAccountDetails() string` + +GetAccountDetails returns the AccountDetails field if non-nil, zero value otherwise. + +### GetAccountDetailsOk + +`func (o *EWalletAccount) GetAccountDetailsOk() (*string, bool)` + +GetAccountDetailsOk returns a tuple with the AccountDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountDetails + +`func (o *EWalletAccount) SetAccountDetails(v string)` + +SetAccountDetails sets AccountDetails field to given value. + +### HasAccountDetails + +`func (o *EWalletAccount) HasAccountDetails() bool` + +HasAccountDetails returns a boolean if a field has been set. + +### SetAccountDetailsNil + +`func (o *EWalletAccount) SetAccountDetailsNil(b bool)` + + SetAccountDetailsNil sets the value for AccountDetails to be an explicit nil + +### UnsetAccountDetails +`func (o *EWalletAccount) UnsetAccountDetails()` + +UnsetAccountDetails ensures that no value is present for AccountDetails, not even an explicit nil +### GetBalance + +`func (o *EWalletAccount) GetBalance() float64` + +GetBalance returns the Balance field if non-nil, zero value otherwise. + +### GetBalanceOk + +`func (o *EWalletAccount) GetBalanceOk() (*float64, bool)` + +GetBalanceOk returns a tuple with the Balance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBalance + +`func (o *EWalletAccount) SetBalance(v float64)` + +SetBalance sets Balance field to given value. + +### HasBalance + +`func (o *EWalletAccount) HasBalance() bool` + +HasBalance returns a boolean if a field has been set. + +### SetBalanceNil + +`func (o *EWalletAccount) SetBalanceNil(b bool)` + + SetBalanceNil sets the value for Balance to be an explicit nil + +### UnsetBalance +`func (o *EWalletAccount) UnsetBalance()` + +UnsetBalance ensures that no value is present for Balance, not even an explicit nil +### GetPointBalance + +`func (o *EWalletAccount) GetPointBalance() float64` + +GetPointBalance returns the PointBalance field if non-nil, zero value otherwise. + +### GetPointBalanceOk + +`func (o *EWalletAccount) GetPointBalanceOk() (*float64, bool)` + +GetPointBalanceOk returns a tuple with the PointBalance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPointBalance + +`func (o *EWalletAccount) SetPointBalance(v float64)` + +SetPointBalance sets PointBalance field to given value. + +### HasPointBalance + +`func (o *EWalletAccount) HasPointBalance() bool` + +HasPointBalance returns a boolean if a field has been set. + +### SetPointBalanceNil + +`func (o *EWalletAccount) SetPointBalanceNil(b bool)` + + SetPointBalanceNil sets the value for PointBalance to be an explicit nil + +### UnsetPointBalance +`func (o *EWalletAccount) UnsetPointBalance()` + +UnsetPointBalance ensures that no value is present for PointBalance, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWalletAllOf.md b/docs/payment_request/EWalletAllOf.md new file mode 100644 index 00000000..3aa29dfe --- /dev/null +++ b/docs/payment_request/EWalletAllOf.md @@ -0,0 +1,56 @@ +# EWalletAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Account** | Pointer to [**EWalletAccount**](EWalletAccount.md) | | [optional] | + +## Methods + +### NewEWalletAllOf + +`func NewEWalletAllOf() *EWalletAllOf` + +NewEWalletAllOf instantiates a new EWalletAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletAllOfWithDefaults + +`func NewEWalletAllOfWithDefaults() *EWalletAllOf` + +NewEWalletAllOfWithDefaults instantiates a new EWalletAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccount + +`func (o *EWalletAllOf) GetAccount() EWalletAccount` + +GetAccount returns the Account field if non-nil, zero value otherwise. + +### GetAccountOk + +`func (o *EWalletAllOf) GetAccountOk() (*EWalletAccount, bool)` + +GetAccountOk returns a tuple with the Account field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccount + +`func (o *EWalletAllOf) SetAccount(v EWalletAccount)` + +SetAccount sets Account field to given value. + +### HasAccount + +`func (o *EWalletAllOf) HasAccount() bool` + +HasAccount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWalletChannelCode.md b/docs/payment_request/EWalletChannelCode.md new file mode 100644 index 00000000..e0ac2e3f --- /dev/null +++ b/docs/payment_request/EWalletChannelCode.md @@ -0,0 +1,47 @@ +# EWalletChannelCode + +## Enum + + +* `GCASH` (value: `"GCASH"`) + +* `GRABPAY` (value: `"GRABPAY"`) + +* `PAYMAYA` (value: `"PAYMAYA"`) + +* `DANA` (value: `"DANA"`) + +* `OVO` (value: `"OVO"`) + +* `LINKAJA` (value: `"LINKAJA"`) + +* `SHOPEEPAY` (value: `"SHOPEEPAY"`) + +* `NEXCASH` (value: `"NEXCASH"`) + +* `ASTRAPAY` (value: `"ASTRAPAY"`) + +* `JENIUSPAY` (value: `"JENIUSPAY"`) + +* `APPOTA` (value: `"APPOTA"`) + +* `MOMO` (value: `"MOMO"`) + +* `VNPTWALLET` (value: `"VNPTWALLET"`) + +* `VIETTELPAY` (value: `"VIETTELPAY"`) + +* `ZALOPAY` (value: `"ZALOPAY"`) + +* `WECHATPAY` (value: `"WECHATPAY"`) + +* `LINEPAY` (value: `"LINEPAY"`) + +* `TRUEMONEY` (value: `"TRUEMONEY"`) + +* `ALIPAY` (value: `"ALIPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWalletChannelProperties.md b/docs/payment_request/EWalletChannelProperties.md new file mode 100644 index 00000000..5d78ef8a --- /dev/null +++ b/docs/payment_request/EWalletChannelProperties.md @@ -0,0 +1,186 @@ +# EWalletChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CancelReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization cancelled | [optional] | +| **RedeemPoints** | Pointer to **string** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] | +| **Mobilenumber** | Pointer to **string** | | [optional] | +| **Cashtag** | Pointer to **string** | | [optional] | + +## Methods + +### NewEWalletChannelProperties + +`func NewEWalletChannelProperties() *EWalletChannelProperties` + +NewEWalletChannelProperties instantiates a new EWalletChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletChannelPropertiesWithDefaults + +`func NewEWalletChannelPropertiesWithDefaults() *EWalletChannelProperties` + +NewEWalletChannelPropertiesWithDefaults instantiates a new EWalletChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *EWalletChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *EWalletChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *EWalletChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *EWalletChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *EWalletChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *EWalletChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *EWalletChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *EWalletChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetCancelReturnUrl + +`func (o *EWalletChannelProperties) GetCancelReturnUrl() string` + +GetCancelReturnUrl returns the CancelReturnUrl field if non-nil, zero value otherwise. + +### GetCancelReturnUrlOk + +`func (o *EWalletChannelProperties) GetCancelReturnUrlOk() (*string, bool)` + +GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelReturnUrl + +`func (o *EWalletChannelProperties) SetCancelReturnUrl(v string)` + +SetCancelReturnUrl sets CancelReturnUrl field to given value. + +### HasCancelReturnUrl + +`func (o *EWalletChannelProperties) HasCancelReturnUrl() bool` + +HasCancelReturnUrl returns a boolean if a field has been set. + +### GetRedeemPoints + +`func (o *EWalletChannelProperties) GetRedeemPoints() string` + +GetRedeemPoints returns the RedeemPoints field if non-nil, zero value otherwise. + +### GetRedeemPointsOk + +`func (o *EWalletChannelProperties) GetRedeemPointsOk() (*string, bool)` + +GetRedeemPointsOk returns a tuple with the RedeemPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedeemPoints + +`func (o *EWalletChannelProperties) SetRedeemPoints(v string)` + +SetRedeemPoints sets RedeemPoints field to given value. + +### HasRedeemPoints + +`func (o *EWalletChannelProperties) HasRedeemPoints() bool` + +HasRedeemPoints returns a boolean if a field has been set. + +### GetMobilenumber + +`func (o *EWalletChannelProperties) GetMobilenumber() string` + +GetMobilenumber returns the Mobilenumber field if non-nil, zero value otherwise. + +### GetMobilenumberOk + +`func (o *EWalletChannelProperties) GetMobilenumberOk() (*string, bool)` + +GetMobilenumberOk returns a tuple with the Mobilenumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMobilenumber + +`func (o *EWalletChannelProperties) SetMobilenumber(v string)` + +SetMobilenumber sets Mobilenumber field to given value. + +### HasMobilenumber + +`func (o *EWalletChannelProperties) HasMobilenumber() bool` + +HasMobilenumber returns a boolean if a field has been set. + +### GetCashtag + +`func (o *EWalletChannelProperties) GetCashtag() string` + +GetCashtag returns the Cashtag field if non-nil, zero value otherwise. + +### GetCashtagOk + +`func (o *EWalletChannelProperties) GetCashtagOk() (*string, bool)` + +GetCashtagOk returns a tuple with the Cashtag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCashtag + +`func (o *EWalletChannelProperties) SetCashtag(v string)` + +SetCashtag sets Cashtag field to given value. + +### HasCashtag + +`func (o *EWalletChannelProperties) HasCashtag() bool` + +HasCashtag returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/EWalletParameters.md b/docs/payment_request/EWalletParameters.md new file mode 100644 index 00000000..51b40631 --- /dev/null +++ b/docs/payment_request/EWalletParameters.md @@ -0,0 +1,82 @@ +# EWalletParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to [**EWalletChannelCode**](EWalletChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**EWalletChannelProperties**](EWalletChannelProperties.md) | | [optional] | + +## Methods + +### NewEWalletParameters + +`func NewEWalletParameters() *EWalletParameters` + +NewEWalletParameters instantiates a new EWalletParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEWalletParametersWithDefaults + +`func NewEWalletParametersWithDefaults() *EWalletParameters` + +NewEWalletParametersWithDefaults instantiates a new EWalletParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *EWalletParameters) GetChannelCode() EWalletChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *EWalletParameters) GetChannelCodeOk() (*EWalletChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *EWalletParameters) SetChannelCode(v EWalletChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *EWalletParameters) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### GetChannelProperties + +`func (o *EWalletParameters) GetChannelProperties() EWalletChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *EWalletParameters) GetChannelPropertiesOk() (*EWalletChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *EWalletParameters) SetChannelProperties(v EWalletChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *EWalletParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/Error.md b/docs/payment_request/Error.md new file mode 100644 index 00000000..eea6015f --- /dev/null +++ b/docs/payment_request/Error.md @@ -0,0 +1,102 @@ +# Error + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **NullableString** | | [optional] | +| **Message** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewError + +`func NewError() *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *Error) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *Error) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *Error) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *Error) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### SetErrorCodeNil + +`func (o *Error) SetErrorCodeNil(b bool)` + + SetErrorCodeNil sets the value for ErrorCode to be an explicit nil + +### UnsetErrorCode +`func (o *Error) UnsetErrorCode()` + +UnsetErrorCode ensures that no value is present for ErrorCode, not even an explicit nil +### GetMessage + +`func (o *Error) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *Error) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *Error) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *Error) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### SetMessageNil + +`func (o *Error) SetMessageNil(b bool)` + + SetMessageNil sets the value for Message to be an explicit nil + +### UnsetMessage +`func (o *Error) UnsetMessage()` + +UnsetMessage ensures that no value is present for Message, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/OverTheCounter.md b/docs/payment_request/OverTheCounter.md new file mode 100644 index 00000000..84386d93 --- /dev/null +++ b/docs/payment_request/OverTheCounter.md @@ -0,0 +1,134 @@ +# OverTheCounter + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | [optional] | +| **ChannelCode** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | | +| **ChannelProperties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | | + +## Methods + +### NewOverTheCounter + +`func NewOverTheCounter(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties, ) *OverTheCounter` + +NewOverTheCounter instantiates a new OverTheCounter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterWithDefaults + +`func NewOverTheCounterWithDefaults() *OverTheCounter` + +NewOverTheCounterWithDefaults instantiates a new OverTheCounter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *OverTheCounter) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *OverTheCounter) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *OverTheCounter) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *OverTheCounter) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *OverTheCounter) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *OverTheCounter) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *OverTheCounter) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *OverTheCounter) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *OverTheCounter) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *OverTheCounter) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *OverTheCounter) GetChannelCode() OverTheCounterChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *OverTheCounter) GetChannelCodeOk() (*OverTheCounterChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *OverTheCounter) SetChannelCode(v OverTheCounterChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *OverTheCounter) GetChannelProperties() OverTheCounterChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *OverTheCounter) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *OverTheCounter) SetChannelProperties(v OverTheCounterChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/OverTheCounterChannelCode.md b/docs/payment_request/OverTheCounterChannelCode.md new file mode 100644 index 00000000..340f17cc --- /dev/null +++ b/docs/payment_request/OverTheCounterChannelCode.md @@ -0,0 +1,41 @@ +# OverTheCounterChannelCode + +## Enum + + +* `_7_ELEVEN` (value: `"7ELEVEN"`) + +* `_7_ELEVEN_CLIQQ` (value: `"7ELEVEN_CLIQQ"`) + +* `CEBUANA` (value: `"CEBUANA"`) + +* `ECPAY` (value: `"ECPAY"`) + +* `PALAWAN` (value: `"PALAWAN"`) + +* `MLHUILLIER` (value: `"MLHUILLIER"`) + +* `ECPAY_DRAGONLOAN` (value: `"ECPAY_DRAGONLOAN"`) + +* `LBC` (value: `"LBC"`) + +* `ECPAY_SCHOOL` (value: `"ECPAY_SCHOOL"`) + +* `RD_PAWNSHOP` (value: `"RD_PAWNSHOP"`) + +* `CVM` (value: `"CVM"`) + +* `USSC` (value: `"USSC"`) + +* `SM_BILLS` (value: `"SM_BILLS"`) + +* `ROBINSONS_BILLS` (value: `"ROBINSONS_BILLS"`) + +* `ALFAMART` (value: `"ALFAMART"`) + +* `INDOMARET` (value: `"INDOMARET"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/OverTheCounterChannelProperties.md b/docs/payment_request/OverTheCounterChannelProperties.md new file mode 100644 index 00000000..5454d548 --- /dev/null +++ b/docs/payment_request/OverTheCounterChannelProperties.md @@ -0,0 +1,103 @@ +# OverTheCounterChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **PaymentCode** | Pointer to **string** | The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random. | [optional] | +| **CustomerName** | **string** | Name of customer. | | +| **ExpiresAt** | Pointer to **time.Time** | The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. | [optional] | + +## Methods + +### NewOverTheCounterChannelProperties + +`func NewOverTheCounterChannelProperties(customerName string, ) *OverTheCounterChannelProperties` + +NewOverTheCounterChannelProperties instantiates a new OverTheCounterChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterChannelPropertiesWithDefaults + +`func NewOverTheCounterChannelPropertiesWithDefaults() *OverTheCounterChannelProperties` + +NewOverTheCounterChannelPropertiesWithDefaults instantiates a new OverTheCounterChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPaymentCode + +`func (o *OverTheCounterChannelProperties) GetPaymentCode() string` + +GetPaymentCode returns the PaymentCode field if non-nil, zero value otherwise. + +### GetPaymentCodeOk + +`func (o *OverTheCounterChannelProperties) GetPaymentCodeOk() (*string, bool)` + +GetPaymentCodeOk returns a tuple with the PaymentCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentCode + +`func (o *OverTheCounterChannelProperties) SetPaymentCode(v string)` + +SetPaymentCode sets PaymentCode field to given value. + +### HasPaymentCode + +`func (o *OverTheCounterChannelProperties) HasPaymentCode() bool` + +HasPaymentCode returns a boolean if a field has been set. + +### GetCustomerName + +`func (o *OverTheCounterChannelProperties) GetCustomerName() string` + +GetCustomerName returns the CustomerName field if non-nil, zero value otherwise. + +### GetCustomerNameOk + +`func (o *OverTheCounterChannelProperties) GetCustomerNameOk() (*string, bool)` + +GetCustomerNameOk returns a tuple with the CustomerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerName + +`func (o *OverTheCounterChannelProperties) SetCustomerName(v string)` + +SetCustomerName sets CustomerName field to given value. + + +### GetExpiresAt + +`func (o *OverTheCounterChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *OverTheCounterChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *OverTheCounterChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *OverTheCounterChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/OverTheCounterParameters.md b/docs/payment_request/OverTheCounterParameters.md new file mode 100644 index 00000000..57cebc24 --- /dev/null +++ b/docs/payment_request/OverTheCounterParameters.md @@ -0,0 +1,134 @@ +# OverTheCounterParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | [optional] | +| **ChannelCode** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | | +| **ChannelProperties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | | + +## Methods + +### NewOverTheCounterParameters + +`func NewOverTheCounterParameters(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties, ) *OverTheCounterParameters` + +NewOverTheCounterParameters instantiates a new OverTheCounterParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOverTheCounterParametersWithDefaults + +`func NewOverTheCounterParametersWithDefaults() *OverTheCounterParameters` + +NewOverTheCounterParametersWithDefaults instantiates a new OverTheCounterParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *OverTheCounterParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *OverTheCounterParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *OverTheCounterParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *OverTheCounterParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *OverTheCounterParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *OverTheCounterParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *OverTheCounterParameters) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *OverTheCounterParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *OverTheCounterParameters) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *OverTheCounterParameters) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *OverTheCounterParameters) GetChannelCode() OverTheCounterChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *OverTheCounterParameters) GetChannelCodeOk() (*OverTheCounterChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *OverTheCounterParameters) SetChannelCode(v OverTheCounterChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *OverTheCounterParameters) GetChannelProperties() OverTheCounterChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *OverTheCounterParameters) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *OverTheCounterParameters) SetChannelProperties(v OverTheCounterChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentMethod.md b/docs/payment_request/PaymentMethod.md new file mode 100644 index 00000000..0868c895 --- /dev/null +++ b/docs/payment_request/PaymentMethod.md @@ -0,0 +1,480 @@ +# PaymentMethod + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | | | +| **Type** | [**PaymentMethodType**](PaymentMethodType.md) | | | +| **Created** | Pointer to **string** | | [optional] | +| **Updated** | Pointer to **string** | | [optional] | +| **Description** | Pointer to **NullableString** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Card** | Pointer to [**NullableCard**](Card.md) | | [optional] | +| **DirectDebit** | Pointer to [**NullableDirectDebit**](DirectDebit.md) | | [optional] | +| **Ewallet** | Pointer to [**NullableEWallet**](EWallet.md) | | [optional] | +| **OverTheCounter** | Pointer to [**NullableOverTheCounter**](OverTheCounter.md) | | [optional] | +| **VirtualAccount** | Pointer to [**NullableVirtualAccount**](VirtualAccount.md) | | [optional] | +| **QrCode** | Pointer to [**NullableQRCode**](QRCode.md) | | [optional] | +| **Reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | | +| **Status** | [**PaymentMethodStatus**](PaymentMethodStatus.md) | | | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewPaymentMethod + +`func NewPaymentMethod(id string, type_ PaymentMethodType, reusability PaymentMethodReusability, status PaymentMethodStatus, ) *PaymentMethod` + +NewPaymentMethod instantiates a new PaymentMethod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodWithDefaults + +`func NewPaymentMethodWithDefaults() *PaymentMethod` + +NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PaymentMethod) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PaymentMethod) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PaymentMethod) SetId(v string)` + +SetId sets Id field to given value. + + +### GetType + +`func (o *PaymentMethod) GetType() PaymentMethodType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentMethod) GetTypeOk() (*PaymentMethodType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentMethod) SetType(v PaymentMethodType)` + +SetType sets Type field to given value. + + +### GetCreated + +`func (o *PaymentMethod) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentMethod) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentMethod) SetCreated(v string)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *PaymentMethod) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetUpdated + +`func (o *PaymentMethod) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *PaymentMethod) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *PaymentMethod) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + +### HasUpdated + +`func (o *PaymentMethod) HasUpdated() bool` + +HasUpdated returns a boolean if a field has been set. + +### GetDescription + +`func (o *PaymentMethod) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentMethod) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentMethod) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentMethod) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentMethod) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentMethod) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetReferenceId + +`func (o *PaymentMethod) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentMethod) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentMethod) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentMethod) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetCard + +`func (o *PaymentMethod) GetCard() Card` + +GetCard returns the Card field if non-nil, zero value otherwise. + +### GetCardOk + +`func (o *PaymentMethod) GetCardOk() (*Card, bool)` + +GetCardOk returns a tuple with the Card field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCard + +`func (o *PaymentMethod) SetCard(v Card)` + +SetCard sets Card field to given value. + +### HasCard + +`func (o *PaymentMethod) HasCard() bool` + +HasCard returns a boolean if a field has been set. + +### SetCardNil + +`func (o *PaymentMethod) SetCardNil(b bool)` + + SetCardNil sets the value for Card to be an explicit nil + +### UnsetCard +`func (o *PaymentMethod) UnsetCard()` + +UnsetCard ensures that no value is present for Card, not even an explicit nil +### GetDirectDebit + +`func (o *PaymentMethod) GetDirectDebit() DirectDebit` + +GetDirectDebit returns the DirectDebit field if non-nil, zero value otherwise. + +### GetDirectDebitOk + +`func (o *PaymentMethod) GetDirectDebitOk() (*DirectDebit, bool)` + +GetDirectDebitOk returns a tuple with the DirectDebit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectDebit + +`func (o *PaymentMethod) SetDirectDebit(v DirectDebit)` + +SetDirectDebit sets DirectDebit field to given value. + +### HasDirectDebit + +`func (o *PaymentMethod) HasDirectDebit() bool` + +HasDirectDebit returns a boolean if a field has been set. + +### SetDirectDebitNil + +`func (o *PaymentMethod) SetDirectDebitNil(b bool)` + + SetDirectDebitNil sets the value for DirectDebit to be an explicit nil + +### UnsetDirectDebit +`func (o *PaymentMethod) UnsetDirectDebit()` + +UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +### GetEwallet + +`func (o *PaymentMethod) GetEwallet() EWallet` + +GetEwallet returns the Ewallet field if non-nil, zero value otherwise. + +### GetEwalletOk + +`func (o *PaymentMethod) GetEwalletOk() (*EWallet, bool)` + +GetEwalletOk returns a tuple with the Ewallet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwallet + +`func (o *PaymentMethod) SetEwallet(v EWallet)` + +SetEwallet sets Ewallet field to given value. + +### HasEwallet + +`func (o *PaymentMethod) HasEwallet() bool` + +HasEwallet returns a boolean if a field has been set. + +### SetEwalletNil + +`func (o *PaymentMethod) SetEwalletNil(b bool)` + + SetEwalletNil sets the value for Ewallet to be an explicit nil + +### UnsetEwallet +`func (o *PaymentMethod) UnsetEwallet()` + +UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +### GetOverTheCounter + +`func (o *PaymentMethod) GetOverTheCounter() OverTheCounter` + +GetOverTheCounter returns the OverTheCounter field if non-nil, zero value otherwise. + +### GetOverTheCounterOk + +`func (o *PaymentMethod) GetOverTheCounterOk() (*OverTheCounter, bool)` + +GetOverTheCounterOk returns a tuple with the OverTheCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverTheCounter + +`func (o *PaymentMethod) SetOverTheCounter(v OverTheCounter)` + +SetOverTheCounter sets OverTheCounter field to given value. + +### HasOverTheCounter + +`func (o *PaymentMethod) HasOverTheCounter() bool` + +HasOverTheCounter returns a boolean if a field has been set. + +### SetOverTheCounterNil + +`func (o *PaymentMethod) SetOverTheCounterNil(b bool)` + + SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil + +### UnsetOverTheCounter +`func (o *PaymentMethod) UnsetOverTheCounter()` + +UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +### GetVirtualAccount + +`func (o *PaymentMethod) GetVirtualAccount() VirtualAccount` + +GetVirtualAccount returns the VirtualAccount field if non-nil, zero value otherwise. + +### GetVirtualAccountOk + +`func (o *PaymentMethod) GetVirtualAccountOk() (*VirtualAccount, bool)` + +GetVirtualAccountOk returns a tuple with the VirtualAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccount + +`func (o *PaymentMethod) SetVirtualAccount(v VirtualAccount)` + +SetVirtualAccount sets VirtualAccount field to given value. + +### HasVirtualAccount + +`func (o *PaymentMethod) HasVirtualAccount() bool` + +HasVirtualAccount returns a boolean if a field has been set. + +### SetVirtualAccountNil + +`func (o *PaymentMethod) SetVirtualAccountNil(b bool)` + + SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil + +### UnsetVirtualAccount +`func (o *PaymentMethod) UnsetVirtualAccount()` + +UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil +### GetQrCode + +`func (o *PaymentMethod) GetQrCode() QRCode` + +GetQrCode returns the QrCode field if non-nil, zero value otherwise. + +### GetQrCodeOk + +`func (o *PaymentMethod) GetQrCodeOk() (*QRCode, bool)` + +GetQrCodeOk returns a tuple with the QrCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCode + +`func (o *PaymentMethod) SetQrCode(v QRCode)` + +SetQrCode sets QrCode field to given value. + +### HasQrCode + +`func (o *PaymentMethod) HasQrCode() bool` + +HasQrCode returns a boolean if a field has been set. + +### SetQrCodeNil + +`func (o *PaymentMethod) SetQrCodeNil(b bool)` + + SetQrCodeNil sets the value for QrCode to be an explicit nil + +### UnsetQrCode +`func (o *PaymentMethod) UnsetQrCode()` + +UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil +### GetReusability + +`func (o *PaymentMethod) GetReusability() PaymentMethodReusability` + +GetReusability returns the Reusability field if non-nil, zero value otherwise. + +### GetReusabilityOk + +`func (o *PaymentMethod) GetReusabilityOk() (*PaymentMethodReusability, bool)` + +GetReusabilityOk returns a tuple with the Reusability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReusability + +`func (o *PaymentMethod) SetReusability(v PaymentMethodReusability)` + +SetReusability sets Reusability field to given value. + + +### GetStatus + +`func (o *PaymentMethod) GetStatus() PaymentMethodStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PaymentMethod) GetStatusOk() (*PaymentMethodStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PaymentMethod) SetStatus(v PaymentMethodStatus)` + +SetStatus sets Status field to given value. + + +### GetMetadata + +`func (o *PaymentMethod) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentMethod) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentMethod) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentMethod) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentMethod) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentMethod) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentMethodParameters.md b/docs/payment_request/PaymentMethodParameters.md new file mode 100644 index 00000000..c614d05a --- /dev/null +++ b/docs/payment_request/PaymentMethodParameters.md @@ -0,0 +1,314 @@ +# PaymentMethodParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | [**PaymentMethodType**](PaymentMethodType.md) | | | +| **Reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | | +| **Description** | Pointer to **NullableString** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **DirectDebit** | Pointer to [**NullableDirectDebitParameters**](DirectDebitParameters.md) | | [optional] | +| **Ewallet** | Pointer to [**NullableEWalletParameters**](EWalletParameters.md) | | [optional] | +| **OverTheCounter** | Pointer to [**NullableOverTheCounterParameters**](OverTheCounterParameters.md) | | [optional] | +| **VirtualAccount** | Pointer to [**NullableVirtualAccountParameters**](VirtualAccountParameters.md) | | [optional] | +| **QrCode** | Pointer to [**NullableQRCodeParameters**](QRCodeParameters.md) | | [optional] | + +## Methods + +### NewPaymentMethodParameters + +`func NewPaymentMethodParameters(type_ PaymentMethodType, reusability PaymentMethodReusability, ) *PaymentMethodParameters` + +NewPaymentMethodParameters instantiates a new PaymentMethodParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodParametersWithDefaults + +`func NewPaymentMethodParametersWithDefaults() *PaymentMethodParameters` + +NewPaymentMethodParametersWithDefaults instantiates a new PaymentMethodParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *PaymentMethodParameters) GetType() PaymentMethodType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentMethodParameters) GetTypeOk() (*PaymentMethodType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentMethodParameters) SetType(v PaymentMethodType)` + +SetType sets Type field to given value. + + +### GetReusability + +`func (o *PaymentMethodParameters) GetReusability() PaymentMethodReusability` + +GetReusability returns the Reusability field if non-nil, zero value otherwise. + +### GetReusabilityOk + +`func (o *PaymentMethodParameters) GetReusabilityOk() (*PaymentMethodReusability, bool)` + +GetReusabilityOk returns a tuple with the Reusability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReusability + +`func (o *PaymentMethodParameters) SetReusability(v PaymentMethodReusability)` + +SetReusability sets Reusability field to given value. + + +### GetDescription + +`func (o *PaymentMethodParameters) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentMethodParameters) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentMethodParameters) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentMethodParameters) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentMethodParameters) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentMethodParameters) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetReferenceId + +`func (o *PaymentMethodParameters) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentMethodParameters) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentMethodParameters) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentMethodParameters) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetDirectDebit + +`func (o *PaymentMethodParameters) GetDirectDebit() DirectDebitParameters` + +GetDirectDebit returns the DirectDebit field if non-nil, zero value otherwise. + +### GetDirectDebitOk + +`func (o *PaymentMethodParameters) GetDirectDebitOk() (*DirectDebitParameters, bool)` + +GetDirectDebitOk returns a tuple with the DirectDebit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectDebit + +`func (o *PaymentMethodParameters) SetDirectDebit(v DirectDebitParameters)` + +SetDirectDebit sets DirectDebit field to given value. + +### HasDirectDebit + +`func (o *PaymentMethodParameters) HasDirectDebit() bool` + +HasDirectDebit returns a boolean if a field has been set. + +### SetDirectDebitNil + +`func (o *PaymentMethodParameters) SetDirectDebitNil(b bool)` + + SetDirectDebitNil sets the value for DirectDebit to be an explicit nil + +### UnsetDirectDebit +`func (o *PaymentMethodParameters) UnsetDirectDebit()` + +UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +### GetEwallet + +`func (o *PaymentMethodParameters) GetEwallet() EWalletParameters` + +GetEwallet returns the Ewallet field if non-nil, zero value otherwise. + +### GetEwalletOk + +`func (o *PaymentMethodParameters) GetEwalletOk() (*EWalletParameters, bool)` + +GetEwalletOk returns a tuple with the Ewallet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwallet + +`func (o *PaymentMethodParameters) SetEwallet(v EWalletParameters)` + +SetEwallet sets Ewallet field to given value. + +### HasEwallet + +`func (o *PaymentMethodParameters) HasEwallet() bool` + +HasEwallet returns a boolean if a field has been set. + +### SetEwalletNil + +`func (o *PaymentMethodParameters) SetEwalletNil(b bool)` + + SetEwalletNil sets the value for Ewallet to be an explicit nil + +### UnsetEwallet +`func (o *PaymentMethodParameters) UnsetEwallet()` + +UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +### GetOverTheCounter + +`func (o *PaymentMethodParameters) GetOverTheCounter() OverTheCounterParameters` + +GetOverTheCounter returns the OverTheCounter field if non-nil, zero value otherwise. + +### GetOverTheCounterOk + +`func (o *PaymentMethodParameters) GetOverTheCounterOk() (*OverTheCounterParameters, bool)` + +GetOverTheCounterOk returns a tuple with the OverTheCounter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOverTheCounter + +`func (o *PaymentMethodParameters) SetOverTheCounter(v OverTheCounterParameters)` + +SetOverTheCounter sets OverTheCounter field to given value. + +### HasOverTheCounter + +`func (o *PaymentMethodParameters) HasOverTheCounter() bool` + +HasOverTheCounter returns a boolean if a field has been set. + +### SetOverTheCounterNil + +`func (o *PaymentMethodParameters) SetOverTheCounterNil(b bool)` + + SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil + +### UnsetOverTheCounter +`func (o *PaymentMethodParameters) UnsetOverTheCounter()` + +UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +### GetVirtualAccount + +`func (o *PaymentMethodParameters) GetVirtualAccount() VirtualAccountParameters` + +GetVirtualAccount returns the VirtualAccount field if non-nil, zero value otherwise. + +### GetVirtualAccountOk + +`func (o *PaymentMethodParameters) GetVirtualAccountOk() (*VirtualAccountParameters, bool)` + +GetVirtualAccountOk returns a tuple with the VirtualAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccount + +`func (o *PaymentMethodParameters) SetVirtualAccount(v VirtualAccountParameters)` + +SetVirtualAccount sets VirtualAccount field to given value. + +### HasVirtualAccount + +`func (o *PaymentMethodParameters) HasVirtualAccount() bool` + +HasVirtualAccount returns a boolean if a field has been set. + +### SetVirtualAccountNil + +`func (o *PaymentMethodParameters) SetVirtualAccountNil(b bool)` + + SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil + +### UnsetVirtualAccount +`func (o *PaymentMethodParameters) UnsetVirtualAccount()` + +UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil +### GetQrCode + +`func (o *PaymentMethodParameters) GetQrCode() QRCodeParameters` + +GetQrCode returns the QrCode field if non-nil, zero value otherwise. + +### GetQrCodeOk + +`func (o *PaymentMethodParameters) GetQrCodeOk() (*QRCodeParameters, bool)` + +GetQrCodeOk returns a tuple with the QrCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCode + +`func (o *PaymentMethodParameters) SetQrCode(v QRCodeParameters)` + +SetQrCode sets QrCode field to given value. + +### HasQrCode + +`func (o *PaymentMethodParameters) HasQrCode() bool` + +HasQrCode returns a boolean if a field has been set. + +### SetQrCodeNil + +`func (o *PaymentMethodParameters) SetQrCodeNil(b bool)` + + SetQrCodeNil sets the value for QrCode to be an explicit nil + +### UnsetQrCode +`func (o *PaymentMethodParameters) UnsetQrCode()` + +UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentMethodReusability.md b/docs/payment_request/PaymentMethodReusability.md new file mode 100644 index 00000000..b1184bbf --- /dev/null +++ b/docs/payment_request/PaymentMethodReusability.md @@ -0,0 +1,13 @@ +# PaymentMethodReusability + +## Enum + + +* `MULTIPLE_USE` (value: `"MULTIPLE_USE"`) + +* `ONE_TIME_USE` (value: `"ONE_TIME_USE"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentMethodStatus.md b/docs/payment_request/PaymentMethodStatus.md new file mode 100644 index 00000000..07c0b3b9 --- /dev/null +++ b/docs/payment_request/PaymentMethodStatus.md @@ -0,0 +1,19 @@ +# PaymentMethodStatus + +## Enum + + +* `ACTIVE` (value: `"ACTIVE"`) + +* `INACTIVE` (value: `"INACTIVE"`) + +* `PENDING` (value: `"PENDING"`) + +* `EXPIRED` (value: `"EXPIRED"`) + +* `FAILED` (value: `"FAILED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentMethodType.md b/docs/payment_request/PaymentMethodType.md new file mode 100644 index 00000000..a439adca --- /dev/null +++ b/docs/payment_request/PaymentMethodType.md @@ -0,0 +1,21 @@ +# PaymentMethodType + +## Enum + + +* `CARD` (value: `"CARD"`) + +* `DIRECT_DEBIT` (value: `"DIRECT_DEBIT"`) + +* `EWALLET` (value: `"EWALLET"`) + +* `OVER_THE_COUNTER` (value: `"OVER_THE_COUNTER"`) + +* `QR_CODE` (value: `"QR_CODE"`) + +* `VIRTUAL_ACCOUNT` (value: `"VIRTUAL_ACCOUNT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequest.md b/docs/payment_request/PaymentRequest.md new file mode 100644 index 00000000..6c8571fd --- /dev/null +++ b/docs/payment_request/PaymentRequest.md @@ -0,0 +1,708 @@ +# PaymentRequest + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | | | +| **Created** | **string** | | | +| **Updated** | **string** | | | +| **ReferenceId** | **string** | | | +| **BusinessId** | **string** | | | +| **CustomerId** | Pointer to **NullableString** | | [optional] | +| **Customer** | Pointer to **map[string]interface{}** | | [optional] | +| **Amount** | Pointer to **float64** | | [optional] | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Country** | Pointer to [**PaymentRequestCountry**](PaymentRequestCountry.md) | | [optional] | +| **Currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | | +| **PaymentMethod** | [**PaymentMethod**](PaymentMethod.md) | | | +| **Description** | Pointer to **NullableString** | | [optional] | +| **FailureCode** | Pointer to **NullableString** | | [optional] | +| **CaptureMethod** | Pointer to [**NullablePaymentRequestCaptureMethod**](PaymentRequestCaptureMethod.md) | | [optional] | +| **Initiator** | Pointer to [**NullablePaymentRequestInitiator**](PaymentRequestInitiator.md) | | [optional] | +| **CardVerificationResults** | Pointer to [**NullablePaymentRequestCardVerificationResults**](PaymentRequestCardVerificationResults.md) | | [optional] | +| **Status** | [**PaymentRequestStatus**](PaymentRequestStatus.md) | | | +| **Actions** | Pointer to [**PaymentRequestAction[]**](PaymentRequestAction.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | +| **ShippingInformation** | Pointer to [**NullablePaymentRequestShippingInformation**](PaymentRequestShippingInformation.md) | | [optional] | +| **Items** | Pointer to [**PaymentRequestBasketItem[]**](PaymentRequestBasketItem.md) | | [optional] | + +## Methods + +### NewPaymentRequest + +`func NewPaymentRequest(id string, created string, updated string, referenceId string, businessId string, currency PaymentRequestCurrency, paymentMethod PaymentMethod, status PaymentRequestStatus, ) *PaymentRequest` + +NewPaymentRequest instantiates a new PaymentRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestWithDefaults + +`func NewPaymentRequestWithDefaults() *PaymentRequest` + +NewPaymentRequestWithDefaults instantiates a new PaymentRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PaymentRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PaymentRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PaymentRequest) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreated + +`func (o *PaymentRequest) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentRequest) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentRequest) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *PaymentRequest) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *PaymentRequest) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *PaymentRequest) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + + +### GetReferenceId + +`func (o *PaymentRequest) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentRequest) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentRequest) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetBusinessId + +`func (o *PaymentRequest) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *PaymentRequest) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *PaymentRequest) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetCustomerId + +`func (o *PaymentRequest) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *PaymentRequest) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *PaymentRequest) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *PaymentRequest) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *PaymentRequest) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *PaymentRequest) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetCustomer + +`func (o *PaymentRequest) GetCustomer() map[string]interface{}` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *PaymentRequest) GetCustomerOk() (*map[string]interface{}, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *PaymentRequest) SetCustomer(v map[string]interface{})` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *PaymentRequest) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### SetCustomerNil + +`func (o *PaymentRequest) SetCustomerNil(b bool)` + + SetCustomerNil sets the value for Customer to be an explicit nil + +### UnsetCustomer +`func (o *PaymentRequest) UnsetCustomer()` + +UnsetCustomer ensures that no value is present for Customer, not even an explicit nil +### GetAmount + +`func (o *PaymentRequest) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *PaymentRequest) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *PaymentRequest) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *PaymentRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetMinAmount + +`func (o *PaymentRequest) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *PaymentRequest) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *PaymentRequest) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *PaymentRequest) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *PaymentRequest) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *PaymentRequest) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *PaymentRequest) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *PaymentRequest) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *PaymentRequest) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *PaymentRequest) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *PaymentRequest) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *PaymentRequest) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetCountry + +`func (o *PaymentRequest) GetCountry() PaymentRequestCountry` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentRequest) GetCountryOk() (*PaymentRequestCountry, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentRequest) SetCountry(v PaymentRequestCountry)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *PaymentRequest) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCurrency + +`func (o *PaymentRequest) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *PaymentRequest) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *PaymentRequest) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + + +### GetPaymentMethod + +`func (o *PaymentRequest) GetPaymentMethod() PaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *PaymentRequest) GetPaymentMethodOk() (*PaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *PaymentRequest) SetPaymentMethod(v PaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + + +### GetDescription + +`func (o *PaymentRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentRequest) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentRequest) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetFailureCode + +`func (o *PaymentRequest) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *PaymentRequest) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *PaymentRequest) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *PaymentRequest) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### SetFailureCodeNil + +`func (o *PaymentRequest) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *PaymentRequest) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetCaptureMethod + +`func (o *PaymentRequest) GetCaptureMethod() PaymentRequestCaptureMethod` + +GetCaptureMethod returns the CaptureMethod field if non-nil, zero value otherwise. + +### GetCaptureMethodOk + +`func (o *PaymentRequest) GetCaptureMethodOk() (*PaymentRequestCaptureMethod, bool)` + +GetCaptureMethodOk returns a tuple with the CaptureMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaptureMethod + +`func (o *PaymentRequest) SetCaptureMethod(v PaymentRequestCaptureMethod)` + +SetCaptureMethod sets CaptureMethod field to given value. + +### HasCaptureMethod + +`func (o *PaymentRequest) HasCaptureMethod() bool` + +HasCaptureMethod returns a boolean if a field has been set. + +### SetCaptureMethodNil + +`func (o *PaymentRequest) SetCaptureMethodNil(b bool)` + + SetCaptureMethodNil sets the value for CaptureMethod to be an explicit nil + +### UnsetCaptureMethod +`func (o *PaymentRequest) UnsetCaptureMethod()` + +UnsetCaptureMethod ensures that no value is present for CaptureMethod, not even an explicit nil +### GetInitiator + +`func (o *PaymentRequest) GetInitiator() PaymentRequestInitiator` + +GetInitiator returns the Initiator field if non-nil, zero value otherwise. + +### GetInitiatorOk + +`func (o *PaymentRequest) GetInitiatorOk() (*PaymentRequestInitiator, bool)` + +GetInitiatorOk returns a tuple with the Initiator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInitiator + +`func (o *PaymentRequest) SetInitiator(v PaymentRequestInitiator)` + +SetInitiator sets Initiator field to given value. + +### HasInitiator + +`func (o *PaymentRequest) HasInitiator() bool` + +HasInitiator returns a boolean if a field has been set. + +### SetInitiatorNil + +`func (o *PaymentRequest) SetInitiatorNil(b bool)` + + SetInitiatorNil sets the value for Initiator to be an explicit nil + +### UnsetInitiator +`func (o *PaymentRequest) UnsetInitiator()` + +UnsetInitiator ensures that no value is present for Initiator, not even an explicit nil +### GetCardVerificationResults + +`func (o *PaymentRequest) GetCardVerificationResults() PaymentRequestCardVerificationResults` + +GetCardVerificationResults returns the CardVerificationResults field if non-nil, zero value otherwise. + +### GetCardVerificationResultsOk + +`func (o *PaymentRequest) GetCardVerificationResultsOk() (*PaymentRequestCardVerificationResults, bool)` + +GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardVerificationResults + +`func (o *PaymentRequest) SetCardVerificationResults(v PaymentRequestCardVerificationResults)` + +SetCardVerificationResults sets CardVerificationResults field to given value. + +### HasCardVerificationResults + +`func (o *PaymentRequest) HasCardVerificationResults() bool` + +HasCardVerificationResults returns a boolean if a field has been set. + +### SetCardVerificationResultsNil + +`func (o *PaymentRequest) SetCardVerificationResultsNil(b bool)` + + SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil + +### UnsetCardVerificationResults +`func (o *PaymentRequest) UnsetCardVerificationResults()` + +UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil +### GetStatus + +`func (o *PaymentRequest) GetStatus() PaymentRequestStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PaymentRequest) GetStatusOk() (*PaymentRequestStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PaymentRequest) SetStatus(v PaymentRequestStatus)` + +SetStatus sets Status field to given value. + + +### GetActions + +`func (o *PaymentRequest) GetActions() []PaymentRequestAction` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *PaymentRequest) GetActionsOk() (*[]PaymentRequestAction, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *PaymentRequest) SetActions(v []PaymentRequestAction)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *PaymentRequest) HasActions() bool` + +HasActions returns a boolean if a field has been set. + +### GetMetadata + +`func (o *PaymentRequest) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentRequest) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentRequest) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentRequest) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentRequest) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil +### GetShippingInformation + +`func (o *PaymentRequest) GetShippingInformation() PaymentRequestShippingInformation` + +GetShippingInformation returns the ShippingInformation field if non-nil, zero value otherwise. + +### GetShippingInformationOk + +`func (o *PaymentRequest) GetShippingInformationOk() (*PaymentRequestShippingInformation, bool)` + +GetShippingInformationOk returns a tuple with the ShippingInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShippingInformation + +`func (o *PaymentRequest) SetShippingInformation(v PaymentRequestShippingInformation)` + +SetShippingInformation sets ShippingInformation field to given value. + +### HasShippingInformation + +`func (o *PaymentRequest) HasShippingInformation() bool` + +HasShippingInformation returns a boolean if a field has been set. + +### SetShippingInformationNil + +`func (o *PaymentRequest) SetShippingInformationNil(b bool)` + + SetShippingInformationNil sets the value for ShippingInformation to be an explicit nil + +### UnsetShippingInformation +`func (o *PaymentRequest) UnsetShippingInformation()` + +UnsetShippingInformation ensures that no value is present for ShippingInformation, not even an explicit nil +### GetItems + +`func (o *PaymentRequest) GetItems() []PaymentRequestBasketItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *PaymentRequest) GetItemsOk() (*[]PaymentRequestBasketItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *PaymentRequest) SetItems(v []PaymentRequestBasketItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *PaymentRequest) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### SetItemsNil + +`func (o *PaymentRequest) SetItemsNil(b bool)` + + SetItemsNil sets the value for Items to be an explicit nil + +### UnsetItems +`func (o *PaymentRequest) UnsetItems()` + +UnsetItems ensures that no value is present for Items, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestAction.md b/docs/payment_request/PaymentRequestAction.md new file mode 100644 index 00000000..67fe1ab5 --- /dev/null +++ b/docs/payment_request/PaymentRequestAction.md @@ -0,0 +1,165 @@ +# PaymentRequestAction + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Action** | **string** | | | +| **UrlType** | **string** | | | +| **Method** | **NullableString** | | | +| **Url** | **NullableString** | | | +| **QrCode** | **NullableString** | | | + +## Methods + +### NewPaymentRequestAction + +`func NewPaymentRequestAction(action string, urlType string, method NullableString, url NullableString, qrCode NullableString, ) *PaymentRequestAction` + +NewPaymentRequestAction instantiates a new PaymentRequestAction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestActionWithDefaults + +`func NewPaymentRequestActionWithDefaults() *PaymentRequestAction` + +NewPaymentRequestActionWithDefaults instantiates a new PaymentRequestAction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *PaymentRequestAction) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *PaymentRequestAction) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *PaymentRequestAction) SetAction(v string)` + +SetAction sets Action field to given value. + + +### GetUrlType + +`func (o *PaymentRequestAction) GetUrlType() string` + +GetUrlType returns the UrlType field if non-nil, zero value otherwise. + +### GetUrlTypeOk + +`func (o *PaymentRequestAction) GetUrlTypeOk() (*string, bool)` + +GetUrlTypeOk returns a tuple with the UrlType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrlType + +`func (o *PaymentRequestAction) SetUrlType(v string)` + +SetUrlType sets UrlType field to given value. + + +### GetMethod + +`func (o *PaymentRequestAction) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *PaymentRequestAction) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *PaymentRequestAction) SetMethod(v string)` + +SetMethod sets Method field to given value. + + +### SetMethodNil + +`func (o *PaymentRequestAction) SetMethodNil(b bool)` + + SetMethodNil sets the value for Method to be an explicit nil + +### UnsetMethod +`func (o *PaymentRequestAction) UnsetMethod()` + +UnsetMethod ensures that no value is present for Method, not even an explicit nil +### GetUrl + +`func (o *PaymentRequestAction) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *PaymentRequestAction) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *PaymentRequestAction) SetUrl(v string)` + +SetUrl sets Url field to given value. + + +### SetUrlNil + +`func (o *PaymentRequestAction) SetUrlNil(b bool)` + + SetUrlNil sets the value for Url to be an explicit nil + +### UnsetUrl +`func (o *PaymentRequestAction) UnsetUrl()` + +UnsetUrl ensures that no value is present for Url, not even an explicit nil +### GetQrCode + +`func (o *PaymentRequestAction) GetQrCode() string` + +GetQrCode returns the QrCode field if non-nil, zero value otherwise. + +### GetQrCodeOk + +`func (o *PaymentRequestAction) GetQrCodeOk() (*string, bool)` + +GetQrCodeOk returns a tuple with the QrCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrCode + +`func (o *PaymentRequestAction) SetQrCode(v string)` + +SetQrCode sets QrCode field to given value. + + +### SetQrCodeNil + +`func (o *PaymentRequestAction) SetQrCodeNil(b bool)` + + SetQrCodeNil sets the value for QrCode to be an explicit nil + +### UnsetQrCode +`func (o *PaymentRequestAction) UnsetQrCode()` + +UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestAuthParameters.md b/docs/payment_request/PaymentRequestAuthParameters.md new file mode 100644 index 00000000..9ffb5e8d --- /dev/null +++ b/docs/payment_request/PaymentRequestAuthParameters.md @@ -0,0 +1,51 @@ +# PaymentRequestAuthParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **AuthCode** | **string** | | | + +## Methods + +### NewPaymentRequestAuthParameters + +`func NewPaymentRequestAuthParameters(authCode string, ) *PaymentRequestAuthParameters` + +NewPaymentRequestAuthParameters instantiates a new PaymentRequestAuthParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestAuthParametersWithDefaults + +`func NewPaymentRequestAuthParametersWithDefaults() *PaymentRequestAuthParameters` + +NewPaymentRequestAuthParametersWithDefaults instantiates a new PaymentRequestAuthParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAuthCode + +`func (o *PaymentRequestAuthParameters) GetAuthCode() string` + +GetAuthCode returns the AuthCode field if non-nil, zero value otherwise. + +### GetAuthCodeOk + +`func (o *PaymentRequestAuthParameters) GetAuthCodeOk() (*string, bool)` + +GetAuthCodeOk returns a tuple with the AuthCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAuthCode + +`func (o *PaymentRequestAuthParameters) SetAuthCode(v string)` + +SetAuthCode sets AuthCode field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestBasketItem.md b/docs/payment_request/PaymentRequestBasketItem.md new file mode 100644 index 00000000..edc07e83 --- /dev/null +++ b/docs/payment_request/PaymentRequestBasketItem.md @@ -0,0 +1,343 @@ +# PaymentRequestBasketItem + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Name** | **string** | | | +| **Description** | Pointer to **string** | | [optional] | +| **Type** | Pointer to **string** | | [optional] | +| **Category** | **string** | | | +| **SubCategory** | Pointer to **string** | | [optional] | +| **Currency** | **string** | | | +| **Quantity** | **float64** | | | +| **Price** | **float64** | | | +| **PayerChargedCurrency** | Pointer to **string** | | [optional] | +| **PayerChargedPrice** | Pointer to **float64** | | [optional] | +| **Url** | Pointer to **string** | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewPaymentRequestBasketItem + +`func NewPaymentRequestBasketItem(name string, category string, currency string, quantity float64, price float64, ) *PaymentRequestBasketItem` + +NewPaymentRequestBasketItem instantiates a new PaymentRequestBasketItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestBasketItemWithDefaults + +`func NewPaymentRequestBasketItemWithDefaults() *PaymentRequestBasketItem` + +NewPaymentRequestBasketItemWithDefaults instantiates a new PaymentRequestBasketItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *PaymentRequestBasketItem) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentRequestBasketItem) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentRequestBasketItem) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentRequestBasketItem) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetName + +`func (o *PaymentRequestBasketItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *PaymentRequestBasketItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *PaymentRequestBasketItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *PaymentRequestBasketItem) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentRequestBasketItem) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentRequestBasketItem) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentRequestBasketItem) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetType + +`func (o *PaymentRequestBasketItem) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentRequestBasketItem) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentRequestBasketItem) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PaymentRequestBasketItem) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCategory + +`func (o *PaymentRequestBasketItem) GetCategory() string` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *PaymentRequestBasketItem) GetCategoryOk() (*string, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *PaymentRequestBasketItem) SetCategory(v string)` + +SetCategory sets Category field to given value. + + +### GetSubCategory + +`func (o *PaymentRequestBasketItem) GetSubCategory() string` + +GetSubCategory returns the SubCategory field if non-nil, zero value otherwise. + +### GetSubCategoryOk + +`func (o *PaymentRequestBasketItem) GetSubCategoryOk() (*string, bool)` + +GetSubCategoryOk returns a tuple with the SubCategory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubCategory + +`func (o *PaymentRequestBasketItem) SetSubCategory(v string)` + +SetSubCategory sets SubCategory field to given value. + +### HasSubCategory + +`func (o *PaymentRequestBasketItem) HasSubCategory() bool` + +HasSubCategory returns a boolean if a field has been set. + +### GetCurrency + +`func (o *PaymentRequestBasketItem) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *PaymentRequestBasketItem) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *PaymentRequestBasketItem) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetQuantity + +`func (o *PaymentRequestBasketItem) GetQuantity() float64` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *PaymentRequestBasketItem) GetQuantityOk() (*float64, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *PaymentRequestBasketItem) SetQuantity(v float64)` + +SetQuantity sets Quantity field to given value. + + +### GetPrice + +`func (o *PaymentRequestBasketItem) GetPrice() float64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *PaymentRequestBasketItem) GetPriceOk() (*float64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *PaymentRequestBasketItem) SetPrice(v float64)` + +SetPrice sets Price field to given value. + + +### GetPayerChargedCurrency + +`func (o *PaymentRequestBasketItem) GetPayerChargedCurrency() string` + +GetPayerChargedCurrency returns the PayerChargedCurrency field if non-nil, zero value otherwise. + +### GetPayerChargedCurrencyOk + +`func (o *PaymentRequestBasketItem) GetPayerChargedCurrencyOk() (*string, bool)` + +GetPayerChargedCurrencyOk returns a tuple with the PayerChargedCurrency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerChargedCurrency + +`func (o *PaymentRequestBasketItem) SetPayerChargedCurrency(v string)` + +SetPayerChargedCurrency sets PayerChargedCurrency field to given value. + +### HasPayerChargedCurrency + +`func (o *PaymentRequestBasketItem) HasPayerChargedCurrency() bool` + +HasPayerChargedCurrency returns a boolean if a field has been set. + +### GetPayerChargedPrice + +`func (o *PaymentRequestBasketItem) GetPayerChargedPrice() float64` + +GetPayerChargedPrice returns the PayerChargedPrice field if non-nil, zero value otherwise. + +### GetPayerChargedPriceOk + +`func (o *PaymentRequestBasketItem) GetPayerChargedPriceOk() (*float64, bool)` + +GetPayerChargedPriceOk returns a tuple with the PayerChargedPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerChargedPrice + +`func (o *PaymentRequestBasketItem) SetPayerChargedPrice(v float64)` + +SetPayerChargedPrice sets PayerChargedPrice field to given value. + +### HasPayerChargedPrice + +`func (o *PaymentRequestBasketItem) HasPayerChargedPrice() bool` + +HasPayerChargedPrice returns a boolean if a field has been set. + +### GetUrl + +`func (o *PaymentRequestBasketItem) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *PaymentRequestBasketItem) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *PaymentRequestBasketItem) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *PaymentRequestBasketItem) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetMetadata + +`func (o *PaymentRequestBasketItem) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentRequestBasketItem) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentRequestBasketItem) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentRequestBasketItem) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestCaptureMethod.md b/docs/payment_request/PaymentRequestCaptureMethod.md new file mode 100644 index 00000000..adf3fede --- /dev/null +++ b/docs/payment_request/PaymentRequestCaptureMethod.md @@ -0,0 +1,13 @@ +# PaymentRequestCaptureMethod + +## Enum + + +* `AUTOMATIC` (value: `"AUTOMATIC"`) + +* `MANUAL` (value: `"MANUAL"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestCardVerificationResults.md b/docs/payment_request/PaymentRequestCardVerificationResults.md new file mode 100644 index 00000000..f481adc5 --- /dev/null +++ b/docs/payment_request/PaymentRequestCardVerificationResults.md @@ -0,0 +1,133 @@ +# PaymentRequestCardVerificationResults + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecure** | [**NullablePaymentRequestCardVerificationResultsThreeDeeSecure**](PaymentRequestCardVerificationResultsThreeDeeSecure.md) | | | +| **CvvResult** | Pointer to **NullableString** | | [optional] | +| **AddressVerificationResult** | Pointer to **NullableString** | | [optional] | + +## Methods + +### NewPaymentRequestCardVerificationResults + +`func NewPaymentRequestCardVerificationResults(threeDSecure NullablePaymentRequestCardVerificationResultsThreeDeeSecure, ) *PaymentRequestCardVerificationResults` + +NewPaymentRequestCardVerificationResults instantiates a new PaymentRequestCardVerificationResults object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestCardVerificationResultsWithDefaults + +`func NewPaymentRequestCardVerificationResultsWithDefaults() *PaymentRequestCardVerificationResults` + +NewPaymentRequestCardVerificationResultsWithDefaults instantiates a new PaymentRequestCardVerificationResults object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecure + +`func (o *PaymentRequestCardVerificationResults) GetThreeDSecure() PaymentRequestCardVerificationResultsThreeDeeSecure` + +GetThreeDSecure returns the ThreeDSecure field if non-nil, zero value otherwise. + +### GetThreeDSecureOk + +`func (o *PaymentRequestCardVerificationResults) GetThreeDSecureOk() (*PaymentRequestCardVerificationResultsThreeDeeSecure, bool)` + +GetThreeDSecureOk returns a tuple with the ThreeDSecure field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecure + +`func (o *PaymentRequestCardVerificationResults) SetThreeDSecure(v PaymentRequestCardVerificationResultsThreeDeeSecure)` + +SetThreeDSecure sets ThreeDSecure field to given value. + + +### SetThreeDSecureNil + +`func (o *PaymentRequestCardVerificationResults) SetThreeDSecureNil(b bool)` + + SetThreeDSecureNil sets the value for ThreeDSecure to be an explicit nil + +### UnsetThreeDSecure +`func (o *PaymentRequestCardVerificationResults) UnsetThreeDSecure()` + +UnsetThreeDSecure ensures that no value is present for ThreeDSecure, not even an explicit nil +### GetCvvResult + +`func (o *PaymentRequestCardVerificationResults) GetCvvResult() string` + +GetCvvResult returns the CvvResult field if non-nil, zero value otherwise. + +### GetCvvResultOk + +`func (o *PaymentRequestCardVerificationResults) GetCvvResultOk() (*string, bool)` + +GetCvvResultOk returns a tuple with the CvvResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvvResult + +`func (o *PaymentRequestCardVerificationResults) SetCvvResult(v string)` + +SetCvvResult sets CvvResult field to given value. + +### HasCvvResult + +`func (o *PaymentRequestCardVerificationResults) HasCvvResult() bool` + +HasCvvResult returns a boolean if a field has been set. + +### SetCvvResultNil + +`func (o *PaymentRequestCardVerificationResults) SetCvvResultNil(b bool)` + + SetCvvResultNil sets the value for CvvResult to be an explicit nil + +### UnsetCvvResult +`func (o *PaymentRequestCardVerificationResults) UnsetCvvResult()` + +UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +### GetAddressVerificationResult + +`func (o *PaymentRequestCardVerificationResults) GetAddressVerificationResult() string` + +GetAddressVerificationResult returns the AddressVerificationResult field if non-nil, zero value otherwise. + +### GetAddressVerificationResultOk + +`func (o *PaymentRequestCardVerificationResults) GetAddressVerificationResultOk() (*string, bool)` + +GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressVerificationResult + +`func (o *PaymentRequestCardVerificationResults) SetAddressVerificationResult(v string)` + +SetAddressVerificationResult sets AddressVerificationResult field to given value. + +### HasAddressVerificationResult + +`func (o *PaymentRequestCardVerificationResults) HasAddressVerificationResult() bool` + +HasAddressVerificationResult returns a boolean if a field has been set. + +### SetAddressVerificationResultNil + +`func (o *PaymentRequestCardVerificationResults) SetAddressVerificationResultNil(b bool)` + + SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil + +### UnsetAddressVerificationResult +`func (o *PaymentRequestCardVerificationResults) UnsetAddressVerificationResult()` + +UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestCardVerificationResultsThreeDeeSecure.md b/docs/payment_request/PaymentRequestCardVerificationResultsThreeDeeSecure.md new file mode 100644 index 00000000..c5204414 --- /dev/null +++ b/docs/payment_request/PaymentRequestCardVerificationResultsThreeDeeSecure.md @@ -0,0 +1,170 @@ +# PaymentRequestCardVerificationResultsThreeDeeSecure + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ThreeDSecureFlow** | Pointer to **string** | | [optional] | +| **EciCode** | Pointer to **string** | | [optional] | +| **ThreeDSecureResult** | Pointer to **string** | | [optional] | +| **ThreeDSecureResultReason** | Pointer to **NullableString** | | [optional] | +| **ThreeDSecureVersion** | Pointer to **string** | | [optional] | + +## Methods + +### NewPaymentRequestCardVerificationResultsThreeDeeSecure + +`func NewPaymentRequestCardVerificationResultsThreeDeeSecure() *PaymentRequestCardVerificationResultsThreeDeeSecure` + +NewPaymentRequestCardVerificationResultsThreeDeeSecure instantiates a new PaymentRequestCardVerificationResultsThreeDeeSecure object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestCardVerificationResultsThreeDeeSecureWithDefaults + +`func NewPaymentRequestCardVerificationResultsThreeDeeSecureWithDefaults() *PaymentRequestCardVerificationResultsThreeDeeSecure` + +NewPaymentRequestCardVerificationResultsThreeDeeSecureWithDefaults instantiates a new PaymentRequestCardVerificationResultsThreeDeeSecure object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetThreeDSecureFlow + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureFlow() string` + +GetThreeDSecureFlow returns the ThreeDSecureFlow field if non-nil, zero value otherwise. + +### GetThreeDSecureFlowOk + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureFlowOk() (*string, bool)` + +GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureFlow + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureFlow(v string)` + +SetThreeDSecureFlow sets ThreeDSecureFlow field to given value. + +### HasThreeDSecureFlow + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureFlow() bool` + +HasThreeDSecureFlow returns a boolean if a field has been set. + +### GetEciCode + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetEciCode() string` + +GetEciCode returns the EciCode field if non-nil, zero value otherwise. + +### GetEciCodeOk + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetEciCodeOk() (*string, bool)` + +GetEciCodeOk returns a tuple with the EciCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEciCode + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetEciCode(v string)` + +SetEciCode sets EciCode field to given value. + +### HasEciCode + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasEciCode() bool` + +HasEciCode returns a boolean if a field has been set. + +### GetThreeDSecureResult + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResult() string` + +GetThreeDSecureResult returns the ThreeDSecureResult field if non-nil, zero value otherwise. + +### GetThreeDSecureResultOk + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultOk() (*string, bool)` + +GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResult + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResult(v string)` + +SetThreeDSecureResult sets ThreeDSecureResult field to given value. + +### HasThreeDSecureResult + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureResult() bool` + +HasThreeDSecureResult returns a boolean if a field has been set. + +### GetThreeDSecureResultReason + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultReason() string` + +GetThreeDSecureResultReason returns the ThreeDSecureResultReason field if non-nil, zero value otherwise. + +### GetThreeDSecureResultReasonOk + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultReasonOk() (*string, bool)` + +GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureResultReason + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResultReason(v string)` + +SetThreeDSecureResultReason sets ThreeDSecureResultReason field to given value. + +### HasThreeDSecureResultReason + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureResultReason() bool` + +HasThreeDSecureResultReason returns a boolean if a field has been set. + +### SetThreeDSecureResultReasonNil + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResultReasonNil(b bool)` + + SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil + +### UnsetThreeDSecureResultReason +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) UnsetThreeDSecureResultReason()` + +UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +### GetThreeDSecureVersion + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureVersion() string` + +GetThreeDSecureVersion returns the ThreeDSecureVersion field if non-nil, zero value otherwise. + +### GetThreeDSecureVersionOk + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureVersionOk() (*string, bool)` + +GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThreeDSecureVersion + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureVersion(v string)` + +SetThreeDSecureVersion sets ThreeDSecureVersion field to given value. + +### HasThreeDSecureVersion + +`func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureVersion() bool` + +HasThreeDSecureVersion returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestChannelProperties.md b/docs/payment_request/PaymentRequestChannelProperties.md new file mode 100644 index 00000000..07ca6f97 --- /dev/null +++ b/docs/payment_request/PaymentRequestChannelProperties.md @@ -0,0 +1,222 @@ +# PaymentRequestChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CancelReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization cancelled | [optional] | +| **RedeemPoints** | Pointer to **string** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] | +| **RequireAuth** | Pointer to **bool** | Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. | [optional] | +| **MerchantIdTag** | Pointer to **string** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [optional] | +| **CardonfileType** | Pointer to **NullableString** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] | + +## Methods + +### NewPaymentRequestChannelProperties + +`func NewPaymentRequestChannelProperties() *PaymentRequestChannelProperties` + +NewPaymentRequestChannelProperties instantiates a new PaymentRequestChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestChannelPropertiesWithDefaults + +`func NewPaymentRequestChannelPropertiesWithDefaults() *PaymentRequestChannelProperties` + +NewPaymentRequestChannelPropertiesWithDefaults instantiates a new PaymentRequestChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *PaymentRequestChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *PaymentRequestChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *PaymentRequestChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *PaymentRequestChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *PaymentRequestChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *PaymentRequestChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *PaymentRequestChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *PaymentRequestChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetCancelReturnUrl + +`func (o *PaymentRequestChannelProperties) GetCancelReturnUrl() string` + +GetCancelReturnUrl returns the CancelReturnUrl field if non-nil, zero value otherwise. + +### GetCancelReturnUrlOk + +`func (o *PaymentRequestChannelProperties) GetCancelReturnUrlOk() (*string, bool)` + +GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelReturnUrl + +`func (o *PaymentRequestChannelProperties) SetCancelReturnUrl(v string)` + +SetCancelReturnUrl sets CancelReturnUrl field to given value. + +### HasCancelReturnUrl + +`func (o *PaymentRequestChannelProperties) HasCancelReturnUrl() bool` + +HasCancelReturnUrl returns a boolean if a field has been set. + +### GetRedeemPoints + +`func (o *PaymentRequestChannelProperties) GetRedeemPoints() string` + +GetRedeemPoints returns the RedeemPoints field if non-nil, zero value otherwise. + +### GetRedeemPointsOk + +`func (o *PaymentRequestChannelProperties) GetRedeemPointsOk() (*string, bool)` + +GetRedeemPointsOk returns a tuple with the RedeemPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedeemPoints + +`func (o *PaymentRequestChannelProperties) SetRedeemPoints(v string)` + +SetRedeemPoints sets RedeemPoints field to given value. + +### HasRedeemPoints + +`func (o *PaymentRequestChannelProperties) HasRedeemPoints() bool` + +HasRedeemPoints returns a boolean if a field has been set. + +### GetRequireAuth + +`func (o *PaymentRequestChannelProperties) GetRequireAuth() bool` + +GetRequireAuth returns the RequireAuth field if non-nil, zero value otherwise. + +### GetRequireAuthOk + +`func (o *PaymentRequestChannelProperties) GetRequireAuthOk() (*bool, bool)` + +GetRequireAuthOk returns a tuple with the RequireAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequireAuth + +`func (o *PaymentRequestChannelProperties) SetRequireAuth(v bool)` + +SetRequireAuth sets RequireAuth field to given value. + +### HasRequireAuth + +`func (o *PaymentRequestChannelProperties) HasRequireAuth() bool` + +HasRequireAuth returns a boolean if a field has been set. + +### GetMerchantIdTag + +`func (o *PaymentRequestChannelProperties) GetMerchantIdTag() string` + +GetMerchantIdTag returns the MerchantIdTag field if non-nil, zero value otherwise. + +### GetMerchantIdTagOk + +`func (o *PaymentRequestChannelProperties) GetMerchantIdTagOk() (*string, bool)` + +GetMerchantIdTagOk returns a tuple with the MerchantIdTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantIdTag + +`func (o *PaymentRequestChannelProperties) SetMerchantIdTag(v string)` + +SetMerchantIdTag sets MerchantIdTag field to given value. + +### HasMerchantIdTag + +`func (o *PaymentRequestChannelProperties) HasMerchantIdTag() bool` + +HasMerchantIdTag returns a boolean if a field has been set. + +### GetCardonfileType + +`func (o *PaymentRequestChannelProperties) GetCardonfileType() string` + +GetCardonfileType returns the CardonfileType field if non-nil, zero value otherwise. + +### GetCardonfileTypeOk + +`func (o *PaymentRequestChannelProperties) GetCardonfileTypeOk() (*string, bool)` + +GetCardonfileTypeOk returns a tuple with the CardonfileType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardonfileType + +`func (o *PaymentRequestChannelProperties) SetCardonfileType(v string)` + +SetCardonfileType sets CardonfileType field to given value. + +### HasCardonfileType + +`func (o *PaymentRequestChannelProperties) HasCardonfileType() bool` + +HasCardonfileType returns a boolean if a field has been set. + +### SetCardonfileTypeNil + +`func (o *PaymentRequestChannelProperties) SetCardonfileTypeNil(b bool)` + + SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil + +### UnsetCardonfileType +`func (o *PaymentRequestChannelProperties) UnsetCardonfileType()` + +UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestCountry.md b/docs/payment_request/PaymentRequestCountry.md new file mode 100644 index 00000000..505c216e --- /dev/null +++ b/docs/payment_request/PaymentRequestCountry.md @@ -0,0 +1,19 @@ +# PaymentRequestCountry + +## Enum + + +* `ID` (value: `"ID"`) + +* `PH` (value: `"PH"`) + +* `VN` (value: `"VN"`) + +* `TH` (value: `"TH"`) + +* `MY` (value: `"MY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestCurrency.md b/docs/payment_request/PaymentRequestCurrency.md new file mode 100644 index 00000000..046b84c7 --- /dev/null +++ b/docs/payment_request/PaymentRequestCurrency.md @@ -0,0 +1,19 @@ +# PaymentRequestCurrency + +## Enum + + +* `IDR` (value: `"IDR"`) + +* `PHP` (value: `"PHP"`) + +* `VND` (value: `"VND"`) + +* `THB` (value: `"THB"`) + +* `MYR` (value: `"MYR"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestInitiator.md b/docs/payment_request/PaymentRequestInitiator.md new file mode 100644 index 00000000..1210b6f1 --- /dev/null +++ b/docs/payment_request/PaymentRequestInitiator.md @@ -0,0 +1,13 @@ +# PaymentRequestInitiator + +## Enum + + +* `CUSTOMER` (value: `"CUSTOMER"`) + +* `MERCHANT` (value: `"MERCHANT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestListResponse.md b/docs/payment_request/PaymentRequestListResponse.md new file mode 100644 index 00000000..648bfd2e --- /dev/null +++ b/docs/payment_request/PaymentRequestListResponse.md @@ -0,0 +1,72 @@ +# PaymentRequestListResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | [**PaymentRequest[]**](PaymentRequest.md) | | | +| **HasMore** | **bool** | | | + +## Methods + +### NewPaymentRequestListResponse + +`func NewPaymentRequestListResponse(data []PaymentRequest, hasMore bool, ) *PaymentRequestListResponse` + +NewPaymentRequestListResponse instantiates a new PaymentRequestListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestListResponseWithDefaults + +`func NewPaymentRequestListResponseWithDefaults() *PaymentRequestListResponse` + +NewPaymentRequestListResponseWithDefaults instantiates a new PaymentRequestListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *PaymentRequestListResponse) GetData() []PaymentRequest` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PaymentRequestListResponse) GetDataOk() (*[]PaymentRequest, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PaymentRequestListResponse) SetData(v []PaymentRequest)` + +SetData sets Data field to given value. + + +### GetHasMore + +`func (o *PaymentRequestListResponse) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *PaymentRequestListResponse) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *PaymentRequestListResponse) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestParameters.md b/docs/payment_request/PaymentRequestParameters.md new file mode 100644 index 00000000..bc3ee80d --- /dev/null +++ b/docs/payment_request/PaymentRequestParameters.md @@ -0,0 +1,469 @@ +# PaymentRequestParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Amount** | Pointer to **float64** | | [optional] | +| **Currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | | +| **PaymentMethod** | Pointer to [**PaymentMethodParameters**](PaymentMethodParameters.md) | | [optional] | +| **Description** | Pointer to **NullableString** | | [optional] | +| **CaptureMethod** | Pointer to [**NullablePaymentRequestCaptureMethod**](PaymentRequestCaptureMethod.md) | | [optional] | +| **Initiator** | Pointer to [**NullablePaymentRequestInitiator**](PaymentRequestInitiator.md) | | [optional] | +| **PaymentMethodId** | Pointer to **string** | | [optional] | +| **ChannelProperties** | Pointer to [**PaymentRequestParametersChannelProperties**](PaymentRequestParametersChannelProperties.md) | | [optional] | +| **ShippingInformation** | Pointer to [**NullablePaymentRequestShippingInformation**](PaymentRequestShippingInformation.md) | | [optional] | +| **Items** | Pointer to [**PaymentRequestBasketItem[]**](PaymentRequestBasketItem.md) | | [optional] | +| **CustomerId** | Pointer to **NullableString** | | [optional] | +| **Customer** | Pointer to **map[string]interface{}** | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewPaymentRequestParameters + +`func NewPaymentRequestParameters(currency PaymentRequestCurrency, ) *PaymentRequestParameters` + +NewPaymentRequestParameters instantiates a new PaymentRequestParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestParametersWithDefaults + +`func NewPaymentRequestParametersWithDefaults() *PaymentRequestParameters` + +NewPaymentRequestParametersWithDefaults instantiates a new PaymentRequestParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *PaymentRequestParameters) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentRequestParameters) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentRequestParameters) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *PaymentRequestParameters) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetAmount + +`func (o *PaymentRequestParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *PaymentRequestParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *PaymentRequestParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *PaymentRequestParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetCurrency + +`func (o *PaymentRequestParameters) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *PaymentRequestParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *PaymentRequestParameters) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + + +### GetPaymentMethod + +`func (o *PaymentRequestParameters) GetPaymentMethod() PaymentMethodParameters` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *PaymentRequestParameters) GetPaymentMethodOk() (*PaymentMethodParameters, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *PaymentRequestParameters) SetPaymentMethod(v PaymentMethodParameters)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *PaymentRequestParameters) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetDescription + +`func (o *PaymentRequestParameters) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *PaymentRequestParameters) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *PaymentRequestParameters) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *PaymentRequestParameters) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *PaymentRequestParameters) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *PaymentRequestParameters) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetCaptureMethod + +`func (o *PaymentRequestParameters) GetCaptureMethod() PaymentRequestCaptureMethod` + +GetCaptureMethod returns the CaptureMethod field if non-nil, zero value otherwise. + +### GetCaptureMethodOk + +`func (o *PaymentRequestParameters) GetCaptureMethodOk() (*PaymentRequestCaptureMethod, bool)` + +GetCaptureMethodOk returns a tuple with the CaptureMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCaptureMethod + +`func (o *PaymentRequestParameters) SetCaptureMethod(v PaymentRequestCaptureMethod)` + +SetCaptureMethod sets CaptureMethod field to given value. + +### HasCaptureMethod + +`func (o *PaymentRequestParameters) HasCaptureMethod() bool` + +HasCaptureMethod returns a boolean if a field has been set. + +### SetCaptureMethodNil + +`func (o *PaymentRequestParameters) SetCaptureMethodNil(b bool)` + + SetCaptureMethodNil sets the value for CaptureMethod to be an explicit nil + +### UnsetCaptureMethod +`func (o *PaymentRequestParameters) UnsetCaptureMethod()` + +UnsetCaptureMethod ensures that no value is present for CaptureMethod, not even an explicit nil +### GetInitiator + +`func (o *PaymentRequestParameters) GetInitiator() PaymentRequestInitiator` + +GetInitiator returns the Initiator field if non-nil, zero value otherwise. + +### GetInitiatorOk + +`func (o *PaymentRequestParameters) GetInitiatorOk() (*PaymentRequestInitiator, bool)` + +GetInitiatorOk returns a tuple with the Initiator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInitiator + +`func (o *PaymentRequestParameters) SetInitiator(v PaymentRequestInitiator)` + +SetInitiator sets Initiator field to given value. + +### HasInitiator + +`func (o *PaymentRequestParameters) HasInitiator() bool` + +HasInitiator returns a boolean if a field has been set. + +### SetInitiatorNil + +`func (o *PaymentRequestParameters) SetInitiatorNil(b bool)` + + SetInitiatorNil sets the value for Initiator to be an explicit nil + +### UnsetInitiator +`func (o *PaymentRequestParameters) UnsetInitiator()` + +UnsetInitiator ensures that no value is present for Initiator, not even an explicit nil +### GetPaymentMethodId + +`func (o *PaymentRequestParameters) GetPaymentMethodId() string` + +GetPaymentMethodId returns the PaymentMethodId field if non-nil, zero value otherwise. + +### GetPaymentMethodIdOk + +`func (o *PaymentRequestParameters) GetPaymentMethodIdOk() (*string, bool)` + +GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodId + +`func (o *PaymentRequestParameters) SetPaymentMethodId(v string)` + +SetPaymentMethodId sets PaymentMethodId field to given value. + +### HasPaymentMethodId + +`func (o *PaymentRequestParameters) HasPaymentMethodId() bool` + +HasPaymentMethodId returns a boolean if a field has been set. + +### GetChannelProperties + +`func (o *PaymentRequestParameters) GetChannelProperties() PaymentRequestParametersChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *PaymentRequestParameters) GetChannelPropertiesOk() (*PaymentRequestParametersChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *PaymentRequestParameters) SetChannelProperties(v PaymentRequestParametersChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *PaymentRequestParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### GetShippingInformation + +`func (o *PaymentRequestParameters) GetShippingInformation() PaymentRequestShippingInformation` + +GetShippingInformation returns the ShippingInformation field if non-nil, zero value otherwise. + +### GetShippingInformationOk + +`func (o *PaymentRequestParameters) GetShippingInformationOk() (*PaymentRequestShippingInformation, bool)` + +GetShippingInformationOk returns a tuple with the ShippingInformation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShippingInformation + +`func (o *PaymentRequestParameters) SetShippingInformation(v PaymentRequestShippingInformation)` + +SetShippingInformation sets ShippingInformation field to given value. + +### HasShippingInformation + +`func (o *PaymentRequestParameters) HasShippingInformation() bool` + +HasShippingInformation returns a boolean if a field has been set. + +### SetShippingInformationNil + +`func (o *PaymentRequestParameters) SetShippingInformationNil(b bool)` + + SetShippingInformationNil sets the value for ShippingInformation to be an explicit nil + +### UnsetShippingInformation +`func (o *PaymentRequestParameters) UnsetShippingInformation()` + +UnsetShippingInformation ensures that no value is present for ShippingInformation, not even an explicit nil +### GetItems + +`func (o *PaymentRequestParameters) GetItems() []PaymentRequestBasketItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *PaymentRequestParameters) GetItemsOk() (*[]PaymentRequestBasketItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *PaymentRequestParameters) SetItems(v []PaymentRequestBasketItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *PaymentRequestParameters) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### SetItemsNil + +`func (o *PaymentRequestParameters) SetItemsNil(b bool)` + + SetItemsNil sets the value for Items to be an explicit nil + +### UnsetItems +`func (o *PaymentRequestParameters) UnsetItems()` + +UnsetItems ensures that no value is present for Items, not even an explicit nil +### GetCustomerId + +`func (o *PaymentRequestParameters) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *PaymentRequestParameters) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *PaymentRequestParameters) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *PaymentRequestParameters) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *PaymentRequestParameters) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *PaymentRequestParameters) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetCustomer + +`func (o *PaymentRequestParameters) GetCustomer() map[string]interface{}` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *PaymentRequestParameters) GetCustomerOk() (*map[string]interface{}, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *PaymentRequestParameters) SetCustomer(v map[string]interface{})` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *PaymentRequestParameters) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### SetCustomerNil + +`func (o *PaymentRequestParameters) SetCustomerNil(b bool)` + + SetCustomerNil sets the value for Customer to be an explicit nil + +### UnsetCustomer +`func (o *PaymentRequestParameters) UnsetCustomer()` + +UnsetCustomer ensures that no value is present for Customer, not even an explicit nil +### GetMetadata + +`func (o *PaymentRequestParameters) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentRequestParameters) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentRequestParameters) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentRequestParameters) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentRequestParameters) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentRequestParameters) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestParametersChannelProperties.md b/docs/payment_request/PaymentRequestParametersChannelProperties.md new file mode 100644 index 00000000..767a0779 --- /dev/null +++ b/docs/payment_request/PaymentRequestParametersChannelProperties.md @@ -0,0 +1,248 @@ +# PaymentRequestParametersChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **SuccessReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization is successful | [optional] | +| **FailureReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization failed | [optional] | +| **CancelReturnUrl** | Pointer to **string** | URL where the end-customer is redirected if the authorization cancelled | [optional] | +| **RedeemPoints** | Pointer to **string** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] | +| **RequireAuth** | Pointer to **bool** | Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. | [optional] | +| **MerchantIdTag** | Pointer to **string** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [optional] | +| **CardonfileType** | Pointer to **NullableString** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] | +| **Cvv** | Pointer to **string** | Three digit code written on the back of the card (usually called CVV/CVN). | [optional] | + +## Methods + +### NewPaymentRequestParametersChannelProperties + +`func NewPaymentRequestParametersChannelProperties() *PaymentRequestParametersChannelProperties` + +NewPaymentRequestParametersChannelProperties instantiates a new PaymentRequestParametersChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestParametersChannelPropertiesWithDefaults + +`func NewPaymentRequestParametersChannelPropertiesWithDefaults() *PaymentRequestParametersChannelProperties` + +NewPaymentRequestParametersChannelPropertiesWithDefaults instantiates a new PaymentRequestParametersChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccessReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) GetSuccessReturnUrl() string` + +GetSuccessReturnUrl returns the SuccessReturnUrl field if non-nil, zero value otherwise. + +### GetSuccessReturnUrlOk + +`func (o *PaymentRequestParametersChannelProperties) GetSuccessReturnUrlOk() (*string, bool)` + +GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) SetSuccessReturnUrl(v string)` + +SetSuccessReturnUrl sets SuccessReturnUrl field to given value. + +### HasSuccessReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) HasSuccessReturnUrl() bool` + +HasSuccessReturnUrl returns a boolean if a field has been set. + +### GetFailureReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) GetFailureReturnUrl() string` + +GetFailureReturnUrl returns the FailureReturnUrl field if non-nil, zero value otherwise. + +### GetFailureReturnUrlOk + +`func (o *PaymentRequestParametersChannelProperties) GetFailureReturnUrlOk() (*string, bool)` + +GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) SetFailureReturnUrl(v string)` + +SetFailureReturnUrl sets FailureReturnUrl field to given value. + +### HasFailureReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) HasFailureReturnUrl() bool` + +HasFailureReturnUrl returns a boolean if a field has been set. + +### GetCancelReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) GetCancelReturnUrl() string` + +GetCancelReturnUrl returns the CancelReturnUrl field if non-nil, zero value otherwise. + +### GetCancelReturnUrlOk + +`func (o *PaymentRequestParametersChannelProperties) GetCancelReturnUrlOk() (*string, bool)` + +GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) SetCancelReturnUrl(v string)` + +SetCancelReturnUrl sets CancelReturnUrl field to given value. + +### HasCancelReturnUrl + +`func (o *PaymentRequestParametersChannelProperties) HasCancelReturnUrl() bool` + +HasCancelReturnUrl returns a boolean if a field has been set. + +### GetRedeemPoints + +`func (o *PaymentRequestParametersChannelProperties) GetRedeemPoints() string` + +GetRedeemPoints returns the RedeemPoints field if non-nil, zero value otherwise. + +### GetRedeemPointsOk + +`func (o *PaymentRequestParametersChannelProperties) GetRedeemPointsOk() (*string, bool)` + +GetRedeemPointsOk returns a tuple with the RedeemPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedeemPoints + +`func (o *PaymentRequestParametersChannelProperties) SetRedeemPoints(v string)` + +SetRedeemPoints sets RedeemPoints field to given value. + +### HasRedeemPoints + +`func (o *PaymentRequestParametersChannelProperties) HasRedeemPoints() bool` + +HasRedeemPoints returns a boolean if a field has been set. + +### GetRequireAuth + +`func (o *PaymentRequestParametersChannelProperties) GetRequireAuth() bool` + +GetRequireAuth returns the RequireAuth field if non-nil, zero value otherwise. + +### GetRequireAuthOk + +`func (o *PaymentRequestParametersChannelProperties) GetRequireAuthOk() (*bool, bool)` + +GetRequireAuthOk returns a tuple with the RequireAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequireAuth + +`func (o *PaymentRequestParametersChannelProperties) SetRequireAuth(v bool)` + +SetRequireAuth sets RequireAuth field to given value. + +### HasRequireAuth + +`func (o *PaymentRequestParametersChannelProperties) HasRequireAuth() bool` + +HasRequireAuth returns a boolean if a field has been set. + +### GetMerchantIdTag + +`func (o *PaymentRequestParametersChannelProperties) GetMerchantIdTag() string` + +GetMerchantIdTag returns the MerchantIdTag field if non-nil, zero value otherwise. + +### GetMerchantIdTagOk + +`func (o *PaymentRequestParametersChannelProperties) GetMerchantIdTagOk() (*string, bool)` + +GetMerchantIdTagOk returns a tuple with the MerchantIdTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantIdTag + +`func (o *PaymentRequestParametersChannelProperties) SetMerchantIdTag(v string)` + +SetMerchantIdTag sets MerchantIdTag field to given value. + +### HasMerchantIdTag + +`func (o *PaymentRequestParametersChannelProperties) HasMerchantIdTag() bool` + +HasMerchantIdTag returns a boolean if a field has been set. + +### GetCardonfileType + +`func (o *PaymentRequestParametersChannelProperties) GetCardonfileType() string` + +GetCardonfileType returns the CardonfileType field if non-nil, zero value otherwise. + +### GetCardonfileTypeOk + +`func (o *PaymentRequestParametersChannelProperties) GetCardonfileTypeOk() (*string, bool)` + +GetCardonfileTypeOk returns a tuple with the CardonfileType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardonfileType + +`func (o *PaymentRequestParametersChannelProperties) SetCardonfileType(v string)` + +SetCardonfileType sets CardonfileType field to given value. + +### HasCardonfileType + +`func (o *PaymentRequestParametersChannelProperties) HasCardonfileType() bool` + +HasCardonfileType returns a boolean if a field has been set. + +### SetCardonfileTypeNil + +`func (o *PaymentRequestParametersChannelProperties) SetCardonfileTypeNil(b bool)` + + SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil + +### UnsetCardonfileType +`func (o *PaymentRequestParametersChannelProperties) UnsetCardonfileType()` + +UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +### GetCvv + +`func (o *PaymentRequestParametersChannelProperties) GetCvv() string` + +GetCvv returns the Cvv field if non-nil, zero value otherwise. + +### GetCvvOk + +`func (o *PaymentRequestParametersChannelProperties) GetCvvOk() (*string, bool)` + +GetCvvOk returns a tuple with the Cvv field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvv + +`func (o *PaymentRequestParametersChannelProperties) SetCvv(v string)` + +SetCvv sets Cvv field to given value. + +### HasCvv + +`func (o *PaymentRequestParametersChannelProperties) HasCvv() bool` + +HasCvv returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestParametersChannelPropertiesAllOf.md b/docs/payment_request/PaymentRequestParametersChannelPropertiesAllOf.md new file mode 100644 index 00000000..3b11a35e --- /dev/null +++ b/docs/payment_request/PaymentRequestParametersChannelPropertiesAllOf.md @@ -0,0 +1,56 @@ +# PaymentRequestParametersChannelPropertiesAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Cvv** | Pointer to **string** | Three digit code written on the back of the card (usually called CVV/CVN). | [optional] | + +## Methods + +### NewPaymentRequestParametersChannelPropertiesAllOf + +`func NewPaymentRequestParametersChannelPropertiesAllOf() *PaymentRequestParametersChannelPropertiesAllOf` + +NewPaymentRequestParametersChannelPropertiesAllOf instantiates a new PaymentRequestParametersChannelPropertiesAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestParametersChannelPropertiesAllOfWithDefaults + +`func NewPaymentRequestParametersChannelPropertiesAllOfWithDefaults() *PaymentRequestParametersChannelPropertiesAllOf` + +NewPaymentRequestParametersChannelPropertiesAllOfWithDefaults instantiates a new PaymentRequestParametersChannelPropertiesAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCvv + +`func (o *PaymentRequestParametersChannelPropertiesAllOf) GetCvv() string` + +GetCvv returns the Cvv field if non-nil, zero value otherwise. + +### GetCvvOk + +`func (o *PaymentRequestParametersChannelPropertiesAllOf) GetCvvOk() (*string, bool)` + +GetCvvOk returns a tuple with the Cvv field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCvv + +`func (o *PaymentRequestParametersChannelPropertiesAllOf) SetCvv(v string)` + +SetCvv sets Cvv field to given value. + +### HasCvv + +`func (o *PaymentRequestParametersChannelPropertiesAllOf) HasCvv() bool` + +HasCvv returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestShippingInformation.md b/docs/payment_request/PaymentRequestShippingInformation.md new file mode 100644 index 00000000..3f1939b4 --- /dev/null +++ b/docs/payment_request/PaymentRequestShippingInformation.md @@ -0,0 +1,181 @@ +# PaymentRequestShippingInformation + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Country** | **string** | | | +| **StreetLine1** | Pointer to **string** | | [optional] | +| **StreetLine2** | Pointer to **string** | | [optional] | +| **City** | Pointer to **string** | | [optional] | +| **ProvinceState** | Pointer to **string** | | [optional] | +| **PostalCode** | Pointer to **string** | | [optional] | + +## Methods + +### NewPaymentRequestShippingInformation + +`func NewPaymentRequestShippingInformation(country string, ) *PaymentRequestShippingInformation` + +NewPaymentRequestShippingInformation instantiates a new PaymentRequestShippingInformation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentRequestShippingInformationWithDefaults + +`func NewPaymentRequestShippingInformationWithDefaults() *PaymentRequestShippingInformation` + +NewPaymentRequestShippingInformationWithDefaults instantiates a new PaymentRequestShippingInformation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCountry + +`func (o *PaymentRequestShippingInformation) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentRequestShippingInformation) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentRequestShippingInformation) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetStreetLine1 + +`func (o *PaymentRequestShippingInformation) GetStreetLine1() string` + +GetStreetLine1 returns the StreetLine1 field if non-nil, zero value otherwise. + +### GetStreetLine1Ok + +`func (o *PaymentRequestShippingInformation) GetStreetLine1Ok() (*string, bool)` + +GetStreetLine1Ok returns a tuple with the StreetLine1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine1 + +`func (o *PaymentRequestShippingInformation) SetStreetLine1(v string)` + +SetStreetLine1 sets StreetLine1 field to given value. + +### HasStreetLine1 + +`func (o *PaymentRequestShippingInformation) HasStreetLine1() bool` + +HasStreetLine1 returns a boolean if a field has been set. + +### GetStreetLine2 + +`func (o *PaymentRequestShippingInformation) GetStreetLine2() string` + +GetStreetLine2 returns the StreetLine2 field if non-nil, zero value otherwise. + +### GetStreetLine2Ok + +`func (o *PaymentRequestShippingInformation) GetStreetLine2Ok() (*string, bool)` + +GetStreetLine2Ok returns a tuple with the StreetLine2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetLine2 + +`func (o *PaymentRequestShippingInformation) SetStreetLine2(v string)` + +SetStreetLine2 sets StreetLine2 field to given value. + +### HasStreetLine2 + +`func (o *PaymentRequestShippingInformation) HasStreetLine2() bool` + +HasStreetLine2 returns a boolean if a field has been set. + +### GetCity + +`func (o *PaymentRequestShippingInformation) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *PaymentRequestShippingInformation) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *PaymentRequestShippingInformation) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *PaymentRequestShippingInformation) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### GetProvinceState + +`func (o *PaymentRequestShippingInformation) GetProvinceState() string` + +GetProvinceState returns the ProvinceState field if non-nil, zero value otherwise. + +### GetProvinceStateOk + +`func (o *PaymentRequestShippingInformation) GetProvinceStateOk() (*string, bool)` + +GetProvinceStateOk returns a tuple with the ProvinceState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvinceState + +`func (o *PaymentRequestShippingInformation) SetProvinceState(v string)` + +SetProvinceState sets ProvinceState field to given value. + +### HasProvinceState + +`func (o *PaymentRequestShippingInformation) HasProvinceState() bool` + +HasProvinceState returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *PaymentRequestShippingInformation) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *PaymentRequestShippingInformation) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *PaymentRequestShippingInformation) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *PaymentRequestShippingInformation) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentRequestStatus.md b/docs/payment_request/PaymentRequestStatus.md new file mode 100644 index 00000000..f5d966e2 --- /dev/null +++ b/docs/payment_request/PaymentRequestStatus.md @@ -0,0 +1,25 @@ +# PaymentRequestStatus + +## Enum + + +* `PENDING` (value: `"PENDING"`) + +* `REQUIRES_ACTION` (value: `"REQUIRES_ACTION"`) + +* `CANCELED` (value: `"CANCELED"`) + +* `SUCCEEDED` (value: `"SUCCEEDED"`) + +* `FAILED` (value: `"FAILED"`) + +* `VOIDED` (value: `"VOIDED"`) + +* `UNKNOWN` (value: `"UNKNOWN"`) + +* `AWAITING_CAPTURE` (value: `"AWAITING_CAPTURE"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/QRCode.md b/docs/payment_request/QRCode.md new file mode 100644 index 00000000..ed174da3 --- /dev/null +++ b/docs/payment_request/QRCode.md @@ -0,0 +1,92 @@ +# QRCode + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to [**NullableQRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**QRCodeChannelProperties**](QRCodeChannelProperties.md) | | [optional] | + +## Methods + +### NewQRCode + +`func NewQRCode() *QRCode` + +NewQRCode instantiates a new QRCode object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeWithDefaults + +`func NewQRCodeWithDefaults() *QRCode` + +NewQRCodeWithDefaults instantiates a new QRCode object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *QRCode) GetChannelCode() QRCodeChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *QRCode) GetChannelCodeOk() (*QRCodeChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *QRCode) SetChannelCode(v QRCodeChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *QRCode) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### SetChannelCodeNil + +`func (o *QRCode) SetChannelCodeNil(b bool)` + + SetChannelCodeNil sets the value for ChannelCode to be an explicit nil + +### UnsetChannelCode +`func (o *QRCode) UnsetChannelCode()` + +UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +### GetChannelProperties + +`func (o *QRCode) GetChannelProperties() QRCodeChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *QRCode) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *QRCode) SetChannelProperties(v QRCodeChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *QRCode) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/QRCodeChannelCode.md b/docs/payment_request/QRCodeChannelCode.md new file mode 100644 index 00000000..decded15 --- /dev/null +++ b/docs/payment_request/QRCodeChannelCode.md @@ -0,0 +1,17 @@ +# QRCodeChannelCode + +## Enum + + +* `DANA` (value: `"DANA"`) + +* `RCBC` (value: `"RCBC"`) + +* `LINKAJA` (value: `"LINKAJA"`) + +* `PROMPTPAY` (value: `"PROMPTPAY"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/QRCodeChannelProperties.md b/docs/payment_request/QRCodeChannelProperties.md new file mode 100644 index 00000000..42ab882a --- /dev/null +++ b/docs/payment_request/QRCodeChannelProperties.md @@ -0,0 +1,82 @@ +# QRCodeChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **QrString** | Pointer to **string** | | [optional] | +| **ExpiresAt** | Pointer to **time.Time** | | [optional] | + +## Methods + +### NewQRCodeChannelProperties + +`func NewQRCodeChannelProperties() *QRCodeChannelProperties` + +NewQRCodeChannelProperties instantiates a new QRCodeChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeChannelPropertiesWithDefaults + +`func NewQRCodeChannelPropertiesWithDefaults() *QRCodeChannelProperties` + +NewQRCodeChannelPropertiesWithDefaults instantiates a new QRCodeChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQrString + +`func (o *QRCodeChannelProperties) GetQrString() string` + +GetQrString returns the QrString field if non-nil, zero value otherwise. + +### GetQrStringOk + +`func (o *QRCodeChannelProperties) GetQrStringOk() (*string, bool)` + +GetQrStringOk returns a tuple with the QrString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQrString + +`func (o *QRCodeChannelProperties) SetQrString(v string)` + +SetQrString sets QrString field to given value. + +### HasQrString + +`func (o *QRCodeChannelProperties) HasQrString() bool` + +HasQrString returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *QRCodeChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *QRCodeChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *QRCodeChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *QRCodeChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/QRCodeParameters.md b/docs/payment_request/QRCodeParameters.md new file mode 100644 index 00000000..fc485af0 --- /dev/null +++ b/docs/payment_request/QRCodeParameters.md @@ -0,0 +1,92 @@ +# QRCodeParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | Pointer to [**NullableQRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] | +| **ChannelProperties** | Pointer to [**QRCodeChannelProperties**](QRCodeChannelProperties.md) | | [optional] | + +## Methods + +### NewQRCodeParameters + +`func NewQRCodeParameters() *QRCodeParameters` + +NewQRCodeParameters instantiates a new QRCodeParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQRCodeParametersWithDefaults + +`func NewQRCodeParametersWithDefaults() *QRCodeParameters` + +NewQRCodeParametersWithDefaults instantiates a new QRCodeParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *QRCodeParameters) GetChannelCode() QRCodeChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *QRCodeParameters) GetChannelCodeOk() (*QRCodeChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *QRCodeParameters) SetChannelCode(v QRCodeChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *QRCodeParameters) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### SetChannelCodeNil + +`func (o *QRCodeParameters) SetChannelCodeNil(b bool)` + + SetChannelCodeNil sets the value for ChannelCode to be an explicit nil + +### UnsetChannelCode +`func (o *QRCodeParameters) UnsetChannelCode()` + +UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +### GetChannelProperties + +`func (o *QRCodeParameters) GetChannelProperties() QRCodeChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *QRCodeParameters) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *QRCodeParameters) SetChannelProperties(v QRCodeChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *QRCodeParameters) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccount.md b/docs/payment_request/VirtualAccount.md new file mode 100644 index 00000000..d725fab4 --- /dev/null +++ b/docs/payment_request/VirtualAccount.md @@ -0,0 +1,258 @@ +# VirtualAccount + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | [optional] | +| **ChannelCode** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | | +| **ChannelProperties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | | +| **AlternativeDisplayTypes** | Pointer to **string[]** | Alternative display requested for the virtual account | [optional] | +| **AlternativeDisplays** | Pointer to [**VirtualAccountAlternativeDisplay[]**](VirtualAccountAlternativeDisplay.md) | | [optional] | + +## Methods + +### NewVirtualAccount + +`func NewVirtualAccount(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties, ) *VirtualAccount` + +NewVirtualAccount instantiates a new VirtualAccount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountWithDefaults + +`func NewVirtualAccountWithDefaults() *VirtualAccount` + +NewVirtualAccountWithDefaults instantiates a new VirtualAccount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMinAmount + +`func (o *VirtualAccount) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *VirtualAccount) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *VirtualAccount) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *VirtualAccount) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *VirtualAccount) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *VirtualAccount) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *VirtualAccount) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *VirtualAccount) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *VirtualAccount) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *VirtualAccount) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *VirtualAccount) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *VirtualAccount) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetAmount + +`func (o *VirtualAccount) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *VirtualAccount) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *VirtualAccount) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *VirtualAccount) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *VirtualAccount) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *VirtualAccount) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *VirtualAccount) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *VirtualAccount) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *VirtualAccount) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *VirtualAccount) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *VirtualAccount) GetChannelCode() VirtualAccountChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *VirtualAccount) GetChannelCodeOk() (*VirtualAccountChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *VirtualAccount) SetChannelCode(v VirtualAccountChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *VirtualAccount) GetChannelProperties() VirtualAccountChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *VirtualAccount) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *VirtualAccount) SetChannelProperties(v VirtualAccountChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAlternativeDisplayTypes + +`func (o *VirtualAccount) GetAlternativeDisplayTypes() []string` + +GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field if non-nil, zero value otherwise. + +### GetAlternativeDisplayTypesOk + +`func (o *VirtualAccount) GetAlternativeDisplayTypesOk() (*[]string, bool)` + +GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplayTypes + +`func (o *VirtualAccount) SetAlternativeDisplayTypes(v []string)` + +SetAlternativeDisplayTypes sets AlternativeDisplayTypes field to given value. + +### HasAlternativeDisplayTypes + +`func (o *VirtualAccount) HasAlternativeDisplayTypes() bool` + +HasAlternativeDisplayTypes returns a boolean if a field has been set. + +### GetAlternativeDisplays + +`func (o *VirtualAccount) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay` + +GetAlternativeDisplays returns the AlternativeDisplays field if non-nil, zero value otherwise. + +### GetAlternativeDisplaysOk + +`func (o *VirtualAccount) GetAlternativeDisplaysOk() (*[]VirtualAccountAlternativeDisplay, bool)` + +GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplays + +`func (o *VirtualAccount) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay)` + +SetAlternativeDisplays sets AlternativeDisplays field to given value. + +### HasAlternativeDisplays + +`func (o *VirtualAccount) HasAlternativeDisplays() bool` + +HasAlternativeDisplays returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccountAllOf.md b/docs/payment_request/VirtualAccountAllOf.md new file mode 100644 index 00000000..792f9b9a --- /dev/null +++ b/docs/payment_request/VirtualAccountAllOf.md @@ -0,0 +1,56 @@ +# VirtualAccountAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **AlternativeDisplays** | Pointer to [**VirtualAccountAlternativeDisplay[]**](VirtualAccountAlternativeDisplay.md) | | [optional] | + +## Methods + +### NewVirtualAccountAllOf + +`func NewVirtualAccountAllOf() *VirtualAccountAllOf` + +NewVirtualAccountAllOf instantiates a new VirtualAccountAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountAllOfWithDefaults + +`func NewVirtualAccountAllOfWithDefaults() *VirtualAccountAllOf` + +NewVirtualAccountAllOfWithDefaults instantiates a new VirtualAccountAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlternativeDisplays + +`func (o *VirtualAccountAllOf) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay` + +GetAlternativeDisplays returns the AlternativeDisplays field if non-nil, zero value otherwise. + +### GetAlternativeDisplaysOk + +`func (o *VirtualAccountAllOf) GetAlternativeDisplaysOk() (*[]VirtualAccountAlternativeDisplay, bool)` + +GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplays + +`func (o *VirtualAccountAllOf) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay)` + +SetAlternativeDisplays sets AlternativeDisplays field to given value. + +### HasAlternativeDisplays + +`func (o *VirtualAccountAllOf) HasAlternativeDisplays() bool` + +HasAlternativeDisplays returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccountAlternativeDisplay.md b/docs/payment_request/VirtualAccountAlternativeDisplay.md new file mode 100644 index 00000000..df5b2e6c --- /dev/null +++ b/docs/payment_request/VirtualAccountAlternativeDisplay.md @@ -0,0 +1,82 @@ +# VirtualAccountAlternativeDisplay + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Type** | Pointer to **string** | Type of the alternative display | [optional] [readonly] | +| **Data** | Pointer to **string** | Data payload of the given alternative display | [optional] | + +## Methods + +### NewVirtualAccountAlternativeDisplay + +`func NewVirtualAccountAlternativeDisplay() *VirtualAccountAlternativeDisplay` + +NewVirtualAccountAlternativeDisplay instantiates a new VirtualAccountAlternativeDisplay object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountAlternativeDisplayWithDefaults + +`func NewVirtualAccountAlternativeDisplayWithDefaults() *VirtualAccountAlternativeDisplay` + +NewVirtualAccountAlternativeDisplayWithDefaults instantiates a new VirtualAccountAlternativeDisplay object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *VirtualAccountAlternativeDisplay) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VirtualAccountAlternativeDisplay) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VirtualAccountAlternativeDisplay) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VirtualAccountAlternativeDisplay) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetData + +`func (o *VirtualAccountAlternativeDisplay) GetData() string` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *VirtualAccountAlternativeDisplay) GetDataOk() (*string, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *VirtualAccountAlternativeDisplay) SetData(v string)` + +SetData sets Data field to given value. + +### HasData + +`func (o *VirtualAccountAlternativeDisplay) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccountChannelCode.md b/docs/payment_request/VirtualAccountChannelCode.md new file mode 100644 index 00000000..5fabe29e --- /dev/null +++ b/docs/payment_request/VirtualAccountChannelCode.md @@ -0,0 +1,39 @@ +# VirtualAccountChannelCode + +## Enum + + +* `BCA` (value: `"BCA"`) + +* `BJB` (value: `"BJB"`) + +* `BNI` (value: `"BNI"`) + +* `BRI` (value: `"BRI"`) + +* `MANDIRI` (value: `"MANDIRI"`) + +* `PERMATA` (value: `"PERMATA"`) + +* `BSI` (value: `"BSI"`) + +* `CIMB` (value: `"CIMB"`) + +* `SAHABAT_SAMPOERNA` (value: `"SAHABAT_SAMPOERNA"`) + +* `ARTAJASA` (value: `"ARTAJASA"`) + +* `PV` (value: `"PV"`) + +* `VIETCAPITAL` (value: `"VIETCAPITAL"`) + +* `WOORI` (value: `"WOORI"`) + +* `MSB` (value: `"MSB"`) + +* `STANDARD_CHARTERED` (value: `"STANDARD_CHARTERED"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccountChannelProperties.md b/docs/payment_request/VirtualAccountChannelProperties.md new file mode 100644 index 00000000..4a5ce59a --- /dev/null +++ b/docs/payment_request/VirtualAccountChannelProperties.md @@ -0,0 +1,129 @@ +# VirtualAccountChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **CustomerName** | **string** | Name of customer. | | +| **VirtualAccountNumber** | Pointer to **string** | You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range. | [optional] | +| **ExpiresAt** | Pointer to **time.Time** | The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. | [optional] | +| **SuggestedAmount** | Pointer to **float64** | The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) | [optional] | + +## Methods + +### NewVirtualAccountChannelProperties + +`func NewVirtualAccountChannelProperties(customerName string, ) *VirtualAccountChannelProperties` + +NewVirtualAccountChannelProperties instantiates a new VirtualAccountChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountChannelPropertiesWithDefaults + +`func NewVirtualAccountChannelPropertiesWithDefaults() *VirtualAccountChannelProperties` + +NewVirtualAccountChannelPropertiesWithDefaults instantiates a new VirtualAccountChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerName + +`func (o *VirtualAccountChannelProperties) GetCustomerName() string` + +GetCustomerName returns the CustomerName field if non-nil, zero value otherwise. + +### GetCustomerNameOk + +`func (o *VirtualAccountChannelProperties) GetCustomerNameOk() (*string, bool)` + +GetCustomerNameOk returns a tuple with the CustomerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerName + +`func (o *VirtualAccountChannelProperties) SetCustomerName(v string)` + +SetCustomerName sets CustomerName field to given value. + + +### GetVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) GetVirtualAccountNumber() string` + +GetVirtualAccountNumber returns the VirtualAccountNumber field if non-nil, zero value otherwise. + +### GetVirtualAccountNumberOk + +`func (o *VirtualAccountChannelProperties) GetVirtualAccountNumberOk() (*string, bool)` + +GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) SetVirtualAccountNumber(v string)` + +SetVirtualAccountNumber sets VirtualAccountNumber field to given value. + +### HasVirtualAccountNumber + +`func (o *VirtualAccountChannelProperties) HasVirtualAccountNumber() bool` + +HasVirtualAccountNumber returns a boolean if a field has been set. + +### GetExpiresAt + +`func (o *VirtualAccountChannelProperties) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *VirtualAccountChannelProperties) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *VirtualAccountChannelProperties) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *VirtualAccountChannelProperties) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetSuggestedAmount + +`func (o *VirtualAccountChannelProperties) GetSuggestedAmount() float64` + +GetSuggestedAmount returns the SuggestedAmount field if non-nil, zero value otherwise. + +### GetSuggestedAmountOk + +`func (o *VirtualAccountChannelProperties) GetSuggestedAmountOk() (*float64, bool)` + +GetSuggestedAmountOk returns a tuple with the SuggestedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuggestedAmount + +`func (o *VirtualAccountChannelProperties) SetSuggestedAmount(v float64)` + +SetSuggestedAmount sets SuggestedAmount field to given value. + +### HasSuggestedAmount + +`func (o *VirtualAccountChannelProperties) HasSuggestedAmount() bool` + +HasSuggestedAmount returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/VirtualAccountParameters.md b/docs/payment_request/VirtualAccountParameters.md new file mode 100644 index 00000000..06aa8367 --- /dev/null +++ b/docs/payment_request/VirtualAccountParameters.md @@ -0,0 +1,232 @@ +# VirtualAccountParameters + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **MinAmount** | Pointer to **NullableFloat64** | | [optional] | +| **MaxAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Amount** | Pointer to **NullableFloat64** | | [optional] | +| **Currency** | Pointer to [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | [optional] | +| **ChannelCode** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | | +| **ChannelProperties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | | +| **AlternativeDisplayTypes** | Pointer to **string[]** | Alternative display requested for the virtual account | [optional] | + +## Methods + +### NewVirtualAccountParameters + +`func NewVirtualAccountParameters(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties, ) *VirtualAccountParameters` + +NewVirtualAccountParameters instantiates a new VirtualAccountParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualAccountParametersWithDefaults + +`func NewVirtualAccountParametersWithDefaults() *VirtualAccountParameters` + +NewVirtualAccountParametersWithDefaults instantiates a new VirtualAccountParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMinAmount + +`func (o *VirtualAccountParameters) GetMinAmount() float64` + +GetMinAmount returns the MinAmount field if non-nil, zero value otherwise. + +### GetMinAmountOk + +`func (o *VirtualAccountParameters) GetMinAmountOk() (*float64, bool)` + +GetMinAmountOk returns a tuple with the MinAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinAmount + +`func (o *VirtualAccountParameters) SetMinAmount(v float64)` + +SetMinAmount sets MinAmount field to given value. + +### HasMinAmount + +`func (o *VirtualAccountParameters) HasMinAmount() bool` + +HasMinAmount returns a boolean if a field has been set. + +### SetMinAmountNil + +`func (o *VirtualAccountParameters) SetMinAmountNil(b bool)` + + SetMinAmountNil sets the value for MinAmount to be an explicit nil + +### UnsetMinAmount +`func (o *VirtualAccountParameters) UnsetMinAmount()` + +UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +### GetMaxAmount + +`func (o *VirtualAccountParameters) GetMaxAmount() float64` + +GetMaxAmount returns the MaxAmount field if non-nil, zero value otherwise. + +### GetMaxAmountOk + +`func (o *VirtualAccountParameters) GetMaxAmountOk() (*float64, bool)` + +GetMaxAmountOk returns a tuple with the MaxAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAmount + +`func (o *VirtualAccountParameters) SetMaxAmount(v float64)` + +SetMaxAmount sets MaxAmount field to given value. + +### HasMaxAmount + +`func (o *VirtualAccountParameters) HasMaxAmount() bool` + +HasMaxAmount returns a boolean if a field has been set. + +### SetMaxAmountNil + +`func (o *VirtualAccountParameters) SetMaxAmountNil(b bool)` + + SetMaxAmountNil sets the value for MaxAmount to be an explicit nil + +### UnsetMaxAmount +`func (o *VirtualAccountParameters) UnsetMaxAmount()` + +UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +### GetAmount + +`func (o *VirtualAccountParameters) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *VirtualAccountParameters) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *VirtualAccountParameters) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *VirtualAccountParameters) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### SetAmountNil + +`func (o *VirtualAccountParameters) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *VirtualAccountParameters) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil +### GetCurrency + +`func (o *VirtualAccountParameters) GetCurrency() PaymentRequestCurrency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *VirtualAccountParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *VirtualAccountParameters) SetCurrency(v PaymentRequestCurrency)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *VirtualAccountParameters) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *VirtualAccountParameters) GetChannelCode() VirtualAccountChannelCode` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *VirtualAccountParameters) GetChannelCodeOk() (*VirtualAccountChannelCode, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *VirtualAccountParameters) SetChannelCode(v VirtualAccountChannelCode)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *VirtualAccountParameters) GetChannelProperties() VirtualAccountChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *VirtualAccountParameters) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *VirtualAccountParameters) SetChannelProperties(v VirtualAccountChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) GetAlternativeDisplayTypes() []string` + +GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field if non-nil, zero value otherwise. + +### GetAlternativeDisplayTypesOk + +`func (o *VirtualAccountParameters) GetAlternativeDisplayTypesOk() (*[]string, bool)` + +GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) SetAlternativeDisplayTypes(v []string)` + +SetAlternativeDisplayTypes sets AlternativeDisplayTypes field to given value. + +### HasAlternativeDisplayTypes + +`func (o *VirtualAccountParameters) HasAlternativeDisplayTypes() bool` + +HasAlternativeDisplayTypes returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout.yaml b/docs/payout.yaml new file mode 100644 index 00000000..4a9ae100 --- /dev/null +++ b/docs/payout.yaml @@ -0,0 +1,837 @@ +openapi: 3.0.0 +info: + contact: + email: help@xendit.co + description: "This API allows Xendit to send money from an account to a channel\ + \ (banks, eWallets, retail outlets) from across regions" + license: + name: UNLICENSED + url: https://xendit.co/en/terms-and-conditions/ + termsOfService: https://xendit.co/en/terms-and-conditions/ + title: Payout Service + version: 1.0.0 +externalDocs: + description: Find out more + url: https://developers.xendit.co/api-reference/#payouts +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /v2/payouts: + get: + operationId: getPayouts + parameters: + - description: Reference_id provided when creating the payout + explode: true + in: query + name: reference_id + required: true + schema: + example: DISB-123 + type: string + style: form + - description: Number of records to fetch per API call + explode: true + in: query + name: limit + required: false + schema: + example: 10 + type: number + style: form + - description: Used to fetch record after this payout unique id + explode: true + in: query + name: after_id + required: false + schema: + example: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + type: string + style: form + - description: Used to fetch record before this payout unique id + explode: true + in: query + name: before_id + required: false + schema: + example: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + type: string + style: form + responses: + "200": + content: + application/json: + examples: + With matching payouts: + value: + data: + - id: disb-5594002a-d0a0-4cd9-b3f7-f5992abc8e48 + reference_id: DISB-001 + channel_code: PH_BDO + channel_properties: + account_holder_name: John Doe + account_number: "000000" + description: FX1234 + currency: PHP + amount: 15000.05 + receipt_notification: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + email_bcc: + - user_bcc@example.com + metadata: + external_party: xendit + created: 2019-11-01T12:34:56.007Z + updated: 2019-11-01T12:34:56.007Z + business_id: 5dbf20d7c8eb0c0896f811b6 + status: ACCEPTED + estimated_arrival_time: 2019-11-01T12:34:56.007Z + has_more: false + schema: + $ref: '#/components/schemas/getPayouts_200_response' + description: An array of Payout objects sorted by created time in desc order. + "data" will be an empty array and "has_more' will be equal to false when + there are no matching data. + "403": + content: + application/json: + example: + error_code: REQUEST_FORBIDDEN_ERROR + message: The API key is forbidden to perform this request. + schema: + $ref: '#/components/schemas/Error' + description: API key in use does not have necessary permissions to perform + the request. Please assign proper permissions for the key. + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: API to retrieve all matching payouts with reference ID + tags: + - payout + post: + operationId: createPayout + parameters: + - description: A unique key to prevent duplicate requests from pushing through + our system. No expiration. + explode: false + in: header + name: idempotency-key + required: true + schema: + example: DISB-1234 + type: string + style: simple + - description: The sub-account user-id that you want to make this transaction + for. This header is only used if you have access to xenPlatform. See xenPlatform + for more information. + explode: false + in: header + name: for-user-id + required: false + schema: + example: 5dbf20d7c8eb0c0896f811b6 + type: string + style: simple + requestBody: + content: + application/json: + examples: + Bank or EWallet Payout: + value: + reference_id: DISB-001 + currency: PHP + channel_code: PH_BDO + channel_properties: + account_holder_name: John Doe + account_number: "000000" + amount: 90000 + description: Test Bank Payout + type: DIRECT_DISBURSEMENT + schema: + $ref: '#/components/schemas/CreatePayoutRequest' + responses: + "200": + content: + application/json: + examples: + Successfully created payout: + value: + id: disb-5594002a-d0a0-4cd9-b3f7-f5992abc8e48 + reference_id: DISB-001 + channel_code: PH_BDO + channel_properties: + account_holder_name: John Doe + account_number: "000000" + description: FX1234 + currency: PHP + amount: 15000.05 + receipt_notification: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + email_bcc: + - user_bcc@example.com + metadata: + external_party: xendit + created: 2019-11-01T12:34:56.007Z + updated: 2019-11-01T12:34:56.007Z + business_id: 5dbf20d7c8eb0c0896f811b6 + status: ACCEPTED + estimated_arrival_time: 2019-11-01T12:34:56.007Z + schema: + $ref: '#/components/schemas/getPayouts_200_response_data_inner' + description: Created payout + "400": + content: + application/json: + examples: + Missing parameters or invalid headers: + value: + error_code: API_VALIDATION_ERROR + message: Should have required property "xxx" + Amount has more than 2 decimal places: + value: + error_code: API_VALIDATION_ERROR + message: '"amount" should have 2 decimal places or less' + Channel code not supported yet: + value: + error_code: CHANNEL_CODE_NOT_SUPPORTED + message: “channel_code” is not supported. See list of supported + channel codes at /payouts_channels. + Minimum transfer limit error per channel: + value: + error_code: MINIMUM_TRANSFER_LIMIT_ERROR + message: “amount” is under the minimum amount supported for the + channel. See amount limitations at the URL below. + Maximum transfer limit error per channel: + value: + error_code: MAXIMUM_TRANSFER_LIMIT_ERROR + message: “amount” is more than the maximum amount supported for + the channel. See amount limitations at the URL below. + Amount Increment Not Supported: + value: + error_code: AMOUNT_INCREMENT_NOT_SUPPORTED + message: amount” needs to be a multiple of the minimum increment + supported by the channel. + schema: + $ref: '#/components/schemas/Error' + description: "Error when creating payout, see error_code for more details" + "401": + content: + application/json: + example: + error_code: INVALID_API_KEY + message: API key format is invalid. + schema: + $ref: '#/components/schemas/Error' + description: Invalid API key + "403": + content: + application/json: + example: + error_code: REQUEST_FORBIDDEN_ERROR + message: The API key is forbidden to perform this request. + schema: + $ref: '#/components/schemas/Error' + description: API key in use does not have necessary permissions to perform + the request. Please assign proper permissions for the key. + "409": + content: + application/json: + example: + error_code: DUPLICATE_ERROR + message: "A payout with this idempotency key already exists. If you\ + \ meant to execute a different request, please use another idempotency\ + \ key." + schema: + $ref: '#/components/schemas/Error' + description: "Duplicate Error, payout already exists" + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: API to send money at scale to bank accounts & eWallets + tags: + - payout + /v2/payouts/{id}: + get: + operationId: getPayoutById + parameters: + - description: Payout id returned from the response of /v2/payouts + explode: false + in: path + name: id + required: true + schema: + example: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + With matching payout: + value: + id: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + reference_id: DISB-001 + channel_code: PH_BDO + channel_properties: + account_holder_name: John Doe + account_number: "000000" + description: FX1234 + currency: PHP + amount: 15000.05 + receipt_notification: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + email_bcc: + - user_bcc@example.com + metadata: + external_party: xendit + created: 2019-11-01T12:34:56.007Z + updated: 2019-11-01T12:34:56.007Z + business_id: 5dbf20d7c8eb0c0896f811b6 + status: ACCEPTED + estimated_arrival_time: 2019-11-01T12:34:56.007Z + schema: + $ref: '#/components/schemas/getPayouts_200_response_data_inner' + description: The Payout object + "401": + content: + application/json: + example: + error_code: INVALID_API_KEY + message: API key format is invalid. + schema: + $ref: '#/components/schemas/Error' + description: Invalid API key + "403": + content: + application/json: + example: + error_code: REQUEST_FORBIDDEN_ERROR + message: The API key is forbidden to perform this request. + schema: + $ref: '#/components/schemas/Error' + description: API key in use does not have necessary permissions to perform + the request. Please assign proper permissions for the key. + "404": + content: + application/json: + example: + error_code: DATA_NOT_FOUND + message: Could not find payout with the corresponding ID. Please try + again with a valid ID. + schema: + $ref: '#/components/schemas/Error' + description: Payout Not Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: "API to fetch the current status, or details of the payout" + tags: + - payout + /payouts_channels: + get: + operationId: getPayoutChannels + parameters: + - description: Filter channels by currency from ISO-4217 values + explode: true + in: query + name: currency + required: false + schema: + example: "IDR, PHP" + type: string + style: form + - allowReserved: true + description: Filter channels by category + explode: false + in: query + name: channel_category + required: false + schema: + items: + $ref: '#/components/schemas/ChannelCategory' + type: array + style: form + - description: "Filter channels by channel code, prefixed by ISO-3166 country\ + \ code" + explode: true + in: query + name: channel_code + required: false + schema: + example: "ID_MANDIRI, PH_GCASH" + type: string + style: form + responses: + "200": + content: + application/json: + schema: + example: + - channel_code: ID_MANDIRI + channel_category: BANK + currency: IDR + name: Bank Mandiri + amount_limits: + minimum: "1," + maximum: "5000000," + minimum_increment: 1 + - channel_code: PH_GCASH + channel_category: BANK + currency: PHP + name: GCASH + amount_limits: + minimum: "1," + maximum: "50000," + minimum_increment: 0.01 + items: + $ref: '#/components/schemas/Channel' + type: array + description: Current list of banks and e-wallets supported for payouts for + all regions + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: API providing the current list of banks and e-wallets we support for + payouts for both regions + tags: + - payout + /v2/payouts/{id}/cancel: + post: + operationId: cancelPayout + parameters: + - description: Payout id returned from the response of /v2/payouts + explode: false + in: path + name: id + required: true + schema: + example: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + type: string + style: simple + responses: + "200": + content: + application/json: + examples: + For API Gateway: + value: + id: disb-7baa7335-a0b2-4678-bb8c-318c0167f332 + reference_id: DISB-001 + channel_code: PH_BDO + channel_properties: + account_holder_name: John Doe + account_number: "000000" + description: FX1234 + currency: PHP + amount: 15000.05 + receipt_notification: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + email_bcc: + - user_bcc@example.com + metadata: + external_party: xendit + created: 2019-11-01T12:34:56.007Z + updated: 2019-11-01T12:34:56.007Z + business_id: 5dbf20d7c8eb0c0896f811b6 + status: CANCELLED + schema: + $ref: '#/components/schemas/getPayouts_200_response_data_inner' + description: Cancelled Successfully + "400": + content: + application/json: + example: + error_code: CANCELLATION_NOT_ALLOWED + message: Payout cannot be canceled because it has already been processed + by Xendit. + schema: + $ref: '#/components/schemas/Error' + description: Unable to Cancel + "404": + content: + application/json: + example: + error_code: DATA_NOT_FOUND + message: Could not find payout with the corresponding ID. Please try + again with a valid ID + schema: + $ref: '#/components/schemas/Error' + description: Invalid Payout ID + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Errors + summary: API to cancel requested payouts that have not yet been sent to partner + banks and e-wallets. Cancellation is possible if the payout has not been sent + out via our partner and when payout status is ACCEPTED. + tags: + - payout +components: + schemas: + ReceiptNotification: + description: Additional notification for completed payout + example: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_bcc: + - user_bcc@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + properties: + email_to: + description: Valid email address to send the payout receipt + example: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + items: + format: email + maxItems: 3 + type: string + nullable: true + type: array + email_cc: + description: Valid email address to cc the payout receipt + example: + - user_cc@example.com + - user_cc2@example.com + items: + format: email + maxItems: 3 + type: string + nullable: true + type: array + email_bcc: + description: Valid email address to bcc the payout receipt + example: + - user_bcc@example.com + items: + format: email + maxItems: 3 + type: string + nullable: true + type: array + type: object + Error: + properties: + error_code: + description: "Specific error encountered when processing the request, can\ + \ refer to the API documentation on proper handling of each available\ + \ error code https://developers.xendit.co/api-reference/#payouts" + example: SERVER_ERROR + type: string + message: + description: Human readable error message + type: string + errors: + items: + $ref: '#/components/schemas/Error_errors_inner' + type: array + required: + - error_code + - message + type: object + ChannelAccountType: + description: Available account types (applicable for MY_DUITNOW) + enum: + - NATIONAL_ID + - MOBILE_NO + - PASSPORT + - BUSINESS_REGISTRATION + - BANK_ACCOUNT + type: string + ChannelCategory: + description: "Category of channel code, as some channels might require more\ + \ fields during processing" + enum: + - BANK + - EWALLET + - OTC + example: BANK + type: string + Channel: + description: Channel information where you can send the money to + properties: + channel_code: + description: "Destination channel to send the money to, prefixed by ISO-3166\ + \ country code" + example: ID_MANDIRI + type: string + channel_category: + $ref: '#/components/schemas/ChannelCategory' + currency: + description: Currency of the destination channel using ISO-4217 currency + code + example: IDR + type: string + channel_name: + description: Name of the destination channel + example: Bank Mandiri + type: string + amount_limits: + $ref: '#/components/schemas/Channel_amount_limits' + required: + - amount_limits + - channel_category + - channel_code + - channel_name + - currency + type: object + DigitalPayoutChannelProperties: + description: "Channel information for digital destinations (banks, e-wallets)" + example: + account_number: "9999999999" + account_type: null + account_holder_name: Adam Gilcrist + properties: + account_holder_name: + description: Registered account name + example: Adam Gilcrist + nullable: true + type: string + account_number: + description: Registered account number + example: "9999999999" + type: string + account_type: + $ref: '#/components/schemas/ChannelAccountType' + required: + - account_number + type: object + CreatePayoutRequest: + description: Information needed by Xendit to send money to the destination channel + provided + example: + amount: 15000.05 + metadata: + external_party: xendit + reference_id: DISB-001 + receipt_notification: + email_to: + - user_to@example.com + - user_to2@example.com + - user_to3@example.com + email_bcc: + - user_bcc@example.com + email_cc: + - user_cc@example.com + - user_cc2@example.com + description: Cashback 2020 + channel_properties: + account_number: "9999999999" + account_type: null + account_holder_name: Adam Gilcrist + currency: PHP + channel_code: PH_BDO + properties: + reference_id: + description: A client defined payout identifier + example: DISB-001 + minLength: 1 + type: string + channel_code: + description: Channel code of selected destination bank or e-wallet + example: PH_BDO + type: string + channel_properties: + $ref: '#/components/schemas/DigitalPayoutChannelProperties' + amount: + description: Amount to be sent to the destination account and should be + a multiple of the minimum increment for the selected channel + example: 15000.05 + type: number + description: + description: "Description to send with the payout, the recipient may see\ + \ this e.g., in their bank statement (if supported) or in email receipts\ + \ we send on your behalf" + example: Cashback 2020 + type: string + currency: + description: Currency of the destination channel using ISO-4217 currency + code + example: PHP + type: string + receipt_notification: + $ref: '#/components/schemas/ReceiptNotification' + metadata: + description: Object of additional information you may use + example: + external_party: xendit + type: object + required: + - amount + - channel_code + - channel_properties + - currency + - reference_id + type: object + Payout: + allOf: + - $ref: '#/components/schemas/CreatePayoutRequest' + - $ref: '#/components/schemas/Payout_allOf' + getPayouts_200_response_data_inner: + anyOf: + - $ref: '#/components/schemas/Payout' + getPayouts_200_response_links: + example: + method: method + rel: rel + href: href + properties: + href: + type: string + rel: + type: string + method: + type: string + type: object + getPayouts_200_response: + example: + data: + - null + - null + links: + method: method + rel: rel + href: href + has_more: true + properties: + data: + items: + $ref: '#/components/schemas/getPayouts_200_response_data_inner' + type: array + has_more: + type: boolean + links: + $ref: '#/components/schemas/getPayouts_200_response_links' + type: object + Error_errors_inner: + properties: + path: + description: Precise location of the error + type: string + message: + description: Specific description of the error + type: string + required: + - message + - path + type: object + Channel_amount_limits: + description: Supported amount ranges for payouts to this channel + properties: + minimum: + description: Lowest amount supported for a payout to this channel + example: 1 + type: number + maximum: + description: Highest amount supported for a payout to this channel + example: 50000000 + type: number + minimum_increment: + description: Supported increments + example: 1 + type: number + required: + - maximum + - minimum + - minimum_increment + type: object + Payout_allOf: + properties: + id: + description: Xendit-generated unique identifier for each payout + example: disb_4203234e-48f5-11eb-b378-0242ac130002 + type: string + created: + description: "The time payout was created on Xendit's system, in ISO 8601\ + \ format" + example: 2019-11-01T12:34:56.007Z + format: date-time + type: string + updated: + description: "The time payout was last updated on Xendit's system, in ISO\ + \ 8601 format" + example: 2019-11-01T12:34:56.007Z + format: date-time + type: string + business_id: + description: Xendit Business ID + example: 4203234e-48f5-11eb-b378-0242ac130002 + type: string + status: + description: Status of payout + enum: + - SUCCEEDED + - FAILED + - ACCEPTED + - REQUESTED + - LOCKED + - CANCELLED + - REVERSED + example: ACCEPTED + type: string + failure_code: + description: "If the Payout failed, we include a failure code for more details\ + \ on the failure." + enum: + - INSUFFICIENT_BALANCE + - REJECTED_BY_CHANNEL + - TEMPORARY_TRANSFER_ERROR + - INVALID_DESTINATION + - TRANSFER_ERROR + type: string + estimated_arrival_time: + description: Our estimated time on to when your payout is reflected to the + destination account + format: date-time + type: string + required: + - business_id + - created + - id + - status + - updated + type: object + example: null diff --git a/docs/payout/Channel.md b/docs/payout/Channel.md new file mode 100644 index 00000000..8fddb4d2 --- /dev/null +++ b/docs/payout/Channel.md @@ -0,0 +1,135 @@ +# Channel + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ChannelCode** | **string** | Destination channel to send the money to, prefixed by ISO-3166 country code | | +| **ChannelCategory** | [**ChannelCategory**](ChannelCategory.md) | | | +| **Currency** | **string** | Currency of the destination channel using ISO-4217 currency code | | +| **ChannelName** | **string** | Name of the destination channel | | +| **AmountLimits** | [**ChannelAmountLimits**](ChannelAmountLimits.md) | | | + +## Methods + +### NewChannel + +`func NewChannel(channelCode string, channelCategory ChannelCategory, currency string, channelName string, amountLimits ChannelAmountLimits, ) *Channel` + +NewChannel instantiates a new Channel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelWithDefaults + +`func NewChannelWithDefaults() *Channel` + +NewChannelWithDefaults instantiates a new Channel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChannelCode + +`func (o *Channel) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *Channel) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *Channel) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelCategory + +`func (o *Channel) GetChannelCategory() ChannelCategory` + +GetChannelCategory returns the ChannelCategory field if non-nil, zero value otherwise. + +### GetChannelCategoryOk + +`func (o *Channel) GetChannelCategoryOk() (*ChannelCategory, bool)` + +GetChannelCategoryOk returns a tuple with the ChannelCategory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCategory + +`func (o *Channel) SetChannelCategory(v ChannelCategory)` + +SetChannelCategory sets ChannelCategory field to given value. + + +### GetCurrency + +`func (o *Channel) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Channel) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Channel) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetChannelName + +`func (o *Channel) GetChannelName() string` + +GetChannelName returns the ChannelName field if non-nil, zero value otherwise. + +### GetChannelNameOk + +`func (o *Channel) GetChannelNameOk() (*string, bool)` + +GetChannelNameOk returns a tuple with the ChannelName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelName + +`func (o *Channel) SetChannelName(v string)` + +SetChannelName sets ChannelName field to given value. + + +### GetAmountLimits + +`func (o *Channel) GetAmountLimits() ChannelAmountLimits` + +GetAmountLimits returns the AmountLimits field if non-nil, zero value otherwise. + +### GetAmountLimitsOk + +`func (o *Channel) GetAmountLimitsOk() (*ChannelAmountLimits, bool)` + +GetAmountLimitsOk returns a tuple with the AmountLimits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountLimits + +`func (o *Channel) SetAmountLimits(v ChannelAmountLimits)` + +SetAmountLimits sets AmountLimits field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/ChannelAccountType.md b/docs/payout/ChannelAccountType.md new file mode 100644 index 00000000..b02e75f3 --- /dev/null +++ b/docs/payout/ChannelAccountType.md @@ -0,0 +1,19 @@ +# ChannelAccountType + +## Enum + + +* `NATIONAL_ID` (value: `"NATIONAL_ID"`) + +* `MOBILE_NO` (value: `"MOBILE_NO"`) + +* `PASSPORT` (value: `"PASSPORT"`) + +* `BUSINESS_REGISTRATION` (value: `"BUSINESS_REGISTRATION"`) + +* `BANK_ACCOUNT` (value: `"BANK_ACCOUNT"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/ChannelAmountLimits.md b/docs/payout/ChannelAmountLimits.md new file mode 100644 index 00000000..a45c827f --- /dev/null +++ b/docs/payout/ChannelAmountLimits.md @@ -0,0 +1,93 @@ +# ChannelAmountLimits + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Minimum** | **float32** | Lowest amount supported for a payout to this channel | | +| **Maximum** | **float32** | Highest amount supported for a payout to this channel | | +| **MinimumIncrement** | **float32** | Supported increments | | + +## Methods + +### NewChannelAmountLimits + +`func NewChannelAmountLimits(minimum float32, maximum float32, minimumIncrement float32, ) *ChannelAmountLimits` + +NewChannelAmountLimits instantiates a new ChannelAmountLimits object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewChannelAmountLimitsWithDefaults + +`func NewChannelAmountLimitsWithDefaults() *ChannelAmountLimits` + +NewChannelAmountLimitsWithDefaults instantiates a new ChannelAmountLimits object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMinimum + +`func (o *ChannelAmountLimits) GetMinimum() float32` + +GetMinimum returns the Minimum field if non-nil, zero value otherwise. + +### GetMinimumOk + +`func (o *ChannelAmountLimits) GetMinimumOk() (*float32, bool)` + +GetMinimumOk returns a tuple with the Minimum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinimum + +`func (o *ChannelAmountLimits) SetMinimum(v float32)` + +SetMinimum sets Minimum field to given value. + + +### GetMaximum + +`func (o *ChannelAmountLimits) GetMaximum() float32` + +GetMaximum returns the Maximum field if non-nil, zero value otherwise. + +### GetMaximumOk + +`func (o *ChannelAmountLimits) GetMaximumOk() (*float32, bool)` + +GetMaximumOk returns a tuple with the Maximum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaximum + +`func (o *ChannelAmountLimits) SetMaximum(v float32)` + +SetMaximum sets Maximum field to given value. + + +### GetMinimumIncrement + +`func (o *ChannelAmountLimits) GetMinimumIncrement() float32` + +GetMinimumIncrement returns the MinimumIncrement field if non-nil, zero value otherwise. + +### GetMinimumIncrementOk + +`func (o *ChannelAmountLimits) GetMinimumIncrementOk() (*float32, bool)` + +GetMinimumIncrementOk returns a tuple with the MinimumIncrement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinimumIncrement + +`func (o *ChannelAmountLimits) SetMinimumIncrement(v float32)` + +SetMinimumIncrement sets MinimumIncrement field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/ChannelCategory.md b/docs/payout/ChannelCategory.md new file mode 100644 index 00000000..2c851158 --- /dev/null +++ b/docs/payout/ChannelCategory.md @@ -0,0 +1,15 @@ +# ChannelCategory + +## Enum + + +* `BANK` (value: `"BANK"`) + +* `EWALLET` (value: `"EWALLET"`) + +* `OTC` (value: `"OTC"`) + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/CreatePayoutRequest.md b/docs/payout/CreatePayoutRequest.md new file mode 100644 index 00000000..139a7a69 --- /dev/null +++ b/docs/payout/CreatePayoutRequest.md @@ -0,0 +1,213 @@ +# CreatePayoutRequest + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | **string** | A client defined payout identifier | | +| **ChannelCode** | **string** | Channel code of selected destination bank or e-wallet | | +| **ChannelProperties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | | +| **Amount** | **float32** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | | +| **Description** | Pointer to **string** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] | +| **Currency** | **string** | Currency of the destination channel using ISO-4217 currency code | | +| **ReceiptNotification** | Pointer to [**ReceiptNotification**](ReceiptNotification.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | Object of additional information you may use | [optional] | + +## Methods + +### NewCreatePayoutRequest + +`func NewCreatePayoutRequest(referenceId string, channelCode string, channelProperties DigitalPayoutChannelProperties, amount float32, currency string, ) *CreatePayoutRequest` + +NewCreatePayoutRequest instantiates a new CreatePayoutRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreatePayoutRequestWithDefaults + +`func NewCreatePayoutRequestWithDefaults() *CreatePayoutRequest` + +NewCreatePayoutRequestWithDefaults instantiates a new CreatePayoutRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *CreatePayoutRequest) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *CreatePayoutRequest) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *CreatePayoutRequest) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetChannelCode + +`func (o *CreatePayoutRequest) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *CreatePayoutRequest) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *CreatePayoutRequest) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *CreatePayoutRequest) GetChannelProperties() DigitalPayoutChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *CreatePayoutRequest) GetChannelPropertiesOk() (*DigitalPayoutChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *CreatePayoutRequest) SetChannelProperties(v DigitalPayoutChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAmount + +`func (o *CreatePayoutRequest) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *CreatePayoutRequest) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *CreatePayoutRequest) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetDescription + +`func (o *CreatePayoutRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *CreatePayoutRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *CreatePayoutRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *CreatePayoutRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetCurrency + +`func (o *CreatePayoutRequest) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *CreatePayoutRequest) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *CreatePayoutRequest) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetReceiptNotification + +`func (o *CreatePayoutRequest) GetReceiptNotification() ReceiptNotification` + +GetReceiptNotification returns the ReceiptNotification field if non-nil, zero value otherwise. + +### GetReceiptNotificationOk + +`func (o *CreatePayoutRequest) GetReceiptNotificationOk() (*ReceiptNotification, bool)` + +GetReceiptNotificationOk returns a tuple with the ReceiptNotification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptNotification + +`func (o *CreatePayoutRequest) SetReceiptNotification(v ReceiptNotification)` + +SetReceiptNotification sets ReceiptNotification field to given value. + +### HasReceiptNotification + +`func (o *CreatePayoutRequest) HasReceiptNotification() bool` + +HasReceiptNotification returns a boolean if a field has been set. + +### GetMetadata + +`func (o *CreatePayoutRequest) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CreatePayoutRequest) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CreatePayoutRequest) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CreatePayoutRequest) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/DigitalPayoutChannelProperties.md b/docs/payout/DigitalPayoutChannelProperties.md new file mode 100644 index 00000000..87bcf46e --- /dev/null +++ b/docs/payout/DigitalPayoutChannelProperties.md @@ -0,0 +1,113 @@ +# DigitalPayoutChannelProperties + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **AccountHolderName** | Pointer to **NullableString** | Registered account name | [optional] | +| **AccountNumber** | **string** | Registered account number | | +| **AccountType** | Pointer to [**ChannelAccountType**](ChannelAccountType.md) | | [optional] | + +## Methods + +### NewDigitalPayoutChannelProperties + +`func NewDigitalPayoutChannelProperties(accountNumber string, ) *DigitalPayoutChannelProperties` + +NewDigitalPayoutChannelProperties instantiates a new DigitalPayoutChannelProperties object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDigitalPayoutChannelPropertiesWithDefaults + +`func NewDigitalPayoutChannelPropertiesWithDefaults() *DigitalPayoutChannelProperties` + +NewDigitalPayoutChannelPropertiesWithDefaults instantiates a new DigitalPayoutChannelProperties object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountHolderName + +`func (o *DigitalPayoutChannelProperties) GetAccountHolderName() string` + +GetAccountHolderName returns the AccountHolderName field if non-nil, zero value otherwise. + +### GetAccountHolderNameOk + +`func (o *DigitalPayoutChannelProperties) GetAccountHolderNameOk() (*string, bool)` + +GetAccountHolderNameOk returns a tuple with the AccountHolderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountHolderName + +`func (o *DigitalPayoutChannelProperties) SetAccountHolderName(v string)` + +SetAccountHolderName sets AccountHolderName field to given value. + +### HasAccountHolderName + +`func (o *DigitalPayoutChannelProperties) HasAccountHolderName() bool` + +HasAccountHolderName returns a boolean if a field has been set. + +### SetAccountHolderNameNil + +`func (o *DigitalPayoutChannelProperties) SetAccountHolderNameNil(b bool)` + + SetAccountHolderNameNil sets the value for AccountHolderName to be an explicit nil + +### UnsetAccountHolderName +`func (o *DigitalPayoutChannelProperties) UnsetAccountHolderName()` + +UnsetAccountHolderName ensures that no value is present for AccountHolderName, not even an explicit nil +### GetAccountNumber + +`func (o *DigitalPayoutChannelProperties) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *DigitalPayoutChannelProperties) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *DigitalPayoutChannelProperties) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + + +### GetAccountType + +`func (o *DigitalPayoutChannelProperties) GetAccountType() ChannelAccountType` + +GetAccountType returns the AccountType field if non-nil, zero value otherwise. + +### GetAccountTypeOk + +`func (o *DigitalPayoutChannelProperties) GetAccountTypeOk() (*ChannelAccountType, bool)` + +GetAccountTypeOk returns a tuple with the AccountType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountType + +`func (o *DigitalPayoutChannelProperties) SetAccountType(v ChannelAccountType)` + +SetAccountType sets AccountType field to given value. + +### HasAccountType + +`func (o *DigitalPayoutChannelProperties) HasAccountType() bool` + +HasAccountType returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/Error.md b/docs/payout/Error.md new file mode 100644 index 00000000..af3b4e0d --- /dev/null +++ b/docs/payout/Error.md @@ -0,0 +1,98 @@ +# Error + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | **string** | Specific error encountered when processing the request, can refer to the API documentation on proper handling of each available error code https://developers.xendit.co/api-reference/#payouts | | +| **Message** | **string** | Human readable error message | | +| **Errors** | Pointer to [**ErrorErrorsInner[]**](ErrorErrorsInner.md) | | [optional] | + +## Methods + +### NewError + +`func NewError(errorCode string, message string, ) *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *Error) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *Error) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *Error) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + + +### GetMessage + +`func (o *Error) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *Error) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *Error) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetErrors + +`func (o *Error) GetErrors() []ErrorErrorsInner` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *Error) GetErrorsOk() (*[]ErrorErrorsInner, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *Error) SetErrors(v []ErrorErrorsInner)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *Error) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/ErrorErrorsInner.md b/docs/payout/ErrorErrorsInner.md new file mode 100644 index 00000000..539975c8 --- /dev/null +++ b/docs/payout/ErrorErrorsInner.md @@ -0,0 +1,72 @@ +# ErrorErrorsInner + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Path** | **string** | Precise location of the error | | +| **Message** | **string** | Specific description of the error | | + +## Methods + +### NewErrorErrorsInner + +`func NewErrorErrorsInner(path string, message string, ) *ErrorErrorsInner` + +NewErrorErrorsInner instantiates a new ErrorErrorsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorErrorsInnerWithDefaults + +`func NewErrorErrorsInnerWithDefaults() *ErrorErrorsInner` + +NewErrorErrorsInnerWithDefaults instantiates a new ErrorErrorsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPath + +`func (o *ErrorErrorsInner) GetPath() string` + +GetPath returns the Path field if non-nil, zero value otherwise. + +### GetPathOk + +`func (o *ErrorErrorsInner) GetPathOk() (*string, bool)` + +GetPathOk returns a tuple with the Path field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPath + +`func (o *ErrorErrorsInner) SetPath(v string)` + +SetPath sets Path field to given value. + + +### GetMessage + +`func (o *ErrorErrorsInner) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ErrorErrorsInner) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ErrorErrorsInner) SetMessage(v string)` + +SetMessage sets Message field to given value. + + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/GetPayouts200Response.md b/docs/payout/GetPayouts200Response.md new file mode 100644 index 00000000..9a223cb5 --- /dev/null +++ b/docs/payout/GetPayouts200Response.md @@ -0,0 +1,108 @@ +# GetPayouts200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | Pointer to [**GetPayouts200ResponseDataInner[]**](GetPayouts200ResponseDataInner.md) | | [optional] | +| **HasMore** | Pointer to **bool** | | [optional] | +| **Links** | Pointer to [**GetPayouts200ResponseLinks**](GetPayouts200ResponseLinks.md) | | [optional] | + +## Methods + +### NewGetPayouts200Response + +`func NewGetPayouts200Response() *GetPayouts200Response` + +NewGetPayouts200Response instantiates a new GetPayouts200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetPayouts200ResponseWithDefaults + +`func NewGetPayouts200ResponseWithDefaults() *GetPayouts200Response` + +NewGetPayouts200ResponseWithDefaults instantiates a new GetPayouts200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *GetPayouts200Response) GetData() []GetPayouts200ResponseDataInner` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *GetPayouts200Response) GetDataOk() (*[]GetPayouts200ResponseDataInner, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *GetPayouts200Response) SetData(v []GetPayouts200ResponseDataInner)` + +SetData sets Data field to given value. + +### HasData + +`func (o *GetPayouts200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetHasMore + +`func (o *GetPayouts200Response) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *GetPayouts200Response) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *GetPayouts200Response) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + +### HasHasMore + +`func (o *GetPayouts200Response) HasHasMore() bool` + +HasHasMore returns a boolean if a field has been set. + +### GetLinks + +`func (o *GetPayouts200Response) GetLinks() GetPayouts200ResponseLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *GetPayouts200Response) GetLinksOk() (*GetPayouts200ResponseLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *GetPayouts200Response) SetLinks(v GetPayouts200ResponseLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *GetPayouts200Response) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/GetPayouts200ResponseDataInner.md b/docs/payout/GetPayouts200ResponseDataInner.md new file mode 100644 index 00000000..ad7616a0 --- /dev/null +++ b/docs/payout/GetPayouts200ResponseDataInner.md @@ -0,0 +1,370 @@ +# GetPayouts200ResponseDataInner + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | **string** | A client defined payout identifier | | +| **ChannelCode** | **string** | Channel code of selected destination bank or e-wallet | | +| **ChannelProperties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | | +| **Amount** | **float32** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | | +| **Description** | Pointer to **string** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] | +| **Currency** | **string** | Currency of the destination channel using ISO-4217 currency code | | +| **ReceiptNotification** | Pointer to [**ReceiptNotification**](ReceiptNotification.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | Object of additional information you may use | [optional] | +| **Id** | **string** | Xendit-generated unique identifier for each payout | | +| **Created** | **time.Time** | The time payout was created on Xendit's system, in ISO 8601 format | | +| **Updated** | **time.Time** | The time payout was last updated on Xendit's system, in ISO 8601 format | | +| **BusinessId** | **string** | Xendit Business ID | | +| **Status** | **string** | Status of payout | | +| **FailureCode** | Pointer to **string** | If the Payout failed, we include a failure code for more details on the failure. | [optional] | +| **EstimatedArrivalTime** | Pointer to **time.Time** | Our estimated time on to when your payout is reflected to the destination account | [optional] | + +## Methods + +### NewGetPayouts200ResponseDataInner + +`func NewGetPayouts200ResponseDataInner(referenceId string, channelCode string, channelProperties DigitalPayoutChannelProperties, amount float32, currency string, id string, created time.Time, updated time.Time, businessId string, status string, ) *GetPayouts200ResponseDataInner` + +NewGetPayouts200ResponseDataInner instantiates a new GetPayouts200ResponseDataInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetPayouts200ResponseDataInnerWithDefaults + +`func NewGetPayouts200ResponseDataInnerWithDefaults() *GetPayouts200ResponseDataInner` + +NewGetPayouts200ResponseDataInnerWithDefaults instantiates a new GetPayouts200ResponseDataInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *GetPayouts200ResponseDataInner) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *GetPayouts200ResponseDataInner) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *GetPayouts200ResponseDataInner) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetChannelCode + +`func (o *GetPayouts200ResponseDataInner) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *GetPayouts200ResponseDataInner) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *GetPayouts200ResponseDataInner) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *GetPayouts200ResponseDataInner) GetChannelProperties() DigitalPayoutChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *GetPayouts200ResponseDataInner) GetChannelPropertiesOk() (*DigitalPayoutChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *GetPayouts200ResponseDataInner) SetChannelProperties(v DigitalPayoutChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAmount + +`func (o *GetPayouts200ResponseDataInner) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *GetPayouts200ResponseDataInner) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *GetPayouts200ResponseDataInner) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetDescription + +`func (o *GetPayouts200ResponseDataInner) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *GetPayouts200ResponseDataInner) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *GetPayouts200ResponseDataInner) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *GetPayouts200ResponseDataInner) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetCurrency + +`func (o *GetPayouts200ResponseDataInner) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *GetPayouts200ResponseDataInner) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *GetPayouts200ResponseDataInner) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetReceiptNotification + +`func (o *GetPayouts200ResponseDataInner) GetReceiptNotification() ReceiptNotification` + +GetReceiptNotification returns the ReceiptNotification field if non-nil, zero value otherwise. + +### GetReceiptNotificationOk + +`func (o *GetPayouts200ResponseDataInner) GetReceiptNotificationOk() (*ReceiptNotification, bool)` + +GetReceiptNotificationOk returns a tuple with the ReceiptNotification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptNotification + +`func (o *GetPayouts200ResponseDataInner) SetReceiptNotification(v ReceiptNotification)` + +SetReceiptNotification sets ReceiptNotification field to given value. + +### HasReceiptNotification + +`func (o *GetPayouts200ResponseDataInner) HasReceiptNotification() bool` + +HasReceiptNotification returns a boolean if a field has been set. + +### GetMetadata + +`func (o *GetPayouts200ResponseDataInner) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *GetPayouts200ResponseDataInner) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *GetPayouts200ResponseDataInner) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *GetPayouts200ResponseDataInner) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetId + +`func (o *GetPayouts200ResponseDataInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *GetPayouts200ResponseDataInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *GetPayouts200ResponseDataInner) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreated + +`func (o *GetPayouts200ResponseDataInner) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *GetPayouts200ResponseDataInner) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *GetPayouts200ResponseDataInner) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *GetPayouts200ResponseDataInner) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *GetPayouts200ResponseDataInner) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *GetPayouts200ResponseDataInner) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + + +### GetBusinessId + +`func (o *GetPayouts200ResponseDataInner) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *GetPayouts200ResponseDataInner) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *GetPayouts200ResponseDataInner) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetStatus + +`func (o *GetPayouts200ResponseDataInner) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *GetPayouts200ResponseDataInner) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *GetPayouts200ResponseDataInner) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetFailureCode + +`func (o *GetPayouts200ResponseDataInner) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *GetPayouts200ResponseDataInner) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *GetPayouts200ResponseDataInner) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *GetPayouts200ResponseDataInner) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### GetEstimatedArrivalTime + +`func (o *GetPayouts200ResponseDataInner) GetEstimatedArrivalTime() time.Time` + +GetEstimatedArrivalTime returns the EstimatedArrivalTime field if non-nil, zero value otherwise. + +### GetEstimatedArrivalTimeOk + +`func (o *GetPayouts200ResponseDataInner) GetEstimatedArrivalTimeOk() (*time.Time, bool)` + +GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEstimatedArrivalTime + +`func (o *GetPayouts200ResponseDataInner) SetEstimatedArrivalTime(v time.Time)` + +SetEstimatedArrivalTime sets EstimatedArrivalTime field to given value. + +### HasEstimatedArrivalTime + +`func (o *GetPayouts200ResponseDataInner) HasEstimatedArrivalTime() bool` + +HasEstimatedArrivalTime returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/GetPayouts200ResponseLinks.md b/docs/payout/GetPayouts200ResponseLinks.md new file mode 100644 index 00000000..92e6c8e1 --- /dev/null +++ b/docs/payout/GetPayouts200ResponseLinks.md @@ -0,0 +1,108 @@ +# GetPayouts200ResponseLinks + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Href** | Pointer to **string** | | [optional] | +| **Rel** | Pointer to **string** | | [optional] | +| **Method** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetPayouts200ResponseLinks + +`func NewGetPayouts200ResponseLinks() *GetPayouts200ResponseLinks` + +NewGetPayouts200ResponseLinks instantiates a new GetPayouts200ResponseLinks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetPayouts200ResponseLinksWithDefaults + +`func NewGetPayouts200ResponseLinksWithDefaults() *GetPayouts200ResponseLinks` + +NewGetPayouts200ResponseLinksWithDefaults instantiates a new GetPayouts200ResponseLinks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *GetPayouts200ResponseLinks) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *GetPayouts200ResponseLinks) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *GetPayouts200ResponseLinks) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *GetPayouts200ResponseLinks) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetRel + +`func (o *GetPayouts200ResponseLinks) GetRel() string` + +GetRel returns the Rel field if non-nil, zero value otherwise. + +### GetRelOk + +`func (o *GetPayouts200ResponseLinks) GetRelOk() (*string, bool)` + +GetRelOk returns a tuple with the Rel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRel + +`func (o *GetPayouts200ResponseLinks) SetRel(v string)` + +SetRel sets Rel field to given value. + +### HasRel + +`func (o *GetPayouts200ResponseLinks) HasRel() bool` + +HasRel returns a boolean if a field has been set. + +### GetMethod + +`func (o *GetPayouts200ResponseLinks) GetMethod() string` + +GetMethod returns the Method field if non-nil, zero value otherwise. + +### GetMethodOk + +`func (o *GetPayouts200ResponseLinks) GetMethodOk() (*string, bool)` + +GetMethodOk returns a tuple with the Method field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMethod + +`func (o *GetPayouts200ResponseLinks) SetMethod(v string)` + +SetMethod sets Method field to given value. + +### HasMethod + +`func (o *GetPayouts200ResponseLinks) HasMethod() bool` + +HasMethod returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/Payout.md b/docs/payout/Payout.md new file mode 100644 index 00000000..658c76b0 --- /dev/null +++ b/docs/payout/Payout.md @@ -0,0 +1,370 @@ +# Payout + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ReferenceId** | **string** | A client defined payout identifier | | +| **ChannelCode** | **string** | Channel code of selected destination bank or e-wallet | | +| **ChannelProperties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | | +| **Amount** | **float32** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | | +| **Description** | Pointer to **string** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] | +| **Currency** | **string** | Currency of the destination channel using ISO-4217 currency code | | +| **ReceiptNotification** | Pointer to [**ReceiptNotification**](ReceiptNotification.md) | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | Object of additional information you may use | [optional] | +| **Id** | **string** | Xendit-generated unique identifier for each payout | | +| **Created** | **time.Time** | The time payout was created on Xendit's system, in ISO 8601 format | | +| **Updated** | **time.Time** | The time payout was last updated on Xendit's system, in ISO 8601 format | | +| **BusinessId** | **string** | Xendit Business ID | | +| **Status** | **string** | Status of payout | | +| **FailureCode** | Pointer to **string** | If the Payout failed, we include a failure code for more details on the failure. | [optional] | +| **EstimatedArrivalTime** | Pointer to **time.Time** | Our estimated time on to when your payout is reflected to the destination account | [optional] | + +## Methods + +### NewPayout + +`func NewPayout(referenceId string, channelCode string, channelProperties DigitalPayoutChannelProperties, amount float32, currency string, id string, created time.Time, updated time.Time, businessId string, status string, ) *Payout` + +NewPayout instantiates a new Payout object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPayoutWithDefaults + +`func NewPayoutWithDefaults() *Payout` + +NewPayoutWithDefaults instantiates a new Payout object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReferenceId + +`func (o *Payout) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *Payout) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *Payout) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetChannelCode + +`func (o *Payout) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *Payout) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *Payout) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetChannelProperties + +`func (o *Payout) GetChannelProperties() DigitalPayoutChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *Payout) GetChannelPropertiesOk() (*DigitalPayoutChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *Payout) SetChannelProperties(v DigitalPayoutChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + + +### GetAmount + +`func (o *Payout) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Payout) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Payout) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetDescription + +`func (o *Payout) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Payout) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Payout) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Payout) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetCurrency + +`func (o *Payout) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Payout) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Payout) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetReceiptNotification + +`func (o *Payout) GetReceiptNotification() ReceiptNotification` + +GetReceiptNotification returns the ReceiptNotification field if non-nil, zero value otherwise. + +### GetReceiptNotificationOk + +`func (o *Payout) GetReceiptNotificationOk() (*ReceiptNotification, bool)` + +GetReceiptNotificationOk returns a tuple with the ReceiptNotification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptNotification + +`func (o *Payout) SetReceiptNotification(v ReceiptNotification)` + +SetReceiptNotification sets ReceiptNotification field to given value. + +### HasReceiptNotification + +`func (o *Payout) HasReceiptNotification() bool` + +HasReceiptNotification returns a boolean if a field has been set. + +### GetMetadata + +`func (o *Payout) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *Payout) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *Payout) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *Payout) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetId + +`func (o *Payout) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Payout) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Payout) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreated + +`func (o *Payout) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *Payout) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *Payout) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *Payout) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *Payout) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *Payout) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + + +### GetBusinessId + +`func (o *Payout) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *Payout) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *Payout) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetStatus + +`func (o *Payout) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Payout) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Payout) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetFailureCode + +`func (o *Payout) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *Payout) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *Payout) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *Payout) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### GetEstimatedArrivalTime + +`func (o *Payout) GetEstimatedArrivalTime() time.Time` + +GetEstimatedArrivalTime returns the EstimatedArrivalTime field if non-nil, zero value otherwise. + +### GetEstimatedArrivalTimeOk + +`func (o *Payout) GetEstimatedArrivalTimeOk() (*time.Time, bool)` + +GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEstimatedArrivalTime + +`func (o *Payout) SetEstimatedArrivalTime(v time.Time)` + +SetEstimatedArrivalTime sets EstimatedArrivalTime field to given value. + +### HasEstimatedArrivalTime + +`func (o *Payout) HasEstimatedArrivalTime() bool` + +HasEstimatedArrivalTime returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/PayoutAllOf.md b/docs/payout/PayoutAllOf.md new file mode 100644 index 00000000..b598f0cf --- /dev/null +++ b/docs/payout/PayoutAllOf.md @@ -0,0 +1,187 @@ +# PayoutAllOf + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | **string** | Xendit-generated unique identifier for each payout | | +| **Created** | **time.Time** | The time payout was created on Xendit's system, in ISO 8601 format | | +| **Updated** | **time.Time** | The time payout was last updated on Xendit's system, in ISO 8601 format | | +| **BusinessId** | **string** | Xendit Business ID | | +| **Status** | **string** | Status of payout | | +| **FailureCode** | Pointer to **string** | If the Payout failed, we include a failure code for more details on the failure. | [optional] | +| **EstimatedArrivalTime** | Pointer to **time.Time** | Our estimated time on to when your payout is reflected to the destination account | [optional] | + +## Methods + +### NewPayoutAllOf + +`func NewPayoutAllOf(id string, created time.Time, updated time.Time, businessId string, status string, ) *PayoutAllOf` + +NewPayoutAllOf instantiates a new PayoutAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPayoutAllOfWithDefaults + +`func NewPayoutAllOfWithDefaults() *PayoutAllOf` + +NewPayoutAllOfWithDefaults instantiates a new PayoutAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PayoutAllOf) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PayoutAllOf) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PayoutAllOf) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreated + +`func (o *PayoutAllOf) GetCreated() time.Time` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PayoutAllOf) GetCreatedOk() (*time.Time, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PayoutAllOf) SetCreated(v time.Time)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *PayoutAllOf) GetUpdated() time.Time` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *PayoutAllOf) GetUpdatedOk() (*time.Time, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *PayoutAllOf) SetUpdated(v time.Time)` + +SetUpdated sets Updated field to given value. + + +### GetBusinessId + +`func (o *PayoutAllOf) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *PayoutAllOf) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *PayoutAllOf) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetStatus + +`func (o *PayoutAllOf) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PayoutAllOf) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PayoutAllOf) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetFailureCode + +`func (o *PayoutAllOf) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *PayoutAllOf) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *PayoutAllOf) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *PayoutAllOf) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### GetEstimatedArrivalTime + +`func (o *PayoutAllOf) GetEstimatedArrivalTime() time.Time` + +GetEstimatedArrivalTime returns the EstimatedArrivalTime field if non-nil, zero value otherwise. + +### GetEstimatedArrivalTimeOk + +`func (o *PayoutAllOf) GetEstimatedArrivalTimeOk() (*time.Time, bool)` + +GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEstimatedArrivalTime + +`func (o *PayoutAllOf) SetEstimatedArrivalTime(v time.Time)` + +SetEstimatedArrivalTime sets EstimatedArrivalTime field to given value. + +### HasEstimatedArrivalTime + +`func (o *PayoutAllOf) HasEstimatedArrivalTime() bool` + +HasEstimatedArrivalTime returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payout/ReceiptNotification.md b/docs/payout/ReceiptNotification.md new file mode 100644 index 00000000..321918a7 --- /dev/null +++ b/docs/payout/ReceiptNotification.md @@ -0,0 +1,138 @@ +# ReceiptNotification + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **EmailTo** | Pointer to **string[]** | Valid email address to send the payout receipt | [optional] | +| **EmailCc** | Pointer to **string[]** | Valid email address to cc the payout receipt | [optional] | +| **EmailBcc** | Pointer to **string[]** | Valid email address to bcc the payout receipt | [optional] | + +## Methods + +### NewReceiptNotification + +`func NewReceiptNotification() *ReceiptNotification` + +NewReceiptNotification instantiates a new ReceiptNotification object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReceiptNotificationWithDefaults + +`func NewReceiptNotificationWithDefaults() *ReceiptNotification` + +NewReceiptNotificationWithDefaults instantiates a new ReceiptNotification object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEmailTo + +`func (o *ReceiptNotification) GetEmailTo() []string` + +GetEmailTo returns the EmailTo field if non-nil, zero value otherwise. + +### GetEmailToOk + +`func (o *ReceiptNotification) GetEmailToOk() (*[]string, bool)` + +GetEmailToOk returns a tuple with the EmailTo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmailTo + +`func (o *ReceiptNotification) SetEmailTo(v []string)` + +SetEmailTo sets EmailTo field to given value. + +### HasEmailTo + +`func (o *ReceiptNotification) HasEmailTo() bool` + +HasEmailTo returns a boolean if a field has been set. + +### SetEmailToNil + +`func (o *ReceiptNotification) SetEmailToNil(b bool)` + + SetEmailToNil sets the value for EmailTo to be an explicit nil + +### UnsetEmailTo +`func (o *ReceiptNotification) UnsetEmailTo()` + +UnsetEmailTo ensures that no value is present for EmailTo, not even an explicit nil +### GetEmailCc + +`func (o *ReceiptNotification) GetEmailCc() []string` + +GetEmailCc returns the EmailCc field if non-nil, zero value otherwise. + +### GetEmailCcOk + +`func (o *ReceiptNotification) GetEmailCcOk() (*[]string, bool)` + +GetEmailCcOk returns a tuple with the EmailCc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmailCc + +`func (o *ReceiptNotification) SetEmailCc(v []string)` + +SetEmailCc sets EmailCc field to given value. + +### HasEmailCc + +`func (o *ReceiptNotification) HasEmailCc() bool` + +HasEmailCc returns a boolean if a field has been set. + +### SetEmailCcNil + +`func (o *ReceiptNotification) SetEmailCcNil(b bool)` + + SetEmailCcNil sets the value for EmailCc to be an explicit nil + +### UnsetEmailCc +`func (o *ReceiptNotification) UnsetEmailCc()` + +UnsetEmailCc ensures that no value is present for EmailCc, not even an explicit nil +### GetEmailBcc + +`func (o *ReceiptNotification) GetEmailBcc() []string` + +GetEmailBcc returns the EmailBcc field if non-nil, zero value otherwise. + +### GetEmailBccOk + +`func (o *ReceiptNotification) GetEmailBccOk() (*[]string, bool)` + +GetEmailBccOk returns a tuple with the EmailBcc field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmailBcc + +`func (o *ReceiptNotification) SetEmailBcc(v []string)` + +SetEmailBcc sets EmailBcc field to given value. + +### HasEmailBcc + +`func (o *ReceiptNotification) HasEmailBcc() bool` + +HasEmailBcc returns a boolean if a field has been set. + +### SetEmailBccNil + +`func (o *ReceiptNotification) SetEmailBccNil(b bool)` + + SetEmailBccNil sets the value for EmailBcc to be an explicit nil + +### UnsetEmailBcc +`func (o *ReceiptNotification) UnsetEmailBcc()` + +UnsetEmailBcc ensures that no value is present for EmailBcc, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/refund.yaml b/docs/refund.yaml new file mode 100644 index 00000000..93d8e420 --- /dev/null +++ b/docs/refund.yaml @@ -0,0 +1,479 @@ +openapi: 3.0.0 +info: + description: This API is used for the unified refund service + title: Refund Service + version: 1.2.3 +servers: +- description: Xendit API Server + url: https://api.xendit.co +paths: + /refunds: + post: + operationId: createRefund + parameters: + - explode: false + in: header + name: idempotency-key + required: false + schema: + example: 9797b5a6-54ad-4511-80a4-ec451346808b + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRefund' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Refund' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_404_response' + description: Data not found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_409_response' + description: Request causes conflict + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_503_response' + description: Service is unavailable due to dependencies + default: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_default_response' + description: Internal server error + tags: + - refund + /refunds/{refundID}: + get: + operationId: getRefund + parameters: + - explode: false + in: path + name: refundID + required: true + schema: + example: rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + - explode: false + in: header + name: idempotency-key + required: false + schema: + example: 9797b5a6-54ad-4511-80a4-ec451346808b + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Refund' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_default_response' + description: Internal server error + tags: + - refund + /refunds/{refundID}/cancel: + post: + operationId: cancelRefund + parameters: + - explode: false + in: path + name: refundID + required: true + schema: + example: rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + - explode: false + in: header + name: idempotency-key + required: false + schema: + example: 9797b5a6-54ad-4511-80a4-ec451346808b + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Refund' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_400_response' + description: Bad request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_403_response' + description: Forbidden due to permissions + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_404_response' + description: Data not found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_default_response' + description: Internal server error + tags: + - refund + /refunds/: + get: + operationId: getAllRefunds + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RefundList' + description: OK + default: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_default_response' + description: Internal server error + tags: + - refund +components: + parameters: + RefundID: + explode: false + in: path + name: refundID + required: true + schema: + example: rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822 + type: string + style: simple + IdempotencyKey: + explode: false + in: header + name: idempotency-key + required: false + schema: + example: 9797b5a6-54ad-4511-80a4-ec451346808b + type: string + style: simple + responses: + InternalServerError: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_default_response' + description: Internal server error + StatusBadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_400_response' + description: Bad request + StatusForbidden: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_403_response' + description: Forbidden due to permissions + StatusNotFound: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_404_response' + description: Data not found + StatusConflict: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_409_response' + description: Request causes conflict + StatusServiceUnavailable: + content: + application/json: + schema: + $ref: '#/components/schemas/createRefund_503_response' + description: Service is unavailable due to dependencies + schemas: + Refund: + example: + country: PH + amount: 1500 + failure_code: REFUND_FAILED + metadata: "{}" + reference_id: order-1234 + refund_fee_amount: 0.8008281904610115 + created: 2023-01-24T07:05:07.859363326Z + currency: PHP + id: rfd-3ece8615-41b7-4983-a3f0-a037430b6036 + payment_request_id: pr-f4a6f77c-4835-4630-9617-2cdc34ee26ee + channel_code: SHOPEEPAY + updated: 2023-01-24T07:05:07.859363326Z + properties: + id: + example: rfd-3ece8615-41b7-4983-a3f0-a037430b6036 + type: string + payment_request_id: + example: pr-f4a6f77c-4835-4630-9617-2cdc34ee26ee + type: string + amount: + example: 1500 + format: double + type: number + channel_code: + example: SHOPEEPAY + type: string + country: + example: PH + type: string + currency: + example: PHP + type: string + reference_id: + example: order-1234 + nullable: true + type: string + failure_code: + example: REFUND_FAILED + nullable: true + type: string + refund_fee_amount: + format: double + nullable: true + type: number + example: null + created: + example: 2023-01-24T07:05:07.859363326Z + type: string + updated: + example: 2023-01-24T07:05:07.859363326Z + type: string + metadata: + nullable: true + type: object + example: null + type: object + RefundList: + example: + data: + - id: rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822' + payment_request_id: pr-f4a6f77c-4835-4630-9617-2cdc34ee26ee + amount: 1500 + channel_code: SHOPEEPAY + country: PH + currency: PHP + reference_id: order-1234 + failure_code: null + refund_fee_amount: null + created: 2023-01-24T07:05:07.859363326Z + updated: 2023-01-24T07:05:07.859363326Z + metadata: null + - id: rfd-db61bc21-8686-49d9-9be1-168cbf45d83f' + payment_request_id: pr-3af41122-a608-4356-a0fe-1f67f5cf4637 + amount: 1500 + channel_code: GRABPAY + country: PH + currency: PHP + reference_id: order-5678 + failure_code: null + refund_fee_amount: null + created: 2023-01-24T07:05:07.859363326Z + updated: 2023-01-24T07:05:07.859363326Z + metadata: null + has_more: false + nullable: false + properties: + data: + example: + - id: rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822' + payment_request_id: pr-f4a6f77c-4835-4630-9617-2cdc34ee26ee + amount: 1500 + channel_code: SHOPEEPAY + country: PH + currency: PHP + reference_id: order-1234 + failure_code: null + refund_fee_amount: null + created: 2023-01-24T07:05:07.859363326Z + updated: 2023-01-24T07:05:07.859363326Z + metadata: null + - id: rfd-db61bc21-8686-49d9-9be1-168cbf45d83f' + payment_request_id: pr-3af41122-a608-4356-a0fe-1f67f5cf4637 + amount: 1500 + channel_code: GRABPAY + country: PH + currency: PHP + reference_id: order-5678 + failure_code: null + refund_fee_amount: null + created: 2023-01-24T07:05:07.859363326Z + updated: 2023-01-24T07:05:07.859363326Z + metadata: null + items: + $ref: '#/components/schemas/Refund' + type: array + has_more: + example: false + type: boolean + required: + - data + type: object + CreateRefund: + example: + reason: CANCELLATION + amount: 1500 + metadata: + foo: bar + reference_id: order-1234 + invoice_id: 7a2c81d4f9e052a870bf37d2 + currency: PHP + payment_request_id: pr-3ece8615-41b7-4983-a3f0-a037430b6036 + nullable: false + properties: + payment_request_id: + example: pr-3ece8615-41b7-4983-a3f0-a037430b6036 + type: string + invoice_id: + example: 7a2c81d4f9e052a870bf37d2 + type: string + reference_id: + example: order-1234 + type: string + amount: + example: 1500 + format: double + type: number + currency: + example: PHP + type: string + reason: + enum: + - FRAUDULENT + - DUPLICATE + - REQUESTED_BY_CUSTOMER + - CANCELLATION + - OTHERS + example: CANCELLATION + type: string + metadata: + example: + foo: bar + nullable: true + type: object + type: object + createRefund_400_response: + properties: + error_code: + enum: + - API_VALIDATION_ERROR + - INELIGIBLE_TRANSACTION + - INSUFFICIENT_BALANCE + - MAXIMUM_REFUND_AMOUNT_REACHED + - PARTIAL_REFUND_NOT_SUPPORTED + - REFUND_NOT_SUPPORTED + - TRANSACTION_NOT_FOUND + example: MAXIMUM_REFUND_AMOUNT_REACHED + type: string + message: + example: Error because the provided amount is greater than the allowed refund + amount. + type: string + type: object + createRefund_403_response: + properties: + error_code: + enum: + - UNAUTHORIZED + example: UNAUTHORIZED + type: string + message: + example: No valid API key provided + type: string + type: object + createRefund_404_response: + properties: + error_code: + enum: + - DATA_NOT_FOUND + example: DATA_NOT_FOUND + type: string + message: + example: Data not found + type: string + type: object + createRefund_409_response: + properties: + error_code: + enum: + - DUPLICATE_ERROR + - IDEMPOTENCY_ERROR + example: DUPLICATE_ERROR + type: string + message: + example: "duplicate value on idempotency_key, try again with a new key" + type: string + type: object + createRefund_503_response: + properties: + error_code: + enum: + - CHANNEL_UNAVAILABLE + - OTP_DELIVERY_ERROR + example: CHANNEL_UNAVAILABLE + type: string + message: + example: The payment channel requested is currently experiencing unexpected + issues. + type: string + type: object + createRefund_default_response: + example: + error_code: SERVER_ERROR + message: An unexpected error occured. Our team has been notified and will + troubleshoot the issue. + properties: + error_code: + type: string + message: + example: An unexpected error occured. Our team has been notified and will + troubleshoot the issue. + type: string + type: object diff --git a/docs/refund/CreateRefund.md b/docs/refund/CreateRefund.md new file mode 100644 index 00000000..7d669d17 --- /dev/null +++ b/docs/refund/CreateRefund.md @@ -0,0 +1,222 @@ +# CreateRefund + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **PaymentRequestId** | Pointer to **string** | | [optional] | +| **InvoiceId** | Pointer to **string** | | [optional] | +| **ReferenceId** | Pointer to **string** | | [optional] | +| **Amount** | Pointer to **float64** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **Reason** | Pointer to **string** | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewCreateRefund + +`func NewCreateRefund() *CreateRefund` + +NewCreateRefund instantiates a new CreateRefund object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefundWithDefaults + +`func NewCreateRefundWithDefaults() *CreateRefund` + +NewCreateRefundWithDefaults instantiates a new CreateRefund object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPaymentRequestId + +`func (o *CreateRefund) GetPaymentRequestId() string` + +GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. + +### GetPaymentRequestIdOk + +`func (o *CreateRefund) GetPaymentRequestIdOk() (*string, bool)` + +GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentRequestId + +`func (o *CreateRefund) SetPaymentRequestId(v string)` + +SetPaymentRequestId sets PaymentRequestId field to given value. + +### HasPaymentRequestId + +`func (o *CreateRefund) HasPaymentRequestId() bool` + +HasPaymentRequestId returns a boolean if a field has been set. + +### GetInvoiceId + +`func (o *CreateRefund) GetInvoiceId() string` + +GetInvoiceId returns the InvoiceId field if non-nil, zero value otherwise. + +### GetInvoiceIdOk + +`func (o *CreateRefund) GetInvoiceIdOk() (*string, bool)` + +GetInvoiceIdOk returns a tuple with the InvoiceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceId + +`func (o *CreateRefund) SetInvoiceId(v string)` + +SetInvoiceId sets InvoiceId field to given value. + +### HasInvoiceId + +`func (o *CreateRefund) HasInvoiceId() bool` + +HasInvoiceId returns a boolean if a field has been set. + +### GetReferenceId + +`func (o *CreateRefund) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *CreateRefund) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *CreateRefund) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *CreateRefund) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetAmount + +`func (o *CreateRefund) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *CreateRefund) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *CreateRefund) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *CreateRefund) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetCurrency + +`func (o *CreateRefund) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *CreateRefund) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *CreateRefund) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *CreateRefund) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetReason + +`func (o *CreateRefund) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *CreateRefund) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *CreateRefund) SetReason(v string)` + +SetReason sets Reason field to given value. + +### HasReason + +`func (o *CreateRefund) HasReason() bool` + +HasReason returns a boolean if a field has been set. + +### GetMetadata + +`func (o *CreateRefund) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *CreateRefund) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *CreateRefund) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *CreateRefund) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *CreateRefund) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *CreateRefund) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefund400Response.md b/docs/refund/CreateRefund400Response.md new file mode 100644 index 00000000..2f0809a6 --- /dev/null +++ b/docs/refund/CreateRefund400Response.md @@ -0,0 +1,82 @@ +# CreateRefund400Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefund400Response + +`func NewCreateRefund400Response() *CreateRefund400Response` + +NewCreateRefund400Response instantiates a new CreateRefund400Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefund400ResponseWithDefaults + +`func NewCreateRefund400ResponseWithDefaults() *CreateRefund400Response` + +NewCreateRefund400ResponseWithDefaults instantiates a new CreateRefund400Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefund400Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefund400Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefund400Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefund400Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefund400Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefund400Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefund400Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefund400Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefund403Response.md b/docs/refund/CreateRefund403Response.md new file mode 100644 index 00000000..1c92e134 --- /dev/null +++ b/docs/refund/CreateRefund403Response.md @@ -0,0 +1,82 @@ +# CreateRefund403Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefund403Response + +`func NewCreateRefund403Response() *CreateRefund403Response` + +NewCreateRefund403Response instantiates a new CreateRefund403Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefund403ResponseWithDefaults + +`func NewCreateRefund403ResponseWithDefaults() *CreateRefund403Response` + +NewCreateRefund403ResponseWithDefaults instantiates a new CreateRefund403Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefund403Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefund403Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefund403Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefund403Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefund403Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefund403Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefund403Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefund403Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefund404Response.md b/docs/refund/CreateRefund404Response.md new file mode 100644 index 00000000..83c0bdf0 --- /dev/null +++ b/docs/refund/CreateRefund404Response.md @@ -0,0 +1,82 @@ +# CreateRefund404Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefund404Response + +`func NewCreateRefund404Response() *CreateRefund404Response` + +NewCreateRefund404Response instantiates a new CreateRefund404Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefund404ResponseWithDefaults + +`func NewCreateRefund404ResponseWithDefaults() *CreateRefund404Response` + +NewCreateRefund404ResponseWithDefaults instantiates a new CreateRefund404Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefund404Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefund404Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefund404Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefund404Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefund404Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefund404Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefund404Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefund404Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefund409Response.md b/docs/refund/CreateRefund409Response.md new file mode 100644 index 00000000..c76490ec --- /dev/null +++ b/docs/refund/CreateRefund409Response.md @@ -0,0 +1,82 @@ +# CreateRefund409Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefund409Response + +`func NewCreateRefund409Response() *CreateRefund409Response` + +NewCreateRefund409Response instantiates a new CreateRefund409Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefund409ResponseWithDefaults + +`func NewCreateRefund409ResponseWithDefaults() *CreateRefund409Response` + +NewCreateRefund409ResponseWithDefaults instantiates a new CreateRefund409Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefund409Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefund409Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefund409Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefund409Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefund409Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefund409Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefund409Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefund409Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefund503Response.md b/docs/refund/CreateRefund503Response.md new file mode 100644 index 00000000..46284ecd --- /dev/null +++ b/docs/refund/CreateRefund503Response.md @@ -0,0 +1,82 @@ +# CreateRefund503Response + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefund503Response + +`func NewCreateRefund503Response() *CreateRefund503Response` + +NewCreateRefund503Response instantiates a new CreateRefund503Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefund503ResponseWithDefaults + +`func NewCreateRefund503ResponseWithDefaults() *CreateRefund503Response` + +NewCreateRefund503ResponseWithDefaults instantiates a new CreateRefund503Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefund503Response) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefund503Response) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefund503Response) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefund503Response) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefund503Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefund503Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefund503Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefund503Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/CreateRefundDefaultResponse.md b/docs/refund/CreateRefundDefaultResponse.md new file mode 100644 index 00000000..da1d923a --- /dev/null +++ b/docs/refund/CreateRefundDefaultResponse.md @@ -0,0 +1,82 @@ +# CreateRefundDefaultResponse + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **ErrorCode** | Pointer to **string** | | [optional] | +| **Message** | Pointer to **string** | | [optional] | + +## Methods + +### NewCreateRefundDefaultResponse + +`func NewCreateRefundDefaultResponse() *CreateRefundDefaultResponse` + +NewCreateRefundDefaultResponse instantiates a new CreateRefundDefaultResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateRefundDefaultResponseWithDefaults + +`func NewCreateRefundDefaultResponseWithDefaults() *CreateRefundDefaultResponse` + +NewCreateRefundDefaultResponseWithDefaults instantiates a new CreateRefundDefaultResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorCode + +`func (o *CreateRefundDefaultResponse) GetErrorCode() string` + +GetErrorCode returns the ErrorCode field if non-nil, zero value otherwise. + +### GetErrorCodeOk + +`func (o *CreateRefundDefaultResponse) GetErrorCodeOk() (*string, bool)` + +GetErrorCodeOk returns a tuple with the ErrorCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorCode + +`func (o *CreateRefundDefaultResponse) SetErrorCode(v string)` + +SetErrorCode sets ErrorCode field to given value. + +### HasErrorCode + +`func (o *CreateRefundDefaultResponse) HasErrorCode() bool` + +HasErrorCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateRefundDefaultResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateRefundDefaultResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateRefundDefaultResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateRefundDefaultResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/Refund.md b/docs/refund/Refund.md new file mode 100644 index 00000000..7dae07d6 --- /dev/null +++ b/docs/refund/Refund.md @@ -0,0 +1,382 @@ +# Refund + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Id** | Pointer to **string** | | [optional] | +| **PaymentRequestId** | Pointer to **string** | | [optional] | +| **Amount** | Pointer to **float64** | | [optional] | +| **ChannelCode** | Pointer to **string** | | [optional] | +| **Country** | Pointer to **string** | | [optional] | +| **Currency** | Pointer to **string** | | [optional] | +| **ReferenceId** | Pointer to **NullableString** | | [optional] | +| **FailureCode** | Pointer to **NullableString** | | [optional] | +| **RefundFeeAmount** | Pointer to **NullableFloat64** | | [optional] | +| **Created** | Pointer to **string** | | [optional] | +| **Updated** | Pointer to **string** | | [optional] | +| **Metadata** | Pointer to **map[string]interface{}** | | [optional] | + +## Methods + +### NewRefund + +`func NewRefund() *Refund` + +NewRefund instantiates a new Refund object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRefundWithDefaults + +`func NewRefundWithDefaults() *Refund` + +NewRefundWithDefaults instantiates a new Refund object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Refund) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Refund) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Refund) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Refund) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPaymentRequestId + +`func (o *Refund) GetPaymentRequestId() string` + +GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. + +### GetPaymentRequestIdOk + +`func (o *Refund) GetPaymentRequestIdOk() (*string, bool)` + +GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentRequestId + +`func (o *Refund) SetPaymentRequestId(v string)` + +SetPaymentRequestId sets PaymentRequestId field to given value. + +### HasPaymentRequestId + +`func (o *Refund) HasPaymentRequestId() bool` + +HasPaymentRequestId returns a boolean if a field has been set. + +### GetAmount + +`func (o *Refund) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Refund) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Refund) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *Refund) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetChannelCode + +`func (o *Refund) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *Refund) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *Refund) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + +### HasChannelCode + +`func (o *Refund) HasChannelCode() bool` + +HasChannelCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *Refund) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *Refund) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *Refund) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *Refund) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCurrency + +`func (o *Refund) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Refund) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Refund) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *Refund) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetReferenceId + +`func (o *Refund) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *Refund) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *Refund) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *Refund) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### SetReferenceIdNil + +`func (o *Refund) SetReferenceIdNil(b bool)` + + SetReferenceIdNil sets the value for ReferenceId to be an explicit nil + +### UnsetReferenceId +`func (o *Refund) UnsetReferenceId()` + +UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +### GetFailureCode + +`func (o *Refund) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *Refund) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *Refund) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *Refund) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### SetFailureCodeNil + +`func (o *Refund) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *Refund) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetRefundFeeAmount + +`func (o *Refund) GetRefundFeeAmount() float64` + +GetRefundFeeAmount returns the RefundFeeAmount field if non-nil, zero value otherwise. + +### GetRefundFeeAmountOk + +`func (o *Refund) GetRefundFeeAmountOk() (*float64, bool)` + +GetRefundFeeAmountOk returns a tuple with the RefundFeeAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRefundFeeAmount + +`func (o *Refund) SetRefundFeeAmount(v float64)` + +SetRefundFeeAmount sets RefundFeeAmount field to given value. + +### HasRefundFeeAmount + +`func (o *Refund) HasRefundFeeAmount() bool` + +HasRefundFeeAmount returns a boolean if a field has been set. + +### SetRefundFeeAmountNil + +`func (o *Refund) SetRefundFeeAmountNil(b bool)` + + SetRefundFeeAmountNil sets the value for RefundFeeAmount to be an explicit nil + +### UnsetRefundFeeAmount +`func (o *Refund) UnsetRefundFeeAmount()` + +UnsetRefundFeeAmount ensures that no value is present for RefundFeeAmount, not even an explicit nil +### GetCreated + +`func (o *Refund) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *Refund) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *Refund) SetCreated(v string)` + +SetCreated sets Created field to given value. + +### HasCreated + +`func (o *Refund) HasCreated() bool` + +HasCreated returns a boolean if a field has been set. + +### GetUpdated + +`func (o *Refund) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *Refund) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *Refund) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + +### HasUpdated + +`func (o *Refund) HasUpdated() bool` + +HasUpdated returns a boolean if a field has been set. + +### GetMetadata + +`func (o *Refund) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *Refund) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *Refund) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *Refund) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *Refund) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *Refund) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/RefundList.md b/docs/refund/RefundList.md new file mode 100644 index 00000000..b4ab01ee --- /dev/null +++ b/docs/refund/RefundList.md @@ -0,0 +1,77 @@ +# RefundList + +## Properties + +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **Data** | [**Refund[]**](Refund.md) | | | +| **HasMore** | Pointer to **bool** | | [optional] | + +## Methods + +### NewRefundList + +`func NewRefundList(data []Refund, ) *RefundList` + +NewRefundList instantiates a new RefundList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRefundListWithDefaults + +`func NewRefundListWithDefaults() *RefundList` + +NewRefundListWithDefaults instantiates a new RefundList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *RefundList) GetData() []Refund` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *RefundList) GetDataOk() (*[]Refund, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *RefundList) SetData(v []Refund)` + +SetData sets Data field to given value. + + +### GetHasMore + +`func (o *RefundList) GetHasMore() bool` + +GetHasMore returns the HasMore field if non-nil, zero value otherwise. + +### GetHasMoreOk + +`func (o *RefundList) GetHasMoreOk() (*bool, bool)` + +GetHasMoreOk returns a tuple with the HasMore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHasMore + +`func (o *RefundList) SetHasMore(v bool)` + +SetHasMore sets HasMore field to given value. + +### HasHasMore + +`func (o *RefundList) HasHasMore() bool` + +HasHasMore returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/error.go b/error.go deleted file mode 100644 index a4396864..00000000 --- a/error.go +++ /dev/null @@ -1,57 +0,0 @@ -package xendit - -import ( - "encoding/json" - "net/http" -) - -// Contains constants for the ErrorCode in xendit.Error -const ( - // APIValidationErrCode error code for parameters validation - APIValidationErrCode string = "API_VALIDATION_ERROR" - // GoErrCode error code for errors happen inside Go code - GoErrCode string = "GO_ERROR" -) - -// Error is the conventional Xendit error -type Error struct { - Status int `json:"status,omitempty"` - ErrorCode string `json:"error_code,omitempty"` - Message string `json:"message,omitempty"` -} - -// Error returns error message. -// This enables xendit.Error to comply with Go error interface -func (e *Error) Error() string { - return e.Message -} - -// GetErrorCode returns error code coming from xendit backend -func (e *Error) GetErrorCode() string { - return e.ErrorCode -} - -// GetStatus returns http status code -func (e *Error) GetStatus() int { - return e.Status -} - -// FromGoErr generates xendit.Error from generic go errors -func FromGoErr(err error) *Error { - return &Error{ - Status: http.StatusTeapot, - ErrorCode: GoErrCode, - Message: err.Error(), - } -} - -// FromHTTPErr generates xendit.Error from http errors with non 2xx status -func FromHTTPErr(status int, respBody []byte) *Error { - var httpError *Error - if err := json.Unmarshal(respBody, &httpError); err != nil { - return FromGoErr(err) - } - httpError.Status = status - - return httpError -} diff --git a/ewallet.go b/ewallet.go deleted file mode 100644 index 5112bc72..00000000 --- a/ewallet.go +++ /dev/null @@ -1,121 +0,0 @@ -package xendit - -import "time" - -//IMPORTANT: EWALLET PAYMENT WILL BE DEPRECATED. PLEASE USE EWALLET CHARGE. - -// EWalletTypeEnum constants are the available e-wallet type for Ewallet Payment -type EWalletTypeEnum string - -// This consists the values that EWalletTypeEnum can take -const ( - EWalletTypeOVO EWalletTypeEnum = "OVO" - EWalletTypeDANA EWalletTypeEnum = "DANA" - EWalletTypeLINKAJA EWalletTypeEnum = "LINKAJA" - EWalletTypeSHOPEEPAY EWalletTypeEnum = "SHOPEEPAY" - EWalletTypeGCASH EWalletTypeEnum = "GCASH" - EWalletTypeGRABPAY EWalletTypeEnum = "GRABPAY" - EWalletTypePAYMAYA EWalletTypeEnum = "PAYMAYA" -) - -// EWallet contains data from Xendit's API response of e-wallet related requests. -// For more details see https://xendit.github.io/apireference/?bash#ewallets. -// For documentation of subpackage ewallet, checkout https://pkg.go.dev/github.com/xendit/xendit-go/ewallet -type EWallet struct { - EWalletType EWalletTypeEnum `json:"ewallet_type"` - ExternalID string `json:"external_id"` - Status string `json:"status"` - Amount float64 `json:"amount"` - TransactionDate *time.Time `json:"transaction_date,omitempty"` - CheckoutURL string `json:"checkout_url,omitempty"` - BusinessID string `json:"business_id,omitempty"` - Created *time.Time `json:"created,omitempty"` - EWalletTransactionID string `json:"e_wallet_transaction_id,omitempty"` -} - -type EWalletBasketItem struct { - ReferenceID string `json:"reference_id" validate:"required"` - Name string `json:"name" validate:"required"` - Category string `json:"category" validate:"required"` - Currency string `json:"currency" validate:"required"` - Price float64 `json:"price" validate:"required"` - Quantity int `json:"quantity" validate:"required"` - Type string `json:"type" validate:"required"` - Url string `json:"url,omitempty"` - Description string `json:"description,omitempty"` - SubCategory string `json:"sub_category,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// ChargeOutputStatus represents the enum for charge output status for an Ewallet Charge -type ChargeOutputStatus string - -// These are the available ChargeOutputStatus values for an Ewallet Charge -const ( - ChargeOutputStatusPending ChargeOutputStatus = "PENDING" - ChargeOutputStatusFailed ChargeOutputStatus = "FAILED" - ChargeOutputStatusSucceeded ChargeOutputStatus = "SUCCEEDED" - ChargeOutputStatusVoided ChargeOutputStatus = "VOIDED" - ChargeOutputStatusRefunded ChargeOutputStatus = "REFUNDED" -) - -// Actions represents the actions of an Ewallet Charge. -type Actions struct { - DesktopWebCheckoutURL *string `json:"desktop_web_checkout_url"` - MobileWebCheckoutURL *string `json:"mobile_web_checkout_url"` - MobileDeeplinkCheckoutURL *string `json:"mobile_deeplink_checkout_url"` - QrCheckoutString *string `json:"qr_checkout_string"` -} - -// ShippingInformation struct for Ewallet Charge ShippingInformation -type ShippingInformation struct { - Country string `json:"country"` //two letter country code eg. ID/PH - StreetLine1 string `json:"street_line1"` - StreetLine2 *string `json:"street_line2,omitempty"` - City string `json:"city"` - ProvinceState string `json:"province_state"` - PostalCode string `json:"postal_code"` -} - -// -type EwalletCustomer struct { - ReferenceId *string `json:"reference_id,omitempty"` - GivenNames *string `json:"given_names,omitempty"` - Surname *string `json:"surname,omitempty"` - Email *string `json:"email,omitempty"` - MobileNumber *string `json:"mobile_number,omitempty"` - DomicileOfRegistration *string `json:"domicile_of_registration,omitempty"` - DateOfRegistration *string `json:"date_of_registration,omitempty"` -} - -//EWalletCharge represents the response from Xendit Ewallet Charge API -type EWalletCharge struct { - ID string `json:"id"` - BusinessID string `json:"business_id"` - ReferenceID string `json:"reference_id"` - Status ChargeOutputStatus `json:"status"` - Currency string `json:"currency"` - ChargeAmount float64 `json:"charge_amount"` - CaptureAmount float64 `json:"capture_amount"` - PayerChargedCurrency string `json:"payer_charged_currency,omitempty"` - PayerChargedAmount float64 `json:"payer_charged_amount,omitempty"` - RefundedAmount float64 `json:"refunded_amount,omitempty"` - CheckoutMethod string `json:"checkout_method"` - ChannelCode string `json:"channel_code"` - ChannelProperties map[string]string `json:"channel_properties"` - Actions Actions `json:"actions"` - IsRedirectRequired bool `json:"is_redirect_required"` - CallbackURL string `json:"callback_url"` - Created string `json:"created"` - Updated string `json:"updated"` - VoidStatus string `json:"void_status,omitempty"` - VoidedAt string `json:"voided_at,omitempty"` - CaptureNow bool `json:"capture_now"` - CustomerID string `json:"customer_id,omitempty"` - Customer *EwalletCustomer `json:"customer,omitempty"` - PaymentMethodID string `json:"payment_method_id,omitempty"` - FailureCode string `json:"failure_code,omitempty"` - Basket []EWalletBasketItem `json:"basket,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - ShippingInformation *ShippingInformation `json:"shipping_information,omitempty"` -} diff --git a/ewallet/client.go b/ewallet/client.go deleted file mode 100644 index 8907c307..00000000 --- a/ewallet/client.go +++ /dev/null @@ -1,184 +0,0 @@ -package ewallet - -import ( - "context" - "fmt" - "net/http" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke e-wallet API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// getPaymentStatusResponse is e-wallet data that is contained in API response of Get Payment Status. -// It exists because the type of `Amount` in Get Payment Status json response is string, -// different from the CreatePayment -type getPaymentStatusResponse struct { - EWalletType xendit.EWalletTypeEnum `json:"ewallet_type"` - ExternalID string `json:"external_id"` - Amount float64 `json:"amount"` - TransactionDate *time.Time `json:"transaction_date,omitempty"` - CheckoutURL string `json:"checkout_url,omitempty"` - BusinessID string `json:"business_id,omitempty"` -} - -func (r *getPaymentStatusResponse) toEwalletResponse() *xendit.EWallet { - return &xendit.EWallet{ - EWalletType: r.EWalletType, - ExternalID: r.ExternalID, - Amount: r.Amount, - TransactionDate: r.TransactionDate, - CheckoutURL: r.CheckoutURL, - BusinessID: r.BusinessID, - } -} - -// CreatePayment creates new payment -func (c *Client) CreatePayment(data *CreatePaymentParams) (*xendit.EWallet, *xendit.Error) { - return c.CreatePaymentWithContext(context.Background(), data) -} - -// CreatePaymentWithContext creates new payment -func (c *Client) CreatePaymentWithContext(ctx context.Context, data *CreatePaymentParams) (*xendit.EWallet, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.EWallet{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - if data.XApiVersion != "" { - header.Add("X-API-VERSION", data.XApiVersion) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/ewallets", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetPaymentStatus gets one payment with its status -func (c *Client) GetPaymentStatus(data *GetPaymentStatusParams) (*xendit.EWallet, *xendit.Error) { - return c.GetPaymentStatusWithContext(context.Background(), data) -} - -// GetPaymentStatusWithContext gets one payment with its status -func (c *Client) GetPaymentStatusWithContext(ctx context.Context, data *GetPaymentStatusParams) (*xendit.EWallet, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - tempResponse := &getPaymentStatusResponse{} - var queryString string - - if data != nil { - queryString = data.QueryString() - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/ewallets?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - nil, - nil, - tempResponse, - ) - if err != nil { - return nil, err - } - - response := tempResponse.toEwalletResponse() - - return response, nil -} - -// CreateEWalletCharge creates new e-wallet charge -func (c *Client) CreateEWalletCharge(data *CreateEWalletChargeParams) (*xendit.EWalletCharge, *xendit.Error) { - return c.CreateEWalletChargeWithContext(context.Background(), data) -} - -// CreateEWalletChargeWithContext creates new e-wallet charge -func (c *Client) CreateEWalletChargeWithContext(ctx context.Context, data *CreateEWalletChargeParams) (*xendit.EWalletCharge, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.EWalletCharge{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - if data.WithFeeRule != "" { - header.Add("with-fee-rule", data.WithFeeRule) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/ewallets/charges", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetEWalletChargeStatus gets one e-wallet charge with its status -func (c *Client) GetEWalletChargeStatus(data *GetEWalletChargeStatusParams) (*xendit.EWalletCharge, *xendit.Error) { - return c.GetEWalletChargeStatusWithContext(context.Background(), data) -} - -// GetPaymentStatusWithContext gets one payment with its status -func (c *Client) GetEWalletChargeStatusWithContext(ctx context.Context, data *GetEWalletChargeStatusParams) (*xendit.EWalletCharge, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.EWalletCharge{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/ewallets/charges/%s", c.Opt.XenditURL, data.ChargeID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/ewallet/ewallet.go b/ewallet/ewallet.go deleted file mode 100644 index 3545fa3d..00000000 --- a/ewallet/ewallet.go +++ /dev/null @@ -1,74 +0,0 @@ -package ewallet - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreatePayment creates new payment -func CreatePayment(data *CreatePaymentParams) (*xendit.EWallet, *xendit.Error) { - return CreatePaymentWithContext(context.Background(), data) -} - -// CreatePaymentWithContext creates new payment -func CreatePaymentWithContext(ctx context.Context, data *CreatePaymentParams) (*xendit.EWallet, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreatePaymentWithContext(ctx, data) -} - -// GetPaymentStatus gets one payment with its status -func GetPaymentStatus(data *GetPaymentStatusParams) (*xendit.EWallet, *xendit.Error) { - return GetPaymentStatusWithContext(context.Background(), data) -} - -// GetPaymentStatusWithContext gets one payment with its status -func GetPaymentStatusWithContext(ctx context.Context, data *GetPaymentStatusParams) (*xendit.EWallet, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetPaymentStatusWithContext(ctx, data) -} - -// CreateEWalletCharge creates new e-wallet charge -func CreateEWalletCharge(data *CreateEWalletChargeParams) (*xendit.EWalletCharge, *xendit.Error) { - return CreateEWalletChargeWithContext(context.Background(), data) -} - -// CreateEWalletChargeWithContext creates new e-wallet charge -func CreateEWalletChargeWithContext(ctx context.Context, data *CreateEWalletChargeParams) (*xendit.EWalletCharge, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateEWalletChargeWithContext(ctx, data) -} - -// GetEWalletChargeStatus gets one e-wallet charge with its status -func GetEWalletChargeStatus(data *GetEWalletChargeStatusParams) (*xendit.EWalletCharge, *xendit.Error) { - return GetEWalletChargeStatusWithContext(context.Background(), data) -} - -// GetEWalletChargeStatusWithContext gets one e-wallet with its status -func GetEWalletChargeStatusWithContext(ctx context.Context, data *GetEWalletChargeStatusParams) (*xendit.EWalletCharge, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetEWalletChargeStatusWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/ewallet/ewallet_test.go b/ewallet/ewallet_test.go deleted file mode 100644 index 3eb96c44..00000000 --- a/ewallet/ewallet_test.go +++ /dev/null @@ -1,514 +0,0 @@ -package ewallet - -import ( - "context" - "errors" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.EWallet).EWalletType = xendit.EWalletTypeDANA - result.(*xendit.EWallet).ExternalID = "dana-ewallet" - result.(*xendit.EWallet).Amount = 200000 - result.(*xendit.EWallet).CheckoutURL = "mystore.com/callback" - - return nil -} - -func TestCreatePayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *CreatePaymentParams - expectedRes *xendit.EWallet - expectedErr *xendit.Error - }{ - { - desc: "should create a payment", - data: &CreatePaymentParams{ - ExternalID: "dana-ewallet", - Amount: 200000, - Phone: "08123123123", - EWalletType: xendit.EWalletTypeDANA, - CallbackURL: "mystore.com/callback", - RedirectURL: "mystore.com/redirect", - }, - expectedRes: &xendit.EWallet{ - EWalletType: xendit.EWalletTypeDANA, - ExternalID: "dana-ewallet", - Amount: 200000, - CheckoutURL: "mystore.com/callback", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &CreatePaymentParams{ - EWalletType: xendit.EWalletTypeDANA, - ExternalID: "dana-ewallet", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Amount'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/ewallets", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.EWallet{}, - ).Return(nil) - - resp, err := CreatePayment(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGet struct { - mock.Mock -} - -func (m *apiRequesterMockGet) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - result.(*getPaymentStatusResponse).EWalletType = xendit.EWalletTypeDANA - result.(*getPaymentStatusResponse).ExternalID = "dana-ewallet" - result.(*getPaymentStatusResponse).Amount = 200000 - result.(*getPaymentStatusResponse).CheckoutURL = "mystore.com/callback" - - return nil -} - -func TestGetPaymentStatus(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGet) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *GetPaymentStatusParams - expectedRes *xendit.EWallet - expectedErr *xendit.Error - }{ - { - desc: "should get a payment status", - data: &GetPaymentStatusParams{ - ExternalID: "dana-ewallet", - EWalletType: xendit.EWalletTypeDANA, - }, - expectedRes: &xendit.EWallet{ - EWalletType: xendit.EWalletTypeDANA, - ExternalID: "dana-ewallet", - Amount: 200000, - CheckoutURL: "mystore.com/callback", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetPaymentStatusParams{ - EWalletType: xendit.EWalletTypeDANA, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ExternalID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/ewallets?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &getPaymentStatusResponse{}, - ).Return(nil) - - resp, err := GetPaymentStatus(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockPostCharge struct { - mock.Mock -} - -func (m *apiRequesterMockPostCharge) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.EWalletCharge).ID = "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c" - result.(*xendit.EWalletCharge).BusinessID = "business-id-example" - result.(*xendit.EWalletCharge).ReferenceID = "test-reference-id" - result.(*xendit.EWalletCharge).Status = "SUCCEEDED" - result.(*xendit.EWalletCharge).Currency = "IDR" - result.(*xendit.EWalletCharge).ChargeAmount = 10000 - result.(*xendit.EWalletCharge).CaptureAmount = 10000 - result.(*xendit.EWalletCharge).PayerChargedCurrency = "IDR" - result.(*xendit.EWalletCharge).PayerChargedAmount = 10000 - result.(*xendit.EWalletCharge).RefundedAmount = 0 - result.(*xendit.EWalletCharge).CheckoutMethod = "TOKENIZED_PAYMENT" - result.(*xendit.EWalletCharge).ChannelCode = "ID_OVO" - result.(*xendit.EWalletCharge).ChannelProperties = map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - "cancel_redirect_url": "https://yourwebsite.com/cancel", - } - result.(*xendit.EWalletCharge).Actions = xendit.Actions{ - DesktopWebCheckoutURL: func(i string) *string { return &i }("https://desktop.web.checkout.url"), - MobileWebCheckoutURL: func(i string) *string { return &i }("https://mobile.web.checkout.url"), - MobileDeeplinkCheckoutURL: func(i string) *string { return &i }("https://mobile.deeplink.checkout.url"), - QrCheckoutString: func(i string) *string { return &i }("test-qr-string"), - } - result.(*xendit.EWalletCharge).IsRedirectRequired = true - result.(*xendit.EWalletCharge).CallbackURL = "https://yourwebsite.com/order/123" - result.(*xendit.EWalletCharge).Created = "2021-02-09T06:22:35.064408Z" - result.(*xendit.EWalletCharge).Updated = "2021-02-09T06:22:35.064408Z" - result.(*xendit.EWalletCharge).VoidStatus = "" - result.(*xendit.EWalletCharge).VoidedAt = "" - result.(*xendit.EWalletCharge).CaptureNow = true - result.(*xendit.EWalletCharge).CustomerID = "f3925450-5c54-4777-98c1-fcf22b0d1e1c" - result.(*xendit.EWalletCharge).Customer = &xendit.EwalletCustomer{ - ReferenceId: func(i string) *string { return &i }("sample_customer_reference_id"), - GivenNames: func(i string) *string { return &i }("sample_given_name"), - Surname: func(i string) *string { return &i }("sample_surname"), - Email: func(i string) *string { return &i }("sample_email"), - MobileNumber: func(i string) *string { return &i }("+6312345678"), - DomicileOfRegistration: func(i string) *string { return &i }("ID"), - DateOfRegistration: func(i string) *string { return &i }("2022-01-01"), - } - result.(*xendit.EWalletCharge).PaymentMethodID = "pm-f3925450-5c54-4777-98c1-fcf22b0d1e1c" - result.(*xendit.EWalletCharge).FailureCode = "" - result.(*xendit.EWalletCharge).Basket = []xendit.EWalletBasketItem{ - { - ReferenceID: "sample_basket_ref_id", - Name: "sample_basket_name", - Category: "sample_category", - Currency: "IDR", - Price: 10000, - Quantity: 1, - Type: "sample_type", - Url: "sample_url", - Description: "sample_desc", - SubCategory: "sample_subcat", - Metadata: map[string]interface{}{}, - }, - } - result.(*xendit.EWalletCharge).Metadata = map[string]interface{}{} - result.(*xendit.EWalletCharge).ShippingInformation = &xendit.ShippingInformation{ - Country: "ID", - StreetLine1: "sample_street_line", - StreetLine2: func(i string) *string { return &i }("sample_street_line_2"), - City: "sample_city", - ProvinceState: "sample_province", - PostalCode: "sample_postal_code", - } - return nil -} - -func TestCreateEWalletCharge(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockPostCharge) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *CreateEWalletChargeParams - expectedRes *xendit.EWalletCharge - expectedErr *xendit.Error - }{ - { - desc: "should create an e-wallet charge with additional parameters", - data: &CreateEWalletChargeParams{ - ReferenceID: "test-reference-id", - Currency: "IDR", - Amount: 10000, - CheckoutMethod: "TOKENIZED_PAYMENT", - ChannelCode: "ID_OVO", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - "cancel_redirect_url": "https://yourwebsite.com/cancel", - }, - CaptureNow: true, - CustomerID: "f3925450-5c54-4777-98c1-fcf22b0d1e1c", - PaymentMethodID: "pm-f3925450-5c54-4777-98c1-fcf22b0d1e1c", - Customer: &xendit.EwalletCustomer{ - ReferenceId: func(i string) *string { return &i }("sample_customer_reference_id"), - GivenNames: func(i string) *string { return &i }("sample_given_name"), - Surname: func(i string) *string { return &i }("sample_surname"), - Email: func(i string) *string { return &i }("sample_email"), - MobileNumber: func(i string) *string { return &i }("+6312345678"), - DomicileOfRegistration: func(i string) *string { return &i }("ID"), - DateOfRegistration: func(i string) *string { return &i }("2022-01-01"), - }, - ShippingInformation: &xendit.ShippingInformation{ - Country: "ID", - StreetLine1: "sample_street_line", - StreetLine2: func(i string) *string { return &i }("sample_street_line_2"), - City: "sample_city", - ProvinceState: "sample_province", - PostalCode: "sample_postal_code", - }, - Basket: []xendit.EWalletBasketItem{ - { - ReferenceID: "sample_basket_ref_id", - Name: "sample_basket_name", - Category: "sample_category", - Currency: "IDR", - Price: 10000, - Quantity: 1, - Type: "sample_type", - Url: "sample_url", - Description: "sample_desc", - SubCategory: "sample_subcat", - Metadata: map[string]interface{}{}, - }, - }, - Metadata: map[string]interface{}{}, - }, - expectedRes: &xendit.EWalletCharge{ - ID: "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - BusinessID: "business-id-example", - ReferenceID: "test-reference-id", - Status: "SUCCEEDED", - Currency: "IDR", - ChargeAmount: 10000, - CaptureAmount: 10000, - PayerChargedCurrency: "IDR", - PayerChargedAmount: 10000, - RefundedAmount: 0, - CheckoutMethod: "TOKENIZED_PAYMENT", - ChannelCode: "ID_OVO", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - "cancel_redirect_url": "https://yourwebsite.com/cancel", - }, - Actions: xendit.Actions{DesktopWebCheckoutURL: func(i string) *string { - return &i - }("https://desktop.web.checkout.url"), MobileWebCheckoutURL: func(i string) *string { - return &i - }("https://mobile.web.checkout.url"), MobileDeeplinkCheckoutURL: func(i string) *string { - return &i - }("https://mobile.deeplink.checkout.url"), QrCheckoutString: func(i string) *string { - return &i - }("test-qr-string")}, - IsRedirectRequired: true, - CallbackURL: "https://yourwebsite.com/order/123", - Created: "2021-02-09T06:22:35.064408Z", - Updated: "2021-02-09T06:22:35.064408Z", - VoidStatus: "", - VoidedAt: "", - CaptureNow: true, - CustomerID: "f3925450-5c54-4777-98c1-fcf22b0d1e1c", - Customer: &xendit.EwalletCustomer{ - ReferenceId: func(i string) *string { return &i }("sample_customer_reference_id"), - GivenNames: func(i string) *string { return &i }("sample_given_name"), - Surname: func(i string) *string { return &i }("sample_surname"), - Email: func(i string) *string { return &i }("sample_email"), - MobileNumber: func(i string) *string { return &i }("+6312345678"), - DomicileOfRegistration: func(i string) *string { return &i }("ID"), - DateOfRegistration: func(i string) *string { return &i }("2022-01-01"), - }, - PaymentMethodID: "pm-f3925450-5c54-4777-98c1-fcf22b0d1e1c", - FailureCode: "", - Basket: []xendit.EWalletBasketItem{ - { - ReferenceID: "sample_basket_ref_id", - Name: "sample_basket_name", - Category: "sample_category", - Currency: "IDR", - Price: 10000, - Quantity: 1, - Type: "sample_type", - Url: "sample_url", - Description: "sample_desc", - SubCategory: "sample_subcat", - Metadata: map[string]interface{}{}, - }, - }, - Metadata: map[string]interface{}{}, - ShippingInformation: &xendit.ShippingInformation{ - Country: "ID", - StreetLine1: "sample_street_line", - StreetLine2: func(i string) *string { return &i }("sample_street_line_2"), - City: "sample_city", - ProvinceState: "sample_province", - PostalCode: "sample_postal_code", - }, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &CreateEWalletChargeParams{ - Currency: "IDR", - Amount: 10000, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/ewallets/charges", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.EWalletCharge{}, - ).Return(nil) - - resp, err := CreateEWalletCharge(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterMockGetCharge struct { - mock.Mock -} - -func (m *apiRequesterMockGetCharge) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - result.(*xendit.EWalletCharge).ID = "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c" - result.(*xendit.EWalletCharge).BusinessID = "business-id-example" - result.(*xendit.EWalletCharge).ReferenceID = "test-reference-id" - result.(*xendit.EWalletCharge).Currency = "IDR" - result.(*xendit.EWalletCharge).ChargeAmount = 10000 - result.(*xendit.EWalletCharge).CaptureAmount = 10000 - result.(*xendit.EWalletCharge).CheckoutMethod = "ONE_TIME_PAYMENT" - result.(*xendit.EWalletCharge).ChannelCode = "ID_SHOPEEPAY" - result.(*xendit.EWalletCharge).ChannelProperties = map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - } - - result.(*xendit.EWalletCharge).Actions = xendit.Actions{ - DesktopWebCheckoutURL: func(i string) *string { return &i }("https://desktop.web.checkout.url"), - MobileWebCheckoutURL: func(i string) *string { return &i }("https://mobile.web.checkout.url"), - MobileDeeplinkCheckoutURL: func(i string) *string { return &i }("https://mobile.deeplink.checkout.url"), - QrCheckoutString: func(i string) *string { return &i }("test-qr-string"), - } - - result.(*xendit.EWalletCharge).IsRedirectRequired = true - result.(*xendit.EWalletCharge).CallbackURL = "https://yourwebsite.com/order/123" - result.(*xendit.EWalletCharge).Created = "2021-02-09T06:22:35.064408Z" - result.(*xendit.EWalletCharge).Updated = "2021-02-09T06:22:35.064408Z" - result.(*xendit.EWalletCharge).CaptureNow = true - - return nil -} - -func TestGetEWalletChargeStatus(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMockGetCharge) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *GetEWalletChargeStatusParams - expectedRes *xendit.EWalletCharge - expectedErr *xendit.Error - }{ - { - desc: "should get an e-wallet charge status", - data: &GetEWalletChargeStatusParams{ - ChargeID: "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - }, - expectedRes: &xendit.EWalletCharge{ - ID: "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - BusinessID: "business-id-example", - ReferenceID: "test-reference-id", - Currency: "IDR", - ChargeAmount: 10000, - CaptureAmount: 10000, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - Actions: xendit.Actions{ - DesktopWebCheckoutURL: func(i string) *string { return &i }("https://desktop.web.checkout.url"), - MobileWebCheckoutURL: func(i string) *string { return &i }("https://mobile.web.checkout.url"), - MobileDeeplinkCheckoutURL: func(i string) *string { return &i }("https://mobile.deeplink.checkout.url"), - QrCheckoutString: func(i string) *string { return &i }("test-qr-string"), - }, - IsRedirectRequired: true, - CallbackURL: "https://yourwebsite.com/order/123", - Created: "2021-02-09T06:22:35.064408Z", - Updated: "2021-02-09T06:22:35.064408Z", - CaptureNow: true, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &GetEWalletChargeStatusParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ChargeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/ewallets/charges/"+tC.data.ChargeID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.EWalletCharge{}, - ).Return(nil) - - resp, err := GetEWalletChargeStatus(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/ewallet/example_test.go b/ewallet/example_test.go deleted file mode 100644 index a6102bbd..00000000 --- a/ewallet/example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package ewallet_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/ewallet" -) - -func ExampleCreatePayment() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := ewallet.CreatePaymentParams{ - ExternalID: "dana-ewallet", - Amount: 20000, - Phone: "08123123123", - EWalletType: xendit.EWalletTypeDANA, - CallbackURL: "mystore.com/callback", - RedirectURL: "mystore.com/redirect", - } - - resp, err := ewallet.CreatePayment(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleGetPaymentStatus() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := ewallet.GetPaymentStatusParams{ - ExternalID: "data-ewallet", - EWalletType: xendit.EWalletTypeDANA, - } - - resp, err := ewallet.GetPaymentStatus(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved payment: %+v\n", resp) -} - -func ExampleCreateEWalletCharge() { - xendit.Opt.SecretKey = "examplesecretkey" - - ewalletBasketItem := xendit.EWalletBasketItem{ - ReferenceID: "basket-product-ref-id", - Name: "product name", - Category: "mechanics", - Currency: "IDR", - Price: 50000, - Quantity: 5, - Type: "type", - SubCategory: "subcategory", - Metadata: map[string]interface{}{ - "meta": "data", - }, - } - - data := ewallet.CreateEWalletChargeParams{ - ReferenceID: "test-reference-id", - Currency: "IDR", - Amount: 1688, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - Basket: []xendit.EWalletBasketItem{ - ewalletBasketItem, - }, - Metadata: map[string]interface{}{ - "meta": "data", - }, - } - - charge, chargeErr := ewallet.CreateEWalletCharge(&data) - if chargeErr != nil { - log.Fatal(chargeErr) - } - fmt.Printf("created e-wallet charge: %+v\n", charge) -} - -func ExampleGetEWalletChargeStatus() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := ewallet.GetEWalletChargeStatusParams{ - ChargeID: "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - } - - charge, chargeErr := ewallet.GetEWalletChargeStatus(&data) - if chargeErr != nil { - log.Fatal(chargeErr) - } - fmt.Printf("retrieved e-wallet charge: %+v\n", charge) -} diff --git a/ewallet/params.go b/ewallet/params.go deleted file mode 100644 index d6d3ede4..00000000 --- a/ewallet/params.go +++ /dev/null @@ -1,71 +0,0 @@ -package ewallet - -import ( - "net/url" - "time" - - "github.com/xendit/xendit-go" -) - -// Item is data that contained in CreatePaymentParams at Items -type Item struct { - ID string `json:"id"` - Name string `json:"name"` - Price float64 `json:"price"` - Quantity int `json:"quantity"` -} - -// CreatePaymentParams contains parameters for CreatePayment -type CreatePaymentParams struct { - XApiVersion string `json:"-"` - ForUserID string `json:"-"` - EWalletType xendit.EWalletTypeEnum `json:"ewallet_type" validate:"required"` - ExternalID string `json:"external_id" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - Phone string `json:"phone,omitempty"` - ExpirationDate *time.Time `json:"expiration_date,omitempty"` - CallbackURL string `json:"callback_url,omitempty"` - RedirectURL string `json:"redirect_url,omitempty"` - Items []Item `json:"items,omitempty"` -} - -// GetPaymentStatusParams contains parameters for GetPaymentStatus -type GetPaymentStatusParams struct { - ExternalID string `json:"external_id" validate:"required"` - EWalletType xendit.EWalletTypeEnum `json:"ewallet_type" validate:"required"` -} - -// QueryString creates query string from GetPaymentStatusParams, ignores nil values -func (p *GetPaymentStatusParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("external_id", p.ExternalID) - urlValues.Add("ewallet_type", string(p.EWalletType)) - - return urlValues.Encode() -} - -// CreateEWalletChargeParams contains parameters for CreateEWalletCharge -type CreateEWalletChargeParams struct { - ForUserID string `json:"-"` - WithFeeRule string `json:"-"` - ReferenceID string `json:"reference_id" validate:"required"` - Currency string `json:"currency" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - CheckoutMethod string `json:"checkout_method" validate:"required"` - ChannelCode string `json:"channel_code,omitempty"` - ChannelProperties map[string]string `json:"channel_properties,omitempty"` - CaptureNow bool `json:"capture_now,omitempty"` - CustomerID string `json:"customer_id,omitempty"` - PaymentMethodID string `json:"payment_method_id,omitempty"` - Customer *xendit.EwalletCustomer `json:"customer,omitempty"` - ShippingInformation *xendit.ShippingInformation `json:"shipping_information,omitempty"` - Basket []xendit.EWalletBasketItem `json:"basket,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` -} - -// GetEWalletChargeStatusParams contains parameters for GetEWalletChargeStatus -type GetEWalletChargeStatusParams struct { - ForUserID string `json:"-"` - ChargeID string `json:"charge_id" validate:"required"` -} diff --git a/example/balance/main.go b/example/balance/main.go deleted file mode 100644 index ed073762..00000000 --- a/example/balance/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/balance" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - getData := balance.GetParams{ - AccountType: "CASH", - } - - resp, err := balance.Get(&getData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("balance: %+v\n", resp) -} diff --git a/example/card/main.go b/example/card/main.go deleted file mode 100644 index cfe87a5d..00000000 --- a/example/card/main.go +++ /dev/null @@ -1,87 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/card" -) - -// To run this example, create the token first in https://js.xendit.co/test_tokenize.html -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - // your token id - tokenID := "5e0461a86113354249aab7ec" - //your auth id - authID := "5e0461a96113354249aab7ee" - - fmt.Println("created charge") - createChargeData := card.CreateChargeParams{ - TokenID: tokenID, - AuthenticationID: authID, - Amount: 10000, - ExternalID: "cardAuth-" + time.Now().String(), - Capture: new(bool), // false - } - - chargeResp, err := card.CreateCharge(&createChargeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created charge: %+v\n", chargeResp) - - getChargeData := card.GetChargeParams{ - ChargeID: chargeResp.ID, - } - - chargeResp, err = card.GetCharge(&getChargeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved charge: %+v\n", chargeResp) - - captureChargeData := card.CaptureChargeParams{ - ChargeID: chargeResp.ID, - Amount: 500000, - } - - chargeResp, err = card.CaptureCharge(&captureChargeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("captured charge: %+v\n", chargeResp) - - createRefundData := card.CreateRefundParams{ - IdempotencyKey: "idempotency-" + time.Now().String(), - ChargeID: "5e2e8354d97c174c58bcf664", - Amount: 10000, - ExternalID: "refund-" + time.Now().String(), - } - - refundResp, err := card.CreateRefund(&createRefundData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("refunded charge: %+v\n", refundResp) - - // To run this part (ReverseAuthorization), the charge must not be captured first. - reverseAuthorizationData := card.ReverseAuthorizationParams{ - ChargeID: chargeResp.ID, - ExternalID: "reverseAuth-" + time.Now().String(), - } - - reverseAuthorizationResp, err := card.ReverseAuthorization(&reverseAuthorizationData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("reversed authorization: %+v\n", reverseAuthorizationResp) -} diff --git a/example/cardlesscredit/main.go b/example/cardlesscredit/main.go deleted file mode 100644 index cdfc1b4a..00000000 --- a/example/cardlesscredit/main.go +++ /dev/null @@ -1,60 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/cardlesscredit" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createPaymentData := cardlesscredit.CreatePaymentParams{ - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - ExternalID: "cardless-credit-" + time.Now().String(), - Amount: 200000, - PaymentType: xendit.PaymentTypeEnum3Months, - Items: []cardlesscredit.Item{ - { - ID: "123", - Name: "Laptop Asus Ila", - Price: 200000, - Type: "Laptop", - URL: "http://asus-ila.com", - Quantity: 1, - }, - }, - CustomerDetails: cardlesscredit.CustomerDetails{ - FirstName: "Michael", - LastName: "Belajarrock", - Email: "michaelbelajarrock@mail.com", - Phone: "08123123123", - }, - ShippingAddress: cardlesscredit.ShippingAddress{ - FirstName: "Michael", - LastName: "Belajarjazz", - Address: "Jalan Teknologi No. 12", - City: "Jakarta", - PostalCode: "40000", - Phone: "08123123123", - CountryCode: "IDN", - }, - RedirectURL: "https://google.com", - CallbackURL: "https://google.com", - } - - resp, err := cardlesscredit.CreatePayment(&createPaymentData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created payment: %+v\n", resp) -} diff --git a/example/customer/main.go b/example/customer/main.go deleted file mode 100644 index eb0998b2..00000000 --- a/example/customer/main.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/customer" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - createCustomerData := customer.CreateCustomerParams{ - ReferenceID: "test-reference-id-003", - Email: "tes@tes.com", - GivenNames: "Given Names", - Nationality: "ID", - DateOfBirth: "1995-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - } - - resp, err := customer.CreateCustomer(&createCustomerData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created customer: %+v\n", resp) - - getCustomerByReferenceIDData := customer.GetCustomerByReferenceIDParams{ - ReferenceID: resp.ReferenceID, - } - - resps, errs := customer.GetCustomerByReferenceID(&getCustomerByReferenceIDData) - if errs != nil { - log.Fatal(errs) - } - fmt.Printf("retrieved customer: %+v\n", resps) -} diff --git a/example/directdebit/main.go b/example/directdebit/main.go deleted file mode 100644 index 2368e107..00000000 --- a/example/directdebit/main.go +++ /dev/null @@ -1,178 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/directdebit/directdebitpayment" - "github.com/xendit/xendit-go/directdebit/linkedaccount" - "github.com/xendit/xendit-go/directdebit/paymentmethod" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - properties := map[string]interface{}{ - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - customerID := "74965fb0-0446-47a9-a7d7-0db06b70af98" - - initializeTokenizationData := linkedaccount.InitializeLinkedAccountTokenizationParams{ - CustomerID: customerID, - ChannelCode: xendit.DC_BRI, - Properties: properties, - Metadata: metadata, - } - - initializedLinkedAccount, err := linkedaccount.InitializeLinkedAccountTokenization(&initializeTokenizationData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("initialized linked account tokenization: %+v\n\n", initializedLinkedAccount) - - validateOTPForLinkedAccountData := linkedaccount.ValidateOTPForLinkedAccountParams{ - LinkedAccountTokenID: initializedLinkedAccount.ID, - OTPCode: "333000", - } - - validatedLinkedAccount, err := linkedaccount.ValidateOTPForLinkedAccount(&validateOTPForLinkedAccountData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("validated linked account: %+v\n\n", validatedLinkedAccount) - - retrieveAccessibleLinkedAccountsData := linkedaccount.RetrieveAccessibleLinkedAccountParams{ - LinkedAccountTokenID: initializedLinkedAccount.ID, - } - - accessibleLinkedAccounts, err := linkedaccount.RetrieveAccessibleLinkedAccounts(&retrieveAccessibleLinkedAccountsData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved accessible linked accounts: %+v\n\n", accessibleLinkedAccounts) - - unbindLinkedAccountTokenData := linkedaccount.UnbindLinkedAccountTokenParams{ - LinkedAccountTokenID: initializedLinkedAccount.ID, - } - - unbindedLinkedAccount, err := linkedaccount.UnbindLinkedAccountToken(&unbindLinkedAccountTokenData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("unbinded linked account: %+v\n\n", unbindedLinkedAccount) - - properties = map[string]interface{}{ - "id": accessibleLinkedAccounts[0].ID, - } - - createPaymentMethodData := paymentmethod.CreatePaymentMethodParams{ - CustomerID: customerID, - Type: xendit.DEBIT_CARD, - Properties: properties, - Metadata: metadata, - } - - paymentMethod, err := paymentmethod.CreatePaymentMethod(&createPaymentMethodData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created payment method: %+v\n\n", paymentMethod) - - getPaymentMethodsByCustomerIDData := paymentmethod.GetPaymentMethodsByCustomerIDParams{ - CustomerID: customerID, - } - - paymentMethods, err := paymentmethod.GetPaymentMethodsByCustomerID(&getPaymentMethodsByCustomerIDData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved payment methods: %+v\n\n", paymentMethods) - - createDirectDebitPaymentData := directdebitpayment.CreateDirectDebitPaymentParams{ - ReferenceID: "test-direct-debit-ref-0100", - PaymentMethodID: paymentMethod.ID, - Currency: "IDR", - Amount: 15000, - CallbackURL: "http://webhook.site/", - EnableOTP: true, - Description: "test description", - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - SuccessRedirectURL: "https://success-redirect.url", - FailureRedirectURL: "https://failure-redirect.url", - Metadata: metadata, - IdempotencyKey: time.Now().String(), - } - - directDebitPayment, err := directdebitpayment.CreateDirectDebitPayment(&createDirectDebitPaymentData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created direct debit payment: %+v\n\n", directDebitPayment) - - validateOTPForDirectDebitPaymentData := directdebitpayment.ValidateOTPForDirectDebitPaymentParams{ - DirectDebitID: directDebitPayment.ID, - OTPCode: "222000", - } - - directDebitPayment, err = directdebitpayment.ValidateOTPForDirectDebitPayment(&validateOTPForDirectDebitPaymentData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("validated direct debit payment: %+v\n\n", directDebitPayment) - - getDirectDebitPaymentStatusByIDData := directdebitpayment.GetDirectDebitPaymentStatusByIDParams{ - ID: directDebitPayment.ID, - } - - directDebitPayment, err = directdebitpayment.GetDirectDebitPaymentStatusByID(&getDirectDebitPaymentStatusByIDData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved direct debit payment: %+v\n\n", directDebitPayment) - - getDirectDebitPaymentStatusByReferenceIDData := directdebitpayment.GetDirectDebitPaymentStatusByReferenceIDParams{ - ReferenceID: directDebitPayment.ReferenceID, - } - - directDebitPayments, err := directdebitpayment.GetDirectDebitPaymentStatusByReferenceID(&getDirectDebitPaymentStatusByReferenceIDData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved direct debit payments: %+v\n\n", directDebitPayments) -} diff --git a/example/disbursement/main.go b/example/disbursement/main.go deleted file mode 100644 index b35752f4..00000000 --- a/example/disbursement/main.go +++ /dev/null @@ -1,88 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/disbursement" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - availableBanks, err := disbursement.GetAvailableBanks() - if err != nil { - log.Fatal(err) - } - fmt.Printf("available disbursement banks: %+v\n", availableBanks) - - createData := disbursement.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ExternalID: "disbursement-external", - BankCode: availableBanks[0].Code, - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "Disbursement from Go", - Amount: 200000, - } - - resp, err := disbursement.Create(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created disbursement: %+v\n", resp) - - getByIDData := disbursement.GetByIDParams{ - DisbursementID: resp.ID, - } - - resp, err = disbursement.GetByID(&getByIDData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved disbursement: %+v\n", resp) - - getByExternalIDData := disbursement.GetByExternalIDParams{ - ExternalID: resp.ExternalID, - } - - resps, err := disbursement.GetByExternalID(&getByExternalIDData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved disbursements: %+v\n", resps) - - createBatchData := disbursement.CreateBatchParams{ - Reference: "batch_disbursement" + time.Now().String(), - Disbursements: []disbursement.DisbursementItem{ - { - Amount: 200000, - BankCode: availableBanks[0].Code, - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go", - }, - { - Amount: 100000, - BankCode: availableBanks[1].Code, - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go 2", - }, - }, - } - - batchDisbursementResp, err := disbursement.CreateBatch(&createBatchData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created batch disbursement: %+v\n", batchDisbursementResp) -} diff --git a/example/ewallet/main.go b/example/ewallet/main.go deleted file mode 100644 index 131f45d3..00000000 --- a/example/ewallet/main.go +++ /dev/null @@ -1,91 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/ewallet" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createPaymentData := ewallet.CreatePaymentParams{ - ExternalID: "ovo-" + time.Now().String(), - Amount: 10000, - Phone: "081234567890", - EWalletType: xendit.EWalletTypeOVO, - } - - resp, err := ewallet.CreatePayment(&createPaymentData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created payment: %+v\n", resp) - - getPaymentStatusData := ewallet.GetPaymentStatusParams{ - ExternalID: resp.ExternalID, - EWalletType: resp.EWalletType, - } - - resp, err = ewallet.GetPaymentStatus(&getPaymentStatusData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved payment: %+v\n", resp) - - metadata := map[string]interface{}{ - "meta": "data", - } - - ewalletBasketItem := xendit.EWalletBasketItem{ - ReferenceID: "basket-product-ref-id", - Name: "product name", - Category: "mechanics", - Currency: "IDR", - Price: 50000, - Quantity: 5, - Type: "type", - SubCategory: "subcategory", - Metadata: metadata, - } - - createEWalletChargeData := ewallet.CreateEWalletChargeParams{ - ReferenceID: "test-reference-id", - Currency: "IDR", - Amount: 1688, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - Basket: []xendit.EWalletBasketItem{ - ewalletBasketItem, - }, - Metadata: metadata, - } - - charge, chargeErr := ewallet.CreateEWalletCharge(&createEWalletChargeData) - if chargeErr != nil { - log.Fatal(chargeErr) - } - fmt.Printf("created e-wallet charge: %+v\n", charge) - - getEWalletChargeStatusData := ewallet.GetEWalletChargeStatusParams{ - ChargeID: charge.ID, - } - - charge, chargeErr = ewallet.GetEWalletChargeStatus(&getEWalletChargeStatusData) - if chargeErr != nil { - log.Fatal(chargeErr) - } - fmt.Printf("retrieved e-wallet charge: %+v\n", charge) -} diff --git a/example/invoice/main.go b/example/invoice/main.go deleted file mode 100644 index 6e239ddd..00000000 --- a/example/invoice/main.go +++ /dev/null @@ -1,56 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/invoice" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - data := invoice.CreateParams{ - ExternalID: "invoice-" + time.Now().String(), - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice #1", - } - - resp, err := invoice.Create(&data) - if err != nil { - log.Fatal(err) - - } - fmt.Printf("created invoice: %+v\n", resp) - - resp, err = invoice.Get(&invoice.GetParams{ - ID: resp.ID, - }) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved invoice: %+v\n", resp) - - resp, err = invoice.Expire(&invoice.ExpireParams{ - ID: resp.ID, - }) - if err != nil { - log.Fatal(err) - } - fmt.Printf("expired invoice: %+v\n", resp) - - resps, err := invoice.GetAll(nil) - if err != nil { - log.Fatal(err) - } - fmt.Printf("first 10 invoices %+v\n", resps) -} diff --git a/example/payout/main.go b/example/payout/main.go deleted file mode 100644 index 4d1c88b9..00000000 --- a/example/payout/main.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go/payout" - - "github.com/xendit/xendit-go" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createData := payout.CreateParams{ - ExternalID: "payout-" + time.Now().String(), - Amount: 200000, - Email: "customer@customer.com", - } - - resp, err := payout.Create(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created payout: %+v\n", resp) - - resp, err = payout.Get(&payout.GetParams{ - ID: resp.ID, - }) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved payout: %+v\n", resp) - - resp, err = payout.Void(&payout.VoidParams{ - ID: resp.ID, - }) - if err != nil { - log.Fatal(err) - } - fmt.Printf("voided payout: %+v\n", resp) -} diff --git a/example/qrcode/main.go b/example/qrcode/main.go deleted file mode 100644 index 7ae312c5..00000000 --- a/example/qrcode/main.go +++ /dev/null @@ -1,44 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/qrcode" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createData := qrcode.CreateQRCodeParams{ - ExternalID: time.Now().String(), - Type: xendit.DynamicQRCode, - CallbackURL: "https://httpstat.us/200", - Amount: 10000, - } - - resp, err := qrcode.CreateQRCode(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created QR code: %+v\n", resp) - - resp, err = qrcode.GetQRCode(&qrcode.GetQRCodeParams{ - ExternalID: resp.ExternalID, - }) - - fmt.Printf("retrieved QR code: %+v\n", resp) - - if err != nil { - log.Panic(err) - } - -} diff --git a/example/recurringpayment/main.go b/example/recurringpayment/main.go deleted file mode 100644 index c12c44d7..00000000 --- a/example/recurringpayment/main.go +++ /dev/null @@ -1,86 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/recurringpayment" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createData := recurringpayment.CreateParams{ - ExternalID: "recurringpayment-" + time.Now().String(), - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurringpayment #1", - Interval: xendit.RecurringPaymentIntervalDay, - IntervalCount: 3, - } - - resp, err := recurringpayment.Create(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created recurring payment: %+v\n", resp) - - getData := recurringpayment.GetParams{ - ID: resp.ID, - } - - resp, err = recurringpayment.Get(&getData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved recurring payment: %+v\n", resp) - - editData := recurringpayment.EditParams{ - ID: resp.ID, - Amount: 500000, - } - - resp, err = recurringpayment.Edit(&editData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("edited recurring payment: %+v\n", resp) - - pauseData := recurringpayment.PauseParams{ - ID: resp.ID, - } - - resp, err = recurringpayment.Pause(&pauseData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("paused recurring payment: %+v\n", resp) - - resumeData := recurringpayment.ResumeParams{ - ID: resp.ID, - } - - resp, err = recurringpayment.Resume(&resumeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("resumed recurring payment: %+v\n", resp) - - stopData := recurringpayment.StopParams{ - ID: resp.ID, - } - - resp, err = recurringpayment.Stop(&stopData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("stopped recurring payment: %+v\n", resp) -} diff --git a/example/report/main.go b/example/report/main.go deleted file mode 100644 index f4230ab0..00000000 --- a/example/report/main.go +++ /dev/null @@ -1,44 +0,0 @@ -package main - -import ( - "fmt" - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/report" - "log" - "os" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - generateReportData := report.GenerateReportParams{ - Type: "BALANCE_HISTORY", // "BALANCE_HISTORY", "TRANSACTIONS", "UPCOMING_TRANSACTIONS" - Filter: report.Filter{ - From: "2020-01-01T00:00:00.000Z", - To: "2020-12-31T23:59:59.999Z", - }, - } - - resp, err := report.GenerateReport(&generateReportData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("generated report: %+v\n", resp) - - getReportData := report.GetReportParams{ - ReportID: resp.ID, - } - - resp, err = report.GetReport(&getReportData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved report: %+v\n", resp) -} diff --git a/example/retailoutlet/main.go b/example/retailoutlet/main.go deleted file mode 100644 index 416e6788..00000000 --- a/example/retailoutlet/main.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/retailoutlet" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - createFixedPaymentCodeData := retailoutlet.CreateFixedPaymentCodeParams{ - ExternalID: "retailoutlet-" + time.Now().String(), - RetailOutletName: xendit.RetailOutletNameAlfamart, - Name: "Michael Jackson", - ExpectedAmount: 200000, - } - - resp, err := retailoutlet.CreateFixedPaymentCode(&createFixedPaymentCodeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created retail outlet fixed payment code: %+v\n", resp) - - getFixedPaymentCodeData := retailoutlet.GetFixedPaymentCodeParams{ - FixedPaymentCodeID: resp.ID, - } - - resp, err = retailoutlet.GetFixedPaymentCode(&getFixedPaymentCodeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved retail outlet fixed payment code: %+v\n", resp) - - getPaymentByFixedPaymentCodeData := retailoutlet.GetPaymentByFixedPaymentCodeParams{ - FixedPaymentCodeID: resp.ID, - } - - respPayments, err := retailoutlet.GetPaymentByFixedPaymentCode(&getPaymentByFixedPaymentCodeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved retail outlet payments: %+v\n", respPayments) - - expirationDate := time.Now().AddDate(0, 0, 1) - - updateFixedPaymentCodeData := retailoutlet.UpdateFixedPaymentCodeParams{ - FixedPaymentCodeID: resp.ID, - Name: "Billy Jackson", - ExpectedAmount: 2000000, - ExpirationDate: &expirationDate, - } - - resp, err = retailoutlet.UpdateFixedPaymentCode(&updateFixedPaymentCodeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("updated retail outlet fixed payment code: %+v\n", resp) -} diff --git a/example/transaction/main.go b/example/transaction/main.go deleted file mode 100644 index f9acde30..00000000 --- a/example/transaction/main.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/transaction" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - getListTransactionData := transaction.GetListTransactionParams{ - Limit: 10, - } - - respList, err := transaction.GetListTransaction(&getListTransactionData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved list transaction: %+v\n", respList) - - getTransactionData := transaction.GetTransactionParams{ - TransactionID: respList.Data[0].ID, - } - - resp, err := transaction.GetTransaction(&getTransactionData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved transaction: %+v\n", resp) - -} diff --git a/example/virtualaccount/main.go b/example/virtualaccount/main.go deleted file mode 100644 index e4780259..00000000 --- a/example/virtualaccount/main.go +++ /dev/null @@ -1,73 +0,0 @@ -package main - -import ( - "fmt" - "log" - "os" - "time" - - "github.com/joho/godotenv" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/virtualaccount" -) - -func main() { - godotenvErr := godotenv.Load() - if godotenvErr != nil { - log.Fatal(godotenvErr) - } - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - availableBanks, err := virtualaccount.GetAvailableBanks() - if err != nil { - log.Fatal(err) - } - fmt.Printf("available va banks: %+v\n", availableBanks) - - createFixedVAData := virtualaccount.CreateFixedVAParams{ - ExternalID: "va-" + time.Now().String(), - BankCode: availableBanks[0].Code, - Name: "Michael Jackson", - } - - resp, err := virtualaccount.CreateFixedVA(&createFixedVAData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created fixed va: %+v\n", resp) - - getFixedVAData := virtualaccount.GetFixedVAParams{ - ID: resp.ID, - } - - resp, err = virtualaccount.GetFixedVA(&getFixedVAData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved fixed va: %+v\n", resp) - - expirationDate := time.Now().AddDate(0, 0, 1) - - updateFixedVAData := virtualaccount.UpdateFixedVAParams{ - ID: resp.ID, - ExpirationDate: &expirationDate, - } - - resp, err = virtualaccount.UpdateFixedVA(&updateFixedVAData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("updated fixed va: %+v\n", resp) - - // Before running this example, create a fixed virtual account payment simulation - // by making a POST request to - // https://api.xendit.co/callback_virtual_accounts/external_id=/simulate_payment - payment, err := virtualaccount.GetPayment(&virtualaccount.GetPaymentParams{ - PaymentID: "VA_fixed-1580285972", - }) - - if err != nil { - log.Fatal(err) - } - fmt.Printf("retrieved va payment: %+v\n", payment) -} diff --git a/example_test.go b/example_test.go deleted file mode 100644 index ca2d98c0..00000000 --- a/example_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package xendit_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/client" - "github.com/xendit/xendit-go/disbursement" -) - -func ExampleDisbursement_createWithoutClient() { - xendit.Opt.SecretKey = "xnd_..." - - availableBanks, err := disbursement.GetAvailableBanks() - if err != nil { - log.Fatal(err) - } - fmt.Printf("available disbursement banks: %+v\n", availableBanks) - - createData := disbursement.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ExternalID: "disbursement-external", - BankCode: availableBanks[0].Code, - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "Disbursement from Go", - Amount: 200000, - } - - resp, err := disbursement.Create(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created disbursement: %+v\n", resp) -} - -func ExampleDisbursement_createWithClient() { - cli := client.New("xnd_...") - - availableBanks, err := cli.Disbursement.GetAvailableBanks() - if err != nil { - log.Fatal(err) - } - fmt.Printf("available disbursement banks: %+v\n", availableBanks) - - createData := disbursement.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ExternalID: "disbursement-external", - BankCode: availableBanks[0].Code, - AccountHolderName: "Michael Jackson", - AccountNumber: "1234567890", - Description: "Disbursement from Go", - Amount: 200000, - } - - resp, err := cli.Disbursement.Create(&createData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("created disbursement: %+v\n", resp) -} diff --git a/go.mod b/go.mod index a859d808..a97e67c4 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ -module github.com/xendit/xendit-go +module github.com/xendit/xendit-go/v3 -go 1.13 +go 1.18 + +require github.com/stretchr/testify v1.8.4 require ( - github.com/go-playground/validator/v10 v10.2.0 - github.com/google/go-querystring v1.1.0 // indirect - github.com/joho/godotenv v1.3.0 - github.com/stretchr/testify v1.5.1 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ee4f79dd..fa4b6e68 100644 --- a/go.sum +++ b/go.sum @@ -1,32 +1,10 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/integration_test/account.go b/integration_test/account.go deleted file mode 100644 index 049695e9..00000000 --- a/integration_test/account.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "fmt" - "log" - "math/rand" - "strconv" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/account" -) - -func accountTest() { - rand.Seed(time.Now().UnixNano()) - email := strconv.Itoa(rand.Intn(100000000)) + "@example.com" //Generate more or less random email - // fmt.Println(email) - data := account.CreateParams{ - Email: email, - Type: xendit.OWNED, - PublicProfile: xendit.PublicProfile{ - BusinessName: "John Doe", - }, - } - resp, err := account.Create(&data) - if err != nil { - log.Panic(err) - - } - resp, err = account.Get(&account.GetParams{ - ID: resp.ID, - }) - if err != nil { - log.Panic(err) - } - if resp.Email != data.Email { - log.Panic("Email is not equal") - } - if resp.Type != data.Type { - log.Panic("Type is not equal") - } - fmt.Println("Account integration tests done!") -} diff --git a/integration_test/balance.go b/integration_test/balance.go deleted file mode 100644 index 9a60c572..00000000 --- a/integration_test/balance.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go/balance" -) - -func balanceTest() { - getData := balance.GetParams{ - AccountType: "CASH", - } - _, err := balance.Get(&getData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Balance integration tests done!") -} diff --git a/integration_test/card.go b/integration_test/card.go deleted file mode 100644 index c0585781..00000000 --- a/integration_test/card.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go/card" -) - -func cardTest() { - _, err := card.GetCharge(&card.GetChargeParams{ - ChargeID: "5e046a736113354249aab8bd", - }) - if err != nil { - log.Panic(err) - } - fmt.Println("Card integration tests done!") -} diff --git a/integration_test/cardlesscredit.go b/integration_test/cardlesscredit.go deleted file mode 100644 index 5688a57c..00000000 --- a/integration_test/cardlesscredit.go +++ /dev/null @@ -1,52 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/cardlesscredit" -) - -func cardlesscreditTest() { - createPaymentData := cardlesscredit.CreatePaymentParams{ - CardlessCreditType: xendit.CardlessCreditTypeEnumKREDIVO, - ExternalID: "cardless-credit-" + time.Now().String(), - Amount: 200000, - PaymentType: xendit.PaymentTypeEnum3Months, - Items: []cardlesscredit.Item{ - { - ID: "123", - Name: "Laptop Asus Ila", - Price: 200000, - Type: "Laptop", - URL: "http://asus-ila.com", - Quantity: 1, - }, - }, - CustomerDetails: cardlesscredit.CustomerDetails{ - FirstName: "Michael", - LastName: "Belajarrock", - Email: "michaelbelajarrock@mail.com", - Phone: "08123123123", - }, - ShippingAddress: cardlesscredit.ShippingAddress{ - FirstName: "Michael", - LastName: "Belajarjazz", - Address: "Jalan Teknologi No. 12", - City: "Jakarta", - PostalCode: "40000", - Phone: "08123123123", - CountryCode: "IDN", - }, - RedirectURL: "https://google.com", - CallbackURL: "https://google.com", - } - _, err := cardlesscredit.CreatePayment(&createPaymentData) - if err != nil && err.GetErrorCode() != "MERCHANT_NOT_FOUND_ERROR" { - log.Panic(err) - } - - fmt.Println("Cardless Credit integration tests done!") -} diff --git a/integration_test/customer.go b/integration_test/customer.go deleted file mode 100644 index d3cd2cb4..00000000 --- a/integration_test/customer.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/customer" -) - -func customerTest() { - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - createCustomerData := customer.CreateCustomerParams{ - ReferenceID: time.Now().String(), - Email: "tes@tes.com", - GivenNames: "Given Names", - Nationality: "ID", - DateOfBirth: "1995-12-30", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - } - - resp, err := customer.CreateCustomer(&createCustomerData) - if err != nil { - log.Panic(err) - } - getCustomerByReferenceIDData := customer.GetCustomerByReferenceIDParams{ - ReferenceID: resp.ReferenceID, - } - - _, err = customer.GetCustomerByReferenceID(&getCustomerByReferenceIDData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Customer integration tests done!") -} diff --git a/integration_test/directdebit.go b/integration_test/directdebit.go deleted file mode 100644 index 23a336f6..00000000 --- a/integration_test/directdebit.go +++ /dev/null @@ -1,181 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/customer" - "github.com/xendit/xendit-go/directdebit/directdebitpayment" - "github.com/xendit/xendit-go/directdebit/linkedaccount" - "github.com/xendit/xendit-go/directdebit/paymentmethod" -) - -func directDebitTest() { - customerAddress := xendit.CustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - Province: "DKI Jakarta", - State: "-", - PostalCode: "12345", - } - - metadata := map[string]interface{}{ - "meta": "data", - } - - createCustomerData := customer.CreateCustomerParams{ - ReferenceID: time.Now().String(), - GivenNames: "customer 1", - MiddleName: "middle", - Surname: "surname", - Email: "customer@website.com", - MobileNumber: "+6281212345678", - Description: "dummy customer", - Addresses: []xendit.CustomerAddress{customerAddress}, - Metadata: metadata, - } - - customer, err := customer.CreateCustomer(&createCustomerData) - if err != nil { - log.Panic(err) - } - - properties := map[string]interface{}{ - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - } - - customerID := customer.ID - - initializeTokenizationData := linkedaccount.InitializeLinkedAccountTokenizationParams{ - CustomerID: customerID, - ChannelCode: xendit.DC_BRI, - Properties: properties, - Metadata: metadata, - } - - resp, err := linkedaccount.InitializeLinkedAccountTokenization(&initializeTokenizationData) - if err != nil { - log.Panic(err) - } - - validateOTPForLinkedAccountData := linkedaccount.ValidateOTPForLinkedAccountParams{ - LinkedAccountTokenID: resp.ID, - OTPCode: "333000", - } - - _, err = linkedaccount.ValidateOTPForLinkedAccount(&validateOTPForLinkedAccountData) - if err != nil { - log.Panic(err) - } - - retrieveAccessibleLinkedAccountsData := linkedaccount.RetrieveAccessibleLinkedAccountParams{ - LinkedAccountTokenID: resp.ID, - } - - resps, err := linkedaccount.RetrieveAccessibleLinkedAccounts(&retrieveAccessibleLinkedAccountsData) - if err != nil { - log.Panic(err) - } - - properties = map[string]interface{}{ - "id": resps[0].ID, - } - - createPaymentMethodData := paymentmethod.CreatePaymentMethodParams{ - CustomerID: customerID, - Type: xendit.DEBIT_CARD, - Properties: properties, - Metadata: metadata, - } - - resppm, err := paymentmethod.CreatePaymentMethod(&createPaymentMethodData) - if err != nil { - log.Panic(err) - } - - getPaymentMethodsByCustomerIDData := paymentmethod.GetPaymentMethodsByCustomerIDParams{ - CustomerID: customerID, - } - - _, err = paymentmethod.GetPaymentMethodsByCustomerID(&getPaymentMethodsByCustomerIDData) - if err != nil { - log.Panic(err) - } - - createDirectDebitPaymentData := directdebitpayment.CreateDirectDebitPaymentParams{ - ReferenceID: "test-direct-debit-ref-0100", - PaymentMethodID: resppm.ID, - Currency: "IDR", - Amount: 15000, - CallbackURL: "http://webhook.site/", - EnableOTP: true, - Description: "test description", - Basket: []xendit.DirectDebitBasketItem{ - { - ReferenceID: "basket-product-ref-id", - Name: "product-name", - Category: "mechanics", - Market: "ID", - Price: 50000, - Quantity: 5, - Type: "product type", - SubCategory: "product sub category", - Description: "product description", - URL: "https://product.url", - }, - }, - Device: xendit.DirectDebitDevice{ - ID: "device-id", - IPAddress: "0.0.0.0", - UserAgent: "user-agent", - ADID: "ad-id", - Imei: "123a456b789c", - }, - SuccessRedirectURL: "https://success-redirect.url", - FailureRedirectURL: "https://failure-redirect.url", - Metadata: metadata, - IdempotencyKey: time.Now().String(), - } - - respdd, err := directdebitpayment.CreateDirectDebitPayment(&createDirectDebitPaymentData) - if err != nil { - log.Panic(err) - } - - validateOTPForDirectDebitPaymentData := directdebitpayment.ValidateOTPForDirectDebitPaymentParams{ - DirectDebitID: respdd.ID, - OTPCode: "222000", - } - - _, err = directdebitpayment.ValidateOTPForDirectDebitPayment(&validateOTPForDirectDebitPaymentData) - if err != nil { - log.Panic(err) - } - - getDirectDebitPaymentStatusByIDData := directdebitpayment.GetDirectDebitPaymentStatusByIDParams{ - ID: respdd.ID, - } - - _, err = directdebitpayment.GetDirectDebitPaymentStatusByID(&getDirectDebitPaymentStatusByIDData) - if err != nil { - log.Panic(err) - } - - getDirectDebitPaymentStatusByReferenceIDData := directdebitpayment.GetDirectDebitPaymentStatusByReferenceIDParams{ - ReferenceID: respdd.ReferenceID, - } - - _, err = directdebitpayment.GetDirectDebitPaymentStatusByReferenceID(&getDirectDebitPaymentStatusByReferenceIDData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Direct debit integration tests done!") -} diff --git a/integration_test/disbursement.go b/integration_test/disbursement.go deleted file mode 100644 index 611c98d6..00000000 --- a/integration_test/disbursement.go +++ /dev/null @@ -1,73 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/disbursement" -) - -func disbursementTest() { - availableBanks, err := disbursement.GetAvailableBanks() - if err != nil { - log.Panic(err) - } - - createData := disbursement.CreateParams{ - IdempotencyKey: "disbursement" + time.Now().String(), - ExternalID: "disbursement-external", - BankCode: availableBanks[0].Code, - AccountHolderName: "Michael Jackson", - AccountNumber: "123124123", - Description: "Disbursement from Go", - Amount: 200000, - } - resp, err := disbursement.Create(&createData) - if err != nil { - log.Panic(err) - } - - getByIDData := disbursement.GetByIDParams{ - DisbursementID: resp.ID, - } - resp, err = disbursement.GetByID(&getByIDData) - if err != nil { - log.Panic(err) - } - - getByExternalIDData := disbursement.GetByExternalIDParams{ - ExternalID: resp.ExternalID, - } - _, err = disbursement.GetByExternalID(&getByExternalIDData) - if err != nil { - log.Panic(err) - } - - createBatchData := disbursement.CreateBatchParams{ - Reference: "batch_disbursement" + time.Now().String(), - Disbursements: []disbursement.DisbursementItem{ - { - Amount: 200000, - BankCode: availableBanks[0].Code, - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go", - }, - { - Amount: 100000, - BankCode: availableBanks[1].Code, - BankAccountName: "Michael Jackson", - BankAccountNumber: "1234567890", - Description: "Batch disbursement from Go 2", - }, - }, - } - - _, err = disbursement.CreateBatch(&createBatchData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Disbursement integration tests done!") -} diff --git a/integration_test/ewallet.go b/integration_test/ewallet.go deleted file mode 100644 index 5760e249..00000000 --- a/integration_test/ewallet.go +++ /dev/null @@ -1,119 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/ewallet" -) - -func ewalletTest() { - - createEWalletChargeMinimalFields := ewallet.CreateEWalletChargeParams{ - ReferenceID: "test-reference-id-2", - Currency: "IDR", - Amount: 10000, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - }, - } - - createChargeResponse, err := ewallet.CreateEWalletCharge(&createEWalletChargeMinimalFields) - if err != nil { - log.Panic(err) - } - - getChargeResponse := ewallet.GetEWalletChargeStatusParams{ - ChargeID: createChargeResponse.ID, - } - - _, err = ewallet.GetEWalletChargeStatus(&getChargeResponse) - if err != nil { - log.Panic(err) - } - - createEWalletChargeAdditionalFields := ewallet.CreateEWalletChargeParams{ - ReferenceID: "test-reference-id-additional-fields-2", - Currency: "IDR", - Amount: 10000, - CheckoutMethod: "ONE_TIME_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - "cancel_redirect_url": "https://yourwebsite.com/cancel", - }, - CaptureNow: true, - CustomerID: "", - PaymentMethodID: "", - Customer: &xendit.EwalletCustomer{ - ReferenceId: func(i string) *string { return &i }("sample_customer_reference_id"), - GivenNames: func(i string) *string { return &i }("sample_given_name"), - Surname: func(i string) *string { return &i }("sample_surname"), - Email: func(i string) *string { return &i }("sample_email"), - MobileNumber: func(i string) *string { return &i }("+639192999999"), - DomicileOfRegistration: func(i string) *string { return &i }("ID"), - DateOfRegistration: func(i string) *string { return &i }("2022-11-01"), - }, - ShippingInformation: &xendit.ShippingInformation{ - Country: "ID", - StreetLine1: "sample_street_line", - StreetLine2: func(i string) *string { return &i }("sample_street_line_2"), - City: "sample_city", - ProvinceState: "sample_province", - PostalCode: "sample_postal_code", - }, - Basket: []xendit.EWalletBasketItem{}, - Metadata: map[string]interface{}{}, - } - - createEWalletChargeAdditionalFieldsResponse, err := ewallet.CreateEWalletCharge(&createEWalletChargeAdditionalFields) - if err != nil { - log.Panic(err) - } - - getEWalletChargeAdditionalFieldsResponse := ewallet.GetEWalletChargeStatusParams{ - ChargeID: createEWalletChargeAdditionalFieldsResponse.ID, - } - - _, err = ewallet.GetEWalletChargeStatus(&getEWalletChargeAdditionalFieldsResponse) - if err != nil { - log.Panic(err) - } - - createEWalletChargeTokenized := ewallet.CreateEWalletChargeParams{ - ReferenceID: "test-reference-id-tokenized_2", - Currency: "IDR", - Amount: 10000, - CheckoutMethod: "TOKENIZED_PAYMENT", - ChannelCode: "ID_SHOPEEPAY", - ChannelProperties: map[string]string{ - "success_redirect_url": "https://yourwebsite.com/order/123", - "failure_redirect_url": "https://yourwebsite.com/failure", - "cancel_redirect_url": "https://yourwebsite.com/cancel", - }, - CaptureNow: true, - CustomerID: "d17cc20d-793b-4f9a-bd8c-2b1834b5b859", - PaymentMethodID: "pm-bf6cb1b6-e3ac-45ec-8fbf-f674c1a9974d", - } - - createEWalletChargeTokenizedResponse, err := ewallet.CreateEWalletCharge(&createEWalletChargeTokenized) - if err != nil { - log.Panic(err) - } - - getEWalletChargeTokenizedResponse := ewallet.GetEWalletChargeStatusParams{ - ChargeID: createEWalletChargeTokenizedResponse.ID, - } - - _, err = ewallet.GetEWalletChargeStatus(&getEWalletChargeTokenizedResponse) - if err != nil { - log.Panic(err) - } - - fmt.Println("EWallet integration tests done!") -} diff --git a/integration_test/invoice.go b/integration_test/invoice.go deleted file mode 100644 index 92bea7e9..00000000 --- a/integration_test/invoice.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/invoice" -) - -func invoiceTest() { - data := invoice.CreateParams{ - ExternalID: "invoice-" + time.Now().String(), - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice #1", - } - resp, err := invoice.Create(&data) - if err != nil { - log.Panic(err) - - } - resp, err = invoice.Get(&invoice.GetParams{ - ID: resp.ID, - }) - if err != nil { - log.Panic(err) - } - _, err = invoice.Expire(&invoice.ExpireParams{ - ID: resp.ID, - }) - if err != nil { - log.Panic(err) - } - _, err = invoice.GetAll(nil) - if err != nil { - log.Panic(err) - } - fmt.Println("Invoice integration tests done!") -} diff --git a/integration_test/main.go b/integration_test/main.go deleted file mode 100644 index a5ca1258..00000000 --- a/integration_test/main.go +++ /dev/null @@ -1,46 +0,0 @@ -package main - -import ( - "os" - "sync" - - "github.com/xendit/xendit-go" -) - -// array of functions to test -var testFunctions = []func(){ - balanceTest, - cardTest, - cardlesscreditTest, - disbursementTest, - ewalletTest, - invoiceTest, - payoutTest, - recurringpaymentTest, - retailoutletTest, - virtualaccountTest, - promotionTest, - customerTest, - directDebitTest, - qrcodeTest, - transactionTest, - accountTest, - paymentmethodTest, - reportTest, -} - -func main() { - xendit.Opt.SecretKey = os.Getenv("SECRET_KEY") - - wg := sync.WaitGroup{} - //Correctly add the wait group, instead of 'magic number' - wg.Add(len(testFunctions)) - for _, f := range testFunctions { - //Scope Capture - go func(f func()) { - f() - wg.Done() - }(f) - } - wg.Wait() -} diff --git a/integration_test/paymentmethod.go b/integration_test/paymentmethod.go deleted file mode 100644 index d63e7ac3..00000000 --- a/integration_test/paymentmethod.go +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - "log" - - "github.com/xendit/xendit-go/pmsv2" - "github.com/xendit/xendit-go/pmsv2/constant" - "github.com/xendit/xendit-go/pmsv2/ewallet" -) - -func paymentmethodTest() { - createData := pmsv2.CreatePaymentMethodParams{ - Type: constant.PaymentMethodTypeEwallet, - Reusability: constant.ReusabilityOneTimeUse, - Ewallet: &ewallet.CreateMethod{ - ChannelCode: ewallet.DANA, - ChannelProperties: ewallet.ChannelProperties{ - "success_return_url": "https://redirect.me/goodstuff", - "failure_return_url": "https://redirect.me/badstuff", - "cancel_return_url": "https://redirect.me/nostuff", - }, - }, - } - - _, err := pmsv2.CreatePaymentMethod(&createData) - if err != nil { - log.Panic(err) - } - -} diff --git a/integration_test/payout.go b/integration_test/payout.go deleted file mode 100644 index aa84a470..00000000 --- a/integration_test/payout.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/payout" -) - -func payoutTest() { - createData := payout.CreateParams{ - ExternalID: time.Now().String(), - Amount: 10000, - Email: "test@example.com", - } - - resp, err := payout.Create(&createData) - if err != nil { - log.Panic(err) - } - - resp, err = payout.Get(&payout.GetParams{ - ID: resp.ID, - }) - if err != nil { - log.Panic(err) - } - - _, err = payout.Void(&payout.VoidParams{ - ID: resp.ID, - }) - if err != nil { - log.Panic(err) - } - - fmt.Println("Payout integration tests done!") -} diff --git a/integration_test/promotion.go b/integration_test/promotion.go deleted file mode 100644 index e8f793b9..00000000 --- a/integration_test/promotion.go +++ /dev/null @@ -1,64 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/promotion" -) - -func promotionTest() { - startTime := time.Now().Add(time.Hour) - endTime := startTime.Add(time.Hour) - - created, err := promotion.CreatePromotion(&promotion.CreatePromotionParams{ - ReferenceID: fmt.Sprintf("promotion-%s", time.Now().String()), - Description: "20% discount applied for all BRI cards", - BinList: []string{ - "400000", - "460000", - }, - DiscountPercent: 20, - Currency: "IDR", - StartTime: &startTime, - EndTime: &endTime, - ChannelCode: "BRI", - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }) - if err != nil { - log.Panic(err) - } - - _, err = promotion.GetPromotions(&promotion.GetPromotionsParams{ - ReferenceID: created.ReferenceID, - }) - if err != nil { - log.Panic(err) - } - - updated, err := promotion.UpdatePromotion(&promotion.UpdatePromotionParams{ - PromotionID: created.ID, - Description: "20% discount applied for all BCA cards", - BinList: []string{ - "400000", - "460000", - }, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BCA", - }) - if err != nil { - log.Panic(err) - } - - _, err = promotion.DeletePromotion(&promotion.DeletePromotionParams{ - PromotionID: updated.ID, - }) - if err != nil { - log.Panic(err) - } - - fmt.Println("Promotion's integration tests done!") -} diff --git a/integration_test/qrcode.go b/integration_test/qrcode.go deleted file mode 100644 index a2e89a1d..00000000 --- a/integration_test/qrcode.go +++ /dev/null @@ -1,33 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/qrcode" -) - -func qrcodeTest() { - createData := qrcode.CreateQRCodeParams{ - ExternalID: time.Now().String(), - Type: xendit.DynamicQRCode, - CallbackURL: "https://httpstat.us/200", - Amount: 10000, - } - - resp, err := qrcode.CreateQRCode(&createData) - if err != nil { - log.Panic(err) - } - _, err = qrcode.GetQRCode(&qrcode.GetQRCodeParams{ - ExternalID: resp.ID, - }) - - if err != nil { - log.Panic(err) - } - - fmt.Println("QR Code integration tests done!") -} diff --git a/integration_test/recurringpayment.go b/integration_test/recurringpayment.go deleted file mode 100644 index 35a81dbf..00000000 --- a/integration_test/recurringpayment.go +++ /dev/null @@ -1,95 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/recurringpayment" -) - -func recurringpaymentTest() { - - customerAddress := xendit.RecurringPaymenCustomerAddress{ - Country: "ID", - StreetLine1: "Jl. 123", - StreetLine2: "Jl. 456", - City: "Jakarta Selatan", - State: "DKI JAKARTA", - PostalCode: "12345", - } - - customerData := xendit.RecurringPaymentCustomer{ - GivenNames: "customer 1", - Email: "customer@customer.com", - MobileNumber: "+6281212345678", - Address: []xendit.RecurringPaymenCustomerAddress{customerAddress}, - } - - customerNotificationPreference := xendit.CustomerNotificationPreference{ - InvoiceCreated: []xendit.CustomerNotificationChannelEnum{xendit.CustomerNotificationChannelEmail, xendit.CustomerNotificationChannelWhatsApp}, - InvoiceReminder: []xendit.CustomerNotificationChannelEnum{xendit.CustomerNotificationChannelSMS, xendit.CustomerNotificationChannelEmail}, - InvoicePaid: []xendit.CustomerNotificationChannelEnum{xendit.CustomerNotificationChannelViber, xendit.CustomerNotificationChannelEmail}, - InvoiceExpired: []xendit.CustomerNotificationChannelEnum{xendit.CustomerNotificationChannelWhatsApp, xendit.CustomerNotificationChannelEmail}, - } - - createData := recurringpayment.CreateParams{ - ExternalID: "recurringpayment-" + time.Now().String(), - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurringpayment #1", - Interval: xendit.RecurringPaymentIntervalDay, - IntervalCount: 3, - Customer: customerData, - CustomerNotificationPreference: customerNotificationPreference, - } - - resp, err := recurringpayment.Create(&createData) - if err != nil { - log.Panic(err) - } - - getData := recurringpayment.GetParams{ - ID: resp.ID, - } - resp, err = recurringpayment.Get(&getData) - if err != nil { - log.Panic(err) - } - - editData := recurringpayment.EditParams{ - ID: resp.ID, - Amount: 500000, - } - resp, err = recurringpayment.Edit(&editData) - if err != nil { - log.Panic(err) - } - - pauseData := recurringpayment.PauseParams{ - ID: resp.ID, - } - resp, err = recurringpayment.Pause(&pauseData) - if err != nil { - log.Panic(err) - } - - resumeData := recurringpayment.ResumeParams{ - ID: resp.ID, - } - resp, err = recurringpayment.Resume(&resumeData) - if err != nil { - log.Panic(err) - } - - stopData := recurringpayment.StopParams{ - ID: resp.ID, - } - _, err = recurringpayment.Stop(&stopData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Recurring Payment integration tests done!") -} diff --git a/integration_test/report.go b/integration_test/report.go deleted file mode 100644 index 4461ea39..00000000 --- a/integration_test/report.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "fmt" - "github.com/xendit/xendit-go/report" - "log" -) - -func reportTest() { - respReport, err := report.GenerateReport(&report.GenerateReportParams{ - Type: "BALANCE_HISTORY", // "BALANCE_HISTORY", "TRANSACTIONS", "UPCOMING_TRANSACTIONS" - Filter: report.Filter{ - From: "2020-01-01T00:00:00.000Z", - To: "2020-12-31T23:59:59.999Z", - }, - }) - if err != nil { - log.Panic(err) - } - - _, err = report.GetReport(&report.GetReportParams{ - ReportID: respReport.ID, - }) - if err != nil { - log.Panic(err) - } - fmt.Println("report integration tests done!") -} diff --git a/integration_test/retailoutlet.go b/integration_test/retailoutlet.go deleted file mode 100644 index 49025c9e..00000000 --- a/integration_test/retailoutlet.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/retailoutlet" -) - -func retailoutletTest() { - createFixedPaymentCodeData := retailoutlet.CreateFixedPaymentCodeParams{ - ExternalID: "retailoutlet-" + time.Now().String(), - RetailOutletName: xendit.RetailOutletNameAlfamart, - Name: "Michael Jackson", - ExpectedAmount: 200000, - } - - resp, err := retailoutlet.CreateFixedPaymentCode(&createFixedPaymentCodeData) - if err != nil { - log.Panic(err) - } - - getFixedPaymentCodeData := retailoutlet.GetFixedPaymentCodeParams{ - FixedPaymentCodeID: resp.ID, - } - - resp, err = retailoutlet.GetFixedPaymentCode(&getFixedPaymentCodeData) - if err != nil { - log.Panic(err) - } - - expirationDate := time.Now().AddDate(0, 0, 1) - updateFixedPaymentCodeData := retailoutlet.UpdateFixedPaymentCodeParams{ - FixedPaymentCodeID: resp.ID, - Name: "Billy Jackson", - ExpectedAmount: 2000000, - ExpirationDate: &expirationDate, - } - - _, err = retailoutlet.UpdateFixedPaymentCode(&updateFixedPaymentCodeData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Retail Outlet integration tests done!") -} diff --git a/integration_test/transaction.go b/integration_test/transaction.go deleted file mode 100644 index 128f226d..00000000 --- a/integration_test/transaction.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go/transaction" -) - -func transactionTest() { - - respList, err := transaction.GetListTransaction(&transaction.GetListTransactionParams{}) - if err != nil { - log.Panic(err) - } - - _, err = transaction.GetTransaction(&transaction.GetTransactionParams{ - TransactionID: respList.Data[0].ID, - }) - - if err != nil { - log.Panic(err) - } - - fmt.Println("transaction integration tests done!") -} diff --git a/integration_test/virtualaccount.go b/integration_test/virtualaccount.go deleted file mode 100644 index 4742250e..00000000 --- a/integration_test/virtualaccount.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go/virtualaccount" -) - -func virtualaccountTest() { - availableBanks, err := virtualaccount.GetAvailableBanks() - if err != nil { - log.Panic(err) - } - - createFixedVAData := virtualaccount.CreateFixedVAParams{ - ExternalID: "va-" + time.Now().String(), - BankCode: availableBanks[0].Code, - Name: "Michael Jackson", - } - resp, err := virtualaccount.CreateFixedVA(&createFixedVAData) - if err != nil { - log.Panic(err) - } - - time.Sleep(3 * time.Second) - getFixedVAData := virtualaccount.GetFixedVAParams{ - ID: resp.ID, - } - resp, err = virtualaccount.GetFixedVA(&getFixedVAData) - if err != nil { - log.Panic(err) - } - - expirationDate := time.Now().AddDate(0, 0, 1) - updateFixedVAData := virtualaccount.UpdateFixedVAParams{ - ID: resp.ID, - ExpirationDate: &expirationDate, - } - _, err = virtualaccount.UpdateFixedVA(&updateFixedVAData) - if err != nil { - log.Panic(err) - } - - fmt.Println("Virtual Account integration tests done!") -} diff --git a/invoice.go b/invoice.go deleted file mode 100644 index 28ae5b8a..00000000 --- a/invoice.go +++ /dev/null @@ -1,123 +0,0 @@ -package xendit - -import "time" - -// Invoice contains data from Xendit's API response of invoice related requests. -// For more API details see https://xendit.github.io/apireference/?bash#invoices. -// For documentation of subpackage invoice, checkout https://pkg.go.dev/github.com/xendit/xendit-go/invoice -type Invoice struct { - ID string `json:"id"` - InvoiceURL string `json:"invoice_url"` - UserID string `json:"user_id,omitempty"` - ExternalID string `json:"external_id"` - Status string `json:"status"` - MerchantName string `json:"merchant_name"` - MerchantProfilePictureURL string `json:"merchant_profile_picture_url,omitempty"` - Amount float64 `json:"amount"` - Locale string `json:"locale,omitempty"` - Items []InvoiceItem `json:"items,omitempty"` - Fees []InvoiceFee `json:"fees,omitempty"` - PayerEmail string `json:"payer_email,omitempty"` - Description string `json:"description,omitempty"` - ExpiryDate *time.Time `json:"expiry_date"` - Customer InvoiceCustomer `json:"customer,omitempty"` - CustomerNotificationPreference InvoiceCustomerNotificationPreference `json:"customer_notification_preference,omitempty"` - AvailableBanks []InvoiceBank `json:"available_banks,omitempty"` - AvailableEWallets []InvoiceEWallet `json:"available_ewallets,omitempty"` - AvailableRetailOutlets []InvoiceRetailOutlet `json:"available_retail_outlets,omitempty"` - ReminderDate *time.Time `json:"reminder_date,omitempty"` - FixedVA bool `json:"fixed_va,omitempty"` - MidLabel string `json:"mid_label,omitempty"` - ShouldExcludeCreditCard bool `json:"should_exclude_credit_card,omitempty"` - ShouldAuthenticateCreditCard bool `json:"should_authenticate_credit_card,omitempty"` - ShouldSendEmail bool `json:"should_send_email"` - Created *time.Time `json:"created"` - Updated *time.Time `json:"updated"` - Currency string `json:"currency,omitempty"` - PaidAt *time.Time `json:"paid_at,omitempty"` - PaymentMethod string `json:"payment_method,omitempty"` - PaymentChannel string `json:"payment_channel,omitempty"` - PaymentDestination string `json:"payment_destination,omitempty"` - PaymentDetail InvoicePaymentDetail `json:"payment_details,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - RecurringPaymentID string `json:"recurring_payment_id,omitempty"` - CreditCardChargeID string `json:"credit_card_charge_id,omitempty"` - AdjustedReceivedAmount float64 `json:"adjusted_received_amount,omitempty"` - //deprecated - BankCode string `json:"bank_code,omitempty"` - PaidAmount float64 `json:"paid_amount,omitempty"` -} - -// InvoiceBank is data that contained in `Invoice` at AvailableBanks -type InvoiceBank struct { - BankCode string `json:"bank_code"` - CollectionType string `json:"collection_type"` - BankAccountNumber string `json:"bank_account_number"` - TransferAmount float64 `json:"transfer_amount"` - BankBranch string `json:"bank_branch"` - AccountHolderName string `json:"account_holder_name"` - IdentityAmount int `json:"identity_amount"` -} - -// InvoiceEWallet is data that contained in `Invoice` at AvailableEWallets -type InvoiceEWallet struct { - EWalletType string `json:"ewallet_type"` -} - -// InvoiceRetailOutlet is data that contained in `Invoice` at AvailableRetailOutlets -type InvoiceRetailOutlet struct { - RetailOutletName string `json:"retail_outlet_name"` - //WILL BE DEPRECATED SOON - PaymentCode string `json:"payment_code,omitempty"` - //WILL BE DEPRECATED SOON - TransferAmount float64 `json:"transfer_amount,omitempty"` - MerchantName string `json:"merchant_name,omitempty"` -} - -// InvoiceItem is data that contained in `Invoice` at Items -type InvoiceItem struct { - Name string `json:"name" validate:"required"` - Price float64 `json:"price" validate:"required"` - Quantity int `json:"quantity" validate:"required"` - Category string `json:"category,omitempty"` - Url string `json:"url,omitempty"` -} - -// InvoiceCustomer is data that contained in `Invoice` at Customer -type InvoiceCustomer struct { - GivenNames string `json:"given_names,omitempty"` - Surname string `json:"surname,omitempty"` - Email string `json:"email,omitempty"` - MobileNumber string `json:"mobile_number,omitempty"` - Address []InvoiceCustomerAddress `json:"addresses,omitempty"` -} - -type InvoiceCustomerAddress struct { - City string `json:"city,omitempty"` - Country string `json:"country,omitempty"` - PostalCode string `json:"postal_code,omitempty"` - State string `json:"state,omitempty"` - StreetLine1 string `json:"street_line1,omitempty"` - StreetLine2 string `json:"street_line2,omitempty"` -} - -// InvoiceCustomerNotificationPreference is data that contained in `Invoice` at CustomerNotificationPreference -type InvoiceCustomerNotificationPreference struct { - InvoiceCreated []string `json:"invoice_created,omitempty"` - InvoiceReminder []string `json:"invoice_reminder,omitempty"` - InvoicePaid []string `json:"invoice_paid,omitempty"` - InvoiceExpired []string `json:"invoice_expired,omitempty"` -} - -// InvoiceFee is data that contained in `Invoice` at Fees -type InvoiceFee struct { - Type string `json:"type" validate:"required"` - Value float64 `json:"value" validate:"required"` -} - -// InvoicePaymentDetail is data that contained in `Invoice` at PaymentDetail -type InvoicePaymentDetail struct { - ReceiptID string `json:"receipt_id,omitempty"` - Source string `json:"source,omitempty"` -} diff --git a/invoice/api_invoice.go b/invoice/api_invoice.go new file mode 100644 index 00000000..3a593727 --- /dev/null +++ b/invoice/api_invoice.go @@ -0,0 +1,581 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package invoice + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" + "reflect" + "time" +) + + +type InvoiceApi interface { + + /* + CreateInvoice Create an invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateInvoiceRequest + */ + CreateInvoice(ctx context.Context) ApiCreateInvoiceRequest + + // CreateInvoiceExecute executes the request + // @return Invoice + CreateInvoiceExecute(r ApiCreateInvoiceRequest) (*Invoice, *http.Response, *common.XenditSdkError) + + /* + ExpireInvoice Manually expire an invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to be expired + @return ApiExpireInvoiceRequest + */ + ExpireInvoice(ctx context.Context, invoiceId string) ApiExpireInvoiceRequest + + // ExpireInvoiceExecute executes the request + // @return Invoice + ExpireInvoiceExecute(r ApiExpireInvoiceRequest) (*Invoice, *http.Response, *common.XenditSdkError) + + /* + GetInvoiceById Get invoice by invoice id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID + @return ApiGetInvoiceByIdRequest + */ + GetInvoiceById(ctx context.Context, invoiceId string) ApiGetInvoiceByIdRequest + + // GetInvoiceByIdExecute executes the request + // @return Invoice + GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (*Invoice, *http.Response, *common.XenditSdkError) + + /* + GetInvoices Get all Invoices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInvoicesRequest + */ + GetInvoices(ctx context.Context) ApiGetInvoicesRequest + + // GetInvoicesExecute executes the request + // @return []Invoice + GetInvoicesExecute(r ApiGetInvoicesRequest) ([]Invoice, *http.Response, *common.XenditSdkError) +} + +// InvoiceApiService InvoiceApi service +type InvoiceApiService struct { + client common.IClient +} + +// NewInvoiceApi Create a new InvoiceApi service +func NewInvoiceApi (client common.IClient) InvoiceApi { + return &InvoiceApiService{ + client: client, + } +} + + +type ApiCreateInvoiceRequest struct { + ctx context.Context + ApiService InvoiceApi + createInvoiceRequest *CreateInvoiceRequest +} + +func (r ApiCreateInvoiceRequest) CreateInvoiceRequest(createInvoiceRequest CreateInvoiceRequest) ApiCreateInvoiceRequest { + r.createInvoiceRequest = &createInvoiceRequest + return r +} + +func (r ApiCreateInvoiceRequest) Execute() (*Invoice, *http.Response, *common.XenditSdkError) { + return r.ApiService.CreateInvoiceExecute(r) +} + +/* +CreateInvoice Create an invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateInvoiceRequest +*/ +func (a *InvoiceApiService) CreateInvoice(ctx context.Context) ApiCreateInvoiceRequest { + return ApiCreateInvoiceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Invoice +func (a *InvoiceApiService) CreateInvoiceExecute(r ApiCreateInvoiceRequest) (*Invoice, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Invoice + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.CreateInvoice") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute") + } + + localVarPath := localBasePath + "/v2/invoices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createInvoiceRequest == nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "createInvoiceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInvoiceRequest + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExpireInvoiceRequest struct { + ctx context.Context + ApiService InvoiceApi + invoiceId string +} + +func (r ApiExpireInvoiceRequest) Execute() (*Invoice, *http.Response, *common.XenditSdkError) { + return r.ApiService.ExpireInvoiceExecute(r) +} + +/* +ExpireInvoice Manually expire an invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to be expired + @return ApiExpireInvoiceRequest +*/ +func (a *InvoiceApiService) ExpireInvoice(ctx context.Context, invoiceId string) ApiExpireInvoiceRequest { + return ApiExpireInvoiceRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// @return Invoice +func (a *InvoiceApiService) ExpireInvoiceExecute(r ApiExpireInvoiceRequest) (*Invoice, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Invoice + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.ExpireInvoice") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.ExpireInvoiceExecute") + } + + localVarPath := localBasePath + "/invoices/{invoice_id}/expire!" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.ExpireInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInvoiceByIdRequest struct { + ctx context.Context + ApiService InvoiceApi + invoiceId string +} + +func (r ApiGetInvoiceByIdRequest) Execute() (*Invoice, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetInvoiceByIdExecute(r) +} + +/* +GetInvoiceById Get invoice by invoice id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID + @return ApiGetInvoiceByIdRequest +*/ +func (a *InvoiceApiService) GetInvoiceById(ctx context.Context, invoiceId string) ApiGetInvoiceByIdRequest { + return ApiGetInvoiceByIdRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// @return Invoice +func (a *InvoiceApiService) GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (*Invoice, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Invoice + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.GetInvoiceById") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoiceByIdExecute") + } + + localVarPath := localBasePath + "/v2/invoices/{invoice_id}" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoiceByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInvoicesRequest struct { + ctx context.Context + ApiService InvoiceApi + externalId *string + statuses *[]InvoiceStatus + limit *float32 + createdAfter *time.Time + createdBefore *time.Time + paidAfter *time.Time + paidBefore *time.Time + expiredAfter *time.Time + expiredBefore *time.Time + lastInvoice *string + clientTypes *[]InvoiceClientType + paymentChannels *[]string + onDemandLink *string + recurringPaymentId *string +} + +func (r ApiGetInvoicesRequest) ExternalId(externalId string) ApiGetInvoicesRequest { + r.externalId = &externalId + return r +} + +func (r ApiGetInvoicesRequest) Statuses(statuses []InvoiceStatus) ApiGetInvoicesRequest { + r.statuses = &statuses + return r +} + +func (r ApiGetInvoicesRequest) Limit(limit float32) ApiGetInvoicesRequest { + r.limit = &limit + return r +} + +func (r ApiGetInvoicesRequest) CreatedAfter(createdAfter time.Time) ApiGetInvoicesRequest { + r.createdAfter = &createdAfter + return r +} + +func (r ApiGetInvoicesRequest) CreatedBefore(createdBefore time.Time) ApiGetInvoicesRequest { + r.createdBefore = &createdBefore + return r +} + +func (r ApiGetInvoicesRequest) PaidAfter(paidAfter time.Time) ApiGetInvoicesRequest { + r.paidAfter = &paidAfter + return r +} + +func (r ApiGetInvoicesRequest) PaidBefore(paidBefore time.Time) ApiGetInvoicesRequest { + r.paidBefore = &paidBefore + return r +} + +func (r ApiGetInvoicesRequest) ExpiredAfter(expiredAfter time.Time) ApiGetInvoicesRequest { + r.expiredAfter = &expiredAfter + return r +} + +func (r ApiGetInvoicesRequest) ExpiredBefore(expiredBefore time.Time) ApiGetInvoicesRequest { + r.expiredBefore = &expiredBefore + return r +} + +func (r ApiGetInvoicesRequest) LastInvoice(lastInvoice string) ApiGetInvoicesRequest { + r.lastInvoice = &lastInvoice + return r +} + +func (r ApiGetInvoicesRequest) ClientTypes(clientTypes []InvoiceClientType) ApiGetInvoicesRequest { + r.clientTypes = &clientTypes + return r +} + +func (r ApiGetInvoicesRequest) PaymentChannels(paymentChannels []string) ApiGetInvoicesRequest { + r.paymentChannels = &paymentChannels + return r +} + +func (r ApiGetInvoicesRequest) OnDemandLink(onDemandLink string) ApiGetInvoicesRequest { + r.onDemandLink = &onDemandLink + return r +} + +func (r ApiGetInvoicesRequest) RecurringPaymentId(recurringPaymentId string) ApiGetInvoicesRequest { + r.recurringPaymentId = &recurringPaymentId + return r +} + +func (r ApiGetInvoicesRequest) Execute() ([]Invoice, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetInvoicesExecute(r) +} + +/* +GetInvoices Get all Invoices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInvoicesRequest +*/ +func (a *InvoiceApiService) GetInvoices(ctx context.Context) ApiGetInvoicesRequest { + return ApiGetInvoicesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Invoice +func (a *InvoiceApiService) GetInvoicesExecute(r ApiGetInvoicesRequest) ([]Invoice, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue []Invoice + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.GetInvoices") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoicesExecute") + } + + localVarPath := localBasePath + "/v2/invoices" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.externalId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "external_id", r.externalId, "") + } + if r.statuses != nil { + t := *r.statuses + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", t, "multi") + } + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.createdAfter != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "created_after", r.createdAfter, "") + } + if r.createdBefore != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "created_before", r.createdBefore, "") + } + if r.paidAfter != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "paid_after", r.paidAfter, "") + } + if r.paidBefore != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "paid_before", r.paidBefore, "") + } + if r.expiredAfter != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "expired_after", r.expiredAfter, "") + } + if r.expiredBefore != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "expired_before", r.expiredBefore, "") + } + if r.lastInvoice != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "last_invoice", r.lastInvoice, "") + } + if r.clientTypes != nil { + t := *r.clientTypes + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "client_types", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "client_types", t, "multi") + } + } + if r.paymentChannels != nil { + t := *r.paymentChannels + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_channels", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_channels", t, "multi") + } + } + if r.onDemandLink != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "on_demand_link", r.onDemandLink, "") + } + if r.recurringPaymentId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "recurring_payment_id", r.recurringPaymentId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoicesExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/invoice/client.go b/invoice/client.go deleted file mode 100644 index 24dc07d1..00000000 --- a/invoice/client.go +++ /dev/null @@ -1,156 +0,0 @@ -package invoice - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new invoice -func (c *Client) Create(data *CreateParams) (*xendit.Invoice, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new invoice with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Invoice, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Invoice{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - if data.WithFeeRule != "" { - header.Add("with-fee-rule", data.WithFeeRule) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/v2/invoices", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Get gets one invoice -func (c *Client) Get(data *GetParams) (*xendit.Invoice, *xendit.Error) { - return c.GetWithContext(context.Background(), data) -} - -// GetWithContext gets one invoice with context -func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Invoice, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Invoice{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/invoices/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Expire expires the created invoice -func (c *Client) Expire(data *ExpireParams) (*xendit.Invoice, *xendit.Error) { - return c.ExpireWithContext(context.Background(), data) -} - -// ExpireWithContext expires the created invoice with context -func (c *Client) ExpireWithContext(ctx context.Context, data *ExpireParams) (*xendit.Invoice, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Invoice{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/invoices/%s/expire!", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetAll gets all invoices with conditions -func (c *Client) GetAll(data *GetAllParams) ([]xendit.Invoice, *xendit.Error) { - return c.GetAllWithContext(context.Background(), data) -} - -// GetAllWithContext gets all invoices with conditions -func (c *Client) GetAllWithContext(ctx context.Context, data *GetAllParams) ([]xendit.Invoice, *xendit.Error) { - response := []xendit.Invoice{} - var queryString string - - header := http.Header{} - - if data != nil { - queryString = data.QueryString() - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/invoices?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - header, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/invoice/event.go b/invoice/event.go deleted file mode 100644 index 7fb2ee75..00000000 --- a/invoice/event.go +++ /dev/null @@ -1,44 +0,0 @@ -package invoice - -import "github.com/xendit/xendit-go" - -type InvoiceCallback struct { - ID string `json:"id"` - UserID string `json:"user_id"` - ExternalID string `json:"external_id"` - IsHigh bool `json:"is_high"` - Status string `json:"status"` - MerchantName string `json:"merchant_name"` - Amount float64 `json:"amount"` - Created string `json:"created"` - Updated string `json:"updated"` - PayerEmail string `json:"payer_email,omitempty"` - Description string `json:"description,omitempty"` - PaymentID string `json:"payment_id,omitempty"` - PaidAmount float64 `json:"paid_amount,omitempty"` - PaymentMethod string `json:"payment_method,omitempty"` - BankCode string `json:"bank_code,omitempty"` - EwalletType string `json:"ewallet_type,omitempty"` - CallbackAuthenticationToken string `json:"callback_authentication_token,omitempty"` - CallbackURL string `json:"callback_url,omitempty"` - BusinessID string `json:"business_id,omitempty"` - BusinessName string `json:"business_name,omitempty"` - OnDemandLink string `json:"on_demand_link,omitempty"` - RecurringPaymentID string `json:"recurring_payment_id,omitempty"` - CreditCardChargeID string `json:"credit_card_charge_id,omitempty"` - Currency string `json:"currency,omitempty"` - InitialCurrency string `json:"initial_currency,omitempty"` - InitialAmount float64 `json:"initial_amount,omitempty"` - PaidAt *string `json:"paid_at,omitempty"` - MidLabel string `json:"mid_label,omitempty"` - PaymentChannel string `json:"payment_channel,omitempty"` - PaymentDestination string `json:"payment_destination,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - CreditCardToken string `json:"credit_card_token,omitempty"` - PaymentMethodID string `json:"payment_method_id,omitempty"` - ShouldAuthenticateCreditCard bool `json:"should_authenticate_credit_card,omitempty"` - PaymentDetails *xendit.InvoicePaymentDetail `json:"payment_details,omitempty"` - Fees *[]xendit.InvoiceFee `json:"fees,omitempty"` - Items *[]xendit.InvoiceItem `json:"items,omitempty"` -} diff --git a/invoice/event_test.go b/invoice/event_test.go deleted file mode 100644 index 57bbf19d..00000000 --- a/invoice/event_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package invoice_test - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/invoice" -) - -func toPointerString(v string) *string { - return &v -} - -func TestInvoiceCallback_EWallet(t *testing.T) { - testPayload := `{ - "id": "12345", - "fees": [ - { - "type": "example fee", - "value": 100 - } - ], - "amount": 1000, - "status": "PAID", - "created": "2023-05-14T07:32:42.646Z", - "is_high": false, - "paid_at": "2023-05-14T07:35:14.000Z", - "updated": "2023-05-14T07:35:15.810Z", - "user_id": "example", - "currency": "IDR", - "payment_id": "qrpy_example", - "external_id": "example", - "paid_amount": 1000, - "merchant_name": "Example Merchant", - "payment_method": "QR_CODE", - "payment_channel": "QRIS", - "payment_details": { - "source": "Ovo", - "receipt_id": "example" - }, - "payment_method_id": "pm-example-123" - }` - expectedPayload := invoice.InvoiceCallback{ - ID: "12345", - Fees: &[]xendit.InvoiceFee{{Type: "example fee", Value: 100}}, - Amount: 1000, - Status: "PAID", - Created: "2023-05-14T07:32:42.646Z", - IsHigh: false, - PaidAt: toPointerString("2023-05-14T07:35:14.000Z"), - Updated: "2023-05-14T07:35:15.810Z", - UserID: "example", - Currency: "IDR", - PaymentID: "qrpy_example", - ExternalID: "example", - PaidAmount: 1000, - MerchantName: "Example Merchant", - PaymentMethod: "QR_CODE", - PaymentChannel: "QRIS", - PaymentDetails: &xendit.InvoicePaymentDetail{ - Source: "Ovo", - ReceiptID: "example", - }, - PaymentMethodID: "pm-example-123", - } - var actualPayload invoice.InvoiceCallback - err := json.Unmarshal([]byte(testPayload), &actualPayload) - assert.NoError(t, err) - assert.Equal(t, expectedPayload, actualPayload) -} - -func TestInvoiceCallback_Bank(t *testing.T) { - testPayload := `{ - "id": "593f4ed1c3d3bb7f39733d83", - "external_id": "testing-invoice", - "user_id": "5848fdf860053555135587e7", - "is_high": false, - "payment_method": "BANK_TRANSFER", - "status": "PAID", - "merchant_name": "Xendit", - "amount": 2000000, - "paid_amount": 2000000, - "bank_code": "TESTBANK", - "paid_at": "2020-01-14T02:32:50.912Z", - "payer_email": "test@xendit.co", - "description": "Invoice callback test", - "created": "2020-01-13T02:32:49.827Z", - "updated": "2020-01-13T02:32:50.912Z", - "currency": "IDR", - "payment_channel": "TEST", - "payment_destination": "8458478548758748" - }` - expectedPayload := invoice.InvoiceCallback{ - ID: "593f4ed1c3d3bb7f39733d83", - ExternalID: "testing-invoice", - UserID: "5848fdf860053555135587e7", - IsHigh: false, - PaymentMethod: "BANK_TRANSFER", - Status: "PAID", - MerchantName: "Xendit", - Amount: 2000000, - PaidAmount: 2000000, - BankCode: "TESTBANK", - PaidAt: toPointerString("2020-01-14T02:32:50.912Z"), - PayerEmail: "test@xendit.co", - Description: "Invoice callback test", - Created: "2020-01-13T02:32:49.827Z", - Updated: "2020-01-13T02:32:50.912Z", - Currency: "IDR", - PaymentChannel: "TEST", - PaymentDestination: "8458478548758748", - } - var actualPayload invoice.InvoiceCallback - err := json.Unmarshal([]byte(testPayload), &actualPayload) - assert.NoError(t, err) - assert.Equal(t, expectedPayload, actualPayload) -} - -func TestInvoiceCallback_RetailOutlet(t *testing.T) { - testPayload := `{ - "id": "593f4ed1c3d3bb7f39733d83", - "external_id": "testing-invoice", - "user_id": "5848fdf860053555135587e7", - "is_high": false, - "payment_method": "RETAIL_OUTLET", - "status": "PAID", - "merchant_name": "Xendit", - "amount": 2000000, - "paid_amount": 2000000, - "paid_at": "2020-01-14T02:32:50.912Z", - "payer_email": "test@xendit.co", - "description": "Invoice callback test", - "created": "2020-01-13T02:32:49.827Z", - "updated": "2020-01-13T02:32:50.912Z", - "currency": "IDR", - "payment_channel": "TESTMART", - "payment_destination": "TEST815" - }` - expectedPayload := invoice.InvoiceCallback{ - ID: "593f4ed1c3d3bb7f39733d83", - ExternalID: "testing-invoice", - UserID: "5848fdf860053555135587e7", - IsHigh: false, - PaymentMethod: "RETAIL_OUTLET", - Status: "PAID", - MerchantName: "Xendit", - Amount: 2000000, - PaidAmount: 2000000, - PaidAt: toPointerString("2020-01-14T02:32:50.912Z"), - PayerEmail: "test@xendit.co", - Description: "Invoice callback test", - Created: "2020-01-13T02:32:49.827Z", - Updated: "2020-01-13T02:32:50.912Z", - Currency: "IDR", - PaymentChannel: "TESTMART", - PaymentDestination: "TEST815", - } - - var actualPayload invoice.InvoiceCallback - err := json.Unmarshal([]byte(testPayload), &actualPayload) - assert.NoError(t, err) - assert.Equal(t, expectedPayload, actualPayload) -} - -func TestInvoiceCallback_Expired(t *testing.T) { - testPayload := `{ - "id": "621887f17d9cdaa199d6e787", - "user_id": "61d3c21692594a88b0dad56b", - "external_id": "yumin-invoice-1645774832", - "is_high": false, - "status": "EXPIRED", - "merchant_name": "fintech", - "amount": 1000, - "created": "2022-02-25T07:40:33.922Z", - "updated": "2022-02-25T07:42:43.872Z", - "description": "Invoice Demo #123", - "currency": "IDR", - "success_redirect_url": "https://www.example.com", - "failure_redirect_url": "https://www.example.com" - }` - expectedPayload := invoice.InvoiceCallback{ - ID: "621887f17d9cdaa199d6e787", - UserID: "61d3c21692594a88b0dad56b", - ExternalID: "yumin-invoice-1645774832", - IsHigh: false, - Status: "EXPIRED", - MerchantName: "fintech", - Amount: 1000, - Created: "2022-02-25T07:40:33.922Z", - Updated: "2022-02-25T07:42:43.872Z", - Description: "Invoice Demo #123", - Currency: "IDR", - SuccessRedirectURL: "https://www.example.com", - FailureRedirectURL: "https://www.example.com", - } - - var actualPayload invoice.InvoiceCallback - err := json.Unmarshal([]byte(testPayload), &actualPayload) - assert.NoError(t, err) - assert.Equal(t, expectedPayload, actualPayload) -} diff --git a/invoice/example_test.go b/invoice/example_test.go deleted file mode 100644 index 75ca25e0..00000000 --- a/invoice/example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package invoice_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/invoice" -) - -func ExampleCreate() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := invoice.CreateParams{ - ExternalID: "invoice-example", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice #1", - } - - resp, err := invoice.Create(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created invoice: %+v\n", resp) -} - -func ExampleGet() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := invoice.GetParams{ - ID: "invoice-id", - } - - resp, err := invoice.Get(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved invoice: %+v\n", resp) -} - -func ExampleExpire() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := invoice.ExpireParams{ - ID: "invoice-id", - } - - resp, err := invoice.Expire(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("expired invoice: %+v\n", resp) -} - -func ExampleGetAll() { - xendit.Opt.SecretKey = "examplesecretkey" - - createdAfter, _ := time.Parse(time.RFC3339, "2016-02-24T23:48:36.697Z") - - data := invoice.GetAllParams{ - Statuses: []string{"EXPIRED", "SETTLED"}, - Limit: 5, - CreatedAfter: createdAfter, - } - - resps, err := invoice.GetAll(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("invoices: %+v\n", resps) -} diff --git a/invoice/invoice.go b/invoice/invoice.go deleted file mode 100644 index 4d281689..00000000 --- a/invoice/invoice.go +++ /dev/null @@ -1,74 +0,0 @@ -package invoice - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new invoice -func Create(data *CreateParams) (*xendit.Invoice, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new invoice with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Invoice, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// Get gets one invoice -func Get(data *GetParams) (*xendit.Invoice, *xendit.Error) { - return GetWithContext(context.Background(), data) -} - -// GetWithContext gets one invoice with context -func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Invoice, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetWithContext(ctx, data) -} - -// Expire expires the created invoice -func Expire(data *ExpireParams) (*xendit.Invoice, *xendit.Error) { - return ExpireWithContext(context.Background(), data) -} - -// ExpireWithContext expires the created invoice with context -func ExpireWithContext(ctx context.Context, data *ExpireParams) (*xendit.Invoice, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ExpireWithContext(ctx, data) -} - -// GetAll gets all invoices with conditions -func GetAll(data *GetAllParams) ([]xendit.Invoice, *xendit.Error) { - return GetAllWithContext(context.Background(), data) -} - -// GetAllWithContext gets all invoices with conditions -func GetAllWithContext(ctx context.Context, data *GetAllParams) ([]xendit.Invoice, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetAllWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/invoice/invoice_test.go b/invoice/invoice_test.go deleted file mode 100644 index 0af62990..00000000 --- a/invoice/invoice_test.go +++ /dev/null @@ -1,291 +0,0 @@ -package invoice_test - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/invoice" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.Invoice).ID = "123" - result.(*xendit.Invoice).ExternalID = "invoice-external-id" - result.(*xendit.Invoice).Amount = 200000 - result.(*xendit.Invoice).PayerEmail = "customer@customer.com" - result.(*xendit.Invoice).Description = "invoice test #1" - - return nil -} - -func TestCreate(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *invoice.CreateParams - expectedRes *xendit.Invoice - expectedErr *xendit.Error - }{ - { - desc: "should create an invoice", - data: &invoice.CreateParams{ - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - expectedRes: &xendit.Invoice{ - ID: "123", - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &invoice.CreateParams{ - // ExternalID: "invoice-external-id", - Amount: 200000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ExternalID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/v2/invoices", - xendit.Opt.SecretKey, - http.Header{}, - tC.data, - &xendit.Invoice{}, - ).Return(nil) - - resp, err := invoice.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGet(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *invoice.GetParams - expectedRes *xendit.Invoice - expectedErr *xendit.Error - }{ - { - desc: "should get an invoice", - data: &invoice.GetParams{ - ID: "123", - }, - expectedRes: &xendit.Invoice{ - ID: "123", - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &invoice.GetParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/invoices/123", - xendit.Opt.SecretKey, - http.Header{}, - nil, - &xendit.Invoice{}, - ).Return(nil) - - resp, err := invoice.Get(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestExpire(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *invoice.ExpireParams - expectedRes *xendit.Invoice - expectedErr *xendit.Error - }{ - { - desc: "should expire an invoice", - data: &invoice.ExpireParams{ - ID: "123", - }, - expectedRes: &xendit.Invoice{ - ID: "123", - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &invoice.ExpireParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/invoices/123/expire!", - xendit.Opt.SecretKey, - http.Header{}, - nil, - &xendit.Invoice{}, - ).Return(nil) - - resp, err := invoice.Expire(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetAllMock struct { - mock.Mock -} - -func (m *apiRequesterGetAllMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[{ - "id": "123", - "external_id": "invoice-external-id", - "amount": 200000, - "payer_email": "customer@customer.com", - "description": "invoice test #1" - }]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetAll(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetAllMock) - initTesting(apiRequesterMockObj) - - createdAfter, _ := time.Parse(time.RFC3339, "2016-02-24T23:48:36.697Z") - - testCases := []struct { - desc string - data *invoice.GetAllParams - expectedRes []xendit.Invoice - expectedErr *xendit.Error - }{ - { - desc: "should get a list of invoices", - data: &invoice.GetAllParams{}, - expectedRes: []xendit.Invoice{ - { - ID: "123", - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - }, - expectedErr: nil, - }, - { - desc: "should get a list of invoices", - data: &invoice.GetAllParams{ - Statuses: []string{"EXPIRED", "SETTLED"}, - Limit: 2, - CreatedAfter: createdAfter, - }, - expectedRes: []xendit.Invoice{ - { - ID: "123", - ExternalID: "invoice-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "invoice test #1", - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/invoices?"+tC.data.QueryString(), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.Invoice{}, - ).Return(nil) - - resp, err := invoice.GetAll(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/invoice/model_address_object.go b/invoice/model_address_object.go new file mode 100644 index 00000000..8695901f --- /dev/null +++ b/invoice/model_address_object.go @@ -0,0 +1,423 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the AddressObject type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &AddressObject{} + +// AddressObject An object representing an address with various properties. +type AddressObject struct { + // The country where the address is located. + Country NullableString `json:"country,omitempty"` + // The first line of the street address. + StreetLine1 NullableString `json:"street_line1,omitempty"` + // The second line of the street address. + StreetLine2 NullableString `json:"street_line2,omitempty"` + // The city or locality within the address. + City NullableString `json:"city,omitempty"` + // The province or region within the country. + Province NullableString `json:"province,omitempty"` + // The state or administrative division within the country. + State NullableString `json:"state,omitempty"` + // The postal code or ZIP code for the address. + PostalCode NullableString `json:"postal_code,omitempty"` +} + +// NewAddressObject instantiates a new AddressObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddressObject() *AddressObject { + this := AddressObject{} + return &this +} + +// NewAddressObjectWithDefaults instantiates a new AddressObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddressObjectWithDefaults() *AddressObject { + this := AddressObject{} + return &this +} + +// GetCountry returns the Country field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetCountry() string { + if o == nil || utils.IsNil(o.Country.Get()) { + var ret string + return ret + } + return *o.Country.Get() +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Country.Get(), o.Country.IsSet() +} + +// HasCountry returns a boolean if a field has been set. +func (o *AddressObject) HasCountry() bool { + if o != nil && o.Country.IsSet() { + return true + } + + return false +} + +// SetCountry gets a reference to the given NullableString and assigns it to the Country field. +func (o *AddressObject) SetCountry(v string) { + o.Country.Set(&v) +} +// SetCountryNil sets the value for Country to be an explicit nil +func (o *AddressObject) SetCountryNil() { + o.Country.Set(nil) +} + +// UnsetCountry ensures that no value is present for Country, not even an explicit nil +func (o *AddressObject) UnsetCountry() { + o.Country.Unset() +} + +// GetStreetLine1 returns the StreetLine1 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetStreetLine1() string { + if o == nil || utils.IsNil(o.StreetLine1.Get()) { + var ret string + return ret + } + return *o.StreetLine1.Get() +} + +// GetStreetLine1Ok returns a tuple with the StreetLine1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetStreetLine1Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.StreetLine1.Get(), o.StreetLine1.IsSet() +} + +// HasStreetLine1 returns a boolean if a field has been set. +func (o *AddressObject) HasStreetLine1() bool { + if o != nil && o.StreetLine1.IsSet() { + return true + } + + return false +} + +// SetStreetLine1 gets a reference to the given NullableString and assigns it to the StreetLine1 field. +func (o *AddressObject) SetStreetLine1(v string) { + o.StreetLine1.Set(&v) +} +// SetStreetLine1Nil sets the value for StreetLine1 to be an explicit nil +func (o *AddressObject) SetStreetLine1Nil() { + o.StreetLine1.Set(nil) +} + +// UnsetStreetLine1 ensures that no value is present for StreetLine1, not even an explicit nil +func (o *AddressObject) UnsetStreetLine1() { + o.StreetLine1.Unset() +} + +// GetStreetLine2 returns the StreetLine2 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetStreetLine2() string { + if o == nil || utils.IsNil(o.StreetLine2.Get()) { + var ret string + return ret + } + return *o.StreetLine2.Get() +} + +// GetStreetLine2Ok returns a tuple with the StreetLine2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetStreetLine2Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.StreetLine2.Get(), o.StreetLine2.IsSet() +} + +// HasStreetLine2 returns a boolean if a field has been set. +func (o *AddressObject) HasStreetLine2() bool { + if o != nil && o.StreetLine2.IsSet() { + return true + } + + return false +} + +// SetStreetLine2 gets a reference to the given NullableString and assigns it to the StreetLine2 field. +func (o *AddressObject) SetStreetLine2(v string) { + o.StreetLine2.Set(&v) +} +// SetStreetLine2Nil sets the value for StreetLine2 to be an explicit nil +func (o *AddressObject) SetStreetLine2Nil() { + o.StreetLine2.Set(nil) +} + +// UnsetStreetLine2 ensures that no value is present for StreetLine2, not even an explicit nil +func (o *AddressObject) UnsetStreetLine2() { + o.StreetLine2.Unset() +} + +// GetCity returns the City field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetCity() string { + if o == nil || utils.IsNil(o.City.Get()) { + var ret string + return ret + } + return *o.City.Get() +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.City.Get(), o.City.IsSet() +} + +// HasCity returns a boolean if a field has been set. +func (o *AddressObject) HasCity() bool { + if o != nil && o.City.IsSet() { + return true + } + + return false +} + +// SetCity gets a reference to the given NullableString and assigns it to the City field. +func (o *AddressObject) SetCity(v string) { + o.City.Set(&v) +} +// SetCityNil sets the value for City to be an explicit nil +func (o *AddressObject) SetCityNil() { + o.City.Set(nil) +} + +// UnsetCity ensures that no value is present for City, not even an explicit nil +func (o *AddressObject) UnsetCity() { + o.City.Unset() +} + +// GetProvince returns the Province field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetProvince() string { + if o == nil || utils.IsNil(o.Province.Get()) { + var ret string + return ret + } + return *o.Province.Get() +} + +// GetProvinceOk returns a tuple with the Province field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetProvinceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Province.Get(), o.Province.IsSet() +} + +// HasProvince returns a boolean if a field has been set. +func (o *AddressObject) HasProvince() bool { + if o != nil && o.Province.IsSet() { + return true + } + + return false +} + +// SetProvince gets a reference to the given NullableString and assigns it to the Province field. +func (o *AddressObject) SetProvince(v string) { + o.Province.Set(&v) +} +// SetProvinceNil sets the value for Province to be an explicit nil +func (o *AddressObject) SetProvinceNil() { + o.Province.Set(nil) +} + +// UnsetProvince ensures that no value is present for Province, not even an explicit nil +func (o *AddressObject) UnsetProvince() { + o.Province.Unset() +} + +// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetState() string { + if o == nil || utils.IsNil(o.State.Get()) { + var ret string + return ret + } + return *o.State.Get() +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.State.Get(), o.State.IsSet() +} + +// HasState returns a boolean if a field has been set. +func (o *AddressObject) HasState() bool { + if o != nil && o.State.IsSet() { + return true + } + + return false +} + +// SetState gets a reference to the given NullableString and assigns it to the State field. +func (o *AddressObject) SetState(v string) { + o.State.Set(&v) +} +// SetStateNil sets the value for State to be an explicit nil +func (o *AddressObject) SetStateNil() { + o.State.Set(nil) +} + +// UnsetState ensures that no value is present for State, not even an explicit nil +func (o *AddressObject) UnsetState() { + o.State.Unset() +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AddressObject) GetPostalCode() string { + if o == nil || utils.IsNil(o.PostalCode.Get()) { + var ret string + return ret + } + return *o.PostalCode.Get() +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AddressObject) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PostalCode.Get(), o.PostalCode.IsSet() +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *AddressObject) HasPostalCode() bool { + if o != nil && o.PostalCode.IsSet() { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given NullableString and assigns it to the PostalCode field. +func (o *AddressObject) SetPostalCode(v string) { + o.PostalCode.Set(&v) +} +// SetPostalCodeNil sets the value for PostalCode to be an explicit nil +func (o *AddressObject) SetPostalCodeNil() { + o.PostalCode.Set(nil) +} + +// UnsetPostalCode ensures that no value is present for PostalCode, not even an explicit nil +func (o *AddressObject) UnsetPostalCode() { + o.PostalCode.Unset() +} + +func (o AddressObject) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddressObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Country.IsSet() { + toSerialize["country"] = o.Country.Get() + } + if o.StreetLine1.IsSet() { + toSerialize["street_line1"] = o.StreetLine1.Get() + } + if o.StreetLine2.IsSet() { + toSerialize["street_line2"] = o.StreetLine2.Get() + } + if o.City.IsSet() { + toSerialize["city"] = o.City.Get() + } + if o.Province.IsSet() { + toSerialize["province"] = o.Province.Get() + } + if o.State.IsSet() { + toSerialize["state"] = o.State.Get() + } + if o.PostalCode.IsSet() { + toSerialize["postal_code"] = o.PostalCode.Get() + } + return toSerialize, nil +} + +type NullableAddressObject struct { + value *AddressObject + isSet bool +} + +func (v NullableAddressObject) Get() *AddressObject { + return v.value +} + +func (v *NullableAddressObject) Set(val *AddressObject) { + v.value = val + v.isSet = true +} + +func (v NullableAddressObject) IsSet() bool { + return v.isSet +} + +func (v *NullableAddressObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddressObject(val *AddressObject) *NullableAddressObject { + return &NullableAddressObject{value: val, isSet: true} +} + +func (v NullableAddressObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddressObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_alternative_display_item.go b/invoice/model_alternative_display_item.go new file mode 100644 index 00000000..119b7bb4 --- /dev/null +++ b/invoice/model_alternative_display_item.go @@ -0,0 +1,168 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the AlternativeDisplayItem type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &AlternativeDisplayItem{} + +// AlternativeDisplayItem An object representing alternative display of a VA. +type AlternativeDisplayItem struct { + // Represent type of alternative display. + Type *string `json:"type,omitempty"` + // Represent value of alternative display value. + Value *string `json:"value,omitempty"` +} + +// NewAlternativeDisplayItem instantiates a new AlternativeDisplayItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlternativeDisplayItem() *AlternativeDisplayItem { + this := AlternativeDisplayItem{} + return &this +} + +// NewAlternativeDisplayItemWithDefaults instantiates a new AlternativeDisplayItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlternativeDisplayItemWithDefaults() *AlternativeDisplayItem { + this := AlternativeDisplayItem{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *AlternativeDisplayItem) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlternativeDisplayItem) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *AlternativeDisplayItem) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *AlternativeDisplayItem) SetType(v string) { + o.Type = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *AlternativeDisplayItem) GetValue() string { + if o == nil || utils.IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AlternativeDisplayItem) GetValueOk() (*string, bool) { + if o == nil || utils.IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *AlternativeDisplayItem) HasValue() bool { + if o != nil && !utils.IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *AlternativeDisplayItem) SetValue(v string) { + o.Value = &v +} + +func (o AlternativeDisplayItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AlternativeDisplayItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableAlternativeDisplayItem struct { + value *AlternativeDisplayItem + isSet bool +} + +func (v NullableAlternativeDisplayItem) Get() *AlternativeDisplayItem { + return v.value +} + +func (v *NullableAlternativeDisplayItem) Set(val *AlternativeDisplayItem) { + v.value = val + v.isSet = true +} + +func (v NullableAlternativeDisplayItem) IsSet() bool { + return v.isSet +} + +func (v *NullableAlternativeDisplayItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlternativeDisplayItem(val *AlternativeDisplayItem) *NullableAlternativeDisplayItem { + return &NullableAlternativeDisplayItem{value: val, isSet: true} +} + +func (v NullableAlternativeDisplayItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlternativeDisplayItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_bad_request_error.go b/invoice/model_bad_request_error.go new file mode 100644 index 00000000..efa8efb0 --- /dev/null +++ b/invoice/model_bad_request_error.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the BadRequestError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &BadRequestError{} + +// BadRequestError Response definition for a 400 Bad Request error when creating an invoice. +type BadRequestError struct { + // The error code indicating the type of error that occurred. + ErrorCode string `json:"error_code"` + // A human-readable error message that provides additional information about the error. + Message string `json:"message"` +} + +// NewBadRequestError instantiates a new BadRequestError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBadRequestError(errorCode string, message string) *BadRequestError { + this := BadRequestError{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewBadRequestErrorWithDefaults instantiates a new BadRequestError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBadRequestErrorWithDefaults() *BadRequestError { + this := BadRequestError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *BadRequestError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *BadRequestError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *BadRequestError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *BadRequestError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *BadRequestError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *BadRequestError) SetMessage(v string) { + o.Message = v +} + +func (o BadRequestError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BadRequestError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableBadRequestError struct { + value *BadRequestError + isSet bool +} + +func (v NullableBadRequestError) Get() *BadRequestError { + return v.value +} + +func (v *NullableBadRequestError) Set(val *BadRequestError) { + v.value = val + v.isSet = true +} + +func (v NullableBadRequestError) IsSet() bool { + return v.isSet +} + +func (v *NullableBadRequestError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBadRequestError(val *BadRequestError) *NullableBadRequestError { + return &NullableBadRequestError{value: val, isSet: true} +} + +func (v NullableBadRequestError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBadRequestError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_bank.go b/invoice/model_bank.go new file mode 100644 index 00000000..5dc16f91 --- /dev/null +++ b/invoice/model_bank.go @@ -0,0 +1,324 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Bank type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Bank{} + +// Bank An object representing bank details for invoices. +type Bank struct { + BankCode BankCode `json:"bank_code"` + // The collection type for the bank details. + CollectionType string `json:"collection_type"` + // The branch of the bank. + BankBranch *string `json:"bank_branch,omitempty"` + // The bank account number. + BankAccountNumber *string `json:"bank_account_number,omitempty"` + // The name of the account holder. + AccountHolderName string `json:"account_holder_name"` + // The transfer amount. + TransferAmount *float32 `json:"transfer_amount,omitempty"` + AlternativeDisplays []AlternativeDisplayItem `json:"alternative_displays,omitempty"` +} + +// NewBank instantiates a new Bank object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBank(bankCode BankCode, collectionType string, accountHolderName string) *Bank { + this := Bank{} + this.BankCode = bankCode + this.CollectionType = collectionType + this.AccountHolderName = accountHolderName + return &this +} + +// NewBankWithDefaults instantiates a new Bank object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBankWithDefaults() *Bank { + this := Bank{} + return &this +} + +// GetBankCode returns the BankCode field value +func (o *Bank) GetBankCode() BankCode { + if o == nil { + var ret BankCode + return ret + } + + return o.BankCode +} + +// GetBankCodeOk returns a tuple with the BankCode field value +// and a boolean to check if the value has been set. +func (o *Bank) GetBankCodeOk() (*BankCode, bool) { + if o == nil { + return nil, false + } + return &o.BankCode, true +} + +// SetBankCode sets field value +func (o *Bank) SetBankCode(v BankCode) { + o.BankCode = v +} + +// GetCollectionType returns the CollectionType field value +func (o *Bank) GetCollectionType() string { + if o == nil { + var ret string + return ret + } + + return o.CollectionType +} + +// GetCollectionTypeOk returns a tuple with the CollectionType field value +// and a boolean to check if the value has been set. +func (o *Bank) GetCollectionTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollectionType, true +} + +// SetCollectionType sets field value +func (o *Bank) SetCollectionType(v string) { + o.CollectionType = v +} + +// GetBankBranch returns the BankBranch field value if set, zero value otherwise. +func (o *Bank) GetBankBranch() string { + if o == nil || utils.IsNil(o.BankBranch) { + var ret string + return ret + } + return *o.BankBranch +} + +// GetBankBranchOk returns a tuple with the BankBranch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Bank) GetBankBranchOk() (*string, bool) { + if o == nil || utils.IsNil(o.BankBranch) { + return nil, false + } + return o.BankBranch, true +} + +// HasBankBranch returns a boolean if a field has been set. +func (o *Bank) HasBankBranch() bool { + if o != nil && !utils.IsNil(o.BankBranch) { + return true + } + + return false +} + +// SetBankBranch gets a reference to the given string and assigns it to the BankBranch field. +func (o *Bank) SetBankBranch(v string) { + o.BankBranch = &v +} + +// GetBankAccountNumber returns the BankAccountNumber field value if set, zero value otherwise. +func (o *Bank) GetBankAccountNumber() string { + if o == nil || utils.IsNil(o.BankAccountNumber) { + var ret string + return ret + } + return *o.BankAccountNumber +} + +// GetBankAccountNumberOk returns a tuple with the BankAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Bank) GetBankAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.BankAccountNumber) { + return nil, false + } + return o.BankAccountNumber, true +} + +// HasBankAccountNumber returns a boolean if a field has been set. +func (o *Bank) HasBankAccountNumber() bool { + if o != nil && !utils.IsNil(o.BankAccountNumber) { + return true + } + + return false +} + +// SetBankAccountNumber gets a reference to the given string and assigns it to the BankAccountNumber field. +func (o *Bank) SetBankAccountNumber(v string) { + o.BankAccountNumber = &v +} + +// GetAccountHolderName returns the AccountHolderName field value +func (o *Bank) GetAccountHolderName() string { + if o == nil { + var ret string + return ret + } + + return o.AccountHolderName +} + +// GetAccountHolderNameOk returns a tuple with the AccountHolderName field value +// and a boolean to check if the value has been set. +func (o *Bank) GetAccountHolderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountHolderName, true +} + +// SetAccountHolderName sets field value +func (o *Bank) SetAccountHolderName(v string) { + o.AccountHolderName = v +} + +// GetTransferAmount returns the TransferAmount field value if set, zero value otherwise. +func (o *Bank) GetTransferAmount() float32 { + if o == nil || utils.IsNil(o.TransferAmount) { + var ret float32 + return ret + } + return *o.TransferAmount +} + +// GetTransferAmountOk returns a tuple with the TransferAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Bank) GetTransferAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.TransferAmount) { + return nil, false + } + return o.TransferAmount, true +} + +// HasTransferAmount returns a boolean if a field has been set. +func (o *Bank) HasTransferAmount() bool { + if o != nil && !utils.IsNil(o.TransferAmount) { + return true + } + + return false +} + +// SetTransferAmount gets a reference to the given float32 and assigns it to the TransferAmount field. +func (o *Bank) SetTransferAmount(v float32) { + o.TransferAmount = &v +} + +// GetAlternativeDisplays returns the AlternativeDisplays field value if set, zero value otherwise. +func (o *Bank) GetAlternativeDisplays() []AlternativeDisplayItem { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + var ret []AlternativeDisplayItem + return ret + } + return o.AlternativeDisplays +} + +// GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Bank) GetAlternativeDisplaysOk() ([]AlternativeDisplayItem, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + return nil, false + } + return o.AlternativeDisplays, true +} + +// HasAlternativeDisplays returns a boolean if a field has been set. +func (o *Bank) HasAlternativeDisplays() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplays) { + return true + } + + return false +} + +// SetAlternativeDisplays gets a reference to the given []AlternativeDisplayItem and assigns it to the AlternativeDisplays field. +func (o *Bank) SetAlternativeDisplays(v []AlternativeDisplayItem) { + o.AlternativeDisplays = v +} + +func (o Bank) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Bank) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bank_code"] = o.BankCode + toSerialize["collection_type"] = o.CollectionType + if !utils.IsNil(o.BankBranch) { + toSerialize["bank_branch"] = o.BankBranch + } + if !utils.IsNil(o.BankAccountNumber) { + toSerialize["bank_account_number"] = o.BankAccountNumber + } + toSerialize["account_holder_name"] = o.AccountHolderName + if !utils.IsNil(o.TransferAmount) { + toSerialize["transfer_amount"] = o.TransferAmount + } + if !utils.IsNil(o.AlternativeDisplays) { + toSerialize["alternative_displays"] = o.AlternativeDisplays + } + return toSerialize, nil +} + +type NullableBank struct { + value *Bank + isSet bool +} + +func (v NullableBank) Get() *Bank { + return v.value +} + +func (v *NullableBank) Set(val *Bank) { + v.value = val + v.isSet = true +} + +func (v NullableBank) IsSet() bool { + return v.isSet +} + +func (v *NullableBank) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBank(val *Bank) *NullableBank { + return &NullableBank{value: val, isSet: true} +} + +func (v NullableBank) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBank) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_bank_code.go b/invoice/model_bank_code.go new file mode 100644 index 00000000..1b29e193 --- /dev/null +++ b/invoice/model_bank_code.go @@ -0,0 +1,125 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// BankCode Representing the available bank channels used for invoice-related transactions. +type BankCode string + +// List of BankCode +const ( + BANKCODE_BCA BankCode = "BCA" + BANKCODE_BNI BankCode = "BNI" + BANKCODE_BRI BankCode = "BRI" + BANKCODE_MANDIRI BankCode = "MANDIRI" + BANKCODE_PERMATA BankCode = "PERMATA" + BANKCODE_BSI BankCode = "BSI" + BANKCODE_BJB BankCode = "BJB" +) + +// All allowed values of BankCode enum +var AllowedBankCodeEnumValues = []BankCode{ + "BCA", + "BNI", + "BRI", + "MANDIRI", + "PERMATA", + "BSI", + "BJB", +} + +func (v *BankCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BankCode(value) + for _, existing := range AllowedBankCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BankCode", value) +} + +// NewBankCodeFromValue returns a pointer to a valid BankCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBankCodeFromValue(v string) (*BankCode, error) { + ev := BankCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BankCode: valid values are %v", v, AllowedBankCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BankCode) IsValid() bool { + for _, existing := range AllowedBankCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v BankCode) String() string { + return string(v) +} + +// Ptr returns reference to BankCode value +func (v BankCode) Ptr() *BankCode { + return &v +} + +type NullableBankCode struct { + value *BankCode + isSet bool +} + +func (v NullableBankCode) Get() *BankCode { + return v.value +} + +func (v *NullableBankCode) Set(val *BankCode) { + v.value = val + v.isSet = true +} + +func (v NullableBankCode) IsSet() bool { + return v.isSet +} + +func (v *NullableBankCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBankCode(val *BankCode) *NullableBankCode { + return &NullableBankCode{value: val, isSet: true} +} + +func (v NullableBankCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBankCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_create_invoice_request.go b/invoice/model_create_invoice_request.go new file mode 100644 index 00000000..81275753 --- /dev/null +++ b/invoice/model_create_invoice_request.go @@ -0,0 +1,814 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateInvoiceRequest type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateInvoiceRequest{} + +// CreateInvoiceRequest An object representing for an invoice creation request. +type CreateInvoiceRequest struct { + // The external ID of the invoice. + ExternalId string `json:"external_id"` + // The invoice amount. + Amount float32 `json:"amount"` + // The email address of the payer. + PayerEmail *string `json:"payer_email,omitempty"` + // A description of the payment. + Description *string `json:"description,omitempty"` + // The duration of the invoice. + InvoiceDuration *string `json:"invoice_duration,omitempty"` + // The ID of the callback virtual account. + CallbackVirtualAccountId *string `json:"callback_virtual_account_id,omitempty"` + // Indicates whether email notifications should be sent. + ShouldSendEmail *bool `json:"should_send_email,omitempty"` + Customer *CustomerObject `json:"customer,omitempty"` + CustomerNotificationPreference *NotificationPreference `json:"customer_notification_preference,omitempty"` + // The URL to redirect to on successful payment. + SuccessRedirectUrl *string `json:"success_redirect_url,omitempty"` + // The URL to redirect to on payment failure. + FailureRedirectUrl *string `json:"failure_redirect_url,omitempty"` + // An array of available payment methods. + PaymentMethods []string `json:"payment_methods,omitempty"` + // The middle label. + MidLabel *string `json:"mid_label,omitempty"` + // Indicates whether credit card authentication is required. + ShouldAuthenticateCreditCard *bool `json:"should_authenticate_credit_card,omitempty"` + // The currency of the invoice. + Currency *string `json:"currency,omitempty"` + // The reminder time. + ReminderTime *float32 `json:"reminder_time,omitempty"` + // The local. + Local *string `json:"local,omitempty"` + // The unit of the reminder time. + ReminderTimeUnit *string `json:"reminder_time_unit,omitempty"` + // An array of items included in the invoice. + Items []InvoiceItem `json:"items,omitempty"` + // An array of fees associated with the invoice. + Fees []InvoiceFee `json:"fees,omitempty"` +} + +// NewCreateInvoiceRequest instantiates a new CreateInvoiceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInvoiceRequest(externalId string, amount float32) *CreateInvoiceRequest { + this := CreateInvoiceRequest{} + this.ExternalId = externalId + this.Amount = amount + return &this +} + +// NewCreateInvoiceRequestWithDefaults instantiates a new CreateInvoiceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInvoiceRequestWithDefaults() *CreateInvoiceRequest { + this := CreateInvoiceRequest{} + return &this +} + +// GetExternalId returns the ExternalId field value +func (o *CreateInvoiceRequest) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *CreateInvoiceRequest) SetExternalId(v string) { + o.ExternalId = v +} + +// GetAmount returns the Amount field value +func (o *CreateInvoiceRequest) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *CreateInvoiceRequest) SetAmount(v float32) { + o.Amount = v +} + +// GetPayerEmail returns the PayerEmail field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetPayerEmail() string { + if o == nil || utils.IsNil(o.PayerEmail) { + var ret string + return ret + } + return *o.PayerEmail +} + +// GetPayerEmailOk returns a tuple with the PayerEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetPayerEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.PayerEmail) { + return nil, false + } + return o.PayerEmail, true +} + +// HasPayerEmail returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasPayerEmail() bool { + if o != nil && !utils.IsNil(o.PayerEmail) { + return true + } + + return false +} + +// SetPayerEmail gets a reference to the given string and assigns it to the PayerEmail field. +func (o *CreateInvoiceRequest) SetPayerEmail(v string) { + o.PayerEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateInvoiceRequest) SetDescription(v string) { + o.Description = &v +} + +// GetInvoiceDuration returns the InvoiceDuration field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetInvoiceDuration() string { + if o == nil || utils.IsNil(o.InvoiceDuration) { + var ret string + return ret + } + return *o.InvoiceDuration +} + +// GetInvoiceDurationOk returns a tuple with the InvoiceDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetInvoiceDurationOk() (*string, bool) { + if o == nil || utils.IsNil(o.InvoiceDuration) { + return nil, false + } + return o.InvoiceDuration, true +} + +// HasInvoiceDuration returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasInvoiceDuration() bool { + if o != nil && !utils.IsNil(o.InvoiceDuration) { + return true + } + + return false +} + +// SetInvoiceDuration gets a reference to the given string and assigns it to the InvoiceDuration field. +func (o *CreateInvoiceRequest) SetInvoiceDuration(v string) { + o.InvoiceDuration = &v +} + +// GetCallbackVirtualAccountId returns the CallbackVirtualAccountId field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetCallbackVirtualAccountId() string { + if o == nil || utils.IsNil(o.CallbackVirtualAccountId) { + var ret string + return ret + } + return *o.CallbackVirtualAccountId +} + +// GetCallbackVirtualAccountIdOk returns a tuple with the CallbackVirtualAccountId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetCallbackVirtualAccountIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.CallbackVirtualAccountId) { + return nil, false + } + return o.CallbackVirtualAccountId, true +} + +// HasCallbackVirtualAccountId returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasCallbackVirtualAccountId() bool { + if o != nil && !utils.IsNil(o.CallbackVirtualAccountId) { + return true + } + + return false +} + +// SetCallbackVirtualAccountId gets a reference to the given string and assigns it to the CallbackVirtualAccountId field. +func (o *CreateInvoiceRequest) SetCallbackVirtualAccountId(v string) { + o.CallbackVirtualAccountId = &v +} + +// GetShouldSendEmail returns the ShouldSendEmail field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetShouldSendEmail() bool { + if o == nil || utils.IsNil(o.ShouldSendEmail) { + var ret bool + return ret + } + return *o.ShouldSendEmail +} + +// GetShouldSendEmailOk returns a tuple with the ShouldSendEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetShouldSendEmailOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldSendEmail) { + return nil, false + } + return o.ShouldSendEmail, true +} + +// HasShouldSendEmail returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasShouldSendEmail() bool { + if o != nil && !utils.IsNil(o.ShouldSendEmail) { + return true + } + + return false +} + +// SetShouldSendEmail gets a reference to the given bool and assigns it to the ShouldSendEmail field. +func (o *CreateInvoiceRequest) SetShouldSendEmail(v bool) { + o.ShouldSendEmail = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetCustomer() CustomerObject { + if o == nil || utils.IsNil(o.Customer) { + var ret CustomerObject + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetCustomerOk() (*CustomerObject, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given CustomerObject and assigns it to the Customer field. +func (o *CreateInvoiceRequest) SetCustomer(v CustomerObject) { + o.Customer = &v +} + +// GetCustomerNotificationPreference returns the CustomerNotificationPreference field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetCustomerNotificationPreference() NotificationPreference { + if o == nil || utils.IsNil(o.CustomerNotificationPreference) { + var ret NotificationPreference + return ret + } + return *o.CustomerNotificationPreference +} + +// GetCustomerNotificationPreferenceOk returns a tuple with the CustomerNotificationPreference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetCustomerNotificationPreferenceOk() (*NotificationPreference, bool) { + if o == nil || utils.IsNil(o.CustomerNotificationPreference) { + return nil, false + } + return o.CustomerNotificationPreference, true +} + +// HasCustomerNotificationPreference returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasCustomerNotificationPreference() bool { + if o != nil && !utils.IsNil(o.CustomerNotificationPreference) { + return true + } + + return false +} + +// SetCustomerNotificationPreference gets a reference to the given NotificationPreference and assigns it to the CustomerNotificationPreference field. +func (o *CreateInvoiceRequest) SetCustomerNotificationPreference(v NotificationPreference) { + o.CustomerNotificationPreference = &v +} + +// GetSuccessRedirectUrl returns the SuccessRedirectUrl field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetSuccessRedirectUrl() string { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + var ret string + return ret + } + return *o.SuccessRedirectUrl +} + +// GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetSuccessRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + return nil, false + } + return o.SuccessRedirectUrl, true +} + +// HasSuccessRedirectUrl returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasSuccessRedirectUrl() bool { + if o != nil && !utils.IsNil(o.SuccessRedirectUrl) { + return true + } + + return false +} + +// SetSuccessRedirectUrl gets a reference to the given string and assigns it to the SuccessRedirectUrl field. +func (o *CreateInvoiceRequest) SetSuccessRedirectUrl(v string) { + o.SuccessRedirectUrl = &v +} + +// GetFailureRedirectUrl returns the FailureRedirectUrl field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetFailureRedirectUrl() string { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + var ret string + return ret + } + return *o.FailureRedirectUrl +} + +// GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetFailureRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + return nil, false + } + return o.FailureRedirectUrl, true +} + +// HasFailureRedirectUrl returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasFailureRedirectUrl() bool { + if o != nil && !utils.IsNil(o.FailureRedirectUrl) { + return true + } + + return false +} + +// SetFailureRedirectUrl gets a reference to the given string and assigns it to the FailureRedirectUrl field. +func (o *CreateInvoiceRequest) SetFailureRedirectUrl(v string) { + o.FailureRedirectUrl = &v +} + +// GetPaymentMethods returns the PaymentMethods field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetPaymentMethods() []string { + if o == nil || utils.IsNil(o.PaymentMethods) { + var ret []string + return ret + } + return o.PaymentMethods +} + +// GetPaymentMethodsOk returns a tuple with the PaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetPaymentMethodsOk() ([]string, bool) { + if o == nil || utils.IsNil(o.PaymentMethods) { + return nil, false + } + return o.PaymentMethods, true +} + +// HasPaymentMethods returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasPaymentMethods() bool { + if o != nil && !utils.IsNil(o.PaymentMethods) { + return true + } + + return false +} + +// SetPaymentMethods gets a reference to the given []string and assigns it to the PaymentMethods field. +func (o *CreateInvoiceRequest) SetPaymentMethods(v []string) { + o.PaymentMethods = v +} + +// GetMidLabel returns the MidLabel field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetMidLabel() string { + if o == nil || utils.IsNil(o.MidLabel) { + var ret string + return ret + } + return *o.MidLabel +} + +// GetMidLabelOk returns a tuple with the MidLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetMidLabelOk() (*string, bool) { + if o == nil || utils.IsNil(o.MidLabel) { + return nil, false + } + return o.MidLabel, true +} + +// HasMidLabel returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasMidLabel() bool { + if o != nil && !utils.IsNil(o.MidLabel) { + return true + } + + return false +} + +// SetMidLabel gets a reference to the given string and assigns it to the MidLabel field. +func (o *CreateInvoiceRequest) SetMidLabel(v string) { + o.MidLabel = &v +} + +// GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetShouldAuthenticateCreditCard() bool { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + var ret bool + return ret + } + return *o.ShouldAuthenticateCreditCard +} + +// GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetShouldAuthenticateCreditCardOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + return nil, false + } + return o.ShouldAuthenticateCreditCard, true +} + +// HasShouldAuthenticateCreditCard returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasShouldAuthenticateCreditCard() bool { + if o != nil && !utils.IsNil(o.ShouldAuthenticateCreditCard) { + return true + } + + return false +} + +// SetShouldAuthenticateCreditCard gets a reference to the given bool and assigns it to the ShouldAuthenticateCreditCard field. +func (o *CreateInvoiceRequest) SetShouldAuthenticateCreditCard(v bool) { + o.ShouldAuthenticateCreditCard = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *CreateInvoiceRequest) SetCurrency(v string) { + o.Currency = &v +} + +// GetReminderTime returns the ReminderTime field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetReminderTime() float32 { + if o == nil || utils.IsNil(o.ReminderTime) { + var ret float32 + return ret + } + return *o.ReminderTime +} + +// GetReminderTimeOk returns a tuple with the ReminderTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetReminderTimeOk() (*float32, bool) { + if o == nil || utils.IsNil(o.ReminderTime) { + return nil, false + } + return o.ReminderTime, true +} + +// HasReminderTime returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasReminderTime() bool { + if o != nil && !utils.IsNil(o.ReminderTime) { + return true + } + + return false +} + +// SetReminderTime gets a reference to the given float32 and assigns it to the ReminderTime field. +func (o *CreateInvoiceRequest) SetReminderTime(v float32) { + o.ReminderTime = &v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetLocal() string { + if o == nil || utils.IsNil(o.Local) { + var ret string + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetLocalOk() (*string, bool) { + if o == nil || utils.IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasLocal() bool { + if o != nil && !utils.IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given string and assigns it to the Local field. +func (o *CreateInvoiceRequest) SetLocal(v string) { + o.Local = &v +} + +// GetReminderTimeUnit returns the ReminderTimeUnit field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetReminderTimeUnit() string { + if o == nil || utils.IsNil(o.ReminderTimeUnit) { + var ret string + return ret + } + return *o.ReminderTimeUnit +} + +// GetReminderTimeUnitOk returns a tuple with the ReminderTimeUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetReminderTimeUnitOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReminderTimeUnit) { + return nil, false + } + return o.ReminderTimeUnit, true +} + +// HasReminderTimeUnit returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasReminderTimeUnit() bool { + if o != nil && !utils.IsNil(o.ReminderTimeUnit) { + return true + } + + return false +} + +// SetReminderTimeUnit gets a reference to the given string and assigns it to the ReminderTimeUnit field. +func (o *CreateInvoiceRequest) SetReminderTimeUnit(v string) { + o.ReminderTimeUnit = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetItems() []InvoiceItem { + if o == nil || utils.IsNil(o.Items) { + var ret []InvoiceItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetItemsOk() ([]InvoiceItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasItems() bool { + if o != nil && !utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InvoiceItem and assigns it to the Items field. +func (o *CreateInvoiceRequest) SetItems(v []InvoiceItem) { + o.Items = v +} + +// GetFees returns the Fees field value if set, zero value otherwise. +func (o *CreateInvoiceRequest) GetFees() []InvoiceFee { + if o == nil || utils.IsNil(o.Fees) { + var ret []InvoiceFee + return ret + } + return o.Fees +} + +// GetFeesOk returns a tuple with the Fees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInvoiceRequest) GetFeesOk() ([]InvoiceFee, bool) { + if o == nil || utils.IsNil(o.Fees) { + return nil, false + } + return o.Fees, true +} + +// HasFees returns a boolean if a field has been set. +func (o *CreateInvoiceRequest) HasFees() bool { + if o != nil && !utils.IsNil(o.Fees) { + return true + } + + return false +} + +// SetFees gets a reference to the given []InvoiceFee and assigns it to the Fees field. +func (o *CreateInvoiceRequest) SetFees(v []InvoiceFee) { + o.Fees = v +} + +func (o CreateInvoiceRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInvoiceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["external_id"] = o.ExternalId + toSerialize["amount"] = o.Amount + if !utils.IsNil(o.PayerEmail) { + toSerialize["payer_email"] = o.PayerEmail + } + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !utils.IsNil(o.InvoiceDuration) { + toSerialize["invoice_duration"] = o.InvoiceDuration + } + if !utils.IsNil(o.CallbackVirtualAccountId) { + toSerialize["callback_virtual_account_id"] = o.CallbackVirtualAccountId + } + if !utils.IsNil(o.ShouldSendEmail) { + toSerialize["should_send_email"] = o.ShouldSendEmail + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.CustomerNotificationPreference) { + toSerialize["customer_notification_preference"] = o.CustomerNotificationPreference + } + if !utils.IsNil(o.SuccessRedirectUrl) { + toSerialize["success_redirect_url"] = o.SuccessRedirectUrl + } + if !utils.IsNil(o.FailureRedirectUrl) { + toSerialize["failure_redirect_url"] = o.FailureRedirectUrl + } + if !utils.IsNil(o.PaymentMethods) { + toSerialize["payment_methods"] = o.PaymentMethods + } + if !utils.IsNil(o.MidLabel) { + toSerialize["mid_label"] = o.MidLabel + } + if !utils.IsNil(o.ShouldAuthenticateCreditCard) { + toSerialize["should_authenticate_credit_card"] = o.ShouldAuthenticateCreditCard + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.ReminderTime) { + toSerialize["reminder_time"] = o.ReminderTime + } + if !utils.IsNil(o.Local) { + toSerialize["local"] = o.Local + } + if !utils.IsNil(o.ReminderTimeUnit) { + toSerialize["reminder_time_unit"] = o.ReminderTimeUnit + } + if !utils.IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !utils.IsNil(o.Fees) { + toSerialize["fees"] = o.Fees + } + return toSerialize, nil +} + +type NullableCreateInvoiceRequest struct { + value *CreateInvoiceRequest + isSet bool +} + +func (v NullableCreateInvoiceRequest) Get() *CreateInvoiceRequest { + return v.value +} + +func (v *NullableCreateInvoiceRequest) Set(val *CreateInvoiceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInvoiceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInvoiceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInvoiceRequest(val *CreateInvoiceRequest) *NullableCreateInvoiceRequest { + return &NullableCreateInvoiceRequest{value: val, isSet: true} +} + +func (v NullableCreateInvoiceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInvoiceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_customer_object.go b/invoice/model_customer_object.go new file mode 100644 index 00000000..5fd175a9 --- /dev/null +++ b/invoice/model_customer_object.go @@ -0,0 +1,461 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CustomerObject type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CustomerObject{} + +// CustomerObject An object representing a customer with various properties, including addresses. +type CustomerObject struct { + // The unique identifier for the customer. + Id NullableString `json:"id,omitempty"` + // The customer's phone number. + PhoneNumber NullableString `json:"phone_number,omitempty"` + // The customer's given names or first names. + GivenNames NullableString `json:"given_names,omitempty"` + // The customer's surname or last name. + Surname NullableString `json:"surname,omitempty"` + // The customer's email address. + Email NullableString `json:"email,omitempty"` + // The customer's mobile phone number. + MobileNumber NullableString `json:"mobile_number,omitempty"` + // An additional identifier for the customer. + CustomerId NullableString `json:"customer_id,omitempty"` + // An array of addresses associated with the customer. + Addresses []AddressObject `json:"addresses,omitempty"` +} + +// NewCustomerObject instantiates a new CustomerObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomerObject() *CustomerObject { + this := CustomerObject{} + return &this +} + +// NewCustomerObjectWithDefaults instantiates a new CustomerObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomerObjectWithDefaults() *CustomerObject { + this := CustomerObject{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetId() string { + if o == nil || utils.IsNil(o.Id.Get()) { + var ret string + return ret + } + return *o.Id.Get() +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id.Get(), o.Id.IsSet() +} + +// HasId returns a boolean if a field has been set. +func (o *CustomerObject) HasId() bool { + if o != nil && o.Id.IsSet() { + return true + } + + return false +} + +// SetId gets a reference to the given NullableString and assigns it to the Id field. +func (o *CustomerObject) SetId(v string) { + o.Id.Set(&v) +} +// SetIdNil sets the value for Id to be an explicit nil +func (o *CustomerObject) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil +func (o *CustomerObject) UnsetId() { + o.Id.Unset() +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetPhoneNumber() string { + if o == nil || utils.IsNil(o.PhoneNumber.Get()) { + var ret string + return ret + } + return *o.PhoneNumber.Get() +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetPhoneNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PhoneNumber.Get(), o.PhoneNumber.IsSet() +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *CustomerObject) HasPhoneNumber() bool { + if o != nil && o.PhoneNumber.IsSet() { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given NullableString and assigns it to the PhoneNumber field. +func (o *CustomerObject) SetPhoneNumber(v string) { + o.PhoneNumber.Set(&v) +} +// SetPhoneNumberNil sets the value for PhoneNumber to be an explicit nil +func (o *CustomerObject) SetPhoneNumberNil() { + o.PhoneNumber.Set(nil) +} + +// UnsetPhoneNumber ensures that no value is present for PhoneNumber, not even an explicit nil +func (o *CustomerObject) UnsetPhoneNumber() { + o.PhoneNumber.Unset() +} + +// GetGivenNames returns the GivenNames field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetGivenNames() string { + if o == nil || utils.IsNil(o.GivenNames.Get()) { + var ret string + return ret + } + return *o.GivenNames.Get() +} + +// GetGivenNamesOk returns a tuple with the GivenNames field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetGivenNamesOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.GivenNames.Get(), o.GivenNames.IsSet() +} + +// HasGivenNames returns a boolean if a field has been set. +func (o *CustomerObject) HasGivenNames() bool { + if o != nil && o.GivenNames.IsSet() { + return true + } + + return false +} + +// SetGivenNames gets a reference to the given NullableString and assigns it to the GivenNames field. +func (o *CustomerObject) SetGivenNames(v string) { + o.GivenNames.Set(&v) +} +// SetGivenNamesNil sets the value for GivenNames to be an explicit nil +func (o *CustomerObject) SetGivenNamesNil() { + o.GivenNames.Set(nil) +} + +// UnsetGivenNames ensures that no value is present for GivenNames, not even an explicit nil +func (o *CustomerObject) UnsetGivenNames() { + o.GivenNames.Unset() +} + +// GetSurname returns the Surname field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetSurname() string { + if o == nil || utils.IsNil(o.Surname.Get()) { + var ret string + return ret + } + return *o.Surname.Get() +} + +// GetSurnameOk returns a tuple with the Surname field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetSurnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Surname.Get(), o.Surname.IsSet() +} + +// HasSurname returns a boolean if a field has been set. +func (o *CustomerObject) HasSurname() bool { + if o != nil && o.Surname.IsSet() { + return true + } + + return false +} + +// SetSurname gets a reference to the given NullableString and assigns it to the Surname field. +func (o *CustomerObject) SetSurname(v string) { + o.Surname.Set(&v) +} +// SetSurnameNil sets the value for Surname to be an explicit nil +func (o *CustomerObject) SetSurnameNil() { + o.Surname.Set(nil) +} + +// UnsetSurname ensures that no value is present for Surname, not even an explicit nil +func (o *CustomerObject) UnsetSurname() { + o.Surname.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetEmail() string { + if o == nil || utils.IsNil(o.Email.Get()) { + var ret string + return ret + } + return *o.Email.Get() +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Email.Get(), o.Email.IsSet() +} + +// HasEmail returns a boolean if a field has been set. +func (o *CustomerObject) HasEmail() bool { + if o != nil && o.Email.IsSet() { + return true + } + + return false +} + +// SetEmail gets a reference to the given NullableString and assigns it to the Email field. +func (o *CustomerObject) SetEmail(v string) { + o.Email.Set(&v) +} +// SetEmailNil sets the value for Email to be an explicit nil +func (o *CustomerObject) SetEmailNil() { + o.Email.Set(nil) +} + +// UnsetEmail ensures that no value is present for Email, not even an explicit nil +func (o *CustomerObject) UnsetEmail() { + o.Email.Unset() +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber.Get()) { + var ret string + return ret + } + return *o.MobileNumber.Get() +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetMobileNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MobileNumber.Get(), o.MobileNumber.IsSet() +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *CustomerObject) HasMobileNumber() bool { + if o != nil && o.MobileNumber.IsSet() { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given NullableString and assigns it to the MobileNumber field. +func (o *CustomerObject) SetMobileNumber(v string) { + o.MobileNumber.Set(&v) +} +// SetMobileNumberNil sets the value for MobileNumber to be an explicit nil +func (o *CustomerObject) SetMobileNumberNil() { + o.MobileNumber.Set(nil) +} + +// UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +func (o *CustomerObject) UnsetMobileNumber() { + o.MobileNumber.Unset() +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *CustomerObject) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *CustomerObject) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *CustomerObject) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *CustomerObject) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetAddresses returns the Addresses field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomerObject) GetAddresses() []AddressObject { + if o == nil { + var ret []AddressObject + return ret + } + return o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CustomerObject) GetAddressesOk() ([]AddressObject, bool) { + if o == nil || utils.IsNil(o.Addresses) { + return nil, false + } + return o.Addresses, true +} + +// HasAddresses returns a boolean if a field has been set. +func (o *CustomerObject) HasAddresses() bool { + if o != nil && utils.IsNil(o.Addresses) { + return true + } + + return false +} + +// SetAddresses gets a reference to the given []AddressObject and assigns it to the Addresses field. +func (o *CustomerObject) SetAddresses(v []AddressObject) { + o.Addresses = v +} + +func (o CustomerObject) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomerObject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() + } + if o.PhoneNumber.IsSet() { + toSerialize["phone_number"] = o.PhoneNumber.Get() + } + if o.GivenNames.IsSet() { + toSerialize["given_names"] = o.GivenNames.Get() + } + if o.Surname.IsSet() { + toSerialize["surname"] = o.Surname.Get() + } + if o.Email.IsSet() { + toSerialize["email"] = o.Email.Get() + } + if o.MobileNumber.IsSet() { + toSerialize["mobile_number"] = o.MobileNumber.Get() + } + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + if o.Addresses != nil { + toSerialize["addresses"] = o.Addresses + } + return toSerialize, nil +} + +type NullableCustomerObject struct { + value *CustomerObject + isSet bool +} + +func (v NullableCustomerObject) Get() *CustomerObject { + return v.value +} + +func (v *NullableCustomerObject) Set(val *CustomerObject) { + v.value = val + v.isSet = true +} + +func (v NullableCustomerObject) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomerObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomerObject(val *CustomerObject) *NullableCustomerObject { + return &NullableCustomerObject{value: val, isSet: true} +} + +func (v NullableCustomerObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomerObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_direct_debit.go b/invoice/model_direct_debit.go new file mode 100644 index 00000000..f0f57ca1 --- /dev/null +++ b/invoice/model_direct_debit.go @@ -0,0 +1,121 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebit type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebit{} + +// DirectDebit An object representing direct debit details for invoices. +type DirectDebit struct { + DirectDebitType DirectDebitType `json:"direct_debit_type"` +} + +// NewDirectDebit instantiates a new DirectDebit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebit(directDebitType DirectDebitType) *DirectDebit { + this := DirectDebit{} + this.DirectDebitType = directDebitType + return &this +} + +// NewDirectDebitWithDefaults instantiates a new DirectDebit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitWithDefaults() *DirectDebit { + this := DirectDebit{} + return &this +} + +// GetDirectDebitType returns the DirectDebitType field value +func (o *DirectDebit) GetDirectDebitType() DirectDebitType { + if o == nil { + var ret DirectDebitType + return ret + } + + return o.DirectDebitType +} + +// GetDirectDebitTypeOk returns a tuple with the DirectDebitType field value +// and a boolean to check if the value has been set. +func (o *DirectDebit) GetDirectDebitTypeOk() (*DirectDebitType, bool) { + if o == nil { + return nil, false + } + return &o.DirectDebitType, true +} + +// SetDirectDebitType sets field value +func (o *DirectDebit) SetDirectDebitType(v DirectDebitType) { + o.DirectDebitType = v +} + +func (o DirectDebit) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["direct_debit_type"] = o.DirectDebitType + return toSerialize, nil +} + +type NullableDirectDebit struct { + value *DirectDebit + isSet bool +} + +func (v NullableDirectDebit) Get() *DirectDebit { + return v.value +} + +func (v *NullableDirectDebit) Set(val *DirectDebit) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebit) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebit(val *DirectDebit) *NullableDirectDebit { + return &NullableDirectDebit{value: val, isSet: true} +} + +func (v NullableDirectDebit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_direct_debit_type.go b/invoice/model_direct_debit_type.go new file mode 100644 index 00000000..cae68224 --- /dev/null +++ b/invoice/model_direct_debit_type.go @@ -0,0 +1,139 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitType Representing the available Direct Debit channels used for invoice-related transactions. +type DirectDebitType string + +// List of DirectDebitType +const ( + DIRECTDEBITTYPE_BA_BRI DirectDebitType = "BA_BRI" + DIRECTDEBITTYPE_DC_BRI DirectDebitType = "DC_BRI" + DIRECTDEBITTYPE_DD_BRI DirectDebitType = "DD_BRI" + DIRECTDEBITTYPE_DD_MANDIRI DirectDebitType = "DD_MANDIRI" + DIRECTDEBITTYPE_BA_BPI DirectDebitType = "BA_BPI" + DIRECTDEBITTYPE_DC_BPI DirectDebitType = "DC_BPI" + DIRECTDEBITTYPE_DD_BPI DirectDebitType = "DD_BPI" + DIRECTDEBITTYPE_BA_UBP DirectDebitType = "BA_UBP" + DIRECTDEBITTYPE_DC_UBP DirectDebitType = "DC_UBP" + DIRECTDEBITTYPE_DD_UBP DirectDebitType = "DD_UBP" + DIRECTDEBITTYPE_BCA_KLIKPAY DirectDebitType = "BCA_KLIKPAY" + DIRECTDEBITTYPE_BA_BCA_KLIKPAY DirectDebitType = "BA_BCA_KLIKPAY" + DIRECTDEBITTYPE_DC_BCA_KLIKPAY DirectDebitType = "DC_BCA_KLIKPAY" + DIRECTDEBITTYPE_DD_BCA_KLIKPAY DirectDebitType = "DD_BCA_KLIKPAY" +) + +// All allowed values of DirectDebitType enum +var AllowedDirectDebitTypeEnumValues = []DirectDebitType{ + "BA_BRI", + "DC_BRI", + "DD_BRI", + "DD_MANDIRI", + "BA_BPI", + "DC_BPI", + "DD_BPI", + "BA_UBP", + "DC_UBP", + "DD_UBP", + "BCA_KLIKPAY", + "BA_BCA_KLIKPAY", + "DC_BCA_KLIKPAY", + "DD_BCA_KLIKPAY", +} + +func (v *DirectDebitType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DirectDebitType(value) + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DirectDebitType", value) +} + +// NewDirectDebitTypeFromValue returns a pointer to a valid DirectDebitType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDirectDebitTypeFromValue(v string) (*DirectDebitType, error) { + ev := DirectDebitType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DirectDebitType: valid values are %v", v, AllowedDirectDebitTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DirectDebitType) IsValid() bool { + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v DirectDebitType) String() string { + return string(v) +} + +// Ptr returns reference to DirectDebitType value +func (v DirectDebitType) Ptr() *DirectDebitType { + return &v +} + +type NullableDirectDebitType struct { + value *DirectDebitType + isSet bool +} + +func (v NullableDirectDebitType) Get() *DirectDebitType { + return v.value +} + +func (v *NullableDirectDebitType) Set(val *DirectDebitType) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitType) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitType(val *DirectDebitType) *NullableDirectDebitType { + return &NullableDirectDebitType{value: val, isSet: true} +} + +func (v NullableDirectDebitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_ewallet.go b/invoice/model_ewallet.go new file mode 100644 index 00000000..13ca33b3 --- /dev/null +++ b/invoice/model_ewallet.go @@ -0,0 +1,121 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Ewallet type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Ewallet{} + +// Ewallet An object representing e-wallet details for invoices. +type Ewallet struct { + EwalletType EwalletType `json:"ewallet_type"` +} + +// NewEwallet instantiates a new Ewallet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEwallet(ewalletType EwalletType) *Ewallet { + this := Ewallet{} + this.EwalletType = ewalletType + return &this +} + +// NewEwalletWithDefaults instantiates a new Ewallet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEwalletWithDefaults() *Ewallet { + this := Ewallet{} + return &this +} + +// GetEwalletType returns the EwalletType field value +func (o *Ewallet) GetEwalletType() EwalletType { + if o == nil { + var ret EwalletType + return ret + } + + return o.EwalletType +} + +// GetEwalletTypeOk returns a tuple with the EwalletType field value +// and a boolean to check if the value has been set. +func (o *Ewallet) GetEwalletTypeOk() (*EwalletType, bool) { + if o == nil { + return nil, false + } + return &o.EwalletType, true +} + +// SetEwalletType sets field value +func (o *Ewallet) SetEwalletType(v EwalletType) { + o.EwalletType = v +} + +func (o Ewallet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Ewallet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ewallet_type"] = o.EwalletType + return toSerialize, nil +} + +type NullableEwallet struct { + value *Ewallet + isSet bool +} + +func (v NullableEwallet) Get() *Ewallet { + return v.value +} + +func (v *NullableEwallet) Set(val *Ewallet) { + v.value = val + v.isSet = true +} + +func (v NullableEwallet) IsSet() bool { + return v.isSet +} + +func (v *NullableEwallet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEwallet(val *Ewallet) *NullableEwallet { + return &NullableEwallet{value: val, isSet: true} +} + +func (v NullableEwallet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEwallet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_ewallet_type.go b/invoice/model_ewallet_type.go new file mode 100644 index 00000000..8f5d1023 --- /dev/null +++ b/invoice/model_ewallet_type.go @@ -0,0 +1,125 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// EwalletType Representing the available eWallet channels used for invoice-related transactions. +type EwalletType string + +// List of EwalletType +const ( + EWALLETTYPE_OVO EwalletType = "OVO" + EWALLETTYPE_DANA EwalletType = "DANA" + EWALLETTYPE_LINKAJA EwalletType = "LINKAJA" + EWALLETTYPE_PAYMAYA EwalletType = "PAYMAYA" + EWALLETTYPE_SHOPEEPAY EwalletType = "SHOPEEPAY" + EWALLETTYPE_GCASH EwalletType = "GCASH" + EWALLETTYPE_GRABPAY EwalletType = "GRABPAY" +) + +// All allowed values of EwalletType enum +var AllowedEwalletTypeEnumValues = []EwalletType{ + "OVO", + "DANA", + "LINKAJA", + "PAYMAYA", + "SHOPEEPAY", + "GCASH", + "GRABPAY", +} + +func (v *EwalletType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EwalletType(value) + for _, existing := range AllowedEwalletTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EwalletType", value) +} + +// NewEwalletTypeFromValue returns a pointer to a valid EwalletType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEwalletTypeFromValue(v string) (*EwalletType, error) { + ev := EwalletType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EwalletType: valid values are %v", v, AllowedEwalletTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EwalletType) IsValid() bool { + for _, existing := range AllowedEwalletTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v EwalletType) String() string { + return string(v) +} + +// Ptr returns reference to EwalletType value +func (v EwalletType) Ptr() *EwalletType { + return &v +} + +type NullableEwalletType struct { + value *EwalletType + isSet bool +} + +func (v NullableEwalletType) Get() *EwalletType { + return v.value +} + +func (v *NullableEwalletType) Set(val *EwalletType) { + v.value = val + v.isSet = true +} + +func (v NullableEwalletType) IsSet() bool { + return v.isSet +} + +func (v *NullableEwalletType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEwalletType(val *EwalletType) *NullableEwalletType { + return &NullableEwalletType{value: val, isSet: true} +} + +func (v NullableEwalletType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEwalletType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_forbidden_error.go b/invoice/model_forbidden_error.go new file mode 100644 index 00000000..3ba1e1b7 --- /dev/null +++ b/invoice/model_forbidden_error.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ForbiddenError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ForbiddenError{} + +// ForbiddenError An error object used to indicate a 403 Forbidden response related to invoice operations. +type ForbiddenError struct { + // The specific error code indicating that access to the invoice operation is suspended. + ErrorCode string `json:"error_code"` + // A human-readable error message providing additional context about the 403 Forbidden response. + Message string `json:"message"` +} + +// NewForbiddenError instantiates a new ForbiddenError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewForbiddenError(errorCode string, message string) *ForbiddenError { + this := ForbiddenError{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewForbiddenErrorWithDefaults instantiates a new ForbiddenError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewForbiddenErrorWithDefaults() *ForbiddenError { + this := ForbiddenError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *ForbiddenError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *ForbiddenError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *ForbiddenError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *ForbiddenError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ForbiddenError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ForbiddenError) SetMessage(v string) { + o.Message = v +} + +func (o ForbiddenError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ForbiddenError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableForbiddenError struct { + value *ForbiddenError + isSet bool +} + +func (v NullableForbiddenError) Get() *ForbiddenError { + return v.value +} + +func (v *NullableForbiddenError) Set(val *ForbiddenError) { + v.value = val + v.isSet = true +} + +func (v NullableForbiddenError) IsSet() bool { + return v.isSet +} + +func (v *NullableForbiddenError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableForbiddenError(val *ForbiddenError) *NullableForbiddenError { + return &NullableForbiddenError{value: val, isSet: true} +} + +func (v NullableForbiddenError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableForbiddenError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice.go b/invoice/model_invoice.go new file mode 100644 index 00000000..70da3bd9 --- /dev/null +++ b/invoice/model_invoice.go @@ -0,0 +1,1158 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the Invoice type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Invoice{} + +// Invoice An object representing details for an invoice. +type Invoice struct { + // The unique identifier for the invoice. + Id *string `json:"id,omitempty"` + // The external identifier for the invoice. + ExternalId string `json:"external_id"` + // The user ID associated with the invoice. + UserId string `json:"user_id"` + // The email address of the payer. + PayerEmail *string `json:"payer_email,omitempty"` + // A description of the invoice. + Description *string `json:"description,omitempty"` + PaymentMethod *InvoicePaymentMethod `json:"payment_method,omitempty"` + Status InvoiceStatus `json:"status"` + // The name of the merchant. + MerchantName string `json:"merchant_name"` + // The URL of the merchant's profile picture. + MerchantProfilePictureUrl string `json:"merchant_profile_picture_url"` + // The locale or language used for the invoice. + Locale *string `json:"locale,omitempty"` + // The total amount of the invoice. + Amount float32 `json:"amount"` + // Representing a date and time in ISO 8601 format. + ExpiryDate time.Time `json:"expiry_date"` + // The URL to view the invoice. + InvoiceUrl string `json:"invoice_url"` + // An array of available banks for payment. + AvailableBanks []Bank `json:"available_banks"` + // An array of available retail outlets for payment. + AvailableRetailOutlets []RetailOutlet `json:"available_retail_outlets"` + // An array of available e-wallets for payment. + AvailableEwallets []Ewallet `json:"available_ewallets"` + // An array of available QR codes for payment. + AvailableQrCodes []QrCode `json:"available_qr_codes"` + // An array of available direct debit options for payment. + AvailableDirectDebits []DirectDebit `json:"available_direct_debits"` + // An array of available pay-later options for payment. + AvailablePaylaters []Paylater `json:"available_paylaters"` + // Indicates whether credit card payments should be excluded. + ShouldExcludeCreditCard *bool `json:"should_exclude_credit_card,omitempty"` + // Indicates whether email notifications should be sent. + ShouldSendEmail bool `json:"should_send_email"` + // Representing a date and time in ISO 8601 format. + Created time.Time `json:"created"` + // Representing a date and time in ISO 8601 format. + Updated time.Time `json:"updated"` + // The URL to redirect to on successful payment. + SuccessRedirectUrl *string `json:"success_redirect_url,omitempty"` + // The URL to redirect to on payment failure. + FailureRedirectUrl *string `json:"failure_redirect_url,omitempty"` + // Indicates whether credit card authentication is required. + ShouldAuthenticateCreditCard *bool `json:"should_authenticate_credit_card,omitempty"` + Currency *InvoiceCurrency `json:"currency,omitempty"` + // An array of items included in the invoice. + Items []InvoiceItem `json:"items,omitempty"` + // Indicates whether the virtual account is fixed. + FixedVa *bool `json:"fixed_va,omitempty"` + // Representing a date and time in ISO 8601 format. + ReminderDate *time.Time `json:"reminder_date,omitempty"` + Customer *CustomerObject `json:"customer,omitempty"` + CustomerNotificationPreference *NotificationPreference `json:"customer_notification_preference,omitempty"` + // An array of fees associated with the invoice. + Fees []InvoiceFee `json:"fees,omitempty"` +} + +// NewInvoice instantiates a new Invoice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoice(externalId string, userId string, status InvoiceStatus, merchantName string, merchantProfilePictureUrl string, amount float32, expiryDate time.Time, invoiceUrl string, availableBanks []Bank, availableRetailOutlets []RetailOutlet, availableEwallets []Ewallet, availableQrCodes []QrCode, availableDirectDebits []DirectDebit, availablePaylaters []Paylater, shouldSendEmail bool, created time.Time, updated time.Time) *Invoice { + this := Invoice{} + this.ExternalId = externalId + this.UserId = userId + this.Status = status + this.MerchantName = merchantName + this.MerchantProfilePictureUrl = merchantProfilePictureUrl + this.Amount = amount + this.ExpiryDate = expiryDate + this.InvoiceUrl = invoiceUrl + this.AvailableBanks = availableBanks + this.AvailableRetailOutlets = availableRetailOutlets + this.AvailableEwallets = availableEwallets + this.AvailableQrCodes = availableQrCodes + this.AvailableDirectDebits = availableDirectDebits + this.AvailablePaylaters = availablePaylaters + this.ShouldSendEmail = shouldSendEmail + this.Created = created + this.Updated = updated + return &this +} + +// NewInvoiceWithDefaults instantiates a new Invoice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceWithDefaults() *Invoice { + this := Invoice{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Invoice) GetId() string { + if o == nil || utils.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Invoice) HasId() bool { + if o != nil && !utils.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Invoice) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value +func (o *Invoice) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *Invoice) SetExternalId(v string) { + o.ExternalId = v +} + +// GetUserId returns the UserId field value +func (o *Invoice) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *Invoice) SetUserId(v string) { + o.UserId = v +} + +// GetPayerEmail returns the PayerEmail field value if set, zero value otherwise. +func (o *Invoice) GetPayerEmail() string { + if o == nil || utils.IsNil(o.PayerEmail) { + var ret string + return ret + } + return *o.PayerEmail +} + +// GetPayerEmailOk returns a tuple with the PayerEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetPayerEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.PayerEmail) { + return nil, false + } + return o.PayerEmail, true +} + +// HasPayerEmail returns a boolean if a field has been set. +func (o *Invoice) HasPayerEmail() bool { + if o != nil && !utils.IsNil(o.PayerEmail) { + return true + } + + return false +} + +// SetPayerEmail gets a reference to the given string and assigns it to the PayerEmail field. +func (o *Invoice) SetPayerEmail(v string) { + o.PayerEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Invoice) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Invoice) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Invoice) SetDescription(v string) { + o.Description = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *Invoice) GetPaymentMethod() InvoicePaymentMethod { + if o == nil || utils.IsNil(o.PaymentMethod) { + var ret InvoicePaymentMethod + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetPaymentMethodOk() (*InvoicePaymentMethod, bool) { + if o == nil || utils.IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *Invoice) HasPaymentMethod() bool { + if o != nil && !utils.IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given InvoicePaymentMethod and assigns it to the PaymentMethod field. +func (o *Invoice) SetPaymentMethod(v InvoicePaymentMethod) { + o.PaymentMethod = &v +} + +// GetStatus returns the Status field value +func (o *Invoice) GetStatus() InvoiceStatus { + if o == nil { + var ret InvoiceStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetStatusOk() (*InvoiceStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Invoice) SetStatus(v InvoiceStatus) { + o.Status = v +} + +// GetMerchantName returns the MerchantName field value +func (o *Invoice) GetMerchantName() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetMerchantNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantName, true +} + +// SetMerchantName sets field value +func (o *Invoice) SetMerchantName(v string) { + o.MerchantName = v +} + +// GetMerchantProfilePictureUrl returns the MerchantProfilePictureUrl field value +func (o *Invoice) GetMerchantProfilePictureUrl() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantProfilePictureUrl +} + +// GetMerchantProfilePictureUrlOk returns a tuple with the MerchantProfilePictureUrl field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetMerchantProfilePictureUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantProfilePictureUrl, true +} + +// SetMerchantProfilePictureUrl sets field value +func (o *Invoice) SetMerchantProfilePictureUrl(v string) { + o.MerchantProfilePictureUrl = v +} + +// GetLocale returns the Locale field value if set, zero value otherwise. +func (o *Invoice) GetLocale() string { + if o == nil || utils.IsNil(o.Locale) { + var ret string + return ret + } + return *o.Locale +} + +// GetLocaleOk returns a tuple with the Locale field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetLocaleOk() (*string, bool) { + if o == nil || utils.IsNil(o.Locale) { + return nil, false + } + return o.Locale, true +} + +// HasLocale returns a boolean if a field has been set. +func (o *Invoice) HasLocale() bool { + if o != nil && !utils.IsNil(o.Locale) { + return true + } + + return false +} + +// SetLocale gets a reference to the given string and assigns it to the Locale field. +func (o *Invoice) SetLocale(v string) { + o.Locale = &v +} + +// GetAmount returns the Amount field value +func (o *Invoice) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *Invoice) SetAmount(v float32) { + o.Amount = v +} + +// GetExpiryDate returns the ExpiryDate field value +func (o *Invoice) GetExpiryDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ExpiryDate +} + +// GetExpiryDateOk returns a tuple with the ExpiryDate field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetExpiryDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryDate, true +} + +// SetExpiryDate sets field value +func (o *Invoice) SetExpiryDate(v time.Time) { + o.ExpiryDate = v +} + +// GetInvoiceUrl returns the InvoiceUrl field value +func (o *Invoice) GetInvoiceUrl() string { + if o == nil { + var ret string + return ret + } + + return o.InvoiceUrl +} + +// GetInvoiceUrlOk returns a tuple with the InvoiceUrl field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetInvoiceUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvoiceUrl, true +} + +// SetInvoiceUrl sets field value +func (o *Invoice) SetInvoiceUrl(v string) { + o.InvoiceUrl = v +} + +// GetAvailableBanks returns the AvailableBanks field value +func (o *Invoice) GetAvailableBanks() []Bank { + if o == nil { + var ret []Bank + return ret + } + + return o.AvailableBanks +} + +// GetAvailableBanksOk returns a tuple with the AvailableBanks field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailableBanksOk() ([]Bank, bool) { + if o == nil { + return nil, false + } + return o.AvailableBanks, true +} + +// SetAvailableBanks sets field value +func (o *Invoice) SetAvailableBanks(v []Bank) { + o.AvailableBanks = v +} + +// GetAvailableRetailOutlets returns the AvailableRetailOutlets field value +func (o *Invoice) GetAvailableRetailOutlets() []RetailOutlet { + if o == nil { + var ret []RetailOutlet + return ret + } + + return o.AvailableRetailOutlets +} + +// GetAvailableRetailOutletsOk returns a tuple with the AvailableRetailOutlets field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailableRetailOutletsOk() ([]RetailOutlet, bool) { + if o == nil { + return nil, false + } + return o.AvailableRetailOutlets, true +} + +// SetAvailableRetailOutlets sets field value +func (o *Invoice) SetAvailableRetailOutlets(v []RetailOutlet) { + o.AvailableRetailOutlets = v +} + +// GetAvailableEwallets returns the AvailableEwallets field value +func (o *Invoice) GetAvailableEwallets() []Ewallet { + if o == nil { + var ret []Ewallet + return ret + } + + return o.AvailableEwallets +} + +// GetAvailableEwalletsOk returns a tuple with the AvailableEwallets field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailableEwalletsOk() ([]Ewallet, bool) { + if o == nil { + return nil, false + } + return o.AvailableEwallets, true +} + +// SetAvailableEwallets sets field value +func (o *Invoice) SetAvailableEwallets(v []Ewallet) { + o.AvailableEwallets = v +} + +// GetAvailableQrCodes returns the AvailableQrCodes field value +func (o *Invoice) GetAvailableQrCodes() []QrCode { + if o == nil { + var ret []QrCode + return ret + } + + return o.AvailableQrCodes +} + +// GetAvailableQrCodesOk returns a tuple with the AvailableQrCodes field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailableQrCodesOk() ([]QrCode, bool) { + if o == nil { + return nil, false + } + return o.AvailableQrCodes, true +} + +// SetAvailableQrCodes sets field value +func (o *Invoice) SetAvailableQrCodes(v []QrCode) { + o.AvailableQrCodes = v +} + +// GetAvailableDirectDebits returns the AvailableDirectDebits field value +func (o *Invoice) GetAvailableDirectDebits() []DirectDebit { + if o == nil { + var ret []DirectDebit + return ret + } + + return o.AvailableDirectDebits +} + +// GetAvailableDirectDebitsOk returns a tuple with the AvailableDirectDebits field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailableDirectDebitsOk() ([]DirectDebit, bool) { + if o == nil { + return nil, false + } + return o.AvailableDirectDebits, true +} + +// SetAvailableDirectDebits sets field value +func (o *Invoice) SetAvailableDirectDebits(v []DirectDebit) { + o.AvailableDirectDebits = v +} + +// GetAvailablePaylaters returns the AvailablePaylaters field value +func (o *Invoice) GetAvailablePaylaters() []Paylater { + if o == nil { + var ret []Paylater + return ret + } + + return o.AvailablePaylaters +} + +// GetAvailablePaylatersOk returns a tuple with the AvailablePaylaters field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetAvailablePaylatersOk() ([]Paylater, bool) { + if o == nil { + return nil, false + } + return o.AvailablePaylaters, true +} + +// SetAvailablePaylaters sets field value +func (o *Invoice) SetAvailablePaylaters(v []Paylater) { + o.AvailablePaylaters = v +} + +// GetShouldExcludeCreditCard returns the ShouldExcludeCreditCard field value if set, zero value otherwise. +func (o *Invoice) GetShouldExcludeCreditCard() bool { + if o == nil || utils.IsNil(o.ShouldExcludeCreditCard) { + var ret bool + return ret + } + return *o.ShouldExcludeCreditCard +} + +// GetShouldExcludeCreditCardOk returns a tuple with the ShouldExcludeCreditCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetShouldExcludeCreditCardOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldExcludeCreditCard) { + return nil, false + } + return o.ShouldExcludeCreditCard, true +} + +// HasShouldExcludeCreditCard returns a boolean if a field has been set. +func (o *Invoice) HasShouldExcludeCreditCard() bool { + if o != nil && !utils.IsNil(o.ShouldExcludeCreditCard) { + return true + } + + return false +} + +// SetShouldExcludeCreditCard gets a reference to the given bool and assigns it to the ShouldExcludeCreditCard field. +func (o *Invoice) SetShouldExcludeCreditCard(v bool) { + o.ShouldExcludeCreditCard = &v +} + +// GetShouldSendEmail returns the ShouldSendEmail field value +func (o *Invoice) GetShouldSendEmail() bool { + if o == nil { + var ret bool + return ret + } + + return o.ShouldSendEmail +} + +// GetShouldSendEmailOk returns a tuple with the ShouldSendEmail field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetShouldSendEmailOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ShouldSendEmail, true +} + +// SetShouldSendEmail sets field value +func (o *Invoice) SetShouldSendEmail(v bool) { + o.ShouldSendEmail = v +} + +// GetCreated returns the Created field value +func (o *Invoice) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Invoice) SetCreated(v time.Time) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *Invoice) GetUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *Invoice) GetUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *Invoice) SetUpdated(v time.Time) { + o.Updated = v +} + +// GetSuccessRedirectUrl returns the SuccessRedirectUrl field value if set, zero value otherwise. +func (o *Invoice) GetSuccessRedirectUrl() string { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + var ret string + return ret + } + return *o.SuccessRedirectUrl +} + +// GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetSuccessRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + return nil, false + } + return o.SuccessRedirectUrl, true +} + +// HasSuccessRedirectUrl returns a boolean if a field has been set. +func (o *Invoice) HasSuccessRedirectUrl() bool { + if o != nil && !utils.IsNil(o.SuccessRedirectUrl) { + return true + } + + return false +} + +// SetSuccessRedirectUrl gets a reference to the given string and assigns it to the SuccessRedirectUrl field. +func (o *Invoice) SetSuccessRedirectUrl(v string) { + o.SuccessRedirectUrl = &v +} + +// GetFailureRedirectUrl returns the FailureRedirectUrl field value if set, zero value otherwise. +func (o *Invoice) GetFailureRedirectUrl() string { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + var ret string + return ret + } + return *o.FailureRedirectUrl +} + +// GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetFailureRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + return nil, false + } + return o.FailureRedirectUrl, true +} + +// HasFailureRedirectUrl returns a boolean if a field has been set. +func (o *Invoice) HasFailureRedirectUrl() bool { + if o != nil && !utils.IsNil(o.FailureRedirectUrl) { + return true + } + + return false +} + +// SetFailureRedirectUrl gets a reference to the given string and assigns it to the FailureRedirectUrl field. +func (o *Invoice) SetFailureRedirectUrl(v string) { + o.FailureRedirectUrl = &v +} + +// GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field value if set, zero value otherwise. +func (o *Invoice) GetShouldAuthenticateCreditCard() bool { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + var ret bool + return ret + } + return *o.ShouldAuthenticateCreditCard +} + +// GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetShouldAuthenticateCreditCardOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + return nil, false + } + return o.ShouldAuthenticateCreditCard, true +} + +// HasShouldAuthenticateCreditCard returns a boolean if a field has been set. +func (o *Invoice) HasShouldAuthenticateCreditCard() bool { + if o != nil && !utils.IsNil(o.ShouldAuthenticateCreditCard) { + return true + } + + return false +} + +// SetShouldAuthenticateCreditCard gets a reference to the given bool and assigns it to the ShouldAuthenticateCreditCard field. +func (o *Invoice) SetShouldAuthenticateCreditCard(v bool) { + o.ShouldAuthenticateCreditCard = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *Invoice) GetCurrency() InvoiceCurrency { + if o == nil || utils.IsNil(o.Currency) { + var ret InvoiceCurrency + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCurrencyOk() (*InvoiceCurrency, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *Invoice) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given InvoiceCurrency and assigns it to the Currency field. +func (o *Invoice) SetCurrency(v InvoiceCurrency) { + o.Currency = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *Invoice) GetItems() []InvoiceItem { + if o == nil || utils.IsNil(o.Items) { + var ret []InvoiceItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetItemsOk() ([]InvoiceItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *Invoice) HasItems() bool { + if o != nil && !utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InvoiceItem and assigns it to the Items field. +func (o *Invoice) SetItems(v []InvoiceItem) { + o.Items = v +} + +// GetFixedVa returns the FixedVa field value if set, zero value otherwise. +func (o *Invoice) GetFixedVa() bool { + if o == nil || utils.IsNil(o.FixedVa) { + var ret bool + return ret + } + return *o.FixedVa +} + +// GetFixedVaOk returns a tuple with the FixedVa field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetFixedVaOk() (*bool, bool) { + if o == nil || utils.IsNil(o.FixedVa) { + return nil, false + } + return o.FixedVa, true +} + +// HasFixedVa returns a boolean if a field has been set. +func (o *Invoice) HasFixedVa() bool { + if o != nil && !utils.IsNil(o.FixedVa) { + return true + } + + return false +} + +// SetFixedVa gets a reference to the given bool and assigns it to the FixedVa field. +func (o *Invoice) SetFixedVa(v bool) { + o.FixedVa = &v +} + +// GetReminderDate returns the ReminderDate field value if set, zero value otherwise. +func (o *Invoice) GetReminderDate() time.Time { + if o == nil || utils.IsNil(o.ReminderDate) { + var ret time.Time + return ret + } + return *o.ReminderDate +} + +// GetReminderDateOk returns a tuple with the ReminderDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetReminderDateOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ReminderDate) { + return nil, false + } + return o.ReminderDate, true +} + +// HasReminderDate returns a boolean if a field has been set. +func (o *Invoice) HasReminderDate() bool { + if o != nil && !utils.IsNil(o.ReminderDate) { + return true + } + + return false +} + +// SetReminderDate gets a reference to the given time.Time and assigns it to the ReminderDate field. +func (o *Invoice) SetReminderDate(v time.Time) { + o.ReminderDate = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *Invoice) GetCustomer() CustomerObject { + if o == nil || utils.IsNil(o.Customer) { + var ret CustomerObject + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCustomerOk() (*CustomerObject, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *Invoice) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given CustomerObject and assigns it to the Customer field. +func (o *Invoice) SetCustomer(v CustomerObject) { + o.Customer = &v +} + +// GetCustomerNotificationPreference returns the CustomerNotificationPreference field value if set, zero value otherwise. +func (o *Invoice) GetCustomerNotificationPreference() NotificationPreference { + if o == nil || utils.IsNil(o.CustomerNotificationPreference) { + var ret NotificationPreference + return ret + } + return *o.CustomerNotificationPreference +} + +// GetCustomerNotificationPreferenceOk returns a tuple with the CustomerNotificationPreference field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCustomerNotificationPreferenceOk() (*NotificationPreference, bool) { + if o == nil || utils.IsNil(o.CustomerNotificationPreference) { + return nil, false + } + return o.CustomerNotificationPreference, true +} + +// HasCustomerNotificationPreference returns a boolean if a field has been set. +func (o *Invoice) HasCustomerNotificationPreference() bool { + if o != nil && !utils.IsNil(o.CustomerNotificationPreference) { + return true + } + + return false +} + +// SetCustomerNotificationPreference gets a reference to the given NotificationPreference and assigns it to the CustomerNotificationPreference field. +func (o *Invoice) SetCustomerNotificationPreference(v NotificationPreference) { + o.CustomerNotificationPreference = &v +} + +// GetFees returns the Fees field value if set, zero value otherwise. +func (o *Invoice) GetFees() []InvoiceFee { + if o == nil || utils.IsNil(o.Fees) { + var ret []InvoiceFee + return ret + } + return o.Fees +} + +// GetFeesOk returns a tuple with the Fees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetFeesOk() ([]InvoiceFee, bool) { + if o == nil || utils.IsNil(o.Fees) { + return nil, false + } + return o.Fees, true +} + +// HasFees returns a boolean if a field has been set. +func (o *Invoice) HasFees() bool { + if o != nil && !utils.IsNil(o.Fees) { + return true + } + + return false +} + +// SetFees gets a reference to the given []InvoiceFee and assigns it to the Fees field. +func (o *Invoice) SetFees(v []InvoiceFee) { + o.Fees = v +} + +func (o Invoice) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Invoice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["external_id"] = o.ExternalId + toSerialize["user_id"] = o.UserId + if !utils.IsNil(o.PayerEmail) { + toSerialize["payer_email"] = o.PayerEmail + } + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !utils.IsNil(o.PaymentMethod) { + toSerialize["payment_method"] = o.PaymentMethod + } + toSerialize["status"] = o.Status + toSerialize["merchant_name"] = o.MerchantName + toSerialize["merchant_profile_picture_url"] = o.MerchantProfilePictureUrl + if !utils.IsNil(o.Locale) { + toSerialize["locale"] = o.Locale + } + toSerialize["amount"] = o.Amount + toSerialize["expiry_date"] = o.ExpiryDate + toSerialize["invoice_url"] = o.InvoiceUrl + toSerialize["available_banks"] = o.AvailableBanks + toSerialize["available_retail_outlets"] = o.AvailableRetailOutlets + toSerialize["available_ewallets"] = o.AvailableEwallets + toSerialize["available_qr_codes"] = o.AvailableQrCodes + toSerialize["available_direct_debits"] = o.AvailableDirectDebits + toSerialize["available_paylaters"] = o.AvailablePaylaters + if !utils.IsNil(o.ShouldExcludeCreditCard) { + toSerialize["should_exclude_credit_card"] = o.ShouldExcludeCreditCard + } + toSerialize["should_send_email"] = o.ShouldSendEmail + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + if !utils.IsNil(o.SuccessRedirectUrl) { + toSerialize["success_redirect_url"] = o.SuccessRedirectUrl + } + if !utils.IsNil(o.FailureRedirectUrl) { + toSerialize["failure_redirect_url"] = o.FailureRedirectUrl + } + if !utils.IsNil(o.ShouldAuthenticateCreditCard) { + toSerialize["should_authenticate_credit_card"] = o.ShouldAuthenticateCreditCard + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !utils.IsNil(o.FixedVa) { + toSerialize["fixed_va"] = o.FixedVa + } + if !utils.IsNil(o.ReminderDate) { + toSerialize["reminder_date"] = o.ReminderDate + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.CustomerNotificationPreference) { + toSerialize["customer_notification_preference"] = o.CustomerNotificationPreference + } + if !utils.IsNil(o.Fees) { + toSerialize["fees"] = o.Fees + } + return toSerialize, nil +} + +type NullableInvoice struct { + value *Invoice + isSet bool +} + +func (v NullableInvoice) Get() *Invoice { + return v.value +} + +func (v *NullableInvoice) Set(val *Invoice) { + v.value = val + v.isSet = true +} + +func (v NullableInvoice) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoice(val *Invoice) *NullableInvoice { + return &NullableInvoice{value: val, isSet: true} +} + +func (v NullableInvoice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_client_type.go b/invoice/model_invoice_client_type.go new file mode 100644 index 00000000..fb3e2770 --- /dev/null +++ b/invoice/model_invoice_client_type.go @@ -0,0 +1,123 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// InvoiceClientType Representing the client type or source of an invoice. +type InvoiceClientType string + +// List of InvoiceClientType +const ( + INVOICECLIENTTYPE_DASHBOARD InvoiceClientType = "DASHBOARD" + INVOICECLIENTTYPE_API_GATEWAY InvoiceClientType = "API_GATEWAY" + INVOICECLIENTTYPE_INTEGRATION InvoiceClientType = "INTEGRATION" + INVOICECLIENTTYPE_ON_DEMAND InvoiceClientType = "ON_DEMAND" + INVOICECLIENTTYPE_RECURRING InvoiceClientType = "RECURRING" + INVOICECLIENTTYPE_MOBILE InvoiceClientType = "MOBILE" +) + +// All allowed values of InvoiceClientType enum +var AllowedInvoiceClientTypeEnumValues = []InvoiceClientType{ + "DASHBOARD", + "API_GATEWAY", + "INTEGRATION", + "ON_DEMAND", + "RECURRING", + "MOBILE", +} + +func (v *InvoiceClientType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvoiceClientType(value) + for _, existing := range AllowedInvoiceClientTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvoiceClientType", value) +} + +// NewInvoiceClientTypeFromValue returns a pointer to a valid InvoiceClientType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvoiceClientTypeFromValue(v string) (*InvoiceClientType, error) { + ev := InvoiceClientType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvoiceClientType: valid values are %v", v, AllowedInvoiceClientTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvoiceClientType) IsValid() bool { + for _, existing := range AllowedInvoiceClientTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v InvoiceClientType) String() string { + return string(v) +} + +// Ptr returns reference to InvoiceClientType value +func (v InvoiceClientType) Ptr() *InvoiceClientType { + return &v +} + +type NullableInvoiceClientType struct { + value *InvoiceClientType + isSet bool +} + +func (v NullableInvoiceClientType) Get() *InvoiceClientType { + return v.value +} + +func (v *NullableInvoiceClientType) Set(val *InvoiceClientType) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceClientType) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceClientType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceClientType(val *InvoiceClientType) *NullableInvoiceClientType { + return &NullableInvoiceClientType{value: val, isSet: true} +} + +func (v NullableInvoiceClientType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceClientType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_currency.go b/invoice/model_invoice_currency.go new file mode 100644 index 00000000..2af6342f --- /dev/null +++ b/invoice/model_invoice_currency.go @@ -0,0 +1,117 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// InvoiceCurrency Representing the currency used for an invoice. +type InvoiceCurrency string + +// List of InvoiceCurrency +const ( + INVOICECURRENCY_IDR InvoiceCurrency = "IDR" + INVOICECURRENCY_USD InvoiceCurrency = "USD" + INVOICECURRENCY_PHP InvoiceCurrency = "PHP" +) + +// All allowed values of InvoiceCurrency enum +var AllowedInvoiceCurrencyEnumValues = []InvoiceCurrency{ + "IDR", + "USD", + "PHP", +} + +func (v *InvoiceCurrency) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvoiceCurrency(value) + for _, existing := range AllowedInvoiceCurrencyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvoiceCurrency", value) +} + +// NewInvoiceCurrencyFromValue returns a pointer to a valid InvoiceCurrency +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvoiceCurrencyFromValue(v string) (*InvoiceCurrency, error) { + ev := InvoiceCurrency(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvoiceCurrency: valid values are %v", v, AllowedInvoiceCurrencyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvoiceCurrency) IsValid() bool { + for _, existing := range AllowedInvoiceCurrencyEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v InvoiceCurrency) String() string { + return string(v) +} + +// Ptr returns reference to InvoiceCurrency value +func (v InvoiceCurrency) Ptr() *InvoiceCurrency { + return &v +} + +type NullableInvoiceCurrency struct { + value *InvoiceCurrency + isSet bool +} + +func (v NullableInvoiceCurrency) Get() *InvoiceCurrency { + return v.value +} + +func (v *NullableInvoiceCurrency) Set(val *InvoiceCurrency) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceCurrency) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceCurrency) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceCurrency(val *InvoiceCurrency) *NullableInvoiceCurrency { + return &NullableInvoiceCurrency{value: val, isSet: true} +} + +func (v NullableInvoiceCurrency) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceCurrency) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_error404_response_definition.go b/invoice/model_invoice_error404_response_definition.go new file mode 100644 index 00000000..e2359f1e --- /dev/null +++ b/invoice/model_invoice_error404_response_definition.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the InvoiceError404ResponseDefinition type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceError404ResponseDefinition{} + +// InvoiceError404ResponseDefinition An error object used to indicate that the requested resource, in this case, an invoice, was not found. +type InvoiceError404ResponseDefinition struct { + // The specific error code indicating that the requested invoice was not found. + ErrorCode string `json:"error_code"` + // A human-readable error message providing additional context about the resource not being found. + Message string `json:"message"` +} + +// NewInvoiceError404ResponseDefinition instantiates a new InvoiceError404ResponseDefinition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceError404ResponseDefinition(errorCode string, message string) *InvoiceError404ResponseDefinition { + this := InvoiceError404ResponseDefinition{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewInvoiceError404ResponseDefinitionWithDefaults instantiates a new InvoiceError404ResponseDefinition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceError404ResponseDefinitionWithDefaults() *InvoiceError404ResponseDefinition { + this := InvoiceError404ResponseDefinition{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *InvoiceError404ResponseDefinition) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *InvoiceError404ResponseDefinition) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *InvoiceError404ResponseDefinition) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *InvoiceError404ResponseDefinition) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *InvoiceError404ResponseDefinition) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *InvoiceError404ResponseDefinition) SetMessage(v string) { + o.Message = v +} + +func (o InvoiceError404ResponseDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceError404ResponseDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableInvoiceError404ResponseDefinition struct { + value *InvoiceError404ResponseDefinition + isSet bool +} + +func (v NullableInvoiceError404ResponseDefinition) Get() *InvoiceError404ResponseDefinition { + return v.value +} + +func (v *NullableInvoiceError404ResponseDefinition) Set(val *InvoiceError404ResponseDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceError404ResponseDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceError404ResponseDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceError404ResponseDefinition(val *InvoiceError404ResponseDefinition) *NullableInvoiceError404ResponseDefinition { + return &NullableInvoiceError404ResponseDefinition{value: val, isSet: true} +} + +func (v NullableInvoiceError404ResponseDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceError404ResponseDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_fee.go b/invoice/model_invoice_fee.go new file mode 100644 index 00000000..06509a89 --- /dev/null +++ b/invoice/model_invoice_fee.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the InvoiceFee type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceFee{} + +// InvoiceFee An object representing internal details for a fee associated with an invoice. +type InvoiceFee struct { + // The type of fee. + Type string `json:"type"` + // The value or amount of the fee. + Value float32 `json:"value"` +} + +// NewInvoiceFee instantiates a new InvoiceFee object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceFee(type_ string, value float32) *InvoiceFee { + this := InvoiceFee{} + this.Type = type_ + this.Value = value + return &this +} + +// NewInvoiceFeeWithDefaults instantiates a new InvoiceFee object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceFeeWithDefaults() *InvoiceFee { + this := InvoiceFee{} + return &this +} + +// GetType returns the Type field value +func (o *InvoiceFee) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *InvoiceFee) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *InvoiceFee) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *InvoiceFee) GetValue() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *InvoiceFee) GetValueOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *InvoiceFee) SetValue(v float32) { + o.Value = v +} + +func (o InvoiceFee) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceFee) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableInvoiceFee struct { + value *InvoiceFee + isSet bool +} + +func (v NullableInvoiceFee) Get() *InvoiceFee { + return v.value +} + +func (v *NullableInvoiceFee) Set(val *InvoiceFee) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceFee) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceFee) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceFee(val *InvoiceFee) *NullableInvoiceFee { + return &NullableInvoiceFee{value: val, isSet: true} +} + +func (v NullableInvoiceFee) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceFee) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_item.go b/invoice/model_invoice_item.go new file mode 100644 index 00000000..cc5292ad --- /dev/null +++ b/invoice/model_invoice_item.go @@ -0,0 +1,289 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the InvoiceItem type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceItem{} + +// InvoiceItem An object representing an item within an invoice. +type InvoiceItem struct { + // The name of the item. + Name string `json:"name"` + // The price of the item. + Price float32 `json:"price"` + // The quantity of the item. Must be greater than or equal to 0. + Quantity float32 `json:"quantity"` + // The reference ID of the item. + ReferenceId *string `json:"reference_id,omitempty"` + // The URL associated with the item. + Url *string `json:"url,omitempty"` + // The category of the item. + Category *string `json:"category,omitempty"` +} + +// NewInvoiceItem instantiates a new InvoiceItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceItem(name string, price float32, quantity float32) *InvoiceItem { + this := InvoiceItem{} + this.Name = name + this.Price = price + this.Quantity = quantity + return &this +} + +// NewInvoiceItemWithDefaults instantiates a new InvoiceItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceItemWithDefaults() *InvoiceItem { + this := InvoiceItem{} + return &this +} + +// GetName returns the Name field value +func (o *InvoiceItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InvoiceItem) SetName(v string) { + o.Name = v +} + +// GetPrice returns the Price field value +func (o *InvoiceItem) GetPrice() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetPriceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *InvoiceItem) SetPrice(v float32) { + o.Price = v +} + +// GetQuantity returns the Quantity field value +func (o *InvoiceItem) GetQuantity() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetQuantityOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *InvoiceItem) SetQuantity(v float32) { + o.Quantity = v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *InvoiceItem) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *InvoiceItem) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *InvoiceItem) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *InvoiceItem) GetUrl() string { + if o == nil || utils.IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *InvoiceItem) HasUrl() bool { + if o != nil && !utils.IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *InvoiceItem) SetUrl(v string) { + o.Url = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *InvoiceItem) GetCategory() string { + if o == nil || utils.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceItem) GetCategoryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *InvoiceItem) HasCategory() bool { + if o != nil && !utils.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *InvoiceItem) SetCategory(v string) { + o.Category = &v +} + +func (o InvoiceItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["price"] = o.Price + toSerialize["quantity"] = o.Quantity + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !utils.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + return toSerialize, nil +} + +type NullableInvoiceItem struct { + value *InvoiceItem + isSet bool +} + +func (v NullableInvoiceItem) Get() *InvoiceItem { + return v.value +} + +func (v *NullableInvoiceItem) Set(val *InvoiceItem) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceItem(val *InvoiceItem) *NullableInvoiceItem { + return &NullableInvoiceItem{value: val, isSet: true} +} + +func (v NullableInvoiceItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_not_found_error.go b/invoice/model_invoice_not_found_error.go new file mode 100644 index 00000000..7ab77056 --- /dev/null +++ b/invoice/model_invoice_not_found_error.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the InvoiceNotFoundError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceNotFoundError{} + +// InvoiceNotFoundError Response definition for a 404 Not Found error when creating an invoice. +type InvoiceNotFoundError struct { + // The error code indicating the type of error that occurred. + ErrorCode string `json:"error_code"` + // A human-readable error message that provides additional information about the error. + Message string `json:"message"` +} + +// NewInvoiceNotFoundError instantiates a new InvoiceNotFoundError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceNotFoundError(errorCode string, message string) *InvoiceNotFoundError { + this := InvoiceNotFoundError{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewInvoiceNotFoundErrorWithDefaults instantiates a new InvoiceNotFoundError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceNotFoundErrorWithDefaults() *InvoiceNotFoundError { + this := InvoiceNotFoundError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *InvoiceNotFoundError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *InvoiceNotFoundError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *InvoiceNotFoundError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *InvoiceNotFoundError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *InvoiceNotFoundError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *InvoiceNotFoundError) SetMessage(v string) { + o.Message = v +} + +func (o InvoiceNotFoundError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceNotFoundError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableInvoiceNotFoundError struct { + value *InvoiceNotFoundError + isSet bool +} + +func (v NullableInvoiceNotFoundError) Get() *InvoiceNotFoundError { + return v.value +} + +func (v *NullableInvoiceNotFoundError) Set(val *InvoiceNotFoundError) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceNotFoundError) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceNotFoundError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceNotFoundError(val *InvoiceNotFoundError) *NullableInvoiceNotFoundError { + return &NullableInvoiceNotFoundError{value: val, isSet: true} +} + +func (v NullableInvoiceNotFoundError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceNotFoundError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_payment_method.go b/invoice/model_invoice_payment_method.go new file mode 100644 index 00000000..acf30940 --- /dev/null +++ b/invoice/model_invoice_payment_method.go @@ -0,0 +1,131 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// InvoicePaymentMethod Representing the payment method used for an invoice. +type InvoicePaymentMethod string + +// List of InvoicePaymentMethod +const ( + INVOICEPAYMENTMETHOD_POOL InvoicePaymentMethod = "POOL" + INVOICEPAYMENTMETHOD_CALLBACK_VIRTUAL_ACCOUNT InvoicePaymentMethod = "CALLBACK_VIRTUAL_ACCOUNT" + INVOICEPAYMENTMETHOD_CREDIT_CARD InvoicePaymentMethod = "CREDIT_CARD" + INVOICEPAYMENTMETHOD_RETAIL_OUTLET InvoicePaymentMethod = "RETAIL_OUTLET" + INVOICEPAYMENTMETHOD_QR_CODE InvoicePaymentMethod = "QR_CODE" + INVOICEPAYMENTMETHOD_QRIS InvoicePaymentMethod = "QRIS" + INVOICEPAYMENTMETHOD_EWALLET InvoicePaymentMethod = "EWALLET" + INVOICEPAYMENTMETHOD_DIRECT_DEBIT InvoicePaymentMethod = "DIRECT_DEBIT" + INVOICEPAYMENTMETHOD_BANK_TRANSFER InvoicePaymentMethod = "BANK_TRANSFER" + INVOICEPAYMENTMETHOD_PAYLATER InvoicePaymentMethod = "PAYLATER" +) + +// All allowed values of InvoicePaymentMethod enum +var AllowedInvoicePaymentMethodEnumValues = []InvoicePaymentMethod{ + "POOL", + "CALLBACK_VIRTUAL_ACCOUNT", + "CREDIT_CARD", + "RETAIL_OUTLET", + "QR_CODE", + "QRIS", + "EWALLET", + "DIRECT_DEBIT", + "BANK_TRANSFER", + "PAYLATER", +} + +func (v *InvoicePaymentMethod) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvoicePaymentMethod(value) + for _, existing := range AllowedInvoicePaymentMethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvoicePaymentMethod", value) +} + +// NewInvoicePaymentMethodFromValue returns a pointer to a valid InvoicePaymentMethod +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvoicePaymentMethodFromValue(v string) (*InvoicePaymentMethod, error) { + ev := InvoicePaymentMethod(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvoicePaymentMethod: valid values are %v", v, AllowedInvoicePaymentMethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvoicePaymentMethod) IsValid() bool { + for _, existing := range AllowedInvoicePaymentMethodEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v InvoicePaymentMethod) String() string { + return string(v) +} + +// Ptr returns reference to InvoicePaymentMethod value +func (v InvoicePaymentMethod) Ptr() *InvoicePaymentMethod { + return &v +} + +type NullableInvoicePaymentMethod struct { + value *InvoicePaymentMethod + isSet bool +} + +func (v NullableInvoicePaymentMethod) Get() *InvoicePaymentMethod { + return v.value +} + +func (v *NullableInvoicePaymentMethod) Set(val *InvoicePaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullableInvoicePaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoicePaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoicePaymentMethod(val *InvoicePaymentMethod) *NullableInvoicePaymentMethod { + return &NullableInvoicePaymentMethod{value: val, isSet: true} +} + +func (v NullableInvoicePaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoicePaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_status.go b/invoice/model_invoice_status.go new file mode 100644 index 00000000..6f58011c --- /dev/null +++ b/invoice/model_invoice_status.go @@ -0,0 +1,119 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// InvoiceStatus Representing the status of an invoice. +type InvoiceStatus string + +// List of InvoiceStatus +const ( + INVOICESTATUS_PENDING InvoiceStatus = "PENDING" + INVOICESTATUS_PAID InvoiceStatus = "PAID" + INVOICESTATUS_SETTLED InvoiceStatus = "SETTLED" + INVOICESTATUS_EXPIRED InvoiceStatus = "EXPIRED" +) + +// All allowed values of InvoiceStatus enum +var AllowedInvoiceStatusEnumValues = []InvoiceStatus{ + "PENDING", + "PAID", + "SETTLED", + "EXPIRED", +} + +func (v *InvoiceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvoiceStatus(value) + for _, existing := range AllowedInvoiceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvoiceStatus", value) +} + +// NewInvoiceStatusFromValue returns a pointer to a valid InvoiceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvoiceStatusFromValue(v string) (*InvoiceStatus, error) { + ev := InvoiceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvoiceStatus: valid values are %v", v, AllowedInvoiceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvoiceStatus) IsValid() bool { + for _, existing := range AllowedInvoiceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v InvoiceStatus) String() string { + return string(v) +} + +// Ptr returns reference to InvoiceStatus value +func (v InvoiceStatus) Ptr() *InvoiceStatus { + return &v +} + +type NullableInvoiceStatus struct { + value *InvoiceStatus + isSet bool +} + +func (v NullableInvoiceStatus) Get() *InvoiceStatus { + return v.value +} + +func (v *NullableInvoiceStatus) Set(val *InvoiceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceStatus(val *InvoiceStatus) *NullableInvoiceStatus { + return &NullableInvoiceStatus{value: val, isSet: true} +} + +func (v NullableInvoiceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_notification_channel.go b/invoice/model_notification_channel.go new file mode 100644 index 00000000..3ae13655 --- /dev/null +++ b/invoice/model_notification_channel.go @@ -0,0 +1,119 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// NotificationChannel Representing a notification channel for sending messages. +type NotificationChannel string + +// List of NotificationChannel +const ( + NOTIFICATIONCHANNEL_EMAIL NotificationChannel = "email" + NOTIFICATIONCHANNEL_SMS NotificationChannel = "sms" + NOTIFICATIONCHANNEL_WHATSAPP NotificationChannel = "whatsapp" + NOTIFICATIONCHANNEL_VIBER NotificationChannel = "viber" +) + +// All allowed values of NotificationChannel enum +var AllowedNotificationChannelEnumValues = []NotificationChannel{ + "email", + "sms", + "whatsapp", + "viber", +} + +func (v *NotificationChannel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NotificationChannel(value) + for _, existing := range AllowedNotificationChannelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NotificationChannel", value) +} + +// NewNotificationChannelFromValue returns a pointer to a valid NotificationChannel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNotificationChannelFromValue(v string) (*NotificationChannel, error) { + ev := NotificationChannel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NotificationChannel: valid values are %v", v, AllowedNotificationChannelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NotificationChannel) IsValid() bool { + for _, existing := range AllowedNotificationChannelEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v NotificationChannel) String() string { + return string(v) +} + +// Ptr returns reference to NotificationChannel value +func (v NotificationChannel) Ptr() *NotificationChannel { + return &v +} + +type NullableNotificationChannel struct { + value *NotificationChannel + isSet bool +} + +func (v NullableNotificationChannel) Get() *NotificationChannel { + return v.value +} + +func (v *NullableNotificationChannel) Set(val *NotificationChannel) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationChannel(val *NotificationChannel) *NullableNotificationChannel { + return &NullableNotificationChannel{value: val, isSet: true} +} + +func (v NullableNotificationChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_notification_preference.go b/invoice/model_notification_preference.go new file mode 100644 index 00000000..04c06f52 --- /dev/null +++ b/invoice/model_notification_preference.go @@ -0,0 +1,242 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the NotificationPreference type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &NotificationPreference{} + +// NotificationPreference An object representing notification preferences for different invoice events. +type NotificationPreference struct { + // Notification channels for when an invoice is created. + InvoiceCreated []NotificationChannel `json:"invoice_created,omitempty"` + // Notification channels for invoice reminders. + InvoiceReminder []NotificationChannel `json:"invoice_reminder,omitempty"` + // Notification channels for expired invoices. + InvoiceExpired []NotificationChannel `json:"invoice_expired,omitempty"` + // Notification channels for when an invoice is paid. + InvoicePaid []NotificationChannel `json:"invoice_paid,omitempty"` +} + +// NewNotificationPreference instantiates a new NotificationPreference object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationPreference() *NotificationPreference { + this := NotificationPreference{} + return &this +} + +// NewNotificationPreferenceWithDefaults instantiates a new NotificationPreference object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationPreferenceWithDefaults() *NotificationPreference { + this := NotificationPreference{} + return &this +} + +// GetInvoiceCreated returns the InvoiceCreated field value if set, zero value otherwise. +func (o *NotificationPreference) GetInvoiceCreated() []NotificationChannel { + if o == nil || utils.IsNil(o.InvoiceCreated) { + var ret []NotificationChannel + return ret + } + return o.InvoiceCreated +} + +// GetInvoiceCreatedOk returns a tuple with the InvoiceCreated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationPreference) GetInvoiceCreatedOk() ([]NotificationChannel, bool) { + if o == nil || utils.IsNil(o.InvoiceCreated) { + return nil, false + } + return o.InvoiceCreated, true +} + +// HasInvoiceCreated returns a boolean if a field has been set. +func (o *NotificationPreference) HasInvoiceCreated() bool { + if o != nil && !utils.IsNil(o.InvoiceCreated) { + return true + } + + return false +} + +// SetInvoiceCreated gets a reference to the given []NotificationChannel and assigns it to the InvoiceCreated field. +func (o *NotificationPreference) SetInvoiceCreated(v []NotificationChannel) { + o.InvoiceCreated = v +} + +// GetInvoiceReminder returns the InvoiceReminder field value if set, zero value otherwise. +func (o *NotificationPreference) GetInvoiceReminder() []NotificationChannel { + if o == nil || utils.IsNil(o.InvoiceReminder) { + var ret []NotificationChannel + return ret + } + return o.InvoiceReminder +} + +// GetInvoiceReminderOk returns a tuple with the InvoiceReminder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationPreference) GetInvoiceReminderOk() ([]NotificationChannel, bool) { + if o == nil || utils.IsNil(o.InvoiceReminder) { + return nil, false + } + return o.InvoiceReminder, true +} + +// HasInvoiceReminder returns a boolean if a field has been set. +func (o *NotificationPreference) HasInvoiceReminder() bool { + if o != nil && !utils.IsNil(o.InvoiceReminder) { + return true + } + + return false +} + +// SetInvoiceReminder gets a reference to the given []NotificationChannel and assigns it to the InvoiceReminder field. +func (o *NotificationPreference) SetInvoiceReminder(v []NotificationChannel) { + o.InvoiceReminder = v +} + +// GetInvoiceExpired returns the InvoiceExpired field value if set, zero value otherwise. +func (o *NotificationPreference) GetInvoiceExpired() []NotificationChannel { + if o == nil || utils.IsNil(o.InvoiceExpired) { + var ret []NotificationChannel + return ret + } + return o.InvoiceExpired +} + +// GetInvoiceExpiredOk returns a tuple with the InvoiceExpired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationPreference) GetInvoiceExpiredOk() ([]NotificationChannel, bool) { + if o == nil || utils.IsNil(o.InvoiceExpired) { + return nil, false + } + return o.InvoiceExpired, true +} + +// HasInvoiceExpired returns a boolean if a field has been set. +func (o *NotificationPreference) HasInvoiceExpired() bool { + if o != nil && !utils.IsNil(o.InvoiceExpired) { + return true + } + + return false +} + +// SetInvoiceExpired gets a reference to the given []NotificationChannel and assigns it to the InvoiceExpired field. +func (o *NotificationPreference) SetInvoiceExpired(v []NotificationChannel) { + o.InvoiceExpired = v +} + +// GetInvoicePaid returns the InvoicePaid field value if set, zero value otherwise. +func (o *NotificationPreference) GetInvoicePaid() []NotificationChannel { + if o == nil || utils.IsNil(o.InvoicePaid) { + var ret []NotificationChannel + return ret + } + return o.InvoicePaid +} + +// GetInvoicePaidOk returns a tuple with the InvoicePaid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationPreference) GetInvoicePaidOk() ([]NotificationChannel, bool) { + if o == nil || utils.IsNil(o.InvoicePaid) { + return nil, false + } + return o.InvoicePaid, true +} + +// HasInvoicePaid returns a boolean if a field has been set. +func (o *NotificationPreference) HasInvoicePaid() bool { + if o != nil && !utils.IsNil(o.InvoicePaid) { + return true + } + + return false +} + +// SetInvoicePaid gets a reference to the given []NotificationChannel and assigns it to the InvoicePaid field. +func (o *NotificationPreference) SetInvoicePaid(v []NotificationChannel) { + o.InvoicePaid = v +} + +func (o NotificationPreference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationPreference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.InvoiceCreated) { + toSerialize["invoice_created"] = o.InvoiceCreated + } + if !utils.IsNil(o.InvoiceReminder) { + toSerialize["invoice_reminder"] = o.InvoiceReminder + } + if !utils.IsNil(o.InvoiceExpired) { + toSerialize["invoice_expired"] = o.InvoiceExpired + } + if !utils.IsNil(o.InvoicePaid) { + toSerialize["invoice_paid"] = o.InvoicePaid + } + return toSerialize, nil +} + +type NullableNotificationPreference struct { + value *NotificationPreference + isSet bool +} + +func (v NullableNotificationPreference) Get() *NotificationPreference { + return v.value +} + +func (v *NullableNotificationPreference) Set(val *NotificationPreference) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationPreference) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationPreference) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationPreference(val *NotificationPreference) *NullableNotificationPreference { + return &NullableNotificationPreference{value: val, isSet: true} +} + +func (v NullableNotificationPreference) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationPreference) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_paylater.go b/invoice/model_paylater.go new file mode 100644 index 00000000..37a0dec2 --- /dev/null +++ b/invoice/model_paylater.go @@ -0,0 +1,158 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Paylater type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Paylater{} + +// Paylater An object representing paylater details for invoices. +type Paylater struct { + PaylaterType PaylaterType `json:"paylater_type"` + // Indicates whether this paylater option should be excluded. + ShouldExclude *bool `json:"should_exclude,omitempty"` +} + +// NewPaylater instantiates a new Paylater object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaylater(paylaterType PaylaterType) *Paylater { + this := Paylater{} + this.PaylaterType = paylaterType + return &this +} + +// NewPaylaterWithDefaults instantiates a new Paylater object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaylaterWithDefaults() *Paylater { + this := Paylater{} + return &this +} + +// GetPaylaterType returns the PaylaterType field value +func (o *Paylater) GetPaylaterType() PaylaterType { + if o == nil { + var ret PaylaterType + return ret + } + + return o.PaylaterType +} + +// GetPaylaterTypeOk returns a tuple with the PaylaterType field value +// and a boolean to check if the value has been set. +func (o *Paylater) GetPaylaterTypeOk() (*PaylaterType, bool) { + if o == nil { + return nil, false + } + return &o.PaylaterType, true +} + +// SetPaylaterType sets field value +func (o *Paylater) SetPaylaterType(v PaylaterType) { + o.PaylaterType = v +} + +// GetShouldExclude returns the ShouldExclude field value if set, zero value otherwise. +func (o *Paylater) GetShouldExclude() bool { + if o == nil || utils.IsNil(o.ShouldExclude) { + var ret bool + return ret + } + return *o.ShouldExclude +} + +// GetShouldExcludeOk returns a tuple with the ShouldExclude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Paylater) GetShouldExcludeOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldExclude) { + return nil, false + } + return o.ShouldExclude, true +} + +// HasShouldExclude returns a boolean if a field has been set. +func (o *Paylater) HasShouldExclude() bool { + if o != nil && !utils.IsNil(o.ShouldExclude) { + return true + } + + return false +} + +// SetShouldExclude gets a reference to the given bool and assigns it to the ShouldExclude field. +func (o *Paylater) SetShouldExclude(v bool) { + o.ShouldExclude = &v +} + +func (o Paylater) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Paylater) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["paylater_type"] = o.PaylaterType + if !utils.IsNil(o.ShouldExclude) { + toSerialize["should_exclude"] = o.ShouldExclude + } + return toSerialize, nil +} + +type NullablePaylater struct { + value *Paylater + isSet bool +} + +func (v NullablePaylater) Get() *Paylater { + return v.value +} + +func (v *NullablePaylater) Set(val *Paylater) { + v.value = val + v.isSet = true +} + +func (v NullablePaylater) IsSet() bool { + return v.isSet +} + +func (v *NullablePaylater) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaylater(val *Paylater) *NullablePaylater { + return &NullablePaylater{value: val, isSet: true} +} + +func (v NullablePaylater) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaylater) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_paylater_type.go b/invoice/model_paylater_type.go new file mode 100644 index 00000000..c80a7127 --- /dev/null +++ b/invoice/model_paylater_type.go @@ -0,0 +1,123 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// PaylaterType Representing the available paylater channels used for invoice-related transactions. +type PaylaterType string + +// List of PaylaterType +const ( + PAYLATERTYPE_KREDIVO PaylaterType = "KREDIVO" + PAYLATERTYPE_AKULAKU PaylaterType = "AKULAKU" + PAYLATERTYPE_UANGME PaylaterType = "UANGME" + PAYLATERTYPE_BILLEASE PaylaterType = "BILLEASE" + PAYLATERTYPE_CASHALO PaylaterType = "CASHALO" + PAYLATERTYPE_ATOME PaylaterType = "ATOME" +) + +// All allowed values of PaylaterType enum +var AllowedPaylaterTypeEnumValues = []PaylaterType{ + "KREDIVO", + "AKULAKU", + "UANGME", + "BILLEASE", + "CASHALO", + "ATOME", +} + +func (v *PaylaterType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaylaterType(value) + for _, existing := range AllowedPaylaterTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaylaterType", value) +} + +// NewPaylaterTypeFromValue returns a pointer to a valid PaylaterType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaylaterTypeFromValue(v string) (*PaylaterType, error) { + ev := PaylaterType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaylaterType: valid values are %v", v, AllowedPaylaterTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaylaterType) IsValid() bool { + for _, existing := range AllowedPaylaterTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaylaterType) String() string { + return string(v) +} + +// Ptr returns reference to PaylaterType value +func (v PaylaterType) Ptr() *PaylaterType { + return &v +} + +type NullablePaylaterType struct { + value *PaylaterType + isSet bool +} + +func (v NullablePaylaterType) Get() *PaylaterType { + return v.value +} + +func (v *NullablePaylaterType) Set(val *PaylaterType) { + v.value = val + v.isSet = true +} + +func (v NullablePaylaterType) IsSet() bool { + return v.isSet +} + +func (v *NullablePaylaterType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaylaterType(val *PaylaterType) *NullablePaylaterType { + return &NullablePaylaterType{value: val, isSet: true} +} + +func (v NullablePaylaterType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaylaterType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_qr_code.go b/invoice/model_qr_code.go new file mode 100644 index 00000000..e3db115e --- /dev/null +++ b/invoice/model_qr_code.go @@ -0,0 +1,121 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the QrCode type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QrCode{} + +// QrCode An object representing QR code details for invoices. +type QrCode struct { + QrCodeType QrCodeType `json:"qr_code_type"` +} + +// NewQrCode instantiates a new QrCode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQrCode(qrCodeType QrCodeType) *QrCode { + this := QrCode{} + this.QrCodeType = qrCodeType + return &this +} + +// NewQrCodeWithDefaults instantiates a new QrCode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQrCodeWithDefaults() *QrCode { + this := QrCode{} + return &this +} + +// GetQrCodeType returns the QrCodeType field value +func (o *QrCode) GetQrCodeType() QrCodeType { + if o == nil { + var ret QrCodeType + return ret + } + + return o.QrCodeType +} + +// GetQrCodeTypeOk returns a tuple with the QrCodeType field value +// and a boolean to check if the value has been set. +func (o *QrCode) GetQrCodeTypeOk() (*QrCodeType, bool) { + if o == nil { + return nil, false + } + return &o.QrCodeType, true +} + +// SetQrCodeType sets field value +func (o *QrCode) SetQrCodeType(v QrCodeType) { + o.QrCodeType = v +} + +func (o QrCode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QrCode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["qr_code_type"] = o.QrCodeType + return toSerialize, nil +} + +type NullableQrCode struct { + value *QrCode + isSet bool +} + +func (v NullableQrCode) Get() *QrCode { + return v.value +} + +func (v *NullableQrCode) Set(val *QrCode) { + v.value = val + v.isSet = true +} + +func (v NullableQrCode) IsSet() bool { + return v.isSet +} + +func (v *NullableQrCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQrCode(val *QrCode) *NullableQrCode { + return &NullableQrCode{value: val, isSet: true} +} + +func (v NullableQrCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQrCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_qr_code_type.go b/invoice/model_qr_code_type.go new file mode 100644 index 00000000..c07d6733 --- /dev/null +++ b/invoice/model_qr_code_type.go @@ -0,0 +1,115 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// QrCodeType Representing the available QR Code channels used for invoice-related transactions. +type QrCodeType string + +// List of QrCodeType +const ( + QRCODETYPE_QRIS QrCodeType = "QRIS" + QRCODETYPE_PROMPTPAY QrCodeType = "PROMPTPAY" +) + +// All allowed values of QrCodeType enum +var AllowedQrCodeTypeEnumValues = []QrCodeType{ + "QRIS", + "PROMPTPAY", +} + +func (v *QrCodeType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := QrCodeType(value) + for _, existing := range AllowedQrCodeTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid QrCodeType", value) +} + +// NewQrCodeTypeFromValue returns a pointer to a valid QrCodeType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewQrCodeTypeFromValue(v string) (*QrCodeType, error) { + ev := QrCodeType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for QrCodeType: valid values are %v", v, AllowedQrCodeTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v QrCodeType) IsValid() bool { + for _, existing := range AllowedQrCodeTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v QrCodeType) String() string { + return string(v) +} + +// Ptr returns reference to QrCodeType value +func (v QrCodeType) Ptr() *QrCodeType { + return &v +} + +type NullableQrCodeType struct { + value *QrCodeType + isSet bool +} + +func (v NullableQrCodeType) Get() *QrCodeType { + return v.value +} + +func (v *NullableQrCodeType) Set(val *QrCodeType) { + v.value = val + v.isSet = true +} + +func (v NullableQrCodeType) IsSet() bool { + return v.isSet +} + +func (v *NullableQrCodeType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQrCodeType(val *QrCodeType) *NullableQrCodeType { + return &NullableQrCodeType{value: val, isSet: true} +} + +func (v NullableQrCodeType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQrCodeType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_retail_outlet.go b/invoice/model_retail_outlet.go new file mode 100644 index 00000000..19e4c3fd --- /dev/null +++ b/invoice/model_retail_outlet.go @@ -0,0 +1,232 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the RetailOutlet type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &RetailOutlet{} + +// RetailOutlet An object representing retail outlet details for invoices. +type RetailOutlet struct { + RetailOutletName RetailOutletName `json:"retail_outlet_name"` + // The payment code. + PaymentCode *string `json:"payment_code,omitempty"` + // The transfer amount. + TransferAmount *float32 `json:"transfer_amount,omitempty"` + // The name of the merchant. + MerchantName *string `json:"merchant_name,omitempty"` +} + +// NewRetailOutlet instantiates a new RetailOutlet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRetailOutlet(retailOutletName RetailOutletName) *RetailOutlet { + this := RetailOutlet{} + this.RetailOutletName = retailOutletName + return &this +} + +// NewRetailOutletWithDefaults instantiates a new RetailOutlet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRetailOutletWithDefaults() *RetailOutlet { + this := RetailOutlet{} + return &this +} + +// GetRetailOutletName returns the RetailOutletName field value +func (o *RetailOutlet) GetRetailOutletName() RetailOutletName { + if o == nil { + var ret RetailOutletName + return ret + } + + return o.RetailOutletName +} + +// GetRetailOutletNameOk returns a tuple with the RetailOutletName field value +// and a boolean to check if the value has been set. +func (o *RetailOutlet) GetRetailOutletNameOk() (*RetailOutletName, bool) { + if o == nil { + return nil, false + } + return &o.RetailOutletName, true +} + +// SetRetailOutletName sets field value +func (o *RetailOutlet) SetRetailOutletName(v RetailOutletName) { + o.RetailOutletName = v +} + +// GetPaymentCode returns the PaymentCode field value if set, zero value otherwise. +func (o *RetailOutlet) GetPaymentCode() string { + if o == nil || utils.IsNil(o.PaymentCode) { + var ret string + return ret + } + return *o.PaymentCode +} + +// GetPaymentCodeOk returns a tuple with the PaymentCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetailOutlet) GetPaymentCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentCode) { + return nil, false + } + return o.PaymentCode, true +} + +// HasPaymentCode returns a boolean if a field has been set. +func (o *RetailOutlet) HasPaymentCode() bool { + if o != nil && !utils.IsNil(o.PaymentCode) { + return true + } + + return false +} + +// SetPaymentCode gets a reference to the given string and assigns it to the PaymentCode field. +func (o *RetailOutlet) SetPaymentCode(v string) { + o.PaymentCode = &v +} + +// GetTransferAmount returns the TransferAmount field value if set, zero value otherwise. +func (o *RetailOutlet) GetTransferAmount() float32 { + if o == nil || utils.IsNil(o.TransferAmount) { + var ret float32 + return ret + } + return *o.TransferAmount +} + +// GetTransferAmountOk returns a tuple with the TransferAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetailOutlet) GetTransferAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.TransferAmount) { + return nil, false + } + return o.TransferAmount, true +} + +// HasTransferAmount returns a boolean if a field has been set. +func (o *RetailOutlet) HasTransferAmount() bool { + if o != nil && !utils.IsNil(o.TransferAmount) { + return true + } + + return false +} + +// SetTransferAmount gets a reference to the given float32 and assigns it to the TransferAmount field. +func (o *RetailOutlet) SetTransferAmount(v float32) { + o.TransferAmount = &v +} + +// GetMerchantName returns the MerchantName field value if set, zero value otherwise. +func (o *RetailOutlet) GetMerchantName() string { + if o == nil || utils.IsNil(o.MerchantName) { + var ret string + return ret + } + return *o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RetailOutlet) GetMerchantNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantName) { + return nil, false + } + return o.MerchantName, true +} + +// HasMerchantName returns a boolean if a field has been set. +func (o *RetailOutlet) HasMerchantName() bool { + if o != nil && !utils.IsNil(o.MerchantName) { + return true + } + + return false +} + +// SetMerchantName gets a reference to the given string and assigns it to the MerchantName field. +func (o *RetailOutlet) SetMerchantName(v string) { + o.MerchantName = &v +} + +func (o RetailOutlet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RetailOutlet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["retail_outlet_name"] = o.RetailOutletName + if !utils.IsNil(o.PaymentCode) { + toSerialize["payment_code"] = o.PaymentCode + } + if !utils.IsNil(o.TransferAmount) { + toSerialize["transfer_amount"] = o.TransferAmount + } + if !utils.IsNil(o.MerchantName) { + toSerialize["merchant_name"] = o.MerchantName + } + return toSerialize, nil +} + +type NullableRetailOutlet struct { + value *RetailOutlet + isSet bool +} + +func (v NullableRetailOutlet) Get() *RetailOutlet { + return v.value +} + +func (v *NullableRetailOutlet) Set(val *RetailOutlet) { + v.value = val + v.isSet = true +} + +func (v NullableRetailOutlet) IsSet() bool { + return v.isSet +} + +func (v *NullableRetailOutlet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetailOutlet(val *RetailOutlet) *NullableRetailOutlet { + return &NullableRetailOutlet{value: val, isSet: true} +} + +func (v NullableRetailOutlet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetailOutlet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_retail_outlet_name.go b/invoice/model_retail_outlet_name.go new file mode 100644 index 00000000..63482c58 --- /dev/null +++ b/invoice/model_retail_outlet_name.go @@ -0,0 +1,129 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// RetailOutletName Representing the available retail outlet channels used for invoice-related transactions. +type RetailOutletName string + +// List of RetailOutletName +const ( + RETAILOUTLETNAME_ALFAMART RetailOutletName = "ALFAMART" + RETAILOUTLETNAME_INDOMARET RetailOutletName = "INDOMARET" + RETAILOUTLETNAME__7_ELEVEN RetailOutletName = "7ELEVEN" + RETAILOUTLETNAME_CEBUANA RetailOutletName = "CEBUANA" + RETAILOUTLETNAME_DP_ECPAY_LOAN RetailOutletName = "DP_ECPAY_LOAN" + RETAILOUTLETNAME_DP_MLHUILLIER RetailOutletName = "DP_MLHUILLIER" + RETAILOUTLETNAME_DP_PALAWAN RetailOutletName = "DP_PALAWAN" + RETAILOUTLETNAME_DP_ECPAY_SCHOOL RetailOutletName = "DP_ECPAY_SCHOOL" + RETAILOUTLETNAME_LBC RetailOutletName = "LBC" +) + +// All allowed values of RetailOutletName enum +var AllowedRetailOutletNameEnumValues = []RetailOutletName{ + "ALFAMART", + "INDOMARET", + "7ELEVEN", + "CEBUANA", + "DP_ECPAY_LOAN", + "DP_MLHUILLIER", + "DP_PALAWAN", + "DP_ECPAY_SCHOOL", + "LBC", +} + +func (v *RetailOutletName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RetailOutletName(value) + for _, existing := range AllowedRetailOutletNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RetailOutletName", value) +} + +// NewRetailOutletNameFromValue returns a pointer to a valid RetailOutletName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRetailOutletNameFromValue(v string) (*RetailOutletName, error) { + ev := RetailOutletName(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RetailOutletName: valid values are %v", v, AllowedRetailOutletNameEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RetailOutletName) IsValid() bool { + for _, existing := range AllowedRetailOutletNameEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v RetailOutletName) String() string { + return string(v) +} + +// Ptr returns reference to RetailOutletName value +func (v RetailOutletName) Ptr() *RetailOutletName { + return &v +} + +type NullableRetailOutletName struct { + value *RetailOutletName + isSet bool +} + +func (v NullableRetailOutletName) Get() *RetailOutletName { + return v.value +} + +func (v *NullableRetailOutletName) Set(val *RetailOutletName) { + v.value = val + v.isSet = true +} + +func (v NullableRetailOutletName) IsSet() bool { + return v.isSet +} + +func (v *NullableRetailOutletName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRetailOutletName(val *RetailOutletName) *NullableRetailOutletName { + return &NullableRetailOutletName{value: val, isSet: true} +} + +func (v NullableRetailOutletName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRetailOutletName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_server_error.go b/invoice/model_server_error.go new file mode 100644 index 00000000..8b9aacff --- /dev/null +++ b/invoice/model_server_error.go @@ -0,0 +1,148 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ServerError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ServerError{} + +// ServerError struct for ServerError +type ServerError struct { + ErrorCode string `json:"error_code"` + Message string `json:"message"` +} + +// NewServerError instantiates a new ServerError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerError(errorCode string, message string) *ServerError { + this := ServerError{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewServerErrorWithDefaults instantiates a new ServerError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerErrorWithDefaults() *ServerError { + this := ServerError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *ServerError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *ServerError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *ServerError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *ServerError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ServerError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ServerError) SetMessage(v string) { + o.Message = v +} + +func (o ServerError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableServerError struct { + value *ServerError + isSet bool +} + +func (v NullableServerError) Get() *ServerError { + return v.value +} + +func (v *NullableServerError) Set(val *ServerError) { + v.value = val + v.isSet = true +} + +func (v NullableServerError) IsSet() bool { + return v.isSet +} + +func (v *NullableServerError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerError(val *ServerError) *NullableServerError { + return &NullableServerError{value: val, isSet: true} +} + +func (v NullableServerError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_unauthorized_error.go b/invoice/model_unauthorized_error.go new file mode 100644 index 00000000..f73a5929 --- /dev/null +++ b/invoice/model_unauthorized_error.go @@ -0,0 +1,150 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package invoice + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the UnauthorizedError type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &UnauthorizedError{} + +// UnauthorizedError An error object used to indicate unauthorized access to an invoice-related resource. +type UnauthorizedError struct { + // The specific error code associated with the unauthorized access. + ErrorCode string `json:"error_code"` + // A human-readable error message providing additional context about the unauthorized access. + Message string `json:"message"` +} + +// NewUnauthorizedError instantiates a new UnauthorizedError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnauthorizedError(errorCode string, message string) *UnauthorizedError { + this := UnauthorizedError{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewUnauthorizedErrorWithDefaults instantiates a new UnauthorizedError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnauthorizedErrorWithDefaults() *UnauthorizedError { + this := UnauthorizedError{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *UnauthorizedError) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *UnauthorizedError) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *UnauthorizedError) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *UnauthorizedError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UnauthorizedError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UnauthorizedError) SetMessage(v string) { + o.Message = v +} + +func (o UnauthorizedError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnauthorizedError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableUnauthorizedError struct { + value *UnauthorizedError + isSet bool +} + +func (v NullableUnauthorizedError) Get() *UnauthorizedError { + return v.value +} + +func (v *NullableUnauthorizedError) Set(val *UnauthorizedError) { + v.value = val + v.isSet = true +} + +func (v NullableUnauthorizedError) IsSet() bool { + return v.isSet +} + +func (v *NullableUnauthorizedError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnauthorizedError(val *UnauthorizedError) *NullableUnauthorizedError { + return &NullableUnauthorizedError{value: val, isSet: true} +} + +func (v NullableUnauthorizedError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnauthorizedError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/nullable.go b/invoice/nullable.go new file mode 100644 index 00000000..1e7ee8ac --- /dev/null +++ b/invoice/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package invoice + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/invoice/params.go b/invoice/params.go deleted file mode 100644 index ed9d5a4d..00000000 --- a/invoice/params.go +++ /dev/null @@ -1,94 +0,0 @@ -package invoice - -import ( - "net/url" - "strconv" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/urlvalues" -) - -// CreateParams contains parameters for Create -type CreateParams struct { - ForUserID string `json:"-"` - WithFeeRule string `json:"-"` // Note: response header fee_rule_id is not implemented yet - ExternalID string `json:"external_id" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - Description string `json:"description,omitempty"` - PayerEmail string `json:"payer_email,omitempty"` - ShouldSendEmail *bool `json:"should_send_email,omitempty"` - Customer xendit.InvoiceCustomer `json:"customer,omitempty"` - CustomerNotificationPreference xendit.InvoiceCustomerNotificationPreference `json:"customer_notification_preference,omitempty"` - InvoiceDuration int `json:"invoice_duration,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - PaymentMethods []string `json:"payment_methods,omitempty"` - Currency string `json:"currency,omitempty"` - FixedVA *bool `json:"fixed_va,omitempty"` - CallbackVirtualAccountID string `json:"callback_virtual_account_id,omitempty"` - MidLabel string `json:"mid_label,omitempty"` - ReminderTimeUnit string `json:"reminder_time_unit,omitempty"` - ReminderTime int `json:"reminder_time,omitempty"` - Locale string `json:"locale,omitempty"` - Items []xendit.InvoiceItem `json:"items,omitempty"` - Fees []xendit.InvoiceFee `json:"fees,omitempty"` - ShouldAuthenticateCreditCard bool `json:"should_authenticate_credit_card,omitempty"` -} - -// GetParams contains parameters for Get -type GetParams struct { - ForUserID string `json:"-"` - ID string `json:"id" validate:"required"` -} - -// GetAllParams contains parameters for GetAll -type GetAllParams struct { - ForUserID string `json:"-"` - Statuses []string `json:"statuses,omitempty"` - Limit int `json:"limit,omitempty"` - CreatedAfter time.Time `json:"created_after,omitempty"` - CreatedBefore time.Time `json:"created_before,omitempty"` - PaidAfter time.Time `json:"paid_after,omitempty"` - PaidBefore time.Time `json:"paid_before,omitempty"` - ExpiredAfter time.Time `json:"expired_after,omitempty"` - ExpiredBefore time.Time `json:"expired_before,omitempty"` - LastInvoiceID string `json:"last_invoice_id,omitempty"` - ClientTypes []string `json:"client_types,omitempty"` - PaymentChannels []string `json:"payment_channels,omitempty"` - OnDemandLink string `json:"on_demand_link,omitempty"` - RecurringPaymentID string `json:"recurring_payment_id,omitempty"` -} - -// QueryString creates query string from GetAllParams, ignores nil values -func (p *GetAllParams) QueryString() string { - urlValues := &url.Values{} - - urlvalues.AddStringSliceToURLValues(urlValues, p.Statuses, "statuses") - if p.Limit > 0 { - urlValues.Add("limit", strconv.Itoa(p.Limit)) - } - urlvalues.AddTimeToURLValues(urlValues, p.CreatedAfter, "created_after") - urlvalues.AddTimeToURLValues(urlValues, p.CreatedBefore, "created_before") - urlvalues.AddTimeToURLValues(urlValues, p.PaidAfter, "paid_after") - urlvalues.AddTimeToURLValues(urlValues, p.PaidBefore, "paid_before") - urlvalues.AddTimeToURLValues(urlValues, p.PaidBefore, "paid_before") - urlvalues.AddTimeToURLValues(urlValues, p.ExpiredAfter, "expired_after") - urlvalues.AddTimeToURLValues(urlValues, p.ExpiredBefore, "expired_before") - urlvalues.AddStringSliceToURLValues(urlValues, p.ClientTypes, "client_types") - urlvalues.AddStringSliceToURLValues(urlValues, p.PaymentChannels, "payment_channels") - if p.OnDemandLink != "" { - urlValues.Add("on_demand", p.OnDemandLink) - } - if p.RecurringPaymentID != "" { - urlValues.Add("recurring_payment_id", p.RecurringPaymentID) - } - - return urlValues.Encode() -} - -// ExpireParams contains parameters for Expire -type ExpireParams struct { - ID string `json:"id" validate:"required"` - ForUserID string `json:"-"` -} diff --git a/newhttprequest_113.go b/newhttprequest_113.go deleted file mode 100644 index e4183951..00000000 --- a/newhttprequest_113.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build go1.13 - -package xendit - -import ( - "context" - "io" - "net/http" -) - -func newHTTPRequestWithContext(ctx context.Context, method string, url string, body io.Reader) (*http.Request, error) { - return http.NewRequestWithContext( - ctx, - method, - url, - body, - ) -} diff --git a/newhttprequest_pre113.go b/newhttprequest_pre113.go deleted file mode 100644 index 0e39e83a..00000000 --- a/newhttprequest_pre113.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build !go1.13 - -package xendit - -import ( - "context" - "io" - "net/http" -) - -func newHTTPRequestWithContext(ctx context.Context, method string, url string, body io.Reader) (*http.Request, error) { - req, err := http.NewRequest( - method, - url, - body, - ) - if err != nil { - return nil, err - } - - return req.WithContext(ctx), nil -} diff --git a/payment_method.go b/payment_method.go deleted file mode 100644 index 54a42338..00000000 --- a/payment_method.go +++ /dev/null @@ -1,113 +0,0 @@ -package xendit - -import ( - "time" - - "github.com/xendit/xendit-go/pmsv2/card" - "github.com/xendit/xendit-go/pmsv2/constant" - "github.com/xendit/xendit-go/pmsv2/directdebit" - "github.com/xendit/xendit-go/pmsv2/ewallet" - "github.com/xendit/xendit-go/pmsv2/overthecounter" - "github.com/xendit/xendit-go/pmsv2/qrcode" - "github.com/xendit/xendit-go/pmsv2/virtualaccount" -) - -type PaymentMethodActions []Action - -type Action struct { - Action ActionType `json:"action"` - URL string `json:"url"` - URLType URLType `json:"url_type"` - HTTPMethod string `json:"method"` -} - -type ActionType string - -const ( - Auth ActionType = "AUTH" - ResendAuth ActionType = "RESEND_AUTH" - Capture ActionType = "CAPTURE" - Cancel ActionType = "CANCEL" -) - -type URLType string - -const ( - API URLType = "API" - Web URLType = "WEB" - Mobile URLType = "MOBILE" - Deeplink URLType = "DEEPLINK" -) - -type Metadata map[string]interface{} - -type BillingInformation struct { - Country constant.CountryEnum `json:"country"` - StreetLine1 *string `json:"street_line1"` - StreetLine2 *string `json:"street_line2"` - City *string `json:"city"` - ProvinceState *string `json:"province_state"` - PostalCode *string `json:"postal_code"` -} - -type EwalletMethod struct { - ChannelCode ewallet.ChannelCode `json:"channel_code"` - ChannelProperties ewallet.ChannelProperties `json:"channel_properties"` - Account ewallet.Account `json:"account"` -} - -type DirectDebitMethod struct { - ChannelCode directdebit.ChannelCode `json:"channel_code"` - ChannelProperties directdebit.ChannelProperties `json:"channel_properties"` - Type directdebit.Type `json:"type"` - BankAccount *directdebit.BankAccount `json:"bank_account"` - DebitCard *directdebit.DebitCard `json:"debit_card"` -} - -type OverTheCounterMethod struct { - Amount float64 `json:"amount"` - Currency constant.CurrencyEnum `json:"currency"` - ChannelCode overthecounter.ChannelCode `json:"channel_code"` - ChannelProperties overthecounter.ChannelProperties `json:"channel_properties"` -} - -type VirtualAccountMethod struct { - Amount float64 `json:"amount"` - MinimumAmount float64 `json:"min_amount,omitempty"` - MaximumAmount float64 `json:"max_amount,omitempty"` - Currency constant.CurrencyEnum `json:"currency"` - ChannelCode virtualaccount.ChannelCode `json:"channel_code"` - ChannelProperties virtualaccount.ChannelProperties `json:"channel_properties"` -} - -type QRCodeMethod struct { - Amount float64 `json:"amount"` - Currency constant.CurrencyEnum `json:"currency"` - ChannelCode qrcode.ChannelCode `json:"channel_code"` - ChannelProperties qrcode.ChannelProperties `json:"channel_properties"` -} - -type PaymentMethodResponse struct { - ID string `json:"id"` - Type constant.PaymentMethodTypeEnum `json:"type"` - Country constant.CountryEnum `json:"country"` - BusinessID string `json:"business_id"` - CustomerID *string `json:"customer_id"` - ReferenceID string `json:"reference_id,omitempty"` - Reusability constant.ReusabilityEnum `json:"reusability"` - Status constant.PaymentMethodStatusEnum `json:"status"` - Actions PaymentMethodActions `json:"actions"` - Description *string `json:"description"` - CreatedAt time.Time `json:"created"` - UpdatedAt time.Time `json:"updated"` - Metadata *Metadata `json:"metadata"` - BillingInformation *BillingInformation `json:"billing_information"` - FailureCode *string `json:"failure_code"` - - Ewallet *EwalletMethod `json:"ewallet"` - DirectDebit *DirectDebitMethod `json:"direct_debit"` - Card *card.Method `json:"card"` - OverTheCounter *OverTheCounterMethod `json:"over_the_counter"` - QRCode *QRCodeMethod `json:"qr_code"` - VirtualAccount *VirtualAccountMethod `json:"virtual_account"` -} diff --git a/payment_method/api_payment_method.go b/payment_method/api_payment_method.go new file mode 100644 index 00000000..8f1f366d --- /dev/null +++ b/payment_method/api_payment_method.go @@ -0,0 +1,1288 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package payment_method + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" + "reflect" + "time" +) + + +type PaymentMethodApi interface { + + /* + AuthPaymentMethod Validate a payment method's linking OTP + + This endpoint validates a payment method linking OTP + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiAuthPaymentMethodRequest + */ + AuthPaymentMethod(ctx context.Context, paymentMethodId string) ApiAuthPaymentMethodRequest + + // AuthPaymentMethodExecute executes the request + // @return PaymentMethod + AuthPaymentMethodExecute(r ApiAuthPaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) + + /* + CreatePaymentMethod Creates payment method + + This endpoint initiates creation of payment method + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePaymentMethodRequest + */ + CreatePaymentMethod(ctx context.Context) ApiCreatePaymentMethodRequest + + // CreatePaymentMethodExecute executes the request + // @return PaymentMethod + CreatePaymentMethodExecute(r ApiCreatePaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) + + /* + ExpirePaymentMethod Expires a payment method + + This endpoint expires a payment method and performs unlinking if necessary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiExpirePaymentMethodRequest + */ + ExpirePaymentMethod(ctx context.Context, paymentMethodId string) ApiExpirePaymentMethodRequest + + // ExpirePaymentMethodExecute executes the request + // @return PaymentMethod + ExpirePaymentMethodExecute(r ApiExpirePaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) + + /* + GetAllPaymentChannels Get all payment channels + + Get all payment channels + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentChannelsRequest + */ + GetAllPaymentChannels(ctx context.Context) ApiGetAllPaymentChannelsRequest + + // GetAllPaymentChannelsExecute executes the request + // @return PaymentChannelList + GetAllPaymentChannelsExecute(r ApiGetAllPaymentChannelsRequest) (*PaymentChannelList, *http.Response, *common.XenditSdkError) + + /* + GetAllPaymentMethods Get all payment methods by filters + + Get all payment methods by filters + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentMethodsRequest + */ + GetAllPaymentMethods(ctx context.Context) ApiGetAllPaymentMethodsRequest + + // GetAllPaymentMethodsExecute executes the request + // @return PaymentMethodList + GetAllPaymentMethodsExecute(r ApiGetAllPaymentMethodsRequest) (*PaymentMethodList, *http.Response, *common.XenditSdkError) + + /* + GetPaymentMethodByID Get payment method by ID + + Get payment method by ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiGetPaymentMethodByIDRequest + */ + GetPaymentMethodByID(ctx context.Context, paymentMethodId string) ApiGetPaymentMethodByIDRequest + + // GetPaymentMethodByIDExecute executes the request + // @return PaymentMethod + GetPaymentMethodByIDExecute(r ApiGetPaymentMethodByIDRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) + + /* + GetPaymentsByPaymentMethodId Returns payments with matching PaymentMethodID. + + Returns payments with matching PaymentMethodID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiGetPaymentsByPaymentMethodIdRequest + */ + GetPaymentsByPaymentMethodId(ctx context.Context, paymentMethodId string) ApiGetPaymentsByPaymentMethodIdRequest + + // GetPaymentsByPaymentMethodIdExecute executes the request + // @return map[string]interface{} + GetPaymentsByPaymentMethodIdExecute(r ApiGetPaymentsByPaymentMethodIdRequest) (map[string]interface{}, *http.Response, *common.XenditSdkError) + + /* + PatchPaymentMethod Patch payment methods + + This endpoint is used to toggle the ```status``` of an e-Wallet or a Direct Debit payment method to ```ACTIVE``` or ```INACTIVE```. This is also used to update the details of an Over-the-Counter or a Virtual Account payment method. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiPatchPaymentMethodRequest + */ + PatchPaymentMethod(ctx context.Context, paymentMethodId string) ApiPatchPaymentMethodRequest + + // PatchPaymentMethodExecute executes the request + // @return PaymentMethod + PatchPaymentMethodExecute(r ApiPatchPaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) + + /* + SimulatePayment Makes payment with matching PaymentMethodID. + + Makes payment with matching PaymentMethodID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiSimulatePaymentRequest + */ + SimulatePayment(ctx context.Context, paymentMethodId string) ApiSimulatePaymentRequest + + // SimulatePaymentExecute executes the request + SimulatePaymentExecute(r ApiSimulatePaymentRequest) (*http.Response, *common.XenditSdkError) +} + +// PaymentMethodApiService PaymentMethodApi service +type PaymentMethodApiService struct { + client common.IClient +} + +// NewPaymentMethodApi Create a new PaymentMethodApi service +func NewPaymentMethodApi (client common.IClient) PaymentMethodApi { + return &PaymentMethodApiService{ + client: client, + } +} + + +type ApiAuthPaymentMethodRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string + paymentMethodAuthParameters *PaymentMethodAuthParameters +} + +func (r ApiAuthPaymentMethodRequest) PaymentMethodAuthParameters(paymentMethodAuthParameters PaymentMethodAuthParameters) ApiAuthPaymentMethodRequest { + r.paymentMethodAuthParameters = &paymentMethodAuthParameters + return r +} + +func (r ApiAuthPaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, *common.XenditSdkError) { + return r.ApiService.AuthPaymentMethodExecute(r) +} + +/* +AuthPaymentMethod Validate a payment method's linking OTP + +This endpoint validates a payment method linking OTP + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiAuthPaymentMethodRequest +*/ +func (a *PaymentMethodApiService) AuthPaymentMethod(ctx context.Context, paymentMethodId string) ApiAuthPaymentMethodRequest { + return ApiAuthPaymentMethodRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +// @return PaymentMethod +func (a *PaymentMethodApiService) AuthPaymentMethodExecute(r ApiAuthPaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.AuthPaymentMethod") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.AuthPaymentMethodExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}/auth" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodAuthParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.AuthPaymentMethodExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreatePaymentMethodRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodParameters *PaymentMethodParameters +} + +func (r ApiCreatePaymentMethodRequest) PaymentMethodParameters(paymentMethodParameters PaymentMethodParameters) ApiCreatePaymentMethodRequest { + r.paymentMethodParameters = &paymentMethodParameters + return r +} + +func (r ApiCreatePaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, *common.XenditSdkError) { + return r.ApiService.CreatePaymentMethodExecute(r) +} + +/* +CreatePaymentMethod Creates payment method + +This endpoint initiates creation of payment method + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePaymentMethodRequest +*/ +func (a *PaymentMethodApiService) CreatePaymentMethod(ctx context.Context) ApiCreatePaymentMethodRequest { + return ApiCreatePaymentMethodRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaymentMethod +func (a *PaymentMethodApiService) CreatePaymentMethodExecute(r ApiCreatePaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.CreatePaymentMethod") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.CreatePaymentMethodExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.CreatePaymentMethodExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExpirePaymentMethodRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string + paymentMethodExpireParameters *PaymentMethodExpireParameters +} + +func (r ApiExpirePaymentMethodRequest) PaymentMethodExpireParameters(paymentMethodExpireParameters PaymentMethodExpireParameters) ApiExpirePaymentMethodRequest { + r.paymentMethodExpireParameters = &paymentMethodExpireParameters + return r +} + +func (r ApiExpirePaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, *common.XenditSdkError) { + return r.ApiService.ExpirePaymentMethodExecute(r) +} + +/* +ExpirePaymentMethod Expires a payment method + +This endpoint expires a payment method and performs unlinking if necessary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiExpirePaymentMethodRequest +*/ +func (a *PaymentMethodApiService) ExpirePaymentMethod(ctx context.Context, paymentMethodId string) ApiExpirePaymentMethodRequest { + return ApiExpirePaymentMethodRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +// @return PaymentMethod +func (a *PaymentMethodApiService) ExpirePaymentMethodExecute(r ApiExpirePaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.ExpirePaymentMethod") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.ExpirePaymentMethodExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}/expire" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodExpireParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.ExpirePaymentMethodExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAllPaymentChannelsRequest struct { + ctx context.Context + ApiService PaymentMethodApi + isActivated *bool + type_ *string +} + +func (r ApiGetAllPaymentChannelsRequest) IsActivated(isActivated bool) ApiGetAllPaymentChannelsRequest { + r.isActivated = &isActivated + return r +} + +func (r ApiGetAllPaymentChannelsRequest) Type_(type_ string) ApiGetAllPaymentChannelsRequest { + r.type_ = &type_ + return r +} + +func (r ApiGetAllPaymentChannelsRequest) Execute() (*PaymentChannelList, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetAllPaymentChannelsExecute(r) +} + +/* +GetAllPaymentChannels Get all payment channels + +Get all payment channels + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentChannelsRequest +*/ +func (a *PaymentMethodApiService) GetAllPaymentChannels(ctx context.Context) ApiGetAllPaymentChannelsRequest { + return ApiGetAllPaymentChannelsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaymentChannelList +func (a *PaymentMethodApiService) GetAllPaymentChannelsExecute(r ApiGetAllPaymentChannelsRequest) (*PaymentChannelList, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentChannelList + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.GetAllPaymentChannels") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetAllPaymentChannelsExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/channels" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.isActivated != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "is_activated", r.isActivated, "") + } + if r.type_ != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetAllPaymentChannelsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAllPaymentMethodsRequest struct { + ctx context.Context + ApiService PaymentMethodApi + id *[]string + type_ *[]string + status *[]PaymentMethodStatus + reusability *PaymentMethodReusability + customerId *string + referenceId *string + afterId *string + beforeId *string + limit *int32 +} + +func (r ApiGetAllPaymentMethodsRequest) Id(id []string) ApiGetAllPaymentMethodsRequest { + r.id = &id + return r +} + +func (r ApiGetAllPaymentMethodsRequest) Type_(type_ []string) ApiGetAllPaymentMethodsRequest { + r.type_ = &type_ + return r +} + +func (r ApiGetAllPaymentMethodsRequest) Status(status []PaymentMethodStatus) ApiGetAllPaymentMethodsRequest { + r.status = &status + return r +} + +func (r ApiGetAllPaymentMethodsRequest) Reusability(reusability PaymentMethodReusability) ApiGetAllPaymentMethodsRequest { + r.reusability = &reusability + return r +} + +func (r ApiGetAllPaymentMethodsRequest) CustomerId(customerId string) ApiGetAllPaymentMethodsRequest { + r.customerId = &customerId + return r +} + +func (r ApiGetAllPaymentMethodsRequest) ReferenceId(referenceId string) ApiGetAllPaymentMethodsRequest { + r.referenceId = &referenceId + return r +} + +func (r ApiGetAllPaymentMethodsRequest) AfterId(afterId string) ApiGetAllPaymentMethodsRequest { + r.afterId = &afterId + return r +} + +func (r ApiGetAllPaymentMethodsRequest) BeforeId(beforeId string) ApiGetAllPaymentMethodsRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetAllPaymentMethodsRequest) Limit(limit int32) ApiGetAllPaymentMethodsRequest { + r.limit = &limit + return r +} + +func (r ApiGetAllPaymentMethodsRequest) Execute() (*PaymentMethodList, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetAllPaymentMethodsExecute(r) +} + +/* +GetAllPaymentMethods Get all payment methods by filters + +Get all payment methods by filters + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentMethodsRequest +*/ +func (a *PaymentMethodApiService) GetAllPaymentMethods(ctx context.Context) ApiGetAllPaymentMethodsRequest { + return ApiGetAllPaymentMethodsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaymentMethodList +func (a *PaymentMethodApiService) GetAllPaymentMethodsExecute(r ApiGetAllPaymentMethodsRequest) (*PaymentMethodList, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethodList + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.GetAllPaymentMethods") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetAllPaymentMethodsExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.reusability != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reusability", r.reusability, "") + } + if r.customerId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "customer_id", r.customerId, "") + } + if r.referenceId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", r.referenceId, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetAllPaymentMethodsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPaymentMethodByIDRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string +} + +func (r ApiGetPaymentMethodByIDRequest) Execute() (*PaymentMethod, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPaymentMethodByIDExecute(r) +} + +/* +GetPaymentMethodByID Get payment method by ID + +Get payment method by ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiGetPaymentMethodByIDRequest +*/ +func (a *PaymentMethodApiService) GetPaymentMethodByID(ctx context.Context, paymentMethodId string) ApiGetPaymentMethodByIDRequest { + return ApiGetPaymentMethodByIDRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +// @return PaymentMethod +func (a *PaymentMethodApiService) GetPaymentMethodByIDExecute(r ApiGetPaymentMethodByIDRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.GetPaymentMethodByID") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetPaymentMethodByIDExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetPaymentMethodByIDExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPaymentsByPaymentMethodIdRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string + paymentRequestId *[]string + paymentMethodId2 *[]string + referenceId *[]string + paymentMethodType *[]PaymentMethodType + channelCode *[]string + status *[]string + currency *[]string + createdGte *time.Time + createdLte *time.Time + updatedGte *time.Time + updatedLte *time.Time + limit *int32 + afterId *string + beforeId *string +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) PaymentRequestId(paymentRequestId []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.paymentRequestId = &paymentRequestId + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) PaymentMethodId2(paymentMethodId2 []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.paymentMethodId2 = &paymentMethodId2 + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) ReferenceId(referenceId []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.referenceId = &referenceId + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) PaymentMethodType(paymentMethodType []PaymentMethodType) ApiGetPaymentsByPaymentMethodIdRequest { + r.paymentMethodType = &paymentMethodType + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) ChannelCode(channelCode []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.channelCode = &channelCode + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) Status(status []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.status = &status + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) Currency(currency []string) ApiGetPaymentsByPaymentMethodIdRequest { + r.currency = ¤cy + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) CreatedGte(createdGte time.Time) ApiGetPaymentsByPaymentMethodIdRequest { + r.createdGte = &createdGte + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) CreatedLte(createdLte time.Time) ApiGetPaymentsByPaymentMethodIdRequest { + r.createdLte = &createdLte + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) UpdatedGte(updatedGte time.Time) ApiGetPaymentsByPaymentMethodIdRequest { + r.updatedGte = &updatedGte + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) UpdatedLte(updatedLte time.Time) ApiGetPaymentsByPaymentMethodIdRequest { + r.updatedLte = &updatedLte + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) Limit(limit int32) ApiGetPaymentsByPaymentMethodIdRequest { + r.limit = &limit + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) AfterId(afterId string) ApiGetPaymentsByPaymentMethodIdRequest { + r.afterId = &afterId + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) BeforeId(beforeId string) ApiGetPaymentsByPaymentMethodIdRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetPaymentsByPaymentMethodIdRequest) Execute() (map[string]interface{}, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPaymentsByPaymentMethodIdExecute(r) +} + +/* +GetPaymentsByPaymentMethodId Returns payments with matching PaymentMethodID. + +Returns payments with matching PaymentMethodID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiGetPaymentsByPaymentMethodIdRequest +*/ +func (a *PaymentMethodApiService) GetPaymentsByPaymentMethodId(ctx context.Context, paymentMethodId string) ApiGetPaymentsByPaymentMethodIdRequest { + return ApiGetPaymentsByPaymentMethodIdRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *PaymentMethodApiService) GetPaymentsByPaymentMethodIdExecute(r ApiGetPaymentsByPaymentMethodIdRequest) (map[string]interface{}, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.GetPaymentsByPaymentMethodId") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetPaymentsByPaymentMethodIdExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}/payments" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.paymentRequestId != nil { + t := *r.paymentRequestId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_request_id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_request_id", t, "multi") + } + } + if r.paymentMethodId2 != nil { + t := *r.paymentMethodId2 + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_method_id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_method_id", t, "multi") + } + } + if r.referenceId != nil { + t := *r.referenceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", t, "multi") + } + } + if r.paymentMethodType != nil { + t := *r.paymentMethodType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_method_type", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "payment_method_type", t, "multi") + } + } + if r.channelCode != nil { + t := *r.channelCode + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_code", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_code", t, "multi") + } + } + if r.status != nil { + t := *r.status + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "status", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "status", t, "multi") + } + } + if r.currency != nil { + t := *r.currency + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "currency", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "currency", t, "multi") + } + } + if r.createdGte != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "created[gte]", r.createdGte, "") + } + if r.createdLte != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "created[lte]", r.createdLte, "") + } + if r.updatedGte != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "updated[gte]", r.updatedGte, "") + } + if r.updatedLte != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "updated[lte]", r.updatedLte, "") + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.GetPaymentsByPaymentMethodIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPatchPaymentMethodRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string + paymentMethodUpdateParameters *PaymentMethodUpdateParameters +} + +func (r ApiPatchPaymentMethodRequest) PaymentMethodUpdateParameters(paymentMethodUpdateParameters PaymentMethodUpdateParameters) ApiPatchPaymentMethodRequest { + r.paymentMethodUpdateParameters = &paymentMethodUpdateParameters + return r +} + +func (r ApiPatchPaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, *common.XenditSdkError) { + return r.ApiService.PatchPaymentMethodExecute(r) +} + +/* +PatchPaymentMethod Patch payment methods + +This endpoint is used to toggle the ```status``` of an e-Wallet or a Direct Debit payment method to ```ACTIVE``` or ```INACTIVE```. This is also used to update the details of an Over-the-Counter or a Virtual Account payment method. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiPatchPaymentMethodRequest +*/ +func (a *PaymentMethodApiService) PatchPaymentMethod(ctx context.Context, paymentMethodId string) ApiPatchPaymentMethodRequest { + return ApiPatchPaymentMethodRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +// @return PaymentMethod +func (a *PaymentMethodApiService) PatchPaymentMethodExecute(r ApiPatchPaymentMethodRequest) (*PaymentMethod, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.PatchPaymentMethod") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.PatchPaymentMethodExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodUpdateParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.PatchPaymentMethodExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSimulatePaymentRequest struct { + ctx context.Context + ApiService PaymentMethodApi + paymentMethodId string + simulatePaymentRequest *SimulatePaymentRequest +} + +func (r ApiSimulatePaymentRequest) SimulatePaymentRequest(simulatePaymentRequest SimulatePaymentRequest) ApiSimulatePaymentRequest { + r.simulatePaymentRequest = &simulatePaymentRequest + return r +} + +func (r ApiSimulatePaymentRequest) Execute() (*http.Response, *common.XenditSdkError) { + return r.ApiService.SimulatePaymentExecute(r) +} + +/* +SimulatePayment Makes payment with matching PaymentMethodID. + +Makes payment with matching PaymentMethodID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentMethodId + @return ApiSimulatePaymentRequest +*/ +func (a *PaymentMethodApiService) SimulatePayment(ctx context.Context, paymentMethodId string) ApiSimulatePaymentRequest { + return ApiSimulatePaymentRequest{ + ApiService: a, + ctx: ctx, + paymentMethodId: paymentMethodId, + } +} + +// Execute executes the request +func (a *PaymentMethodApiService) SimulatePaymentExecute(r ApiSimulatePaymentRequest) (*http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentMethodApiService.SimulatePayment") + if err != nil { + return nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.SimulatePaymentExecute") + } + + localVarPath := localBasePath + "/v2/payment_methods/{paymentMethodId}/payments/simulate" + localVarPath = strings.Replace(localVarPath, "{"+"paymentMethodId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentMethodId, "paymentMethodId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.simulatePaymentRequest + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentMethodApiService.SimulatePaymentExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarHTTPResponse, xenditSdkError + } + + return localVarHTTPResponse, nil +} diff --git a/payment_method/model_billing_information.go b/payment_method/model_billing_information.go new file mode 100644 index 00000000..4cfb2bc2 --- /dev/null +++ b/payment_method/model_billing_information.go @@ -0,0 +1,351 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the BillingInformation type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &BillingInformation{} + +// BillingInformation Billing Information +type BillingInformation struct { + Country string `json:"country"` + StreetLine1 NullableString `json:"street_line1,omitempty"` + StreetLine2 NullableString `json:"street_line2,omitempty"` + City NullableString `json:"city,omitempty"` + ProvinceState NullableString `json:"province_state,omitempty"` + PostalCode NullableString `json:"postal_code,omitempty"` +} + +// NewBillingInformation instantiates a new BillingInformation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBillingInformation(country string) *BillingInformation { + this := BillingInformation{} + this.Country = country + return &this +} + +// NewBillingInformationWithDefaults instantiates a new BillingInformation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBillingInformationWithDefaults() *BillingInformation { + this := BillingInformation{} + return &this +} + +// GetCountry returns the Country field value +func (o *BillingInformation) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *BillingInformation) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *BillingInformation) SetCountry(v string) { + o.Country = v +} + +// GetStreetLine1 returns the StreetLine1 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BillingInformation) GetStreetLine1() string { + if o == nil || utils.IsNil(o.StreetLine1.Get()) { + var ret string + return ret + } + return *o.StreetLine1.Get() +} + +// GetStreetLine1Ok returns a tuple with the StreetLine1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BillingInformation) GetStreetLine1Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.StreetLine1.Get(), o.StreetLine1.IsSet() +} + +// HasStreetLine1 returns a boolean if a field has been set. +func (o *BillingInformation) HasStreetLine1() bool { + if o != nil && o.StreetLine1.IsSet() { + return true + } + + return false +} + +// SetStreetLine1 gets a reference to the given NullableString and assigns it to the StreetLine1 field. +func (o *BillingInformation) SetStreetLine1(v string) { + o.StreetLine1.Set(&v) +} +// SetStreetLine1Nil sets the value for StreetLine1 to be an explicit nil +func (o *BillingInformation) SetStreetLine1Nil() { + o.StreetLine1.Set(nil) +} + +// UnsetStreetLine1 ensures that no value is present for StreetLine1, not even an explicit nil +func (o *BillingInformation) UnsetStreetLine1() { + o.StreetLine1.Unset() +} + +// GetStreetLine2 returns the StreetLine2 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BillingInformation) GetStreetLine2() string { + if o == nil || utils.IsNil(o.StreetLine2.Get()) { + var ret string + return ret + } + return *o.StreetLine2.Get() +} + +// GetStreetLine2Ok returns a tuple with the StreetLine2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BillingInformation) GetStreetLine2Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.StreetLine2.Get(), o.StreetLine2.IsSet() +} + +// HasStreetLine2 returns a boolean if a field has been set. +func (o *BillingInformation) HasStreetLine2() bool { + if o != nil && o.StreetLine2.IsSet() { + return true + } + + return false +} + +// SetStreetLine2 gets a reference to the given NullableString and assigns it to the StreetLine2 field. +func (o *BillingInformation) SetStreetLine2(v string) { + o.StreetLine2.Set(&v) +} +// SetStreetLine2Nil sets the value for StreetLine2 to be an explicit nil +func (o *BillingInformation) SetStreetLine2Nil() { + o.StreetLine2.Set(nil) +} + +// UnsetStreetLine2 ensures that no value is present for StreetLine2, not even an explicit nil +func (o *BillingInformation) UnsetStreetLine2() { + o.StreetLine2.Unset() +} + +// GetCity returns the City field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BillingInformation) GetCity() string { + if o == nil || utils.IsNil(o.City.Get()) { + var ret string + return ret + } + return *o.City.Get() +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BillingInformation) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.City.Get(), o.City.IsSet() +} + +// HasCity returns a boolean if a field has been set. +func (o *BillingInformation) HasCity() bool { + if o != nil && o.City.IsSet() { + return true + } + + return false +} + +// SetCity gets a reference to the given NullableString and assigns it to the City field. +func (o *BillingInformation) SetCity(v string) { + o.City.Set(&v) +} +// SetCityNil sets the value for City to be an explicit nil +func (o *BillingInformation) SetCityNil() { + o.City.Set(nil) +} + +// UnsetCity ensures that no value is present for City, not even an explicit nil +func (o *BillingInformation) UnsetCity() { + o.City.Unset() +} + +// GetProvinceState returns the ProvinceState field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BillingInformation) GetProvinceState() string { + if o == nil || utils.IsNil(o.ProvinceState.Get()) { + var ret string + return ret + } + return *o.ProvinceState.Get() +} + +// GetProvinceStateOk returns a tuple with the ProvinceState field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BillingInformation) GetProvinceStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProvinceState.Get(), o.ProvinceState.IsSet() +} + +// HasProvinceState returns a boolean if a field has been set. +func (o *BillingInformation) HasProvinceState() bool { + if o != nil && o.ProvinceState.IsSet() { + return true + } + + return false +} + +// SetProvinceState gets a reference to the given NullableString and assigns it to the ProvinceState field. +func (o *BillingInformation) SetProvinceState(v string) { + o.ProvinceState.Set(&v) +} +// SetProvinceStateNil sets the value for ProvinceState to be an explicit nil +func (o *BillingInformation) SetProvinceStateNil() { + o.ProvinceState.Set(nil) +} + +// UnsetProvinceState ensures that no value is present for ProvinceState, not even an explicit nil +func (o *BillingInformation) UnsetProvinceState() { + o.ProvinceState.Unset() +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BillingInformation) GetPostalCode() string { + if o == nil || utils.IsNil(o.PostalCode.Get()) { + var ret string + return ret + } + return *o.PostalCode.Get() +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BillingInformation) GetPostalCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PostalCode.Get(), o.PostalCode.IsSet() +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *BillingInformation) HasPostalCode() bool { + if o != nil && o.PostalCode.IsSet() { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given NullableString and assigns it to the PostalCode field. +func (o *BillingInformation) SetPostalCode(v string) { + o.PostalCode.Set(&v) +} +// SetPostalCodeNil sets the value for PostalCode to be an explicit nil +func (o *BillingInformation) SetPostalCodeNil() { + o.PostalCode.Set(nil) +} + +// UnsetPostalCode ensures that no value is present for PostalCode, not even an explicit nil +func (o *BillingInformation) UnsetPostalCode() { + o.PostalCode.Unset() +} + +func (o BillingInformation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BillingInformation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["country"] = o.Country + if o.StreetLine1.IsSet() { + toSerialize["street_line1"] = o.StreetLine1.Get() + } + if o.StreetLine2.IsSet() { + toSerialize["street_line2"] = o.StreetLine2.Get() + } + if o.City.IsSet() { + toSerialize["city"] = o.City.Get() + } + if o.ProvinceState.IsSet() { + toSerialize["province_state"] = o.ProvinceState.Get() + } + if o.PostalCode.IsSet() { + toSerialize["postal_code"] = o.PostalCode.Get() + } + return toSerialize, nil +} + +type NullableBillingInformation struct { + value *BillingInformation + isSet bool +} + +func (v NullableBillingInformation) Get() *BillingInformation { + return v.value +} + +func (v *NullableBillingInformation) Set(val *BillingInformation) { + v.value = val + v.isSet = true +} + +func (v NullableBillingInformation) IsSet() bool { + return v.isSet +} + +func (v *NullableBillingInformation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBillingInformation(val *BillingInformation) *NullableBillingInformation { + return &NullableBillingInformation{value: val, isSet: true} +} + +func (v NullableBillingInformation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBillingInformation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card.go b/payment_method/model_card.go new file mode 100644 index 00000000..ffbb2dac --- /dev/null +++ b/payment_method/model_card.go @@ -0,0 +1,234 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Card type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Card{} + +// Card Card Payment Method Details +type Card struct { + Currency NullableString `json:"currency"` + ChannelProperties NullableCardChannelProperties `json:"channel_properties"` + CardInformation *TokenizedCardInformation `json:"card_information,omitempty"` + CardVerificationResults NullableCardVerificationResults `json:"card_verification_results,omitempty"` +} + +// NewCard instantiates a new Card object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCard(currency NullableString, channelProperties NullableCardChannelProperties) *Card { + this := Card{} + this.Currency = currency + this.ChannelProperties = channelProperties + return &this +} + +// NewCardWithDefaults instantiates a new Card object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardWithDefaults() *Card { + this := Card{} + return &this +} + +// GetCurrency returns the Currency field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Card) GetCurrency() string { + if o == nil || o.Currency.Get() == nil { + var ret string + return ret + } + + return *o.Currency.Get() +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Card) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Currency.Get(), o.Currency.IsSet() +} + +// SetCurrency sets field value +func (o *Card) SetCurrency(v string) { + o.Currency.Set(&v) +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for CardChannelProperties will be returned +func (o *Card) GetChannelProperties() CardChannelProperties { + if o == nil || o.ChannelProperties.Get() == nil { + var ret CardChannelProperties + return ret + } + + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Card) GetChannelPropertiesOk() (*CardChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// SetChannelProperties sets field value +func (o *Card) SetChannelProperties(v CardChannelProperties) { + o.ChannelProperties.Set(&v) +} + +// GetCardInformation returns the CardInformation field value if set, zero value otherwise. +func (o *Card) GetCardInformation() TokenizedCardInformation { + if o == nil || utils.IsNil(o.CardInformation) { + var ret TokenizedCardInformation + return ret + } + return *o.CardInformation +} + +// GetCardInformationOk returns a tuple with the CardInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Card) GetCardInformationOk() (*TokenizedCardInformation, bool) { + if o == nil || utils.IsNil(o.CardInformation) { + return nil, false + } + return o.CardInformation, true +} + +// HasCardInformation returns a boolean if a field has been set. +func (o *Card) HasCardInformation() bool { + if o != nil && !utils.IsNil(o.CardInformation) { + return true + } + + return false +} + +// SetCardInformation gets a reference to the given TokenizedCardInformation and assigns it to the CardInformation field. +func (o *Card) SetCardInformation(v TokenizedCardInformation) { + o.CardInformation = &v +} + +// GetCardVerificationResults returns the CardVerificationResults field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Card) GetCardVerificationResults() CardVerificationResults { + if o == nil || utils.IsNil(o.CardVerificationResults.Get()) { + var ret CardVerificationResults + return ret + } + return *o.CardVerificationResults.Get() +} + +// GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Card) GetCardVerificationResultsOk() (*CardVerificationResults, bool) { + if o == nil { + return nil, false + } + return o.CardVerificationResults.Get(), o.CardVerificationResults.IsSet() +} + +// HasCardVerificationResults returns a boolean if a field has been set. +func (o *Card) HasCardVerificationResults() bool { + if o != nil && o.CardVerificationResults.IsSet() { + return true + } + + return false +} + +// SetCardVerificationResults gets a reference to the given NullableCardVerificationResults and assigns it to the CardVerificationResults field. +func (o *Card) SetCardVerificationResults(v CardVerificationResults) { + o.CardVerificationResults.Set(&v) +} +// SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil +func (o *Card) SetCardVerificationResultsNil() { + o.CardVerificationResults.Set(nil) +} + +// UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil +func (o *Card) UnsetCardVerificationResults() { + o.CardVerificationResults.Unset() +} + +func (o Card) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Card) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency.Get() + toSerialize["channel_properties"] = o.ChannelProperties.Get() + if !utils.IsNil(o.CardInformation) { + toSerialize["card_information"] = o.CardInformation + } + if o.CardVerificationResults.IsSet() { + toSerialize["card_verification_results"] = o.CardVerificationResults.Get() + } + return toSerialize, nil +} + +type NullableCard struct { + value *Card + isSet bool +} + +func (v NullableCard) Get() *Card { + return v.value +} + +func (v *NullableCard) Set(val *Card) { + v.value = val + v.isSet = true +} + +func (v NullableCard) IsSet() bool { + return v.isSet +} + +func (v *NullableCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCard(val *Card) *NullableCard { + return &NullableCard{value: val, isSet: true} +} + +func (v NullableCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card_channel_properties.go b/payment_method/model_card_channel_properties.go new file mode 100644 index 00000000..13da5297 --- /dev/null +++ b/payment_method/model_card_channel_properties.go @@ -0,0 +1,282 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardChannelProperties{} + +// CardChannelProperties Card Channel Properties +type CardChannelProperties struct { + // This field value is only being used for reusability = MULTIPLE_USE. To indicate whether to perform 3DS during the linking phase. Defaults to false. + SkipThreeDSecure NullableBool `json:"skip_three_d_secure,omitempty"` + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl NullableString `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl NullableString `json:"failure_return_url,omitempty"` + // Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. + CardonfileType NullableString `json:"cardonfile_type,omitempty"` +} + +// NewCardChannelProperties instantiates a new CardChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardChannelProperties() *CardChannelProperties { + this := CardChannelProperties{} + return &this +} + +// NewCardChannelPropertiesWithDefaults instantiates a new CardChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardChannelPropertiesWithDefaults() *CardChannelProperties { + this := CardChannelProperties{} + return &this +} + +// GetSkipThreeDSecure returns the SkipThreeDSecure field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetSkipThreeDSecure() bool { + if o == nil || utils.IsNil(o.SkipThreeDSecure.Get()) { + var ret bool + return ret + } + return *o.SkipThreeDSecure.Get() +} + +// GetSkipThreeDSecureOk returns a tuple with the SkipThreeDSecure field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetSkipThreeDSecureOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.SkipThreeDSecure.Get(), o.SkipThreeDSecure.IsSet() +} + +// HasSkipThreeDSecure returns a boolean if a field has been set. +func (o *CardChannelProperties) HasSkipThreeDSecure() bool { + if o != nil && o.SkipThreeDSecure.IsSet() { + return true + } + + return false +} + +// SetSkipThreeDSecure gets a reference to the given NullableBool and assigns it to the SkipThreeDSecure field. +func (o *CardChannelProperties) SetSkipThreeDSecure(v bool) { + o.SkipThreeDSecure.Set(&v) +} +// SetSkipThreeDSecureNil sets the value for SkipThreeDSecure to be an explicit nil +func (o *CardChannelProperties) SetSkipThreeDSecureNil() { + o.SkipThreeDSecure.Set(nil) +} + +// UnsetSkipThreeDSecure ensures that no value is present for SkipThreeDSecure, not even an explicit nil +func (o *CardChannelProperties) UnsetSkipThreeDSecure() { + o.SkipThreeDSecure.Unset() +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl.Get()) { + var ret string + return ret + } + return *o.SuccessReturnUrl.Get() +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SuccessReturnUrl.Get(), o.SuccessReturnUrl.IsSet() +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *CardChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && o.SuccessReturnUrl.IsSet() { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given NullableString and assigns it to the SuccessReturnUrl field. +func (o *CardChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl.Set(&v) +} +// SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil +func (o *CardChannelProperties) SetSuccessReturnUrlNil() { + o.SuccessReturnUrl.Set(nil) +} + +// UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +func (o *CardChannelProperties) UnsetSuccessReturnUrl() { + o.SuccessReturnUrl.Unset() +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl.Get()) { + var ret string + return ret + } + return *o.FailureReturnUrl.Get() +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureReturnUrl.Get(), o.FailureReturnUrl.IsSet() +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *CardChannelProperties) HasFailureReturnUrl() bool { + if o != nil && o.FailureReturnUrl.IsSet() { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given NullableString and assigns it to the FailureReturnUrl field. +func (o *CardChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl.Set(&v) +} +// SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil +func (o *CardChannelProperties) SetFailureReturnUrlNil() { + o.FailureReturnUrl.Set(nil) +} + +// UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +func (o *CardChannelProperties) UnsetFailureReturnUrl() { + o.FailureReturnUrl.Unset() +} + +// GetCardonfileType returns the CardonfileType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetCardonfileType() string { + if o == nil || utils.IsNil(o.CardonfileType.Get()) { + var ret string + return ret + } + return *o.CardonfileType.Get() +} + +// GetCardonfileTypeOk returns a tuple with the CardonfileType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetCardonfileTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardonfileType.Get(), o.CardonfileType.IsSet() +} + +// HasCardonfileType returns a boolean if a field has been set. +func (o *CardChannelProperties) HasCardonfileType() bool { + if o != nil && o.CardonfileType.IsSet() { + return true + } + + return false +} + +// SetCardonfileType gets a reference to the given NullableString and assigns it to the CardonfileType field. +func (o *CardChannelProperties) SetCardonfileType(v string) { + o.CardonfileType.Set(&v) +} +// SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil +func (o *CardChannelProperties) SetCardonfileTypeNil() { + o.CardonfileType.Set(nil) +} + +// UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +func (o *CardChannelProperties) UnsetCardonfileType() { + o.CardonfileType.Unset() +} + +func (o CardChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.SkipThreeDSecure.IsSet() { + toSerialize["skip_three_d_secure"] = o.SkipThreeDSecure.Get() + } + if o.SuccessReturnUrl.IsSet() { + toSerialize["success_return_url"] = o.SuccessReturnUrl.Get() + } + if o.FailureReturnUrl.IsSet() { + toSerialize["failure_return_url"] = o.FailureReturnUrl.Get() + } + if o.CardonfileType.IsSet() { + toSerialize["cardonfile_type"] = o.CardonfileType.Get() + } + return toSerialize, nil +} + +type NullableCardChannelProperties struct { + value *CardChannelProperties + isSet bool +} + +func (v NullableCardChannelProperties) Get() *CardChannelProperties { + return v.value +} + +func (v *NullableCardChannelProperties) Set(val *CardChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableCardChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableCardChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardChannelProperties(val *CardChannelProperties) *NullableCardChannelProperties { + return &NullableCardChannelProperties{value: val, isSet: true} +} + +func (v NullableCardChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card_parameters.go b/payment_method/model_card_parameters.go new file mode 100644 index 00000000..1f6be2c6 --- /dev/null +++ b/payment_method/model_card_parameters.go @@ -0,0 +1,203 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardParameters{} + +// CardParameters struct for CardParameters +type CardParameters struct { + Currency string `json:"currency"` + ChannelProperties NullableCardChannelProperties `json:"channel_properties,omitempty"` + CardInformation *CardParametersCardInformation `json:"card_information,omitempty"` +} + +// NewCardParameters instantiates a new CardParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardParameters(currency string) *CardParameters { + this := CardParameters{} + this.Currency = currency + return &this +} + +// NewCardParametersWithDefaults instantiates a new CardParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardParametersWithDefaults() *CardParameters { + this := CardParameters{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *CardParameters) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *CardParameters) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *CardParameters) SetCurrency(v string) { + o.Currency = v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardParameters) GetChannelProperties() CardChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties.Get()) { + var ret CardChannelProperties + return ret + } + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardParameters) GetChannelPropertiesOk() (*CardChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *CardParameters) HasChannelProperties() bool { + if o != nil && o.ChannelProperties.IsSet() { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given NullableCardChannelProperties and assigns it to the ChannelProperties field. +func (o *CardParameters) SetChannelProperties(v CardChannelProperties) { + o.ChannelProperties.Set(&v) +} +// SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil +func (o *CardParameters) SetChannelPropertiesNil() { + o.ChannelProperties.Set(nil) +} + +// UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +func (o *CardParameters) UnsetChannelProperties() { + o.ChannelProperties.Unset() +} + +// GetCardInformation returns the CardInformation field value if set, zero value otherwise. +func (o *CardParameters) GetCardInformation() CardParametersCardInformation { + if o == nil || utils.IsNil(o.CardInformation) { + var ret CardParametersCardInformation + return ret + } + return *o.CardInformation +} + +// GetCardInformationOk returns a tuple with the CardInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardParameters) GetCardInformationOk() (*CardParametersCardInformation, bool) { + if o == nil || utils.IsNil(o.CardInformation) { + return nil, false + } + return o.CardInformation, true +} + +// HasCardInformation returns a boolean if a field has been set. +func (o *CardParameters) HasCardInformation() bool { + if o != nil && !utils.IsNil(o.CardInformation) { + return true + } + + return false +} + +// SetCardInformation gets a reference to the given CardParametersCardInformation and assigns it to the CardInformation field. +func (o *CardParameters) SetCardInformation(v CardParametersCardInformation) { + o.CardInformation = &v +} + +func (o CardParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + if o.ChannelProperties.IsSet() { + toSerialize["channel_properties"] = o.ChannelProperties.Get() + } + if !utils.IsNil(o.CardInformation) { + toSerialize["card_information"] = o.CardInformation + } + return toSerialize, nil +} + +type NullableCardParameters struct { + value *CardParameters + isSet bool +} + +func (v NullableCardParameters) Get() *CardParameters { + return v.value +} + +func (v *NullableCardParameters) Set(val *CardParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCardParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCardParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardParameters(val *CardParameters) *NullableCardParameters { + return &NullableCardParameters{value: val, isSet: true} +} + +func (v NullableCardParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card_parameters_card_information.go b/payment_method/model_card_parameters_card_information.go new file mode 100644 index 00000000..73c093fc --- /dev/null +++ b/payment_method/model_card_parameters_card_information.go @@ -0,0 +1,270 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardParametersCardInformation type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardParametersCardInformation{} + +// CardParametersCardInformation Card Information +type CardParametersCardInformation struct { + CardNumber string `json:"card_number"` + // Card expiry month in MM format + ExpiryMonth string `json:"expiry_month"` + // Card expiry month in YY format + ExpiryYear string `json:"expiry_year"` + // Cardholder name + CardholderName NullableString `json:"cardholder_name,omitempty"` + Cvv NullableString `json:"cvv,omitempty"` +} + +// NewCardParametersCardInformation instantiates a new CardParametersCardInformation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardParametersCardInformation(cardNumber string, expiryMonth string, expiryYear string) *CardParametersCardInformation { + this := CardParametersCardInformation{} + this.CardNumber = cardNumber + this.ExpiryMonth = expiryMonth + this.ExpiryYear = expiryYear + return &this +} + +// NewCardParametersCardInformationWithDefaults instantiates a new CardParametersCardInformation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardParametersCardInformationWithDefaults() *CardParametersCardInformation { + this := CardParametersCardInformation{} + return &this +} + +// GetCardNumber returns the CardNumber field value +func (o *CardParametersCardInformation) GetCardNumber() string { + if o == nil { + var ret string + return ret + } + + return o.CardNumber +} + +// GetCardNumberOk returns a tuple with the CardNumber field value +// and a boolean to check if the value has been set. +func (o *CardParametersCardInformation) GetCardNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CardNumber, true +} + +// SetCardNumber sets field value +func (o *CardParametersCardInformation) SetCardNumber(v string) { + o.CardNumber = v +} + +// GetExpiryMonth returns the ExpiryMonth field value +func (o *CardParametersCardInformation) GetExpiryMonth() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryMonth +} + +// GetExpiryMonthOk returns a tuple with the ExpiryMonth field value +// and a boolean to check if the value has been set. +func (o *CardParametersCardInformation) GetExpiryMonthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryMonth, true +} + +// SetExpiryMonth sets field value +func (o *CardParametersCardInformation) SetExpiryMonth(v string) { + o.ExpiryMonth = v +} + +// GetExpiryYear returns the ExpiryYear field value +func (o *CardParametersCardInformation) GetExpiryYear() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryYear +} + +// GetExpiryYearOk returns a tuple with the ExpiryYear field value +// and a boolean to check if the value has been set. +func (o *CardParametersCardInformation) GetExpiryYearOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryYear, true +} + +// SetExpiryYear sets field value +func (o *CardParametersCardInformation) SetExpiryYear(v string) { + o.ExpiryYear = v +} + +// GetCardholderName returns the CardholderName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardParametersCardInformation) GetCardholderName() string { + if o == nil || utils.IsNil(o.CardholderName.Get()) { + var ret string + return ret + } + return *o.CardholderName.Get() +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardParametersCardInformation) GetCardholderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardholderName.Get(), o.CardholderName.IsSet() +} + +// HasCardholderName returns a boolean if a field has been set. +func (o *CardParametersCardInformation) HasCardholderName() bool { + if o != nil && o.CardholderName.IsSet() { + return true + } + + return false +} + +// SetCardholderName gets a reference to the given NullableString and assigns it to the CardholderName field. +func (o *CardParametersCardInformation) SetCardholderName(v string) { + o.CardholderName.Set(&v) +} +// SetCardholderNameNil sets the value for CardholderName to be an explicit nil +func (o *CardParametersCardInformation) SetCardholderNameNil() { + o.CardholderName.Set(nil) +} + +// UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +func (o *CardParametersCardInformation) UnsetCardholderName() { + o.CardholderName.Unset() +} + +// GetCvv returns the Cvv field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardParametersCardInformation) GetCvv() string { + if o == nil || utils.IsNil(o.Cvv.Get()) { + var ret string + return ret + } + return *o.Cvv.Get() +} + +// GetCvvOk returns a tuple with the Cvv field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardParametersCardInformation) GetCvvOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cvv.Get(), o.Cvv.IsSet() +} + +// HasCvv returns a boolean if a field has been set. +func (o *CardParametersCardInformation) HasCvv() bool { + if o != nil && o.Cvv.IsSet() { + return true + } + + return false +} + +// SetCvv gets a reference to the given NullableString and assigns it to the Cvv field. +func (o *CardParametersCardInformation) SetCvv(v string) { + o.Cvv.Set(&v) +} +// SetCvvNil sets the value for Cvv to be an explicit nil +func (o *CardParametersCardInformation) SetCvvNil() { + o.Cvv.Set(nil) +} + +// UnsetCvv ensures that no value is present for Cvv, not even an explicit nil +func (o *CardParametersCardInformation) UnsetCvv() { + o.Cvv.Unset() +} + +func (o CardParametersCardInformation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardParametersCardInformation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["card_number"] = o.CardNumber + toSerialize["expiry_month"] = o.ExpiryMonth + toSerialize["expiry_year"] = o.ExpiryYear + if o.CardholderName.IsSet() { + toSerialize["cardholder_name"] = o.CardholderName.Get() + } + if o.Cvv.IsSet() { + toSerialize["cvv"] = o.Cvv.Get() + } + return toSerialize, nil +} + +type NullableCardParametersCardInformation struct { + value *CardParametersCardInformation + isSet bool +} + +func (v NullableCardParametersCardInformation) Get() *CardParametersCardInformation { + return v.value +} + +func (v *NullableCardParametersCardInformation) Set(val *CardParametersCardInformation) { + v.value = val + v.isSet = true +} + +func (v NullableCardParametersCardInformation) IsSet() bool { + return v.isSet +} + +func (v *NullableCardParametersCardInformation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardParametersCardInformation(val *CardParametersCardInformation) *NullableCardParametersCardInformation { + return &NullableCardParametersCardInformation{value: val, isSet: true} +} + +func (v NullableCardParametersCardInformation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardParametersCardInformation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card_verification_results.go b/payment_method/model_card_verification_results.go new file mode 100644 index 00000000..a4c225ef --- /dev/null +++ b/payment_method/model_card_verification_results.go @@ -0,0 +1,215 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardVerificationResults type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardVerificationResults{} + +// CardVerificationResults struct for CardVerificationResults +type CardVerificationResults struct { + ThreeDSecure NullableCardVerificationResultsThreeDSecure `json:"three_d_secure"` + CvvResult NullableString `json:"cvv_result,omitempty"` + AddressVerificationResult NullableString `json:"address_verification_result,omitempty"` +} + +// NewCardVerificationResults instantiates a new CardVerificationResults object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardVerificationResults(threeDSecure NullableCardVerificationResultsThreeDSecure) *CardVerificationResults { + this := CardVerificationResults{} + this.ThreeDSecure = threeDSecure + return &this +} + +// NewCardVerificationResultsWithDefaults instantiates a new CardVerificationResults object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardVerificationResultsWithDefaults() *CardVerificationResults { + this := CardVerificationResults{} + return &this +} + +// GetThreeDSecure returns the ThreeDSecure field value +// If the value is explicit nil, the zero value for CardVerificationResultsThreeDSecure will be returned +func (o *CardVerificationResults) GetThreeDSecure() CardVerificationResultsThreeDSecure { + if o == nil || o.ThreeDSecure.Get() == nil { + var ret CardVerificationResultsThreeDSecure + return ret + } + + return *o.ThreeDSecure.Get() +} + +// GetThreeDSecureOk returns a tuple with the ThreeDSecure field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResults) GetThreeDSecureOk() (*CardVerificationResultsThreeDSecure, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecure.Get(), o.ThreeDSecure.IsSet() +} + +// SetThreeDSecure sets field value +func (o *CardVerificationResults) SetThreeDSecure(v CardVerificationResultsThreeDSecure) { + o.ThreeDSecure.Set(&v) +} + +// GetCvvResult returns the CvvResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResults) GetCvvResult() string { + if o == nil || utils.IsNil(o.CvvResult.Get()) { + var ret string + return ret + } + return *o.CvvResult.Get() +} + +// GetCvvResultOk returns a tuple with the CvvResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResults) GetCvvResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CvvResult.Get(), o.CvvResult.IsSet() +} + +// HasCvvResult returns a boolean if a field has been set. +func (o *CardVerificationResults) HasCvvResult() bool { + if o != nil && o.CvvResult.IsSet() { + return true + } + + return false +} + +// SetCvvResult gets a reference to the given NullableString and assigns it to the CvvResult field. +func (o *CardVerificationResults) SetCvvResult(v string) { + o.CvvResult.Set(&v) +} +// SetCvvResultNil sets the value for CvvResult to be an explicit nil +func (o *CardVerificationResults) SetCvvResultNil() { + o.CvvResult.Set(nil) +} + +// UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +func (o *CardVerificationResults) UnsetCvvResult() { + o.CvvResult.Unset() +} + +// GetAddressVerificationResult returns the AddressVerificationResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResults) GetAddressVerificationResult() string { + if o == nil || utils.IsNil(o.AddressVerificationResult.Get()) { + var ret string + return ret + } + return *o.AddressVerificationResult.Get() +} + +// GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResults) GetAddressVerificationResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AddressVerificationResult.Get(), o.AddressVerificationResult.IsSet() +} + +// HasAddressVerificationResult returns a boolean if a field has been set. +func (o *CardVerificationResults) HasAddressVerificationResult() bool { + if o != nil && o.AddressVerificationResult.IsSet() { + return true + } + + return false +} + +// SetAddressVerificationResult gets a reference to the given NullableString and assigns it to the AddressVerificationResult field. +func (o *CardVerificationResults) SetAddressVerificationResult(v string) { + o.AddressVerificationResult.Set(&v) +} +// SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil +func (o *CardVerificationResults) SetAddressVerificationResultNil() { + o.AddressVerificationResult.Set(nil) +} + +// UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil +func (o *CardVerificationResults) UnsetAddressVerificationResult() { + o.AddressVerificationResult.Unset() +} + +func (o CardVerificationResults) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardVerificationResults) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["three_d_secure"] = o.ThreeDSecure.Get() + if o.CvvResult.IsSet() { + toSerialize["cvv_result"] = o.CvvResult.Get() + } + if o.AddressVerificationResult.IsSet() { + toSerialize["address_verification_result"] = o.AddressVerificationResult.Get() + } + return toSerialize, nil +} + +type NullableCardVerificationResults struct { + value *CardVerificationResults + isSet bool +} + +func (v NullableCardVerificationResults) Get() *CardVerificationResults { + return v.value +} + +func (v *NullableCardVerificationResults) Set(val *CardVerificationResults) { + v.value = val + v.isSet = true +} + +func (v NullableCardVerificationResults) IsSet() bool { + return v.isSet +} + +func (v *NullableCardVerificationResults) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardVerificationResults(val *CardVerificationResults) *NullableCardVerificationResults { + return &NullableCardVerificationResults{value: val, isSet: true} +} + +func (v NullableCardVerificationResults) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardVerificationResults) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_card_verification_results_three_d_secure.go b/payment_method/model_card_verification_results_three_d_secure.go new file mode 100644 index 00000000..f746d82f --- /dev/null +++ b/payment_method/model_card_verification_results_three_d_secure.go @@ -0,0 +1,324 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardVerificationResultsThreeDSecure type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardVerificationResultsThreeDSecure{} + +// CardVerificationResultsThreeDSecure struct for CardVerificationResultsThreeDSecure +type CardVerificationResultsThreeDSecure struct { + ThreeDSecureFlow NullableString `json:"three_d_secure_flow,omitempty"` + EciCode NullableString `json:"eci_code,omitempty"` + ThreeDSecureResult NullableString `json:"three_d_secure_result,omitempty"` + ThreeDSecureResultReason NullableString `json:"three_d_secure_result_reason,omitempty"` + ThreeDSecureVersion NullableString `json:"three_d_secure_version,omitempty"` +} + +// NewCardVerificationResultsThreeDSecure instantiates a new CardVerificationResultsThreeDSecure object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardVerificationResultsThreeDSecure() *CardVerificationResultsThreeDSecure { + this := CardVerificationResultsThreeDSecure{} + return &this +} + +// NewCardVerificationResultsThreeDSecureWithDefaults instantiates a new CardVerificationResultsThreeDSecure object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardVerificationResultsThreeDSecureWithDefaults() *CardVerificationResultsThreeDSecure { + this := CardVerificationResultsThreeDSecure{} + return &this +} + +// GetThreeDSecureFlow returns the ThreeDSecureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlow() string { + if o == nil || utils.IsNil(o.ThreeDSecureFlow.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureFlow.Get() +} + +// GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureFlow.Get(), o.ThreeDSecureFlow.IsSet() +} + +// HasThreeDSecureFlow returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureFlow() bool { + if o != nil && o.ThreeDSecureFlow.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureFlow gets a reference to the given NullableString and assigns it to the ThreeDSecureFlow field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlow(v string) { + o.ThreeDSecureFlow.Set(&v) +} +// SetThreeDSecureFlowNil sets the value for ThreeDSecureFlow to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlowNil() { + o.ThreeDSecureFlow.Set(nil) +} + +// UnsetThreeDSecureFlow ensures that no value is present for ThreeDSecureFlow, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureFlow() { + o.ThreeDSecureFlow.Unset() +} + +// GetEciCode returns the EciCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetEciCode() string { + if o == nil || utils.IsNil(o.EciCode.Get()) { + var ret string + return ret + } + return *o.EciCode.Get() +} + +// GetEciCodeOk returns a tuple with the EciCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetEciCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EciCode.Get(), o.EciCode.IsSet() +} + +// HasEciCode returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasEciCode() bool { + if o != nil && o.EciCode.IsSet() { + return true + } + + return false +} + +// SetEciCode gets a reference to the given NullableString and assigns it to the EciCode field. +func (o *CardVerificationResultsThreeDSecure) SetEciCode(v string) { + o.EciCode.Set(&v) +} +// SetEciCodeNil sets the value for EciCode to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetEciCodeNil() { + o.EciCode.Set(nil) +} + +// UnsetEciCode ensures that no value is present for EciCode, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetEciCode() { + o.EciCode.Unset() +} + +// GetThreeDSecureResult returns the ThreeDSecureResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResult() string { + if o == nil || utils.IsNil(o.ThreeDSecureResult.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureResult.Get() +} + +// GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureResult.Get(), o.ThreeDSecureResult.IsSet() +} + +// HasThreeDSecureResult returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResult() bool { + if o != nil && o.ThreeDSecureResult.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureResult gets a reference to the given NullableString and assigns it to the ThreeDSecureResult field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResult(v string) { + o.ThreeDSecureResult.Set(&v) +} +// SetThreeDSecureResultNil sets the value for ThreeDSecureResult to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultNil() { + o.ThreeDSecureResult.Set(nil) +} + +// UnsetThreeDSecureResult ensures that no value is present for ThreeDSecureResult, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResult() { + o.ThreeDSecureResult.Unset() +} + +// GetThreeDSecureResultReason returns the ThreeDSecureResultReason field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReason() string { + if o == nil || utils.IsNil(o.ThreeDSecureResultReason.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureResultReason.Get() +} + +// GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureResultReason.Get(), o.ThreeDSecureResultReason.IsSet() +} + +// HasThreeDSecureResultReason returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResultReason() bool { + if o != nil && o.ThreeDSecureResultReason.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureResultReason gets a reference to the given NullableString and assigns it to the ThreeDSecureResultReason field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReason(v string) { + o.ThreeDSecureResultReason.Set(&v) +} +// SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReasonNil() { + o.ThreeDSecureResultReason.Set(nil) +} + +// UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResultReason() { + o.ThreeDSecureResultReason.Unset() +} + +// GetThreeDSecureVersion returns the ThreeDSecureVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersion() string { + if o == nil || utils.IsNil(o.ThreeDSecureVersion.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureVersion.Get() +} + +// GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureVersion.Get(), o.ThreeDSecureVersion.IsSet() +} + +// HasThreeDSecureVersion returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureVersion() bool { + if o != nil && o.ThreeDSecureVersion.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureVersion gets a reference to the given NullableString and assigns it to the ThreeDSecureVersion field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersion(v string) { + o.ThreeDSecureVersion.Set(&v) +} +// SetThreeDSecureVersionNil sets the value for ThreeDSecureVersion to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersionNil() { + o.ThreeDSecureVersion.Set(nil) +} + +// UnsetThreeDSecureVersion ensures that no value is present for ThreeDSecureVersion, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureVersion() { + o.ThreeDSecureVersion.Unset() +} + +func (o CardVerificationResultsThreeDSecure) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardVerificationResultsThreeDSecure) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ThreeDSecureFlow.IsSet() { + toSerialize["three_d_secure_flow"] = o.ThreeDSecureFlow.Get() + } + if o.EciCode.IsSet() { + toSerialize["eci_code"] = o.EciCode.Get() + } + if o.ThreeDSecureResult.IsSet() { + toSerialize["three_d_secure_result"] = o.ThreeDSecureResult.Get() + } + if o.ThreeDSecureResultReason.IsSet() { + toSerialize["three_d_secure_result_reason"] = o.ThreeDSecureResultReason.Get() + } + if o.ThreeDSecureVersion.IsSet() { + toSerialize["three_d_secure_version"] = o.ThreeDSecureVersion.Get() + } + return toSerialize, nil +} + +type NullableCardVerificationResultsThreeDSecure struct { + value *CardVerificationResultsThreeDSecure + isSet bool +} + +func (v NullableCardVerificationResultsThreeDSecure) Get() *CardVerificationResultsThreeDSecure { + return v.value +} + +func (v *NullableCardVerificationResultsThreeDSecure) Set(val *CardVerificationResultsThreeDSecure) { + v.value = val + v.isSet = true +} + +func (v NullableCardVerificationResultsThreeDSecure) IsSet() bool { + return v.isSet +} + +func (v *NullableCardVerificationResultsThreeDSecure) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardVerificationResultsThreeDSecure(val *CardVerificationResultsThreeDSecure) *NullableCardVerificationResultsThreeDSecure { + return &NullableCardVerificationResultsThreeDSecure{value: val, isSet: true} +} + +func (v NullableCardVerificationResultsThreeDSecure) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardVerificationResultsThreeDSecure) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_channel_amount_limits.go b/payment_method/model_channel_amount_limits.go new file mode 100644 index 00000000..876dd4b3 --- /dev/null +++ b/payment_method/model_channel_amount_limits.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ChannelAmountLimits type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelAmountLimits{} + +// ChannelAmountLimits struct for ChannelAmountLimits +type ChannelAmountLimits struct { + // Currency supported by the payment channel + Currency *string `json:"currency,omitempty"` + // The minimum allowed transaction amount for the payment channel + MinLimit *float32 `json:"min_limit,omitempty"` + // The minimum allowed transaction amount for the payment channel + MaxLimit *float32 `json:"max_limit,omitempty"` +} + +// NewChannelAmountLimits instantiates a new ChannelAmountLimits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannelAmountLimits() *ChannelAmountLimits { + this := ChannelAmountLimits{} + return &this +} + +// NewChannelAmountLimitsWithDefaults instantiates a new ChannelAmountLimits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelAmountLimitsWithDefaults() *ChannelAmountLimits { + this := ChannelAmountLimits{} + return &this +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *ChannelAmountLimits) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *ChannelAmountLimits) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *ChannelAmountLimits) SetCurrency(v string) { + o.Currency = &v +} + +// GetMinLimit returns the MinLimit field value if set, zero value otherwise. +func (o *ChannelAmountLimits) GetMinLimit() float32 { + if o == nil || utils.IsNil(o.MinLimit) { + var ret float32 + return ret + } + return *o.MinLimit +} + +// GetMinLimitOk returns a tuple with the MinLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetMinLimitOk() (*float32, bool) { + if o == nil || utils.IsNil(o.MinLimit) { + return nil, false + } + return o.MinLimit, true +} + +// HasMinLimit returns a boolean if a field has been set. +func (o *ChannelAmountLimits) HasMinLimit() bool { + if o != nil && !utils.IsNil(o.MinLimit) { + return true + } + + return false +} + +// SetMinLimit gets a reference to the given float32 and assigns it to the MinLimit field. +func (o *ChannelAmountLimits) SetMinLimit(v float32) { + o.MinLimit = &v +} + +// GetMaxLimit returns the MaxLimit field value if set, zero value otherwise. +func (o *ChannelAmountLimits) GetMaxLimit() float32 { + if o == nil || utils.IsNil(o.MaxLimit) { + var ret float32 + return ret + } + return *o.MaxLimit +} + +// GetMaxLimitOk returns a tuple with the MaxLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetMaxLimitOk() (*float32, bool) { + if o == nil || utils.IsNil(o.MaxLimit) { + return nil, false + } + return o.MaxLimit, true +} + +// HasMaxLimit returns a boolean if a field has been set. +func (o *ChannelAmountLimits) HasMaxLimit() bool { + if o != nil && !utils.IsNil(o.MaxLimit) { + return true + } + + return false +} + +// SetMaxLimit gets a reference to the given float32 and assigns it to the MaxLimit field. +func (o *ChannelAmountLimits) SetMaxLimit(v float32) { + o.MaxLimit = &v +} + +func (o ChannelAmountLimits) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelAmountLimits) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.MinLimit) { + toSerialize["min_limit"] = o.MinLimit + } + if !utils.IsNil(o.MaxLimit) { + toSerialize["max_limit"] = o.MaxLimit + } + return toSerialize, nil +} + +type NullableChannelAmountLimits struct { + value *ChannelAmountLimits + isSet bool +} + +func (v NullableChannelAmountLimits) Get() *ChannelAmountLimits { + return v.value +} + +func (v *NullableChannelAmountLimits) Set(val *ChannelAmountLimits) { + v.value = val + v.isSet = true +} + +func (v NullableChannelAmountLimits) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelAmountLimits) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelAmountLimits(val *ChannelAmountLimits) *NullableChannelAmountLimits { + return &NullableChannelAmountLimits{value: val, isSet: true} +} + +func (v NullableChannelAmountLimits) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelAmountLimits) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_channel_amount_limits_all_of.go b/payment_method/model_channel_amount_limits_all_of.go new file mode 100644 index 00000000..7f4b2820 --- /dev/null +++ b/payment_method/model_channel_amount_limits_all_of.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ChannelAmountLimitsAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelAmountLimitsAllOf{} + +// ChannelAmountLimitsAllOf Contains objects of the support currencies and its respective limits per transaction +type ChannelAmountLimitsAllOf struct { + // Currency supported by the payment channel + Currency *string `json:"currency,omitempty"` + // The minimum allowed transaction amount for the payment channel + MinLimit *float32 `json:"min_limit,omitempty"` + // The minimum allowed transaction amount for the payment channel + MaxLimit *float32 `json:"max_limit,omitempty"` +} + +// NewChannelAmountLimitsAllOf instantiates a new ChannelAmountLimitsAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannelAmountLimitsAllOf() *ChannelAmountLimitsAllOf { + this := ChannelAmountLimitsAllOf{} + return &this +} + +// NewChannelAmountLimitsAllOfWithDefaults instantiates a new ChannelAmountLimitsAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelAmountLimitsAllOfWithDefaults() *ChannelAmountLimitsAllOf { + this := ChannelAmountLimitsAllOf{} + return &this +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *ChannelAmountLimitsAllOf) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimitsAllOf) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *ChannelAmountLimitsAllOf) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *ChannelAmountLimitsAllOf) SetCurrency(v string) { + o.Currency = &v +} + +// GetMinLimit returns the MinLimit field value if set, zero value otherwise. +func (o *ChannelAmountLimitsAllOf) GetMinLimit() float32 { + if o == nil || utils.IsNil(o.MinLimit) { + var ret float32 + return ret + } + return *o.MinLimit +} + +// GetMinLimitOk returns a tuple with the MinLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimitsAllOf) GetMinLimitOk() (*float32, bool) { + if o == nil || utils.IsNil(o.MinLimit) { + return nil, false + } + return o.MinLimit, true +} + +// HasMinLimit returns a boolean if a field has been set. +func (o *ChannelAmountLimitsAllOf) HasMinLimit() bool { + if o != nil && !utils.IsNil(o.MinLimit) { + return true + } + + return false +} + +// SetMinLimit gets a reference to the given float32 and assigns it to the MinLimit field. +func (o *ChannelAmountLimitsAllOf) SetMinLimit(v float32) { + o.MinLimit = &v +} + +// GetMaxLimit returns the MaxLimit field value if set, zero value otherwise. +func (o *ChannelAmountLimitsAllOf) GetMaxLimit() float32 { + if o == nil || utils.IsNil(o.MaxLimit) { + var ret float32 + return ret + } + return *o.MaxLimit +} + +// GetMaxLimitOk returns a tuple with the MaxLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimitsAllOf) GetMaxLimitOk() (*float32, bool) { + if o == nil || utils.IsNil(o.MaxLimit) { + return nil, false + } + return o.MaxLimit, true +} + +// HasMaxLimit returns a boolean if a field has been set. +func (o *ChannelAmountLimitsAllOf) HasMaxLimit() bool { + if o != nil && !utils.IsNil(o.MaxLimit) { + return true + } + + return false +} + +// SetMaxLimit gets a reference to the given float32 and assigns it to the MaxLimit field. +func (o *ChannelAmountLimitsAllOf) SetMaxLimit(v float32) { + o.MaxLimit = &v +} + +func (o ChannelAmountLimitsAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelAmountLimitsAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.MinLimit) { + toSerialize["min_limit"] = o.MinLimit + } + if !utils.IsNil(o.MaxLimit) { + toSerialize["max_limit"] = o.MaxLimit + } + return toSerialize, nil +} + +type NullableChannelAmountLimitsAllOf struct { + value *ChannelAmountLimitsAllOf + isSet bool +} + +func (v NullableChannelAmountLimitsAllOf) Get() *ChannelAmountLimitsAllOf { + return v.value +} + +func (v *NullableChannelAmountLimitsAllOf) Set(val *ChannelAmountLimitsAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableChannelAmountLimitsAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelAmountLimitsAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelAmountLimitsAllOf(val *ChannelAmountLimitsAllOf) *NullableChannelAmountLimitsAllOf { + return &NullableChannelAmountLimitsAllOf{value: val, isSet: true} +} + +func (v NullableChannelAmountLimitsAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelAmountLimitsAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_channel_property.go b/payment_method/model_channel_property.go new file mode 100644 index 00000000..6c58cf13 --- /dev/null +++ b/payment_method/model_channel_property.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ChannelProperty type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelProperty{} + +// ChannelProperty struct for ChannelProperty +type ChannelProperty struct { + // The corresponding parameter name + Name *string `json:"name,omitempty"` + // Data type of the parameter + Type *string `json:"type,omitempty"` + // Indicates whether or not the parameter is required + IsRequired *bool `json:"is_required,omitempty"` +} + +// NewChannelProperty instantiates a new ChannelProperty object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannelProperty() *ChannelProperty { + this := ChannelProperty{} + return &this +} + +// NewChannelPropertyWithDefaults instantiates a new ChannelProperty object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelPropertyWithDefaults() *ChannelProperty { + this := ChannelProperty{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ChannelProperty) GetName() string { + if o == nil || utils.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelProperty) GetNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ChannelProperty) HasName() bool { + if o != nil && !utils.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ChannelProperty) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ChannelProperty) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelProperty) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ChannelProperty) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ChannelProperty) SetType(v string) { + o.Type = &v +} + +// GetIsRequired returns the IsRequired field value if set, zero value otherwise. +func (o *ChannelProperty) GetIsRequired() bool { + if o == nil || utils.IsNil(o.IsRequired) { + var ret bool + return ret + } + return *o.IsRequired +} + +// GetIsRequiredOk returns a tuple with the IsRequired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelProperty) GetIsRequiredOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsRequired) { + return nil, false + } + return o.IsRequired, true +} + +// HasIsRequired returns a boolean if a field has been set. +func (o *ChannelProperty) HasIsRequired() bool { + if o != nil && !utils.IsNil(o.IsRequired) { + return true + } + + return false +} + +// SetIsRequired gets a reference to the given bool and assigns it to the IsRequired field. +func (o *ChannelProperty) SetIsRequired(v bool) { + o.IsRequired = &v +} + +func (o ChannelProperty) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelProperty) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.IsRequired) { + toSerialize["is_required"] = o.IsRequired + } + return toSerialize, nil +} + +type NullableChannelProperty struct { + value *ChannelProperty + isSet bool +} + +func (v NullableChannelProperty) Get() *ChannelProperty { + return v.value +} + +func (v *NullableChannelProperty) Set(val *ChannelProperty) { + v.value = val + v.isSet = true +} + +func (v NullableChannelProperty) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelProperty) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelProperty(val *ChannelProperty) *NullableChannelProperty { + return &NullableChannelProperty{value: val, isSet: true} +} + +func (v NullableChannelProperty) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelProperty) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_channel_property_all_of.go b/payment_method/model_channel_property_all_of.go new file mode 100644 index 00000000..c079edf5 --- /dev/null +++ b/payment_method/model_channel_property_all_of.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ChannelPropertyAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelPropertyAllOf{} + +// ChannelPropertyAllOf Objects that enumerate the parameters needed as `channel_properties` when creating a Payment Method +type ChannelPropertyAllOf struct { + // The corresponding parameter name + Name *string `json:"name,omitempty"` + // Data type of the parameter + Type *string `json:"type,omitempty"` + // Indicates whether or not the parameter is required + IsRequired *bool `json:"is_required,omitempty"` +} + +// NewChannelPropertyAllOf instantiates a new ChannelPropertyAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannelPropertyAllOf() *ChannelPropertyAllOf { + this := ChannelPropertyAllOf{} + return &this +} + +// NewChannelPropertyAllOfWithDefaults instantiates a new ChannelPropertyAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelPropertyAllOfWithDefaults() *ChannelPropertyAllOf { + this := ChannelPropertyAllOf{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ChannelPropertyAllOf) GetName() string { + if o == nil || utils.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertyAllOf) GetNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ChannelPropertyAllOf) HasName() bool { + if o != nil && !utils.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ChannelPropertyAllOf) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ChannelPropertyAllOf) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertyAllOf) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ChannelPropertyAllOf) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ChannelPropertyAllOf) SetType(v string) { + o.Type = &v +} + +// GetIsRequired returns the IsRequired field value if set, zero value otherwise. +func (o *ChannelPropertyAllOf) GetIsRequired() bool { + if o == nil || utils.IsNil(o.IsRequired) { + var ret bool + return ret + } + return *o.IsRequired +} + +// GetIsRequiredOk returns a tuple with the IsRequired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ChannelPropertyAllOf) GetIsRequiredOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsRequired) { + return nil, false + } + return o.IsRequired, true +} + +// HasIsRequired returns a boolean if a field has been set. +func (o *ChannelPropertyAllOf) HasIsRequired() bool { + if o != nil && !utils.IsNil(o.IsRequired) { + return true + } + + return false +} + +// SetIsRequired gets a reference to the given bool and assigns it to the IsRequired field. +func (o *ChannelPropertyAllOf) SetIsRequired(v bool) { + o.IsRequired = &v +} + +func (o ChannelPropertyAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelPropertyAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.IsRequired) { + toSerialize["is_required"] = o.IsRequired + } + return toSerialize, nil +} + +type NullableChannelPropertyAllOf struct { + value *ChannelPropertyAllOf + isSet bool +} + +func (v NullableChannelPropertyAllOf) Get() *ChannelPropertyAllOf { + return v.value +} + +func (v *NullableChannelPropertyAllOf) Set(val *ChannelPropertyAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableChannelPropertyAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelPropertyAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelPropertyAllOf(val *ChannelPropertyAllOf) *NullableChannelPropertyAllOf { + return &NullableChannelPropertyAllOf{value: val, isSet: true} +} + +func (v NullableChannelPropertyAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelPropertyAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_create_payment_method_409_response.go b/payment_method/model_create_payment_method_409_response.go new file mode 100644 index 00000000..70156c6b --- /dev/null +++ b/payment_method/model_create_payment_method_409_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreatePaymentMethod409Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreatePaymentMethod409Response{} + +// CreatePaymentMethod409Response struct for CreatePaymentMethod409Response +type CreatePaymentMethod409Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreatePaymentMethod409Response instantiates a new CreatePaymentMethod409Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePaymentMethod409Response() *CreatePaymentMethod409Response { + this := CreatePaymentMethod409Response{} + return &this +} + +// NewCreatePaymentMethod409ResponseWithDefaults instantiates a new CreatePaymentMethod409Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePaymentMethod409ResponseWithDefaults() *CreatePaymentMethod409Response { + this := CreatePaymentMethod409Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreatePaymentMethod409Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePaymentMethod409Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreatePaymentMethod409Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreatePaymentMethod409Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreatePaymentMethod409Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePaymentMethod409Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreatePaymentMethod409Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreatePaymentMethod409Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreatePaymentMethod409Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePaymentMethod409Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreatePaymentMethod409Response struct { + value *CreatePaymentMethod409Response + isSet bool +} + +func (v NullableCreatePaymentMethod409Response) Get() *CreatePaymentMethod409Response { + return v.value +} + +func (v *NullableCreatePaymentMethod409Response) Set(val *CreatePaymentMethod409Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePaymentMethod409Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePaymentMethod409Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePaymentMethod409Response(val *CreatePaymentMethod409Response) *NullableCreatePaymentMethod409Response { + return &NullableCreatePaymentMethod409Response{value: val, isSet: true} +} + +func (v NullableCreatePaymentMethod409Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePaymentMethod409Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_create_payment_method_503_response.go b/payment_method/model_create_payment_method_503_response.go new file mode 100644 index 00000000..f01fa4b4 --- /dev/null +++ b/payment_method/model_create_payment_method_503_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreatePaymentMethod503Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreatePaymentMethod503Response{} + +// CreatePaymentMethod503Response struct for CreatePaymentMethod503Response +type CreatePaymentMethod503Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreatePaymentMethod503Response instantiates a new CreatePaymentMethod503Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePaymentMethod503Response() *CreatePaymentMethod503Response { + this := CreatePaymentMethod503Response{} + return &this +} + +// NewCreatePaymentMethod503ResponseWithDefaults instantiates a new CreatePaymentMethod503Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePaymentMethod503ResponseWithDefaults() *CreatePaymentMethod503Response { + this := CreatePaymentMethod503Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreatePaymentMethod503Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePaymentMethod503Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreatePaymentMethod503Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreatePaymentMethod503Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreatePaymentMethod503Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePaymentMethod503Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreatePaymentMethod503Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreatePaymentMethod503Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreatePaymentMethod503Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePaymentMethod503Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreatePaymentMethod503Response struct { + value *CreatePaymentMethod503Response + isSet bool +} + +func (v NullableCreatePaymentMethod503Response) Get() *CreatePaymentMethod503Response { + return v.value +} + +func (v *NullableCreatePaymentMethod503Response) Set(val *CreatePaymentMethod503Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePaymentMethod503Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePaymentMethod503Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePaymentMethod503Response(val *CreatePaymentMethod503Response) *NullableCreatePaymentMethod503Response { + return &NullableCreatePaymentMethod503Response{value: val, isSet: true} +} + +func (v NullableCreatePaymentMethod503Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePaymentMethod503Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit.go b/payment_method/model_direct_debit.go new file mode 100644 index 00000000..5f56b197 --- /dev/null +++ b/payment_method/model_direct_debit.go @@ -0,0 +1,269 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebit type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebit{} + +// DirectDebit Direct Debit Payment Method Details +type DirectDebit struct { + ChannelCode DirectDebitChannelCode `json:"channel_code"` + ChannelProperties NullableDirectDebitChannelProperties `json:"channel_properties"` + Type DirectDebitType `json:"type"` + BankAccount NullableDirectDebitBankAccount `json:"bank_account,omitempty"` + DebitCard NullableDirectDebitDebitCard `json:"debit_card,omitempty"` +} + +// NewDirectDebit instantiates a new DirectDebit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebit(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, type_ DirectDebitType) *DirectDebit { + this := DirectDebit{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + this.Type = type_ + return &this +} + +// NewDirectDebitWithDefaults instantiates a new DirectDebit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitWithDefaults() *DirectDebit { + this := DirectDebit{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *DirectDebit) GetChannelCode() DirectDebitChannelCode { + if o == nil { + var ret DirectDebitChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *DirectDebit) GetChannelCodeOk() (*DirectDebitChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *DirectDebit) SetChannelCode(v DirectDebitChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for DirectDebitChannelProperties will be returned +func (o *DirectDebit) GetChannelProperties() DirectDebitChannelProperties { + if o == nil || o.ChannelProperties.Get() == nil { + var ret DirectDebitChannelProperties + return ret + } + + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// SetChannelProperties sets field value +func (o *DirectDebit) SetChannelProperties(v DirectDebitChannelProperties) { + o.ChannelProperties.Set(&v) +} + +// GetType returns the Type field value +func (o *DirectDebit) GetType() DirectDebitType { + if o == nil { + var ret DirectDebitType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DirectDebit) GetTypeOk() (*DirectDebitType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DirectDebit) SetType(v DirectDebitType) { + o.Type = v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebit) GetBankAccount() DirectDebitBankAccount { + if o == nil || utils.IsNil(o.BankAccount.Get()) { + var ret DirectDebitBankAccount + return ret + } + return *o.BankAccount.Get() +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetBankAccountOk() (*DirectDebitBankAccount, bool) { + if o == nil { + return nil, false + } + return o.BankAccount.Get(), o.BankAccount.IsSet() +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *DirectDebit) HasBankAccount() bool { + if o != nil && o.BankAccount.IsSet() { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given NullableDirectDebitBankAccount and assigns it to the BankAccount field. +func (o *DirectDebit) SetBankAccount(v DirectDebitBankAccount) { + o.BankAccount.Set(&v) +} +// SetBankAccountNil sets the value for BankAccount to be an explicit nil +func (o *DirectDebit) SetBankAccountNil() { + o.BankAccount.Set(nil) +} + +// UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +func (o *DirectDebit) UnsetBankAccount() { + o.BankAccount.Unset() +} + +// GetDebitCard returns the DebitCard field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebit) GetDebitCard() DirectDebitDebitCard { + if o == nil || utils.IsNil(o.DebitCard.Get()) { + var ret DirectDebitDebitCard + return ret + } + return *o.DebitCard.Get() +} + +// GetDebitCardOk returns a tuple with the DebitCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetDebitCardOk() (*DirectDebitDebitCard, bool) { + if o == nil { + return nil, false + } + return o.DebitCard.Get(), o.DebitCard.IsSet() +} + +// HasDebitCard returns a boolean if a field has been set. +func (o *DirectDebit) HasDebitCard() bool { + if o != nil && o.DebitCard.IsSet() { + return true + } + + return false +} + +// SetDebitCard gets a reference to the given NullableDirectDebitDebitCard and assigns it to the DebitCard field. +func (o *DirectDebit) SetDebitCard(v DirectDebitDebitCard) { + o.DebitCard.Set(&v) +} +// SetDebitCardNil sets the value for DebitCard to be an explicit nil +func (o *DirectDebit) SetDebitCardNil() { + o.DebitCard.Set(nil) +} + +// UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil +func (o *DirectDebit) UnsetDebitCard() { + o.DebitCard.Unset() +} + +func (o DirectDebit) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties.Get() + toSerialize["type"] = o.Type + if o.BankAccount.IsSet() { + toSerialize["bank_account"] = o.BankAccount.Get() + } + if o.DebitCard.IsSet() { + toSerialize["debit_card"] = o.DebitCard.Get() + } + return toSerialize, nil +} + +type NullableDirectDebit struct { + value *DirectDebit + isSet bool +} + +func (v NullableDirectDebit) Get() *DirectDebit { + return v.value +} + +func (v *NullableDirectDebit) Set(val *DirectDebit) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebit) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebit(val *DirectDebit) *NullableDirectDebit { + return &NullableDirectDebit{value: val, isSet: true} +} + +func (v NullableDirectDebit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_all_of.go b/payment_method/model_direct_debit_all_of.go new file mode 100644 index 00000000..5e76c0f4 --- /dev/null +++ b/payment_method/model_direct_debit_all_of.go @@ -0,0 +1,213 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitAllOf{} + +// DirectDebitAllOf struct for DirectDebitAllOf +type DirectDebitAllOf struct { + Type DirectDebitType `json:"type"` + BankAccount NullableDirectDebitBankAccount `json:"bank_account,omitempty"` + DebitCard NullableDirectDebitDebitCard `json:"debit_card,omitempty"` +} + +// NewDirectDebitAllOf instantiates a new DirectDebitAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitAllOf(type_ DirectDebitType) *DirectDebitAllOf { + this := DirectDebitAllOf{} + this.Type = type_ + return &this +} + +// NewDirectDebitAllOfWithDefaults instantiates a new DirectDebitAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitAllOfWithDefaults() *DirectDebitAllOf { + this := DirectDebitAllOf{} + return &this +} + +// GetType returns the Type field value +func (o *DirectDebitAllOf) GetType() DirectDebitType { + if o == nil { + var ret DirectDebitType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DirectDebitAllOf) GetTypeOk() (*DirectDebitType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DirectDebitAllOf) SetType(v DirectDebitType) { + o.Type = v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitAllOf) GetBankAccount() DirectDebitBankAccount { + if o == nil || utils.IsNil(o.BankAccount.Get()) { + var ret DirectDebitBankAccount + return ret + } + return *o.BankAccount.Get() +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitAllOf) GetBankAccountOk() (*DirectDebitBankAccount, bool) { + if o == nil { + return nil, false + } + return o.BankAccount.Get(), o.BankAccount.IsSet() +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *DirectDebitAllOf) HasBankAccount() bool { + if o != nil && o.BankAccount.IsSet() { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given NullableDirectDebitBankAccount and assigns it to the BankAccount field. +func (o *DirectDebitAllOf) SetBankAccount(v DirectDebitBankAccount) { + o.BankAccount.Set(&v) +} +// SetBankAccountNil sets the value for BankAccount to be an explicit nil +func (o *DirectDebitAllOf) SetBankAccountNil() { + o.BankAccount.Set(nil) +} + +// UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +func (o *DirectDebitAllOf) UnsetBankAccount() { + o.BankAccount.Unset() +} + +// GetDebitCard returns the DebitCard field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitAllOf) GetDebitCard() DirectDebitDebitCard { + if o == nil || utils.IsNil(o.DebitCard.Get()) { + var ret DirectDebitDebitCard + return ret + } + return *o.DebitCard.Get() +} + +// GetDebitCardOk returns a tuple with the DebitCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitAllOf) GetDebitCardOk() (*DirectDebitDebitCard, bool) { + if o == nil { + return nil, false + } + return o.DebitCard.Get(), o.DebitCard.IsSet() +} + +// HasDebitCard returns a boolean if a field has been set. +func (o *DirectDebitAllOf) HasDebitCard() bool { + if o != nil && o.DebitCard.IsSet() { + return true + } + + return false +} + +// SetDebitCard gets a reference to the given NullableDirectDebitDebitCard and assigns it to the DebitCard field. +func (o *DirectDebitAllOf) SetDebitCard(v DirectDebitDebitCard) { + o.DebitCard.Set(&v) +} +// SetDebitCardNil sets the value for DebitCard to be an explicit nil +func (o *DirectDebitAllOf) SetDebitCardNil() { + o.DebitCard.Set(nil) +} + +// UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil +func (o *DirectDebitAllOf) UnsetDebitCard() { + o.DebitCard.Unset() +} + +func (o DirectDebitAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if o.BankAccount.IsSet() { + toSerialize["bank_account"] = o.BankAccount.Get() + } + if o.DebitCard.IsSet() { + toSerialize["debit_card"] = o.DebitCard.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitAllOf struct { + value *DirectDebitAllOf + isSet bool +} + +func (v NullableDirectDebitAllOf) Get() *DirectDebitAllOf { + return v.value +} + +func (v *NullableDirectDebitAllOf) Set(val *DirectDebitAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitAllOf(val *DirectDebitAllOf) *NullableDirectDebitAllOf { + return &NullableDirectDebitAllOf{value: val, isSet: true} +} + +func (v NullableDirectDebitAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_bank_account.go b/payment_method/model_direct_debit_bank_account.go new file mode 100644 index 00000000..b61c87e7 --- /dev/null +++ b/payment_method/model_direct_debit_bank_account.go @@ -0,0 +1,280 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitBankAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitBankAccount{} + +// DirectDebitBankAccount struct for DirectDebitBankAccount +type DirectDebitBankAccount struct { + MaskedBankAccountNumber NullableString `json:"masked_bank_account_number,omitempty"` + BankAccountHash NullableString `json:"bank_account_hash,omitempty"` + // Mobile number of the customer registered to the partner channel + MobileNumber NullableString `json:"mobile_number,omitempty"` + // Identity number of the customer registered to the partner channel + IdentityDocumentNumber NullableString `json:"identity_document_number,omitempty"` +} + +// NewDirectDebitBankAccount instantiates a new DirectDebitBankAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitBankAccount() *DirectDebitBankAccount { + this := DirectDebitBankAccount{} + return &this +} + +// NewDirectDebitBankAccountWithDefaults instantiates a new DirectDebitBankAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitBankAccountWithDefaults() *DirectDebitBankAccount { + this := DirectDebitBankAccount{} + return &this +} + +// GetMaskedBankAccountNumber returns the MaskedBankAccountNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetMaskedBankAccountNumber() string { + if o == nil || utils.IsNil(o.MaskedBankAccountNumber.Get()) { + var ret string + return ret + } + return *o.MaskedBankAccountNumber.Get() +} + +// GetMaskedBankAccountNumberOk returns a tuple with the MaskedBankAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetMaskedBankAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MaskedBankAccountNumber.Get(), o.MaskedBankAccountNumber.IsSet() +} + +// HasMaskedBankAccountNumber returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasMaskedBankAccountNumber() bool { + if o != nil && o.MaskedBankAccountNumber.IsSet() { + return true + } + + return false +} + +// SetMaskedBankAccountNumber gets a reference to the given NullableString and assigns it to the MaskedBankAccountNumber field. +func (o *DirectDebitBankAccount) SetMaskedBankAccountNumber(v string) { + o.MaskedBankAccountNumber.Set(&v) +} +// SetMaskedBankAccountNumberNil sets the value for MaskedBankAccountNumber to be an explicit nil +func (o *DirectDebitBankAccount) SetMaskedBankAccountNumberNil() { + o.MaskedBankAccountNumber.Set(nil) +} + +// UnsetMaskedBankAccountNumber ensures that no value is present for MaskedBankAccountNumber, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetMaskedBankAccountNumber() { + o.MaskedBankAccountNumber.Unset() +} + +// GetBankAccountHash returns the BankAccountHash field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetBankAccountHash() string { + if o == nil || utils.IsNil(o.BankAccountHash.Get()) { + var ret string + return ret + } + return *o.BankAccountHash.Get() +} + +// GetBankAccountHashOk returns a tuple with the BankAccountHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetBankAccountHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BankAccountHash.Get(), o.BankAccountHash.IsSet() +} + +// HasBankAccountHash returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasBankAccountHash() bool { + if o != nil && o.BankAccountHash.IsSet() { + return true + } + + return false +} + +// SetBankAccountHash gets a reference to the given NullableString and assigns it to the BankAccountHash field. +func (o *DirectDebitBankAccount) SetBankAccountHash(v string) { + o.BankAccountHash.Set(&v) +} +// SetBankAccountHashNil sets the value for BankAccountHash to be an explicit nil +func (o *DirectDebitBankAccount) SetBankAccountHashNil() { + o.BankAccountHash.Set(nil) +} + +// UnsetBankAccountHash ensures that no value is present for BankAccountHash, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetBankAccountHash() { + o.BankAccountHash.Unset() +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber.Get()) { + var ret string + return ret + } + return *o.MobileNumber.Get() +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetMobileNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MobileNumber.Get(), o.MobileNumber.IsSet() +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasMobileNumber() bool { + if o != nil && o.MobileNumber.IsSet() { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given NullableString and assigns it to the MobileNumber field. +func (o *DirectDebitBankAccount) SetMobileNumber(v string) { + o.MobileNumber.Set(&v) +} +// SetMobileNumberNil sets the value for MobileNumber to be an explicit nil +func (o *DirectDebitBankAccount) SetMobileNumberNil() { + o.MobileNumber.Set(nil) +} + +// UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetMobileNumber() { + o.MobileNumber.Unset() +} + +// GetIdentityDocumentNumber returns the IdentityDocumentNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetIdentityDocumentNumber() string { + if o == nil || utils.IsNil(o.IdentityDocumentNumber.Get()) { + var ret string + return ret + } + return *o.IdentityDocumentNumber.Get() +} + +// GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetIdentityDocumentNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IdentityDocumentNumber.Get(), o.IdentityDocumentNumber.IsSet() +} + +// HasIdentityDocumentNumber returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasIdentityDocumentNumber() bool { + if o != nil && o.IdentityDocumentNumber.IsSet() { + return true + } + + return false +} + +// SetIdentityDocumentNumber gets a reference to the given NullableString and assigns it to the IdentityDocumentNumber field. +func (o *DirectDebitBankAccount) SetIdentityDocumentNumber(v string) { + o.IdentityDocumentNumber.Set(&v) +} +// SetIdentityDocumentNumberNil sets the value for IdentityDocumentNumber to be an explicit nil +func (o *DirectDebitBankAccount) SetIdentityDocumentNumberNil() { + o.IdentityDocumentNumber.Set(nil) +} + +// UnsetIdentityDocumentNumber ensures that no value is present for IdentityDocumentNumber, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetIdentityDocumentNumber() { + o.IdentityDocumentNumber.Unset() +} + +func (o DirectDebitBankAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitBankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MaskedBankAccountNumber.IsSet() { + toSerialize["masked_bank_account_number"] = o.MaskedBankAccountNumber.Get() + } + if o.BankAccountHash.IsSet() { + toSerialize["bank_account_hash"] = o.BankAccountHash.Get() + } + if o.MobileNumber.IsSet() { + toSerialize["mobile_number"] = o.MobileNumber.Get() + } + if o.IdentityDocumentNumber.IsSet() { + toSerialize["identity_document_number"] = o.IdentityDocumentNumber.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitBankAccount struct { + value *DirectDebitBankAccount + isSet bool +} + +func (v NullableDirectDebitBankAccount) Get() *DirectDebitBankAccount { + return v.value +} + +func (v *NullableDirectDebitBankAccount) Set(val *DirectDebitBankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitBankAccount(val *DirectDebitBankAccount) *NullableDirectDebitBankAccount { + return &NullableDirectDebitBankAccount{value: val, isSet: true} +} + +func (v NullableDirectDebitBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_channel_code.go b/payment_method/model_direct_debit_channel_code.go new file mode 100644 index 00000000..02e938f9 --- /dev/null +++ b/payment_method/model_direct_debit_channel_code.go @@ -0,0 +1,237 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitChannelCode Direct Debit Channel Code +type DirectDebitChannelCode string + +// List of DirectDebitChannelCode +const ( + DIRECTDEBITCHANNELCODE_BCA_KLIKPAY DirectDebitChannelCode = "BCA_KLIKPAY" + DIRECTDEBITCHANNELCODE_BCA_ONEKLIK DirectDebitChannelCode = "BCA_ONEKLIK" + DIRECTDEBITCHANNELCODE_BDO DirectDebitChannelCode = "BDO" + DIRECTDEBITCHANNELCODE_BPI DirectDebitChannelCode = "BPI" + DIRECTDEBITCHANNELCODE_BRI DirectDebitChannelCode = "BRI" + DIRECTDEBITCHANNELCODE_BNI DirectDebitChannelCode = "BNI" + DIRECTDEBITCHANNELCODE_CHINABANK DirectDebitChannelCode = "CHINABANK" + DIRECTDEBITCHANNELCODE_CIMBNIAGA DirectDebitChannelCode = "CIMBNIAGA" + DIRECTDEBITCHANNELCODE_MTB DirectDebitChannelCode = "MTB" + DIRECTDEBITCHANNELCODE_RCBC DirectDebitChannelCode = "RCBC" + DIRECTDEBITCHANNELCODE_UBP DirectDebitChannelCode = "UBP" + DIRECTDEBITCHANNELCODE_MANDIRI DirectDebitChannelCode = "MANDIRI" + DIRECTDEBITCHANNELCODE_BBL DirectDebitChannelCode = "BBL" + DIRECTDEBITCHANNELCODE_SCB DirectDebitChannelCode = "SCB" + DIRECTDEBITCHANNELCODE_KTB DirectDebitChannelCode = "KTB" + DIRECTDEBITCHANNELCODE_BAY DirectDebitChannelCode = "BAY" + DIRECTDEBITCHANNELCODE_KBANK_MB DirectDebitChannelCode = "KBANK_MB" + DIRECTDEBITCHANNELCODE_BAY_MB DirectDebitChannelCode = "BAY_MB" + DIRECTDEBITCHANNELCODE_KTB_MB DirectDebitChannelCode = "KTB_MB" + DIRECTDEBITCHANNELCODE_BBL_MB DirectDebitChannelCode = "BBL_MB" + DIRECTDEBITCHANNELCODE_SCB_MB DirectDebitChannelCode = "SCB_MB" + DIRECTDEBITCHANNELCODE_BDO_EPAY DirectDebitChannelCode = "BDO_EPAY" + DIRECTDEBITCHANNELCODE_AUTODEBIT_UBP DirectDebitChannelCode = "AUTODEBIT_UBP" + DIRECTDEBITCHANNELCODE_AFFIN_FPX DirectDebitChannelCode = "AFFIN_FPX" + DIRECTDEBITCHANNELCODE_AGRO_FPX DirectDebitChannelCode = "AGRO_FPX" + DIRECTDEBITCHANNELCODE_ALLIANCE_FPX DirectDebitChannelCode = "ALLIANCE_FPX" + DIRECTDEBITCHANNELCODE_AMBANK_FPX DirectDebitChannelCode = "AMBANK_FPX" + DIRECTDEBITCHANNELCODE_ISLAM_FPX DirectDebitChannelCode = "ISLAM_FPX" + DIRECTDEBITCHANNELCODE_MUAMALAT_FPX DirectDebitChannelCode = "MUAMALAT_FPX" + DIRECTDEBITCHANNELCODE_BOC_FPX DirectDebitChannelCode = "BOC_FPX" + DIRECTDEBITCHANNELCODE_RAKYAT_FPX DirectDebitChannelCode = "RAKYAT_FPX" + DIRECTDEBITCHANNELCODE_BSN_FPX DirectDebitChannelCode = "BSN_FPX" + DIRECTDEBITCHANNELCODE_CIMB_FPX DirectDebitChannelCode = "CIMB_FPX" + DIRECTDEBITCHANNELCODE_HLB_FPX DirectDebitChannelCode = "HLB_FPX" + DIRECTDEBITCHANNELCODE_HSBC_FPX DirectDebitChannelCode = "HSBC_FPX" + DIRECTDEBITCHANNELCODE_KFH_FPX DirectDebitChannelCode = "KFH_FPX" + DIRECTDEBITCHANNELCODE_MAYB2_E_FPX DirectDebitChannelCode = "MAYB2E_FPX" + DIRECTDEBITCHANNELCODE_MAYB2_U_FPX DirectDebitChannelCode = "MAYB2U_FPX" + DIRECTDEBITCHANNELCODE_OCBC_FPX DirectDebitChannelCode = "OCBC_FPX" + DIRECTDEBITCHANNELCODE_PUBLIC_FPX DirectDebitChannelCode = "PUBLIC_FPX" + DIRECTDEBITCHANNELCODE_RHB_FPX DirectDebitChannelCode = "RHB_FPX" + DIRECTDEBITCHANNELCODE_SCH_FPX DirectDebitChannelCode = "SCH_FPX" + DIRECTDEBITCHANNELCODE_UOB_FPX DirectDebitChannelCode = "UOB_FPX" + DIRECTDEBITCHANNELCODE_AFFIN_FPX_BUSINESS DirectDebitChannelCode = "AFFIN_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_AGRO_FPX_BUSINESS DirectDebitChannelCode = "AGRO_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_ALLIANCE_FPX_BUSINESS DirectDebitChannelCode = "ALLIANCE_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_AMBANK_FPX_BUSINESS DirectDebitChannelCode = "AMBANK_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_ISLAM_FPX_BUSINESS DirectDebitChannelCode = "ISLAM_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_MUAMALAT_FPX_BUSINESS DirectDebitChannelCode = "MUAMALAT_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_BNP_FPX_BUSINESS DirectDebitChannelCode = "BNP_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_CIMB_FPX_BUSINESS DirectDebitChannelCode = "CIMB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_CITIBANK_FPX_BUSINESS DirectDebitChannelCode = "CITIBANK_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_DEUTSCHE_FPX_BUSINESS DirectDebitChannelCode = "DEUTSCHE_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_HLB_FPX_BUSINESS DirectDebitChannelCode = "HLB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_HSBC_FPX_BUSINESS DirectDebitChannelCode = "HSBC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_RAKYAT_FPX_BUSINESS DirectDebitChannelCode = "RAKYAT_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_KFH_FPX_BUSINESS DirectDebitChannelCode = "KFH_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_MAYB2_E_FPX_BUSINESS DirectDebitChannelCode = "MAYB2E_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_OCBC_FPX_BUSINESS DirectDebitChannelCode = "OCBC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_PUBLIC_FPX_BUSINESS DirectDebitChannelCode = "PUBLIC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_RHB_FPX_BUSINESS DirectDebitChannelCode = "RHB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_SCH_FPX_BUSINESS DirectDebitChannelCode = "SCH_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_UOB_FPX_BUSINESS DirectDebitChannelCode = "UOB_FPX_BUSINESS" +) + +// All allowed values of DirectDebitChannelCode enum +var AllowedDirectDebitChannelCodeEnumValues = []DirectDebitChannelCode{ + "BCA_KLIKPAY", + "BCA_ONEKLIK", + "BDO", + "BPI", + "BRI", + "BNI", + "CHINABANK", + "CIMBNIAGA", + "MTB", + "RCBC", + "UBP", + "MANDIRI", + "BBL", + "SCB", + "KTB", + "BAY", + "KBANK_MB", + "BAY_MB", + "KTB_MB", + "BBL_MB", + "SCB_MB", + "BDO_EPAY", + "AUTODEBIT_UBP", + "AFFIN_FPX", + "AGRO_FPX", + "ALLIANCE_FPX", + "AMBANK_FPX", + "ISLAM_FPX", + "MUAMALAT_FPX", + "BOC_FPX", + "RAKYAT_FPX", + "BSN_FPX", + "CIMB_FPX", + "HLB_FPX", + "HSBC_FPX", + "KFH_FPX", + "MAYB2E_FPX", + "MAYB2U_FPX", + "OCBC_FPX", + "PUBLIC_FPX", + "RHB_FPX", + "SCH_FPX", + "UOB_FPX", + "AFFIN_FPX_BUSINESS", + "AGRO_FPX_BUSINESS", + "ALLIANCE_FPX_BUSINESS", + "AMBANK_FPX_BUSINESS", + "ISLAM_FPX_BUSINESS", + "MUAMALAT_FPX_BUSINESS", + "BNP_FPX_BUSINESS", + "CIMB_FPX_BUSINESS", + "CITIBANK_FPX_BUSINESS", + "DEUTSCHE_FPX_BUSINESS", + "HLB_FPX_BUSINESS", + "HSBC_FPX_BUSINESS", + "RAKYAT_FPX_BUSINESS", + "KFH_FPX_BUSINESS", + "MAYB2E_FPX_BUSINESS", + "OCBC_FPX_BUSINESS", + "PUBLIC_FPX_BUSINESS", + "RHB_FPX_BUSINESS", + "SCH_FPX_BUSINESS", + "UOB_FPX_BUSINESS", +} + +func (v *DirectDebitChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DirectDebitChannelCode(value) + for _, existing := range AllowedDirectDebitChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DirectDebitChannelCode", value) +} + +// NewDirectDebitChannelCodeFromValue returns a pointer to a valid DirectDebitChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDirectDebitChannelCodeFromValue(v string) (*DirectDebitChannelCode, error) { + ev := DirectDebitChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DirectDebitChannelCode: valid values are %v", v, AllowedDirectDebitChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DirectDebitChannelCode) IsValid() bool { + for _, existing := range AllowedDirectDebitChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v DirectDebitChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to DirectDebitChannelCode value +func (v DirectDebitChannelCode) Ptr() *DirectDebitChannelCode { + return &v +} + +type NullableDirectDebitChannelCode struct { + value *DirectDebitChannelCode + isSet bool +} + +func (v NullableDirectDebitChannelCode) Get() *DirectDebitChannelCode { + return v.value +} + +func (v *NullableDirectDebitChannelCode) Set(val *DirectDebitChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelCode(val *DirectDebitChannelCode) *NullableDirectDebitChannelCode { + return &NullableDirectDebitChannelCode{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_direct_debit_channel_properties.go b/payment_method/model_direct_debit_channel_properties.go new file mode 100644 index 00000000..48d59d7f --- /dev/null +++ b/payment_method/model_direct_debit_channel_properties.go @@ -0,0 +1,457 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitChannelProperties{} + +// DirectDebitChannelProperties Direct Debit Channel Properties +type DirectDebitChannelProperties struct { + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + FailureReturnUrl NullableString `json:"failure_return_url,omitempty"` + // Mobile number of the customer registered to the partner channel + MobileNumber NullableString `json:"mobile_number,omitempty"` + // Last four digits of the debit card + CardLastFour NullableString `json:"card_last_four,omitempty"` + // Expiry month and year of the debit card (in MM/YY format) + CardExpiry NullableString `json:"card_expiry,omitempty"` + // Email address of the customer that is registered to the partner channel + Email NullableString `json:"email,omitempty"` + // Identity number of the customer registered to the partner channel + IdentityDocumentNumber NullableString `json:"identity_document_number,omitempty"` + RequireAuth NullableBool `json:"require_auth,omitempty"` +} + +// NewDirectDebitChannelProperties instantiates a new DirectDebitChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitChannelProperties() *DirectDebitChannelProperties { + this := DirectDebitChannelProperties{} + return &this +} + +// NewDirectDebitChannelPropertiesWithDefaults instantiates a new DirectDebitChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitChannelPropertiesWithDefaults() *DirectDebitChannelProperties { + this := DirectDebitChannelProperties{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *DirectDebitChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *DirectDebitChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl.Get()) { + var ret string + return ret + } + return *o.FailureReturnUrl.Get() +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureReturnUrl.Get(), o.FailureReturnUrl.IsSet() +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasFailureReturnUrl() bool { + if o != nil && o.FailureReturnUrl.IsSet() { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given NullableString and assigns it to the FailureReturnUrl field. +func (o *DirectDebitChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl.Set(&v) +} +// SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil +func (o *DirectDebitChannelProperties) SetFailureReturnUrlNil() { + o.FailureReturnUrl.Set(nil) +} + +// UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetFailureReturnUrl() { + o.FailureReturnUrl.Unset() +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber.Get()) { + var ret string + return ret + } + return *o.MobileNumber.Get() +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetMobileNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MobileNumber.Get(), o.MobileNumber.IsSet() +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasMobileNumber() bool { + if o != nil && o.MobileNumber.IsSet() { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given NullableString and assigns it to the MobileNumber field. +func (o *DirectDebitChannelProperties) SetMobileNumber(v string) { + o.MobileNumber.Set(&v) +} +// SetMobileNumberNil sets the value for MobileNumber to be an explicit nil +func (o *DirectDebitChannelProperties) SetMobileNumberNil() { + o.MobileNumber.Set(nil) +} + +// UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetMobileNumber() { + o.MobileNumber.Unset() +} + +// GetCardLastFour returns the CardLastFour field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetCardLastFour() string { + if o == nil || utils.IsNil(o.CardLastFour.Get()) { + var ret string + return ret + } + return *o.CardLastFour.Get() +} + +// GetCardLastFourOk returns a tuple with the CardLastFour field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetCardLastFourOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardLastFour.Get(), o.CardLastFour.IsSet() +} + +// HasCardLastFour returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasCardLastFour() bool { + if o != nil && o.CardLastFour.IsSet() { + return true + } + + return false +} + +// SetCardLastFour gets a reference to the given NullableString and assigns it to the CardLastFour field. +func (o *DirectDebitChannelProperties) SetCardLastFour(v string) { + o.CardLastFour.Set(&v) +} +// SetCardLastFourNil sets the value for CardLastFour to be an explicit nil +func (o *DirectDebitChannelProperties) SetCardLastFourNil() { + o.CardLastFour.Set(nil) +} + +// UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetCardLastFour() { + o.CardLastFour.Unset() +} + +// GetCardExpiry returns the CardExpiry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetCardExpiry() string { + if o == nil || utils.IsNil(o.CardExpiry.Get()) { + var ret string + return ret + } + return *o.CardExpiry.Get() +} + +// GetCardExpiryOk returns a tuple with the CardExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetCardExpiryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardExpiry.Get(), o.CardExpiry.IsSet() +} + +// HasCardExpiry returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasCardExpiry() bool { + if o != nil && o.CardExpiry.IsSet() { + return true + } + + return false +} + +// SetCardExpiry gets a reference to the given NullableString and assigns it to the CardExpiry field. +func (o *DirectDebitChannelProperties) SetCardExpiry(v string) { + o.CardExpiry.Set(&v) +} +// SetCardExpiryNil sets the value for CardExpiry to be an explicit nil +func (o *DirectDebitChannelProperties) SetCardExpiryNil() { + o.CardExpiry.Set(nil) +} + +// UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetCardExpiry() { + o.CardExpiry.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetEmail() string { + if o == nil || utils.IsNil(o.Email.Get()) { + var ret string + return ret + } + return *o.Email.Get() +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Email.Get(), o.Email.IsSet() +} + +// HasEmail returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasEmail() bool { + if o != nil && o.Email.IsSet() { + return true + } + + return false +} + +// SetEmail gets a reference to the given NullableString and assigns it to the Email field. +func (o *DirectDebitChannelProperties) SetEmail(v string) { + o.Email.Set(&v) +} +// SetEmailNil sets the value for Email to be an explicit nil +func (o *DirectDebitChannelProperties) SetEmailNil() { + o.Email.Set(nil) +} + +// UnsetEmail ensures that no value is present for Email, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetEmail() { + o.Email.Unset() +} + +// GetIdentityDocumentNumber returns the IdentityDocumentNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetIdentityDocumentNumber() string { + if o == nil || utils.IsNil(o.IdentityDocumentNumber.Get()) { + var ret string + return ret + } + return *o.IdentityDocumentNumber.Get() +} + +// GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetIdentityDocumentNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IdentityDocumentNumber.Get(), o.IdentityDocumentNumber.IsSet() +} + +// HasIdentityDocumentNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasIdentityDocumentNumber() bool { + if o != nil && o.IdentityDocumentNumber.IsSet() { + return true + } + + return false +} + +// SetIdentityDocumentNumber gets a reference to the given NullableString and assigns it to the IdentityDocumentNumber field. +func (o *DirectDebitChannelProperties) SetIdentityDocumentNumber(v string) { + o.IdentityDocumentNumber.Set(&v) +} +// SetIdentityDocumentNumberNil sets the value for IdentityDocumentNumber to be an explicit nil +func (o *DirectDebitChannelProperties) SetIdentityDocumentNumberNil() { + o.IdentityDocumentNumber.Set(nil) +} + +// UnsetIdentityDocumentNumber ensures that no value is present for IdentityDocumentNumber, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetIdentityDocumentNumber() { + o.IdentityDocumentNumber.Unset() +} + +// GetRequireAuth returns the RequireAuth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitChannelProperties) GetRequireAuth() bool { + if o == nil || utils.IsNil(o.RequireAuth.Get()) { + var ret bool + return ret + } + return *o.RequireAuth.Get() +} + +// GetRequireAuthOk returns a tuple with the RequireAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitChannelProperties) GetRequireAuthOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.RequireAuth.Get(), o.RequireAuth.IsSet() +} + +// HasRequireAuth returns a boolean if a field has been set. +func (o *DirectDebitChannelProperties) HasRequireAuth() bool { + if o != nil && o.RequireAuth.IsSet() { + return true + } + + return false +} + +// SetRequireAuth gets a reference to the given NullableBool and assigns it to the RequireAuth field. +func (o *DirectDebitChannelProperties) SetRequireAuth(v bool) { + o.RequireAuth.Set(&v) +} +// SetRequireAuthNil sets the value for RequireAuth to be an explicit nil +func (o *DirectDebitChannelProperties) SetRequireAuthNil() { + o.RequireAuth.Set(nil) +} + +// UnsetRequireAuth ensures that no value is present for RequireAuth, not even an explicit nil +func (o *DirectDebitChannelProperties) UnsetRequireAuth() { + o.RequireAuth.Unset() +} + +func (o DirectDebitChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if o.FailureReturnUrl.IsSet() { + toSerialize["failure_return_url"] = o.FailureReturnUrl.Get() + } + if o.MobileNumber.IsSet() { + toSerialize["mobile_number"] = o.MobileNumber.Get() + } + if o.CardLastFour.IsSet() { + toSerialize["card_last_four"] = o.CardLastFour.Get() + } + if o.CardExpiry.IsSet() { + toSerialize["card_expiry"] = o.CardExpiry.Get() + } + if o.Email.IsSet() { + toSerialize["email"] = o.Email.Get() + } + if o.IdentityDocumentNumber.IsSet() { + toSerialize["identity_document_number"] = o.IdentityDocumentNumber.Get() + } + if o.RequireAuth.IsSet() { + toSerialize["require_auth"] = o.RequireAuth.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitChannelProperties struct { + value *DirectDebitChannelProperties + isSet bool +} + +func (v NullableDirectDebitChannelProperties) Get() *DirectDebitChannelProperties { + return v.value +} + +func (v *NullableDirectDebitChannelProperties) Set(val *DirectDebitChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelProperties(val *DirectDebitChannelProperties) *NullableDirectDebitChannelProperties { + return &NullableDirectDebitChannelProperties{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_debit_card.go b/payment_method/model_direct_debit_debit_card.go new file mode 100644 index 00000000..0f16f459 --- /dev/null +++ b/payment_method/model_direct_debit_debit_card.go @@ -0,0 +1,282 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitDebitCard type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitDebitCard{} + +// DirectDebitDebitCard struct for DirectDebitDebitCard +type DirectDebitDebitCard struct { + // Mobile number of the customer registered to the partner channel + MobileNumber NullableString `json:"mobile_number,omitempty"` + // Last four digits of the debit card + CardLastFour NullableString `json:"card_last_four,omitempty"` + // Expiry month and year of the debit card (in MM/YY format) + CardExpiry NullableString `json:"card_expiry,omitempty"` + // Email address of the customer that is registered to the partner channel + Email NullableString `json:"email,omitempty"` +} + +// NewDirectDebitDebitCard instantiates a new DirectDebitDebitCard object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitDebitCard() *DirectDebitDebitCard { + this := DirectDebitDebitCard{} + return &this +} + +// NewDirectDebitDebitCardWithDefaults instantiates a new DirectDebitDebitCard object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitDebitCardWithDefaults() *DirectDebitDebitCard { + this := DirectDebitDebitCard{} + return &this +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber.Get()) { + var ret string + return ret + } + return *o.MobileNumber.Get() +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetMobileNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MobileNumber.Get(), o.MobileNumber.IsSet() +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasMobileNumber() bool { + if o != nil && o.MobileNumber.IsSet() { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given NullableString and assigns it to the MobileNumber field. +func (o *DirectDebitDebitCard) SetMobileNumber(v string) { + o.MobileNumber.Set(&v) +} +// SetMobileNumberNil sets the value for MobileNumber to be an explicit nil +func (o *DirectDebitDebitCard) SetMobileNumberNil() { + o.MobileNumber.Set(nil) +} + +// UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetMobileNumber() { + o.MobileNumber.Unset() +} + +// GetCardLastFour returns the CardLastFour field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetCardLastFour() string { + if o == nil || utils.IsNil(o.CardLastFour.Get()) { + var ret string + return ret + } + return *o.CardLastFour.Get() +} + +// GetCardLastFourOk returns a tuple with the CardLastFour field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetCardLastFourOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardLastFour.Get(), o.CardLastFour.IsSet() +} + +// HasCardLastFour returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasCardLastFour() bool { + if o != nil && o.CardLastFour.IsSet() { + return true + } + + return false +} + +// SetCardLastFour gets a reference to the given NullableString and assigns it to the CardLastFour field. +func (o *DirectDebitDebitCard) SetCardLastFour(v string) { + o.CardLastFour.Set(&v) +} +// SetCardLastFourNil sets the value for CardLastFour to be an explicit nil +func (o *DirectDebitDebitCard) SetCardLastFourNil() { + o.CardLastFour.Set(nil) +} + +// UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetCardLastFour() { + o.CardLastFour.Unset() +} + +// GetCardExpiry returns the CardExpiry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetCardExpiry() string { + if o == nil || utils.IsNil(o.CardExpiry.Get()) { + var ret string + return ret + } + return *o.CardExpiry.Get() +} + +// GetCardExpiryOk returns a tuple with the CardExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetCardExpiryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardExpiry.Get(), o.CardExpiry.IsSet() +} + +// HasCardExpiry returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasCardExpiry() bool { + if o != nil && o.CardExpiry.IsSet() { + return true + } + + return false +} + +// SetCardExpiry gets a reference to the given NullableString and assigns it to the CardExpiry field. +func (o *DirectDebitDebitCard) SetCardExpiry(v string) { + o.CardExpiry.Set(&v) +} +// SetCardExpiryNil sets the value for CardExpiry to be an explicit nil +func (o *DirectDebitDebitCard) SetCardExpiryNil() { + o.CardExpiry.Set(nil) +} + +// UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetCardExpiry() { + o.CardExpiry.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetEmail() string { + if o == nil || utils.IsNil(o.Email.Get()) { + var ret string + return ret + } + return *o.Email.Get() +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Email.Get(), o.Email.IsSet() +} + +// HasEmail returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasEmail() bool { + if o != nil && o.Email.IsSet() { + return true + } + + return false +} + +// SetEmail gets a reference to the given NullableString and assigns it to the Email field. +func (o *DirectDebitDebitCard) SetEmail(v string) { + o.Email.Set(&v) +} +// SetEmailNil sets the value for Email to be an explicit nil +func (o *DirectDebitDebitCard) SetEmailNil() { + o.Email.Set(nil) +} + +// UnsetEmail ensures that no value is present for Email, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetEmail() { + o.Email.Unset() +} + +func (o DirectDebitDebitCard) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitDebitCard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MobileNumber.IsSet() { + toSerialize["mobile_number"] = o.MobileNumber.Get() + } + if o.CardLastFour.IsSet() { + toSerialize["card_last_four"] = o.CardLastFour.Get() + } + if o.CardExpiry.IsSet() { + toSerialize["card_expiry"] = o.CardExpiry.Get() + } + if o.Email.IsSet() { + toSerialize["email"] = o.Email.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitDebitCard struct { + value *DirectDebitDebitCard + isSet bool +} + +func (v NullableDirectDebitDebitCard) Get() *DirectDebitDebitCard { + return v.value +} + +func (v *NullableDirectDebitDebitCard) Set(val *DirectDebitDebitCard) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitDebitCard) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitDebitCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitDebitCard(val *DirectDebitDebitCard) *NullableDirectDebitDebitCard { + return &NullableDirectDebitDebitCard{value: val, isSet: true} +} + +func (v NullableDirectDebitDebitCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitDebitCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_parameters.go b/payment_method/model_direct_debit_parameters.go new file mode 100644 index 00000000..a9adc329 --- /dev/null +++ b/payment_method/model_direct_debit_parameters.go @@ -0,0 +1,150 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitParameters{} + +// DirectDebitParameters struct for DirectDebitParameters +type DirectDebitParameters struct { + ChannelCode DirectDebitChannelCode `json:"channel_code"` + ChannelProperties NullableDirectDebitChannelProperties `json:"channel_properties"` +} + +// NewDirectDebitParameters instantiates a new DirectDebitParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitParameters(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties) *DirectDebitParameters { + this := DirectDebitParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewDirectDebitParametersWithDefaults instantiates a new DirectDebitParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitParametersWithDefaults() *DirectDebitParameters { + this := DirectDebitParameters{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *DirectDebitParameters) GetChannelCode() DirectDebitChannelCode { + if o == nil { + var ret DirectDebitChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *DirectDebitParameters) GetChannelCodeOk() (*DirectDebitChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *DirectDebitParameters) SetChannelCode(v DirectDebitChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for DirectDebitChannelProperties will be returned +func (o *DirectDebitParameters) GetChannelProperties() DirectDebitChannelProperties { + if o == nil || o.ChannelProperties.Get() == nil { + var ret DirectDebitChannelProperties + return ret + } + + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitParameters) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// SetChannelProperties sets field value +func (o *DirectDebitParameters) SetChannelProperties(v DirectDebitChannelProperties) { + o.ChannelProperties.Set(&v) +} + +func (o DirectDebitParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties.Get() + return toSerialize, nil +} + +type NullableDirectDebitParameters struct { + value *DirectDebitParameters + isSet bool +} + +func (v NullableDirectDebitParameters) Get() *DirectDebitParameters { + return v.value +} + +func (v *NullableDirectDebitParameters) Set(val *DirectDebitParameters) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitParameters(val *DirectDebitParameters) *NullableDirectDebitParameters { + return &NullableDirectDebitParameters{value: val, isSet: true} +} + +func (v NullableDirectDebitParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_direct_debit_type.go b/payment_method/model_direct_debit_type.go new file mode 100644 index 00000000..92c0462b --- /dev/null +++ b/payment_method/model_direct_debit_type.go @@ -0,0 +1,117 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitType the model 'DirectDebitType' +type DirectDebitType string + +// List of DirectDebitType +const ( + DIRECTDEBITTYPE_DEBIT_CARD DirectDebitType = "DEBIT_CARD" + DIRECTDEBITTYPE_BANK_ACCOUNT DirectDebitType = "BANK_ACCOUNT" + DIRECTDEBITTYPE_BANK_REDIRECT DirectDebitType = "BANK_REDIRECT" +) + +// All allowed values of DirectDebitType enum +var AllowedDirectDebitTypeEnumValues = []DirectDebitType{ + "DEBIT_CARD", + "BANK_ACCOUNT", + "BANK_REDIRECT", +} + +func (v *DirectDebitType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DirectDebitType(value) + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DirectDebitType", value) +} + +// NewDirectDebitTypeFromValue returns a pointer to a valid DirectDebitType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDirectDebitTypeFromValue(v string) (*DirectDebitType, error) { + ev := DirectDebitType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DirectDebitType: valid values are %v", v, AllowedDirectDebitTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DirectDebitType) IsValid() bool { + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v DirectDebitType) String() string { + return string(v) +} + +// Ptr returns reference to DirectDebitType value +func (v DirectDebitType) Ptr() *DirectDebitType { + return &v +} + +type NullableDirectDebitType struct { + value *DirectDebitType + isSet bool +} + +func (v NullableDirectDebitType) Get() *DirectDebitType { + return v.value +} + +func (v *NullableDirectDebitType) Set(val *DirectDebitType) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitType) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitType(val *DirectDebitType) *NullableDirectDebitType { + return &NullableDirectDebitType{value: val, isSet: true} +} + +func (v NullableDirectDebitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_e_wallet.go b/payment_method/model_e_wallet.go new file mode 100644 index 00000000..ad727646 --- /dev/null +++ b/payment_method/model_e_wallet.go @@ -0,0 +1,193 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWallet type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWallet{} + +// EWallet Ewallet Payment Method Details +type EWallet struct { + ChannelCode EWalletChannelCode `json:"channel_code"` + ChannelProperties *EWalletChannelProperties `json:"channel_properties,omitempty"` + Account *EWalletAccount `json:"account,omitempty"` +} + +// NewEWallet instantiates a new EWallet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWallet(channelCode EWalletChannelCode) *EWallet { + this := EWallet{} + this.ChannelCode = channelCode + return &this +} + +// NewEWalletWithDefaults instantiates a new EWallet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletWithDefaults() *EWallet { + this := EWallet{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *EWallet) GetChannelCode() EWalletChannelCode { + if o == nil { + var ret EWalletChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *EWallet) GetChannelCodeOk() (*EWalletChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *EWallet) SetChannelCode(v EWalletChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *EWallet) GetChannelProperties() EWalletChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret EWalletChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWallet) GetChannelPropertiesOk() (*EWalletChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *EWallet) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given EWalletChannelProperties and assigns it to the ChannelProperties field. +func (o *EWallet) SetChannelProperties(v EWalletChannelProperties) { + o.ChannelProperties = &v +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *EWallet) GetAccount() EWalletAccount { + if o == nil || utils.IsNil(o.Account) { + var ret EWalletAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWallet) GetAccountOk() (*EWalletAccount, bool) { + if o == nil || utils.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *EWallet) HasAccount() bool { + if o != nil && !utils.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given EWalletAccount and assigns it to the Account field. +func (o *EWallet) SetAccount(v EWalletAccount) { + o.Account = &v +} + +func (o EWallet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWallet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + return toSerialize, nil +} + +type NullableEWallet struct { + value *EWallet + isSet bool +} + +func (v NullableEWallet) Get() *EWallet { + return v.value +} + +func (v *NullableEWallet) Set(val *EWallet) { + v.value = val + v.isSet = true +} + +func (v NullableEWallet) IsSet() bool { + return v.isSet +} + +func (v *NullableEWallet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWallet(val *EWallet) *NullableEWallet { + return &NullableEWallet{value: val, isSet: true} +} + +func (v NullableEWallet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWallet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_e_wallet_account.go b/payment_method/model_e_wallet_account.go new file mode 100644 index 00000000..8c02612c --- /dev/null +++ b/payment_method/model_e_wallet_account.go @@ -0,0 +1,282 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletAccount{} + +// EWalletAccount EWallet Account Properties +type EWalletAccount struct { + // Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable + Name NullableString `json:"name,omitempty"` + // Identifier from eWallet provider e.g. phone number. The value is null if unavailable + AccountDetails NullableString `json:"account_details,omitempty"` + // The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable + Balance NullableFloat64 `json:"balance,omitempty"` + // The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl + PointBalance NullableFloat64 `json:"point_balance,omitempty"` +} + +// NewEWalletAccount instantiates a new EWalletAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletAccount() *EWalletAccount { + this := EWalletAccount{} + return &this +} + +// NewEWalletAccountWithDefaults instantiates a new EWalletAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletAccountWithDefaults() *EWalletAccount { + this := EWalletAccount{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetName() string { + if o == nil || utils.IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *EWalletAccount) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *EWalletAccount) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *EWalletAccount) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *EWalletAccount) UnsetName() { + o.Name.Unset() +} + +// GetAccountDetails returns the AccountDetails field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetAccountDetails() string { + if o == nil || utils.IsNil(o.AccountDetails.Get()) { + var ret string + return ret + } + return *o.AccountDetails.Get() +} + +// GetAccountDetailsOk returns a tuple with the AccountDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetAccountDetailsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccountDetails.Get(), o.AccountDetails.IsSet() +} + +// HasAccountDetails returns a boolean if a field has been set. +func (o *EWalletAccount) HasAccountDetails() bool { + if o != nil && o.AccountDetails.IsSet() { + return true + } + + return false +} + +// SetAccountDetails gets a reference to the given NullableString and assigns it to the AccountDetails field. +func (o *EWalletAccount) SetAccountDetails(v string) { + o.AccountDetails.Set(&v) +} +// SetAccountDetailsNil sets the value for AccountDetails to be an explicit nil +func (o *EWalletAccount) SetAccountDetailsNil() { + o.AccountDetails.Set(nil) +} + +// UnsetAccountDetails ensures that no value is present for AccountDetails, not even an explicit nil +func (o *EWalletAccount) UnsetAccountDetails() { + o.AccountDetails.Unset() +} + +// GetBalance returns the Balance field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetBalance() float64 { + if o == nil || utils.IsNil(o.Balance.Get()) { + var ret float64 + return ret + } + return *o.Balance.Get() +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetBalanceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Balance.Get(), o.Balance.IsSet() +} + +// HasBalance returns a boolean if a field has been set. +func (o *EWalletAccount) HasBalance() bool { + if o != nil && o.Balance.IsSet() { + return true + } + + return false +} + +// SetBalance gets a reference to the given NullableFloat64 and assigns it to the Balance field. +func (o *EWalletAccount) SetBalance(v float64) { + o.Balance.Set(&v) +} +// SetBalanceNil sets the value for Balance to be an explicit nil +func (o *EWalletAccount) SetBalanceNil() { + o.Balance.Set(nil) +} + +// UnsetBalance ensures that no value is present for Balance, not even an explicit nil +func (o *EWalletAccount) UnsetBalance() { + o.Balance.Unset() +} + +// GetPointBalance returns the PointBalance field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetPointBalance() float64 { + if o == nil || utils.IsNil(o.PointBalance.Get()) { + var ret float64 + return ret + } + return *o.PointBalance.Get() +} + +// GetPointBalanceOk returns a tuple with the PointBalance field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetPointBalanceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.PointBalance.Get(), o.PointBalance.IsSet() +} + +// HasPointBalance returns a boolean if a field has been set. +func (o *EWalletAccount) HasPointBalance() bool { + if o != nil && o.PointBalance.IsSet() { + return true + } + + return false +} + +// SetPointBalance gets a reference to the given NullableFloat64 and assigns it to the PointBalance field. +func (o *EWalletAccount) SetPointBalance(v float64) { + o.PointBalance.Set(&v) +} +// SetPointBalanceNil sets the value for PointBalance to be an explicit nil +func (o *EWalletAccount) SetPointBalanceNil() { + o.PointBalance.Set(nil) +} + +// UnsetPointBalance ensures that no value is present for PointBalance, not even an explicit nil +func (o *EWalletAccount) UnsetPointBalance() { + o.PointBalance.Unset() +} + +func (o EWalletAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.AccountDetails.IsSet() { + toSerialize["account_details"] = o.AccountDetails.Get() + } + if o.Balance.IsSet() { + toSerialize["balance"] = o.Balance.Get() + } + if o.PointBalance.IsSet() { + toSerialize["point_balance"] = o.PointBalance.Get() + } + return toSerialize, nil +} + +type NullableEWalletAccount struct { + value *EWalletAccount + isSet bool +} + +func (v NullableEWalletAccount) Get() *EWalletAccount { + return v.value +} + +func (v *NullableEWalletAccount) Set(val *EWalletAccount) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletAccount(val *EWalletAccount) *NullableEWalletAccount { + return &NullableEWalletAccount{value: val, isSet: true} +} + +func (v NullableEWalletAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_e_wallet_channel_code.go b/payment_method/model_e_wallet_channel_code.go new file mode 100644 index 00000000..352ebf9b --- /dev/null +++ b/payment_method/model_e_wallet_channel_code.go @@ -0,0 +1,151 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// EWalletChannelCode EWallet Channel Code +type EWalletChannelCode string + +// List of EWalletChannelCode +const ( + EWALLETCHANNELCODE_GCASH EWalletChannelCode = "GCASH" + EWALLETCHANNELCODE_GRABPAY EWalletChannelCode = "GRABPAY" + EWALLETCHANNELCODE_PAYMAYA EWalletChannelCode = "PAYMAYA" + EWALLETCHANNELCODE_OVO EWalletChannelCode = "OVO" + EWALLETCHANNELCODE_DANA EWalletChannelCode = "DANA" + EWALLETCHANNELCODE_LINKAJA EWalletChannelCode = "LINKAJA" + EWALLETCHANNELCODE_SHOPEEPAY EWalletChannelCode = "SHOPEEPAY" + EWALLETCHANNELCODE_SAKUKU EWalletChannelCode = "SAKUKU" + EWALLETCHANNELCODE_NEXCASH EWalletChannelCode = "NEXCASH" + EWALLETCHANNELCODE_ASTRAPAY EWalletChannelCode = "ASTRAPAY" + EWALLETCHANNELCODE_JENIUSPAY EWalletChannelCode = "JENIUSPAY" + EWALLETCHANNELCODE_APPOTA EWalletChannelCode = "APPOTA" + EWALLETCHANNELCODE_MOMO EWalletChannelCode = "MOMO" + EWALLETCHANNELCODE_VNPTWALLET EWalletChannelCode = "VNPTWALLET" + EWALLETCHANNELCODE_VIETTELPAY EWalletChannelCode = "VIETTELPAY" + EWALLETCHANNELCODE_ZALOPAY EWalletChannelCode = "ZALOPAY" + EWALLETCHANNELCODE_WECHATPAY EWalletChannelCode = "WECHATPAY" + EWALLETCHANNELCODE_LINEPAY EWalletChannelCode = "LINEPAY" + EWALLETCHANNELCODE_TRUEMONEY EWalletChannelCode = "TRUEMONEY" + EWALLETCHANNELCODE_ALIPAY EWalletChannelCode = "ALIPAY" +) + +// All allowed values of EWalletChannelCode enum +var AllowedEWalletChannelCodeEnumValues = []EWalletChannelCode{ + "GCASH", + "GRABPAY", + "PAYMAYA", + "OVO", + "DANA", + "LINKAJA", + "SHOPEEPAY", + "SAKUKU", + "NEXCASH", + "ASTRAPAY", + "JENIUSPAY", + "APPOTA", + "MOMO", + "VNPTWALLET", + "VIETTELPAY", + "ZALOPAY", + "WECHATPAY", + "LINEPAY", + "TRUEMONEY", + "ALIPAY", +} + +func (v *EWalletChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EWalletChannelCode(value) + for _, existing := range AllowedEWalletChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EWalletChannelCode", value) +} + +// NewEWalletChannelCodeFromValue returns a pointer to a valid EWalletChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEWalletChannelCodeFromValue(v string) (*EWalletChannelCode, error) { + ev := EWalletChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EWalletChannelCode: valid values are %v", v, AllowedEWalletChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EWalletChannelCode) IsValid() bool { + for _, existing := range AllowedEWalletChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v EWalletChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to EWalletChannelCode value +func (v EWalletChannelCode) Ptr() *EWalletChannelCode { + return &v +} + +type NullableEWalletChannelCode struct { + value *EWalletChannelCode + isSet bool +} + +func (v NullableEWalletChannelCode) Get() *EWalletChannelCode { + return v.value +} + +func (v *NullableEWalletChannelCode) Set(val *EWalletChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletChannelCode(val *EWalletChannelCode) *NullableEWalletChannelCode { + return &NullableEWalletChannelCode{value: val, isSet: true} +} + +func (v NullableEWalletChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_e_wallet_channel_properties.go b/payment_method/model_e_wallet_channel_properties.go new file mode 100644 index 00000000..710aff60 --- /dev/null +++ b/payment_method/model_e_wallet_channel_properties.go @@ -0,0 +1,316 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletChannelProperties{} + +// EWalletChannelProperties EWallet Channel Properties +type EWalletChannelProperties struct { + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl *string `json:"failure_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization cancelled + CancelReturnUrl *string `json:"cancel_return_url,omitempty"` + // Mobile number of customer in E.164 format (e.g. +628123123123). For OVO one time payment use only. + MobileNumber *string `json:"mobile_number,omitempty"` + // REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. + RedeemPoints *string `json:"redeem_points,omitempty"` + // Available for JENIUSPAY only + Cashtag *string `json:"cashtag,omitempty"` +} + +// NewEWalletChannelProperties instantiates a new EWalletChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletChannelProperties() *EWalletChannelProperties { + this := EWalletChannelProperties{} + return &this +} + +// NewEWalletChannelPropertiesWithDefaults instantiates a new EWalletChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletChannelPropertiesWithDefaults() *EWalletChannelProperties { + this := EWalletChannelProperties{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *EWalletChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *EWalletChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +// GetCancelReturnUrl returns the CancelReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetCancelReturnUrl() string { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + var ret string + return ret + } + return *o.CancelReturnUrl +} + +// GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetCancelReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + return nil, false + } + return o.CancelReturnUrl, true +} + +// HasCancelReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasCancelReturnUrl() bool { + if o != nil && !utils.IsNil(o.CancelReturnUrl) { + return true + } + + return false +} + +// SetCancelReturnUrl gets a reference to the given string and assigns it to the CancelReturnUrl field. +func (o *EWalletChannelProperties) SetCancelReturnUrl(v string) { + o.CancelReturnUrl = &v +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetMobileNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.MobileNumber) { + return nil, false + } + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasMobileNumber() bool { + if o != nil && !utils.IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *EWalletChannelProperties) SetMobileNumber(v string) { + o.MobileNumber = &v +} + +// GetRedeemPoints returns the RedeemPoints field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetRedeemPoints() string { + if o == nil || utils.IsNil(o.RedeemPoints) { + var ret string + return ret + } + return *o.RedeemPoints +} + +// GetRedeemPointsOk returns a tuple with the RedeemPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetRedeemPointsOk() (*string, bool) { + if o == nil || utils.IsNil(o.RedeemPoints) { + return nil, false + } + return o.RedeemPoints, true +} + +// HasRedeemPoints returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasRedeemPoints() bool { + if o != nil && !utils.IsNil(o.RedeemPoints) { + return true + } + + return false +} + +// SetRedeemPoints gets a reference to the given string and assigns it to the RedeemPoints field. +func (o *EWalletChannelProperties) SetRedeemPoints(v string) { + o.RedeemPoints = &v +} + +// GetCashtag returns the Cashtag field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetCashtag() string { + if o == nil || utils.IsNil(o.Cashtag) { + var ret string + return ret + } + return *o.Cashtag +} + +// GetCashtagOk returns a tuple with the Cashtag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetCashtagOk() (*string, bool) { + if o == nil || utils.IsNil(o.Cashtag) { + return nil, false + } + return o.Cashtag, true +} + +// HasCashtag returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasCashtag() bool { + if o != nil && !utils.IsNil(o.Cashtag) { + return true + } + + return false +} + +// SetCashtag gets a reference to the given string and assigns it to the Cashtag field. +func (o *EWalletChannelProperties) SetCashtag(v string) { + o.Cashtag = &v +} + +func (o EWalletChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + if !utils.IsNil(o.CancelReturnUrl) { + toSerialize["cancel_return_url"] = o.CancelReturnUrl + } + if !utils.IsNil(o.MobileNumber) { + toSerialize["mobile_number"] = o.MobileNumber + } + if !utils.IsNil(o.RedeemPoints) { + toSerialize["redeem_points"] = o.RedeemPoints + } + if !utils.IsNil(o.Cashtag) { + toSerialize["cashtag"] = o.Cashtag + } + return toSerialize, nil +} + +type NullableEWalletChannelProperties struct { + value *EWalletChannelProperties + isSet bool +} + +func (v NullableEWalletChannelProperties) Get() *EWalletChannelProperties { + return v.value +} + +func (v *NullableEWalletChannelProperties) Set(val *EWalletChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletChannelProperties(val *EWalletChannelProperties) *NullableEWalletChannelProperties { + return &NullableEWalletChannelProperties{value: val, isSet: true} +} + +func (v NullableEWalletChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_e_wallet_parameters.go b/payment_method/model_e_wallet_parameters.go new file mode 100644 index 00000000..cef31aaf --- /dev/null +++ b/payment_method/model_e_wallet_parameters.go @@ -0,0 +1,193 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletParameters{} + +// EWalletParameters struct for EWalletParameters +type EWalletParameters struct { + ChannelCode EWalletChannelCode `json:"channel_code"` + ChannelProperties *EWalletChannelProperties `json:"channel_properties,omitempty"` + Account *EWalletAccount `json:"account,omitempty"` +} + +// NewEWalletParameters instantiates a new EWalletParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletParameters(channelCode EWalletChannelCode) *EWalletParameters { + this := EWalletParameters{} + this.ChannelCode = channelCode + return &this +} + +// NewEWalletParametersWithDefaults instantiates a new EWalletParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletParametersWithDefaults() *EWalletParameters { + this := EWalletParameters{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *EWalletParameters) GetChannelCode() EWalletChannelCode { + if o == nil { + var ret EWalletChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *EWalletParameters) GetChannelCodeOk() (*EWalletChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *EWalletParameters) SetChannelCode(v EWalletChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *EWalletParameters) GetChannelProperties() EWalletChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret EWalletChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletParameters) GetChannelPropertiesOk() (*EWalletChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *EWalletParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given EWalletChannelProperties and assigns it to the ChannelProperties field. +func (o *EWalletParameters) SetChannelProperties(v EWalletChannelProperties) { + o.ChannelProperties = &v +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *EWalletParameters) GetAccount() EWalletAccount { + if o == nil || utils.IsNil(o.Account) { + var ret EWalletAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletParameters) GetAccountOk() (*EWalletAccount, bool) { + if o == nil || utils.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *EWalletParameters) HasAccount() bool { + if o != nil && !utils.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given EWalletAccount and assigns it to the Account field. +func (o *EWalletParameters) SetAccount(v EWalletAccount) { + o.Account = &v +} + +func (o EWalletParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + return toSerialize, nil +} + +type NullableEWalletParameters struct { + value *EWalletParameters + isSet bool +} + +func (v NullableEWalletParameters) Get() *EWalletParameters { + return v.value +} + +func (v *NullableEWalletParameters) Set(val *EWalletParameters) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletParameters(val *EWalletParameters) *NullableEWalletParameters { + return &NullableEWalletParameters{value: val, isSet: true} +} + +func (v NullableEWalletParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_get_all_payment_methods_400_response.go b/payment_method/model_get_all_payment_methods_400_response.go new file mode 100644 index 00000000..be797ec2 --- /dev/null +++ b/payment_method/model_get_all_payment_methods_400_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetAllPaymentMethods400Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetAllPaymentMethods400Response{} + +// GetAllPaymentMethods400Response struct for GetAllPaymentMethods400Response +type GetAllPaymentMethods400Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewGetAllPaymentMethods400Response instantiates a new GetAllPaymentMethods400Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAllPaymentMethods400Response() *GetAllPaymentMethods400Response { + this := GetAllPaymentMethods400Response{} + return &this +} + +// NewGetAllPaymentMethods400ResponseWithDefaults instantiates a new GetAllPaymentMethods400Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAllPaymentMethods400ResponseWithDefaults() *GetAllPaymentMethods400Response { + this := GetAllPaymentMethods400Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *GetAllPaymentMethods400Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods400Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *GetAllPaymentMethods400Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *GetAllPaymentMethods400Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetAllPaymentMethods400Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods400Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetAllPaymentMethods400Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetAllPaymentMethods400Response) SetMessage(v string) { + o.Message = &v +} + +func (o GetAllPaymentMethods400Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAllPaymentMethods400Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGetAllPaymentMethods400Response struct { + value *GetAllPaymentMethods400Response + isSet bool +} + +func (v NullableGetAllPaymentMethods400Response) Get() *GetAllPaymentMethods400Response { + return v.value +} + +func (v *NullableGetAllPaymentMethods400Response) Set(val *GetAllPaymentMethods400Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetAllPaymentMethods400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAllPaymentMethods400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAllPaymentMethods400Response(val *GetAllPaymentMethods400Response) *NullableGetAllPaymentMethods400Response { + return &NullableGetAllPaymentMethods400Response{value: val, isSet: true} +} + +func (v NullableGetAllPaymentMethods400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAllPaymentMethods400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_get_all_payment_methods_403_response.go b/payment_method/model_get_all_payment_methods_403_response.go new file mode 100644 index 00000000..134d3779 --- /dev/null +++ b/payment_method/model_get_all_payment_methods_403_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetAllPaymentMethods403Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetAllPaymentMethods403Response{} + +// GetAllPaymentMethods403Response struct for GetAllPaymentMethods403Response +type GetAllPaymentMethods403Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewGetAllPaymentMethods403Response instantiates a new GetAllPaymentMethods403Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAllPaymentMethods403Response() *GetAllPaymentMethods403Response { + this := GetAllPaymentMethods403Response{} + return &this +} + +// NewGetAllPaymentMethods403ResponseWithDefaults instantiates a new GetAllPaymentMethods403Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAllPaymentMethods403ResponseWithDefaults() *GetAllPaymentMethods403Response { + this := GetAllPaymentMethods403Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *GetAllPaymentMethods403Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods403Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *GetAllPaymentMethods403Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *GetAllPaymentMethods403Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetAllPaymentMethods403Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods403Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetAllPaymentMethods403Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetAllPaymentMethods403Response) SetMessage(v string) { + o.Message = &v +} + +func (o GetAllPaymentMethods403Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAllPaymentMethods403Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGetAllPaymentMethods403Response struct { + value *GetAllPaymentMethods403Response + isSet bool +} + +func (v NullableGetAllPaymentMethods403Response) Get() *GetAllPaymentMethods403Response { + return v.value +} + +func (v *NullableGetAllPaymentMethods403Response) Set(val *GetAllPaymentMethods403Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetAllPaymentMethods403Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAllPaymentMethods403Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAllPaymentMethods403Response(val *GetAllPaymentMethods403Response) *NullableGetAllPaymentMethods403Response { + return &NullableGetAllPaymentMethods403Response{value: val, isSet: true} +} + +func (v NullableGetAllPaymentMethods403Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAllPaymentMethods403Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_get_all_payment_methods_404_response.go b/payment_method/model_get_all_payment_methods_404_response.go new file mode 100644 index 00000000..b3418d1c --- /dev/null +++ b/payment_method/model_get_all_payment_methods_404_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetAllPaymentMethods404Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetAllPaymentMethods404Response{} + +// GetAllPaymentMethods404Response struct for GetAllPaymentMethods404Response +type GetAllPaymentMethods404Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewGetAllPaymentMethods404Response instantiates a new GetAllPaymentMethods404Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAllPaymentMethods404Response() *GetAllPaymentMethods404Response { + this := GetAllPaymentMethods404Response{} + return &this +} + +// NewGetAllPaymentMethods404ResponseWithDefaults instantiates a new GetAllPaymentMethods404Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAllPaymentMethods404ResponseWithDefaults() *GetAllPaymentMethods404Response { + this := GetAllPaymentMethods404Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *GetAllPaymentMethods404Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods404Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *GetAllPaymentMethods404Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *GetAllPaymentMethods404Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetAllPaymentMethods404Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethods404Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetAllPaymentMethods404Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetAllPaymentMethods404Response) SetMessage(v string) { + o.Message = &v +} + +func (o GetAllPaymentMethods404Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAllPaymentMethods404Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGetAllPaymentMethods404Response struct { + value *GetAllPaymentMethods404Response + isSet bool +} + +func (v NullableGetAllPaymentMethods404Response) Get() *GetAllPaymentMethods404Response { + return v.value +} + +func (v *NullableGetAllPaymentMethods404Response) Set(val *GetAllPaymentMethods404Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetAllPaymentMethods404Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAllPaymentMethods404Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAllPaymentMethods404Response(val *GetAllPaymentMethods404Response) *NullableGetAllPaymentMethods404Response { + return &NullableGetAllPaymentMethods404Response{value: val, isSet: true} +} + +func (v NullableGetAllPaymentMethods404Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAllPaymentMethods404Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_get_all_payment_methods_default_response.go b/payment_method/model_get_all_payment_methods_default_response.go new file mode 100644 index 00000000..12f74245 --- /dev/null +++ b/payment_method/model_get_all_payment_methods_default_response.go @@ -0,0 +1,166 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetAllPaymentMethodsDefaultResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetAllPaymentMethodsDefaultResponse{} + +// GetAllPaymentMethodsDefaultResponse struct for GetAllPaymentMethodsDefaultResponse +type GetAllPaymentMethodsDefaultResponse struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewGetAllPaymentMethodsDefaultResponse instantiates a new GetAllPaymentMethodsDefaultResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetAllPaymentMethodsDefaultResponse() *GetAllPaymentMethodsDefaultResponse { + this := GetAllPaymentMethodsDefaultResponse{} + return &this +} + +// NewGetAllPaymentMethodsDefaultResponseWithDefaults instantiates a new GetAllPaymentMethodsDefaultResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetAllPaymentMethodsDefaultResponseWithDefaults() *GetAllPaymentMethodsDefaultResponse { + this := GetAllPaymentMethodsDefaultResponse{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *GetAllPaymentMethodsDefaultResponse) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethodsDefaultResponse) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *GetAllPaymentMethodsDefaultResponse) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *GetAllPaymentMethodsDefaultResponse) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GetAllPaymentMethodsDefaultResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllPaymentMethodsDefaultResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GetAllPaymentMethodsDefaultResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GetAllPaymentMethodsDefaultResponse) SetMessage(v string) { + o.Message = &v +} + +func (o GetAllPaymentMethodsDefaultResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAllPaymentMethodsDefaultResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableGetAllPaymentMethodsDefaultResponse struct { + value *GetAllPaymentMethodsDefaultResponse + isSet bool +} + +func (v NullableGetAllPaymentMethodsDefaultResponse) Get() *GetAllPaymentMethodsDefaultResponse { + return v.value +} + +func (v *NullableGetAllPaymentMethodsDefaultResponse) Set(val *GetAllPaymentMethodsDefaultResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetAllPaymentMethodsDefaultResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAllPaymentMethodsDefaultResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAllPaymentMethodsDefaultResponse(val *GetAllPaymentMethodsDefaultResponse) *NullableGetAllPaymentMethodsDefaultResponse { + return &NullableGetAllPaymentMethodsDefaultResponse{value: val, isSet: true} +} + +func (v NullableGetAllPaymentMethodsDefaultResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAllPaymentMethodsDefaultResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_over_the_counter.go b/payment_method/model_over_the_counter.go new file mode 100644 index 00000000..3f2a22e6 --- /dev/null +++ b/payment_method/model_over_the_counter.go @@ -0,0 +1,230 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the OverTheCounter type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounter{} + +// OverTheCounter Over The Counter Payment Method Details +type OverTheCounter struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode OverTheCounterChannelCode `json:"channel_code"` + ChannelProperties OverTheCounterChannelProperties `json:"channel_properties"` +} + +// NewOverTheCounter instantiates a new OverTheCounter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounter(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties) *OverTheCounter { + this := OverTheCounter{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewOverTheCounterWithDefaults instantiates a new OverTheCounter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterWithDefaults() *OverTheCounter { + this := OverTheCounter{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OverTheCounter) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OverTheCounter) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *OverTheCounter) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *OverTheCounter) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *OverTheCounter) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *OverTheCounter) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *OverTheCounter) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *OverTheCounter) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *OverTheCounter) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *OverTheCounter) GetChannelCode() OverTheCounterChannelCode { + if o == nil { + var ret OverTheCounterChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetChannelCodeOk() (*OverTheCounterChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *OverTheCounter) SetChannelCode(v OverTheCounterChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *OverTheCounter) GetChannelProperties() OverTheCounterChannelProperties { + if o == nil { + var ret OverTheCounterChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *OverTheCounter) SetChannelProperties(v OverTheCounterChannelProperties) { + o.ChannelProperties = v +} + +func (o OverTheCounter) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + return toSerialize, nil +} + +type NullableOverTheCounter struct { + value *OverTheCounter + isSet bool +} + +func (v NullableOverTheCounter) Get() *OverTheCounter { + return v.value +} + +func (v *NullableOverTheCounter) Set(val *OverTheCounter) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounter) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounter(val *OverTheCounter) *NullableOverTheCounter { + return &NullableOverTheCounter{value: val, isSet: true} +} + +func (v NullableOverTheCounter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_over_the_counter_channel_code.go b/payment_method/model_over_the_counter_channel_code.go new file mode 100644 index 00000000..5bfe0e4b --- /dev/null +++ b/payment_method/model_over_the_counter_channel_code.go @@ -0,0 +1,143 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// OverTheCounterChannelCode Over The Counter Channel Code +type OverTheCounterChannelCode string + +// List of OverTheCounterChannelCode +const ( + OVERTHECOUNTERCHANNELCODE__7_ELEVEN OverTheCounterChannelCode = "7ELEVEN" + OVERTHECOUNTERCHANNELCODE__7_ELEVEN_CLIQQ OverTheCounterChannelCode = "7ELEVEN_CLIQQ" + OVERTHECOUNTERCHANNELCODE_CEBUANA OverTheCounterChannelCode = "CEBUANA" + OVERTHECOUNTERCHANNELCODE_ECPAY OverTheCounterChannelCode = "ECPAY" + OVERTHECOUNTERCHANNELCODE_PALAWAN OverTheCounterChannelCode = "PALAWAN" + OVERTHECOUNTERCHANNELCODE_MLHUILLIER OverTheCounterChannelCode = "MLHUILLIER" + OVERTHECOUNTERCHANNELCODE_ECPAY_DRAGONLOAN OverTheCounterChannelCode = "ECPAY_DRAGONLOAN" + OVERTHECOUNTERCHANNELCODE_LBC OverTheCounterChannelCode = "LBC" + OVERTHECOUNTERCHANNELCODE_ECPAY_SCHOOL OverTheCounterChannelCode = "ECPAY_SCHOOL" + OVERTHECOUNTERCHANNELCODE_RD_PAWNSHOP OverTheCounterChannelCode = "RD_PAWNSHOP" + OVERTHECOUNTERCHANNELCODE_CVM OverTheCounterChannelCode = "CVM" + OVERTHECOUNTERCHANNELCODE_USSC OverTheCounterChannelCode = "USSC" + OVERTHECOUNTERCHANNELCODE_SM_BILLS OverTheCounterChannelCode = "SM_BILLS" + OVERTHECOUNTERCHANNELCODE_ROBINSONS_BILLS OverTheCounterChannelCode = "ROBINSONS_BILLS" + OVERTHECOUNTERCHANNELCODE_ALFAMART OverTheCounterChannelCode = "ALFAMART" + OVERTHECOUNTERCHANNELCODE_INDOMARET OverTheCounterChannelCode = "INDOMARET" +) + +// All allowed values of OverTheCounterChannelCode enum +var AllowedOverTheCounterChannelCodeEnumValues = []OverTheCounterChannelCode{ + "7ELEVEN", + "7ELEVEN_CLIQQ", + "CEBUANA", + "ECPAY", + "PALAWAN", + "MLHUILLIER", + "ECPAY_DRAGONLOAN", + "LBC", + "ECPAY_SCHOOL", + "RD_PAWNSHOP", + "CVM", + "USSC", + "SM_BILLS", + "ROBINSONS_BILLS", + "ALFAMART", + "INDOMARET", +} + +func (v *OverTheCounterChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OverTheCounterChannelCode(value) + for _, existing := range AllowedOverTheCounterChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OverTheCounterChannelCode", value) +} + +// NewOverTheCounterChannelCodeFromValue returns a pointer to a valid OverTheCounterChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOverTheCounterChannelCodeFromValue(v string) (*OverTheCounterChannelCode, error) { + ev := OverTheCounterChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OverTheCounterChannelCode: valid values are %v", v, AllowedOverTheCounterChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OverTheCounterChannelCode) IsValid() bool { + for _, existing := range AllowedOverTheCounterChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v OverTheCounterChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to OverTheCounterChannelCode value +func (v OverTheCounterChannelCode) Ptr() *OverTheCounterChannelCode { + return &v +} + +type NullableOverTheCounterChannelCode struct { + value *OverTheCounterChannelCode + isSet bool +} + +func (v NullableOverTheCounterChannelCode) Get() *OverTheCounterChannelCode { + return v.value +} + +func (v *NullableOverTheCounterChannelCode) Set(val *OverTheCounterChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterChannelCode(val *OverTheCounterChannelCode) *NullableOverTheCounterChannelCode { + return &NullableOverTheCounterChannelCode{value: val, isSet: true} +} + +func (v NullableOverTheCounterChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_over_the_counter_channel_properties.go b/payment_method/model_over_the_counter_channel_properties.go new file mode 100644 index 00000000..46b29a70 --- /dev/null +++ b/payment_method/model_over_the_counter_channel_properties.go @@ -0,0 +1,197 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the OverTheCounterChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterChannelProperties{} + +// OverTheCounterChannelProperties Over The Counter Channel Properties +type OverTheCounterChannelProperties struct { + // The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random. + PaymentCode *string `json:"payment_code,omitempty"` + // Name of customer. + CustomerName string `json:"customer_name"` + // The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +// NewOverTheCounterChannelProperties instantiates a new OverTheCounterChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterChannelProperties(customerName string) *OverTheCounterChannelProperties { + this := OverTheCounterChannelProperties{} + this.CustomerName = customerName + return &this +} + +// NewOverTheCounterChannelPropertiesWithDefaults instantiates a new OverTheCounterChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterChannelPropertiesWithDefaults() *OverTheCounterChannelProperties { + this := OverTheCounterChannelProperties{} + return &this +} + +// GetPaymentCode returns the PaymentCode field value if set, zero value otherwise. +func (o *OverTheCounterChannelProperties) GetPaymentCode() string { + if o == nil || utils.IsNil(o.PaymentCode) { + var ret string + return ret + } + return *o.PaymentCode +} + +// GetPaymentCodeOk returns a tuple with the PaymentCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetPaymentCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentCode) { + return nil, false + } + return o.PaymentCode, true +} + +// HasPaymentCode returns a boolean if a field has been set. +func (o *OverTheCounterChannelProperties) HasPaymentCode() bool { + if o != nil && !utils.IsNil(o.PaymentCode) { + return true + } + + return false +} + +// SetPaymentCode gets a reference to the given string and assigns it to the PaymentCode field. +func (o *OverTheCounterChannelProperties) SetPaymentCode(v string) { + o.PaymentCode = &v +} + +// GetCustomerName returns the CustomerName field value +func (o *OverTheCounterChannelProperties) GetCustomerName() string { + if o == nil { + var ret string + return ret + } + + return o.CustomerName +} + +// GetCustomerNameOk returns a tuple with the CustomerName field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetCustomerNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CustomerName, true +} + +// SetCustomerName sets field value +func (o *OverTheCounterChannelProperties) SetCustomerName(v string) { + o.CustomerName = v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *OverTheCounterChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *OverTheCounterChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *OverTheCounterChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +func (o OverTheCounterChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.PaymentCode) { + toSerialize["payment_code"] = o.PaymentCode + } + toSerialize["customer_name"] = o.CustomerName + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + return toSerialize, nil +} + +type NullableOverTheCounterChannelProperties struct { + value *OverTheCounterChannelProperties + isSet bool +} + +func (v NullableOverTheCounterChannelProperties) Get() *OverTheCounterChannelProperties { + return v.value +} + +func (v *NullableOverTheCounterChannelProperties) Set(val *OverTheCounterChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterChannelProperties(val *OverTheCounterChannelProperties) *NullableOverTheCounterChannelProperties { + return &NullableOverTheCounterChannelProperties{value: val, isSet: true} +} + +func (v NullableOverTheCounterChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_over_the_counter_channel_properties_update.go b/payment_method/model_over_the_counter_channel_properties_update.go new file mode 100644 index 00000000..a5ec0078 --- /dev/null +++ b/payment_method/model_over_the_counter_channel_properties_update.go @@ -0,0 +1,169 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the OverTheCounterChannelPropertiesUpdate type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterChannelPropertiesUpdate{} + +// OverTheCounterChannelPropertiesUpdate Over The Counter Channel properties that can be updated +type OverTheCounterChannelPropertiesUpdate struct { + // Name of customer. + CustomerName *string `json:"customer_name,omitempty"` + // The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +// NewOverTheCounterChannelPropertiesUpdate instantiates a new OverTheCounterChannelPropertiesUpdate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterChannelPropertiesUpdate() *OverTheCounterChannelPropertiesUpdate { + this := OverTheCounterChannelPropertiesUpdate{} + return &this +} + +// NewOverTheCounterChannelPropertiesUpdateWithDefaults instantiates a new OverTheCounterChannelPropertiesUpdate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterChannelPropertiesUpdateWithDefaults() *OverTheCounterChannelPropertiesUpdate { + this := OverTheCounterChannelPropertiesUpdate{} + return &this +} + +// GetCustomerName returns the CustomerName field value if set, zero value otherwise. +func (o *OverTheCounterChannelPropertiesUpdate) GetCustomerName() string { + if o == nil || utils.IsNil(o.CustomerName) { + var ret string + return ret + } + return *o.CustomerName +} + +// GetCustomerNameOk returns a tuple with the CustomerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelPropertiesUpdate) GetCustomerNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.CustomerName) { + return nil, false + } + return o.CustomerName, true +} + +// HasCustomerName returns a boolean if a field has been set. +func (o *OverTheCounterChannelPropertiesUpdate) HasCustomerName() bool { + if o != nil && !utils.IsNil(o.CustomerName) { + return true + } + + return false +} + +// SetCustomerName gets a reference to the given string and assigns it to the CustomerName field. +func (o *OverTheCounterChannelPropertiesUpdate) SetCustomerName(v string) { + o.CustomerName = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *OverTheCounterChannelPropertiesUpdate) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelPropertiesUpdate) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *OverTheCounterChannelPropertiesUpdate) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *OverTheCounterChannelPropertiesUpdate) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +func (o OverTheCounterChannelPropertiesUpdate) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterChannelPropertiesUpdate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.CustomerName) { + toSerialize["customer_name"] = o.CustomerName + } + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + return toSerialize, nil +} + +type NullableOverTheCounterChannelPropertiesUpdate struct { + value *OverTheCounterChannelPropertiesUpdate + isSet bool +} + +func (v NullableOverTheCounterChannelPropertiesUpdate) Get() *OverTheCounterChannelPropertiesUpdate { + return v.value +} + +func (v *NullableOverTheCounterChannelPropertiesUpdate) Set(val *OverTheCounterChannelPropertiesUpdate) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterChannelPropertiesUpdate) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterChannelPropertiesUpdate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterChannelPropertiesUpdate(val *OverTheCounterChannelPropertiesUpdate) *NullableOverTheCounterChannelPropertiesUpdate { + return &NullableOverTheCounterChannelPropertiesUpdate{value: val, isSet: true} +} + +func (v NullableOverTheCounterChannelPropertiesUpdate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterChannelPropertiesUpdate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_over_the_counter_parameters.go b/payment_method/model_over_the_counter_parameters.go new file mode 100644 index 00000000..55e5cafb --- /dev/null +++ b/payment_method/model_over_the_counter_parameters.go @@ -0,0 +1,230 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the OverTheCounterParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterParameters{} + +// OverTheCounterParameters struct for OverTheCounterParameters +type OverTheCounterParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode OverTheCounterChannelCode `json:"channel_code"` + ChannelProperties OverTheCounterChannelProperties `json:"channel_properties"` +} + +// NewOverTheCounterParameters instantiates a new OverTheCounterParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterParameters(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties) *OverTheCounterParameters { + this := OverTheCounterParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewOverTheCounterParametersWithDefaults instantiates a new OverTheCounterParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterParametersWithDefaults() *OverTheCounterParameters { + this := OverTheCounterParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OverTheCounterParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OverTheCounterParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *OverTheCounterParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *OverTheCounterParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *OverTheCounterParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *OverTheCounterParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *OverTheCounterParameters) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *OverTheCounterParameters) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *OverTheCounterParameters) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *OverTheCounterParameters) GetChannelCode() OverTheCounterChannelCode { + if o == nil { + var ret OverTheCounterChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetChannelCodeOk() (*OverTheCounterChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *OverTheCounterParameters) SetChannelCode(v OverTheCounterChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *OverTheCounterParameters) GetChannelProperties() OverTheCounterChannelProperties { + if o == nil { + var ret OverTheCounterChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *OverTheCounterParameters) SetChannelProperties(v OverTheCounterChannelProperties) { + o.ChannelProperties = v +} + +func (o OverTheCounterParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + return toSerialize, nil +} + +type NullableOverTheCounterParameters struct { + value *OverTheCounterParameters + isSet bool +} + +func (v NullableOverTheCounterParameters) Get() *OverTheCounterParameters { + return v.value +} + +func (v *NullableOverTheCounterParameters) Set(val *OverTheCounterParameters) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterParameters(val *OverTheCounterParameters) *NullableOverTheCounterParameters { + return &NullableOverTheCounterParameters{value: val, isSet: true} +} + +func (v NullableOverTheCounterParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_over_the_counter_update_parameters.go b/payment_method/model_over_the_counter_update_parameters.go new file mode 100644 index 00000000..b2e3803f --- /dev/null +++ b/payment_method/model_over_the_counter_update_parameters.go @@ -0,0 +1,176 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the OverTheCounterUpdateParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterUpdateParameters{} + +// OverTheCounterUpdateParameters struct for OverTheCounterUpdateParameters +type OverTheCounterUpdateParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + ChannelProperties *OverTheCounterChannelPropertiesUpdate `json:"channel_properties,omitempty"` +} + +// NewOverTheCounterUpdateParameters instantiates a new OverTheCounterUpdateParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterUpdateParameters() *OverTheCounterUpdateParameters { + this := OverTheCounterUpdateParameters{} + return &this +} + +// NewOverTheCounterUpdateParametersWithDefaults instantiates a new OverTheCounterUpdateParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterUpdateParametersWithDefaults() *OverTheCounterUpdateParameters { + this := OverTheCounterUpdateParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OverTheCounterUpdateParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OverTheCounterUpdateParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *OverTheCounterUpdateParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *OverTheCounterUpdateParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *OverTheCounterUpdateParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *OverTheCounterUpdateParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *OverTheCounterUpdateParameters) GetChannelProperties() OverTheCounterChannelPropertiesUpdate { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret OverTheCounterChannelPropertiesUpdate + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterUpdateParameters) GetChannelPropertiesOk() (*OverTheCounterChannelPropertiesUpdate, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *OverTheCounterUpdateParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given OverTheCounterChannelPropertiesUpdate and assigns it to the ChannelProperties field. +func (o *OverTheCounterUpdateParameters) SetChannelProperties(v OverTheCounterChannelPropertiesUpdate) { + o.ChannelProperties = &v +} + +func (o OverTheCounterUpdateParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterUpdateParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + return toSerialize, nil +} + +type NullableOverTheCounterUpdateParameters struct { + value *OverTheCounterUpdateParameters + isSet bool +} + +func (v NullableOverTheCounterUpdateParameters) Get() *OverTheCounterUpdateParameters { + return v.value +} + +func (v *NullableOverTheCounterUpdateParameters) Set(val *OverTheCounterUpdateParameters) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterUpdateParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterUpdateParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterUpdateParameters(val *OverTheCounterUpdateParameters) *NullableOverTheCounterUpdateParameters { + return &NullableOverTheCounterUpdateParameters{value: val, isSet: true} +} + +func (v NullableOverTheCounterUpdateParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterUpdateParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_channel.go b/payment_method/model_payment_channel.go new file mode 100644 index 00000000..cf26f865 --- /dev/null +++ b/payment_method/model_payment_channel.go @@ -0,0 +1,351 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentChannel type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentChannel{} + +// PaymentChannel struct for PaymentChannel +type PaymentChannel struct { + // The specific Xendit code used to identify the partner channel + ChannelCode *string `json:"channel_code,omitempty"` + // The payment method type + Type *string `json:"type,omitempty"` + // The country where the channel operates in ISO 3166-2 country code + Country *string `json:"country,omitempty"` + // Official parter name of the payment channel + ChannelName *string `json:"channel_name,omitempty"` + ChannelProperties []ChannelProperty `json:"channel_properties,omitempty"` + // If available, this contains a URL to the logo of the partner channel + LogoUrl *string `json:"logo_url,omitempty"` + AmountLimits []ChannelAmountLimits `json:"amount_limits,omitempty"` +} + +// NewPaymentChannel instantiates a new PaymentChannel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentChannel() *PaymentChannel { + this := PaymentChannel{} + return &this +} + +// NewPaymentChannelWithDefaults instantiates a new PaymentChannel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentChannelWithDefaults() *PaymentChannel { + this := PaymentChannel{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise. +func (o *PaymentChannel) GetChannelCode() string { + if o == nil || utils.IsNil(o.ChannelCode) { + var ret string + return ret + } + return *o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetChannelCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ChannelCode) { + return nil, false + } + return o.ChannelCode, true +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *PaymentChannel) HasChannelCode() bool { + if o != nil && !utils.IsNil(o.ChannelCode) { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given string and assigns it to the ChannelCode field. +func (o *PaymentChannel) SetChannelCode(v string) { + o.ChannelCode = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PaymentChannel) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PaymentChannel) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PaymentChannel) SetType(v string) { + o.Type = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *PaymentChannel) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *PaymentChannel) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *PaymentChannel) SetCountry(v string) { + o.Country = &v +} + +// GetChannelName returns the ChannelName field value if set, zero value otherwise. +func (o *PaymentChannel) GetChannelName() string { + if o == nil || utils.IsNil(o.ChannelName) { + var ret string + return ret + } + return *o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetChannelNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.ChannelName) { + return nil, false + } + return o.ChannelName, true +} + +// HasChannelName returns a boolean if a field has been set. +func (o *PaymentChannel) HasChannelName() bool { + if o != nil && !utils.IsNil(o.ChannelName) { + return true + } + + return false +} + +// SetChannelName gets a reference to the given string and assigns it to the ChannelName field. +func (o *PaymentChannel) SetChannelName(v string) { + o.ChannelName = &v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *PaymentChannel) GetChannelProperties() []ChannelProperty { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret []ChannelProperty + return ret + } + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetChannelPropertiesOk() ([]ChannelProperty, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *PaymentChannel) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given []ChannelProperty and assigns it to the ChannelProperties field. +func (o *PaymentChannel) SetChannelProperties(v []ChannelProperty) { + o.ChannelProperties = v +} + +// GetLogoUrl returns the LogoUrl field value if set, zero value otherwise. +func (o *PaymentChannel) GetLogoUrl() string { + if o == nil || utils.IsNil(o.LogoUrl) { + var ret string + return ret + } + return *o.LogoUrl +} + +// GetLogoUrlOk returns a tuple with the LogoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetLogoUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.LogoUrl) { + return nil, false + } + return o.LogoUrl, true +} + +// HasLogoUrl returns a boolean if a field has been set. +func (o *PaymentChannel) HasLogoUrl() bool { + if o != nil && !utils.IsNil(o.LogoUrl) { + return true + } + + return false +} + +// SetLogoUrl gets a reference to the given string and assigns it to the LogoUrl field. +func (o *PaymentChannel) SetLogoUrl(v string) { + o.LogoUrl = &v +} + +// GetAmountLimits returns the AmountLimits field value if set, zero value otherwise. +func (o *PaymentChannel) GetAmountLimits() []ChannelAmountLimits { + if o == nil || utils.IsNil(o.AmountLimits) { + var ret []ChannelAmountLimits + return ret + } + return o.AmountLimits +} + +// GetAmountLimitsOk returns a tuple with the AmountLimits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannel) GetAmountLimitsOk() ([]ChannelAmountLimits, bool) { + if o == nil || utils.IsNil(o.AmountLimits) { + return nil, false + } + return o.AmountLimits, true +} + +// HasAmountLimits returns a boolean if a field has been set. +func (o *PaymentChannel) HasAmountLimits() bool { + if o != nil && !utils.IsNil(o.AmountLimits) { + return true + } + + return false +} + +// SetAmountLimits gets a reference to the given []ChannelAmountLimits and assigns it to the AmountLimits field. +func (o *PaymentChannel) SetAmountLimits(v []ChannelAmountLimits) { + o.AmountLimits = v +} + +func (o PaymentChannel) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentChannel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ChannelCode) { + toSerialize["channel_code"] = o.ChannelCode + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.ChannelName) { + toSerialize["channel_name"] = o.ChannelName + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.LogoUrl) { + toSerialize["logo_url"] = o.LogoUrl + } + if !utils.IsNil(o.AmountLimits) { + toSerialize["amount_limits"] = o.AmountLimits + } + return toSerialize, nil +} + +type NullablePaymentChannel struct { + value *PaymentChannel + isSet bool +} + +func (v NullablePaymentChannel) Get() *PaymentChannel { + return v.value +} + +func (v *NullablePaymentChannel) Set(val *PaymentChannel) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentChannel) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentChannel(val *PaymentChannel) *NullablePaymentChannel { + return &NullablePaymentChannel{value: val, isSet: true} +} + +func (v NullablePaymentChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_channel_all_of.go b/payment_method/model_payment_channel_all_of.go new file mode 100644 index 00000000..7aee0025 --- /dev/null +++ b/payment_method/model_payment_channel_all_of.go @@ -0,0 +1,351 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentChannelAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentChannelAllOf{} + +// PaymentChannelAllOf struct for PaymentChannelAllOf +type PaymentChannelAllOf struct { + // The specific Xendit code used to identify the partner channel + ChannelCode *string `json:"channel_code,omitempty"` + // The payment method type + Type *string `json:"type,omitempty"` + // The country where the channel operates in ISO 3166-2 country code + Country *string `json:"country,omitempty"` + // Official parter name of the payment channel + ChannelName *string `json:"channel_name,omitempty"` + ChannelProperties []ChannelProperty `json:"channel_properties,omitempty"` + // If available, this contains a URL to the logo of the partner channel + LogoUrl *string `json:"logo_url,omitempty"` + AmountLimits []ChannelAmountLimits `json:"amount_limits,omitempty"` +} + +// NewPaymentChannelAllOf instantiates a new PaymentChannelAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentChannelAllOf() *PaymentChannelAllOf { + this := PaymentChannelAllOf{} + return &this +} + +// NewPaymentChannelAllOfWithDefaults instantiates a new PaymentChannelAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentChannelAllOfWithDefaults() *PaymentChannelAllOf { + this := PaymentChannelAllOf{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetChannelCode() string { + if o == nil || utils.IsNil(o.ChannelCode) { + var ret string + return ret + } + return *o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetChannelCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ChannelCode) { + return nil, false + } + return o.ChannelCode, true +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasChannelCode() bool { + if o != nil && !utils.IsNil(o.ChannelCode) { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given string and assigns it to the ChannelCode field. +func (o *PaymentChannelAllOf) SetChannelCode(v string) { + o.ChannelCode = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PaymentChannelAllOf) SetType(v string) { + o.Type = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *PaymentChannelAllOf) SetCountry(v string) { + o.Country = &v +} + +// GetChannelName returns the ChannelName field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetChannelName() string { + if o == nil || utils.IsNil(o.ChannelName) { + var ret string + return ret + } + return *o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetChannelNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.ChannelName) { + return nil, false + } + return o.ChannelName, true +} + +// HasChannelName returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasChannelName() bool { + if o != nil && !utils.IsNil(o.ChannelName) { + return true + } + + return false +} + +// SetChannelName gets a reference to the given string and assigns it to the ChannelName field. +func (o *PaymentChannelAllOf) SetChannelName(v string) { + o.ChannelName = &v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetChannelProperties() []ChannelProperty { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret []ChannelProperty + return ret + } + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetChannelPropertiesOk() ([]ChannelProperty, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given []ChannelProperty and assigns it to the ChannelProperties field. +func (o *PaymentChannelAllOf) SetChannelProperties(v []ChannelProperty) { + o.ChannelProperties = v +} + +// GetLogoUrl returns the LogoUrl field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetLogoUrl() string { + if o == nil || utils.IsNil(o.LogoUrl) { + var ret string + return ret + } + return *o.LogoUrl +} + +// GetLogoUrlOk returns a tuple with the LogoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetLogoUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.LogoUrl) { + return nil, false + } + return o.LogoUrl, true +} + +// HasLogoUrl returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasLogoUrl() bool { + if o != nil && !utils.IsNil(o.LogoUrl) { + return true + } + + return false +} + +// SetLogoUrl gets a reference to the given string and assigns it to the LogoUrl field. +func (o *PaymentChannelAllOf) SetLogoUrl(v string) { + o.LogoUrl = &v +} + +// GetAmountLimits returns the AmountLimits field value if set, zero value otherwise. +func (o *PaymentChannelAllOf) GetAmountLimits() []ChannelAmountLimits { + if o == nil || utils.IsNil(o.AmountLimits) { + var ret []ChannelAmountLimits + return ret + } + return o.AmountLimits +} + +// GetAmountLimitsOk returns a tuple with the AmountLimits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelAllOf) GetAmountLimitsOk() ([]ChannelAmountLimits, bool) { + if o == nil || utils.IsNil(o.AmountLimits) { + return nil, false + } + return o.AmountLimits, true +} + +// HasAmountLimits returns a boolean if a field has been set. +func (o *PaymentChannelAllOf) HasAmountLimits() bool { + if o != nil && !utils.IsNil(o.AmountLimits) { + return true + } + + return false +} + +// SetAmountLimits gets a reference to the given []ChannelAmountLimits and assigns it to the AmountLimits field. +func (o *PaymentChannelAllOf) SetAmountLimits(v []ChannelAmountLimits) { + o.AmountLimits = v +} + +func (o PaymentChannelAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentChannelAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ChannelCode) { + toSerialize["channel_code"] = o.ChannelCode + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.ChannelName) { + toSerialize["channel_name"] = o.ChannelName + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.LogoUrl) { + toSerialize["logo_url"] = o.LogoUrl + } + if !utils.IsNil(o.AmountLimits) { + toSerialize["amount_limits"] = o.AmountLimits + } + return toSerialize, nil +} + +type NullablePaymentChannelAllOf struct { + value *PaymentChannelAllOf + isSet bool +} + +func (v NullablePaymentChannelAllOf) Get() *PaymentChannelAllOf { + return v.value +} + +func (v *NullablePaymentChannelAllOf) Set(val *PaymentChannelAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentChannelAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentChannelAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentChannelAllOf(val *PaymentChannelAllOf) *NullablePaymentChannelAllOf { + return &NullablePaymentChannelAllOf{value: val, isSet: true} +} + +func (v NullablePaymentChannelAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentChannelAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_channel_list.go b/payment_method/model_payment_channel_list.go new file mode 100644 index 00000000..7af05ff3 --- /dev/null +++ b/payment_method/model_payment_channel_list.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentChannelList type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentChannelList{} + +// PaymentChannelList struct for PaymentChannelList +type PaymentChannelList struct { + // Array of resources that match the provided filters + Data []PaymentChannel `json:"data,omitempty"` + // Array of objects that can be used to assist on navigating through the data + Links []PaymentChannelListLinksInner `json:"links,omitempty"` + // Indicates whether there are more items in the list + HasMore *bool `json:"has_more,omitempty"` +} + +// NewPaymentChannelList instantiates a new PaymentChannelList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentChannelList() *PaymentChannelList { + this := PaymentChannelList{} + return &this +} + +// NewPaymentChannelListWithDefaults instantiates a new PaymentChannelList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentChannelListWithDefaults() *PaymentChannelList { + this := PaymentChannelList{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *PaymentChannelList) GetData() []PaymentChannel { + if o == nil || utils.IsNil(o.Data) { + var ret []PaymentChannel + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelList) GetDataOk() ([]PaymentChannel, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PaymentChannelList) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []PaymentChannel and assigns it to the Data field. +func (o *PaymentChannelList) SetData(v []PaymentChannel) { + o.Data = v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *PaymentChannelList) GetLinks() []PaymentChannelListLinksInner { + if o == nil || utils.IsNil(o.Links) { + var ret []PaymentChannelListLinksInner + return ret + } + return o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelList) GetLinksOk() ([]PaymentChannelListLinksInner, bool) { + if o == nil || utils.IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *PaymentChannelList) HasLinks() bool { + if o != nil && !utils.IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given []PaymentChannelListLinksInner and assigns it to the Links field. +func (o *PaymentChannelList) SetLinks(v []PaymentChannelListLinksInner) { + o.Links = v +} + +// GetHasMore returns the HasMore field value if set, zero value otherwise. +func (o *PaymentChannelList) GetHasMore() bool { + if o == nil || utils.IsNil(o.HasMore) { + var ret bool + return ret + } + return *o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelList) GetHasMoreOk() (*bool, bool) { + if o == nil || utils.IsNil(o.HasMore) { + return nil, false + } + return o.HasMore, true +} + +// HasHasMore returns a boolean if a field has been set. +func (o *PaymentChannelList) HasHasMore() bool { + if o != nil && !utils.IsNil(o.HasMore) { + return true + } + + return false +} + +// SetHasMore gets a reference to the given bool and assigns it to the HasMore field. +func (o *PaymentChannelList) SetHasMore(v bool) { + o.HasMore = &v +} + +func (o PaymentChannelList) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentChannelList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Links) { + toSerialize["links"] = o.Links + } + if !utils.IsNil(o.HasMore) { + toSerialize["has_more"] = o.HasMore + } + return toSerialize, nil +} + +type NullablePaymentChannelList struct { + value *PaymentChannelList + isSet bool +} + +func (v NullablePaymentChannelList) Get() *PaymentChannelList { + return v.value +} + +func (v *NullablePaymentChannelList) Set(val *PaymentChannelList) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentChannelList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentChannelList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentChannelList(val *PaymentChannelList) *NullablePaymentChannelList { + return &NullablePaymentChannelList{value: val, isSet: true} +} + +func (v NullablePaymentChannelList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentChannelList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_channel_list_links_inner.go b/payment_method/model_payment_channel_list_links_inner.go new file mode 100644 index 00000000..92450889 --- /dev/null +++ b/payment_method/model_payment_channel_list_links_inner.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentChannelListLinksInner type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentChannelListLinksInner{} + +// PaymentChannelListLinksInner struct for PaymentChannelListLinksInner +type PaymentChannelListLinksInner struct { + // Target URI that should contain a target to Internationalized Resource Identifiers (IRI) + Href *string `json:"href,omitempty"` + // The link relation type described how the current context (source) is related to target resource + Rel *string `json:"rel,omitempty"` + // The HTTP method to be used to call `href` + Method *string `json:"method,omitempty"` +} + +// NewPaymentChannelListLinksInner instantiates a new PaymentChannelListLinksInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentChannelListLinksInner() *PaymentChannelListLinksInner { + this := PaymentChannelListLinksInner{} + return &this +} + +// NewPaymentChannelListLinksInnerWithDefaults instantiates a new PaymentChannelListLinksInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentChannelListLinksInnerWithDefaults() *PaymentChannelListLinksInner { + this := PaymentChannelListLinksInner{} + return &this +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInner) GetHref() string { + if o == nil || utils.IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInner) GetHrefOk() (*string, bool) { + if o == nil || utils.IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInner) HasHref() bool { + if o != nil && !utils.IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PaymentChannelListLinksInner) SetHref(v string) { + o.Href = &v +} + +// GetRel returns the Rel field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInner) GetRel() string { + if o == nil || utils.IsNil(o.Rel) { + var ret string + return ret + } + return *o.Rel +} + +// GetRelOk returns a tuple with the Rel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInner) GetRelOk() (*string, bool) { + if o == nil || utils.IsNil(o.Rel) { + return nil, false + } + return o.Rel, true +} + +// HasRel returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInner) HasRel() bool { + if o != nil && !utils.IsNil(o.Rel) { + return true + } + + return false +} + +// SetRel gets a reference to the given string and assigns it to the Rel field. +func (o *PaymentChannelListLinksInner) SetRel(v string) { + o.Rel = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInner) GetMethod() string { + if o == nil || utils.IsNil(o.Method) { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInner) GetMethodOk() (*string, bool) { + if o == nil || utils.IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInner) HasMethod() bool { + if o != nil && !utils.IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *PaymentChannelListLinksInner) SetMethod(v string) { + o.Method = &v +} + +func (o PaymentChannelListLinksInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentChannelListLinksInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !utils.IsNil(o.Rel) { + toSerialize["rel"] = o.Rel + } + if !utils.IsNil(o.Method) { + toSerialize["method"] = o.Method + } + return toSerialize, nil +} + +type NullablePaymentChannelListLinksInner struct { + value *PaymentChannelListLinksInner + isSet bool +} + +func (v NullablePaymentChannelListLinksInner) Get() *PaymentChannelListLinksInner { + return v.value +} + +func (v *NullablePaymentChannelListLinksInner) Set(val *PaymentChannelListLinksInner) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentChannelListLinksInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentChannelListLinksInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentChannelListLinksInner(val *PaymentChannelListLinksInner) *NullablePaymentChannelListLinksInner { + return &NullablePaymentChannelListLinksInner{value: val, isSet: true} +} + +func (v NullablePaymentChannelListLinksInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentChannelListLinksInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_channel_list_links_inner_all_of.go b/payment_method/model_payment_channel_list_links_inner_all_of.go new file mode 100644 index 00000000..83592aed --- /dev/null +++ b/payment_method/model_payment_channel_list_links_inner_all_of.go @@ -0,0 +1,205 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentChannelListLinksInnerAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentChannelListLinksInnerAllOf{} + +// PaymentChannelListLinksInnerAllOf struct for PaymentChannelListLinksInnerAllOf +type PaymentChannelListLinksInnerAllOf struct { + // Target URI that should contain a target to Internationalized Resource Identifiers (IRI) + Href *string `json:"href,omitempty"` + // The link relation type described how the current context (source) is related to target resource + Rel *string `json:"rel,omitempty"` + // The HTTP method to be used to call `href` + Method *string `json:"method,omitempty"` +} + +// NewPaymentChannelListLinksInnerAllOf instantiates a new PaymentChannelListLinksInnerAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentChannelListLinksInnerAllOf() *PaymentChannelListLinksInnerAllOf { + this := PaymentChannelListLinksInnerAllOf{} + return &this +} + +// NewPaymentChannelListLinksInnerAllOfWithDefaults instantiates a new PaymentChannelListLinksInnerAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentChannelListLinksInnerAllOfWithDefaults() *PaymentChannelListLinksInnerAllOf { + this := PaymentChannelListLinksInnerAllOf{} + return &this +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInnerAllOf) GetHref() string { + if o == nil || utils.IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInnerAllOf) GetHrefOk() (*string, bool) { + if o == nil || utils.IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInnerAllOf) HasHref() bool { + if o != nil && !utils.IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PaymentChannelListLinksInnerAllOf) SetHref(v string) { + o.Href = &v +} + +// GetRel returns the Rel field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInnerAllOf) GetRel() string { + if o == nil || utils.IsNil(o.Rel) { + var ret string + return ret + } + return *o.Rel +} + +// GetRelOk returns a tuple with the Rel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInnerAllOf) GetRelOk() (*string, bool) { + if o == nil || utils.IsNil(o.Rel) { + return nil, false + } + return o.Rel, true +} + +// HasRel returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInnerAllOf) HasRel() bool { + if o != nil && !utils.IsNil(o.Rel) { + return true + } + + return false +} + +// SetRel gets a reference to the given string and assigns it to the Rel field. +func (o *PaymentChannelListLinksInnerAllOf) SetRel(v string) { + o.Rel = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *PaymentChannelListLinksInnerAllOf) GetMethod() string { + if o == nil || utils.IsNil(o.Method) { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentChannelListLinksInnerAllOf) GetMethodOk() (*string, bool) { + if o == nil || utils.IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *PaymentChannelListLinksInnerAllOf) HasMethod() bool { + if o != nil && !utils.IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *PaymentChannelListLinksInnerAllOf) SetMethod(v string) { + o.Method = &v +} + +func (o PaymentChannelListLinksInnerAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentChannelListLinksInnerAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !utils.IsNil(o.Rel) { + toSerialize["rel"] = o.Rel + } + if !utils.IsNil(o.Method) { + toSerialize["method"] = o.Method + } + return toSerialize, nil +} + +type NullablePaymentChannelListLinksInnerAllOf struct { + value *PaymentChannelListLinksInnerAllOf + isSet bool +} + +func (v NullablePaymentChannelListLinksInnerAllOf) Get() *PaymentChannelListLinksInnerAllOf { + return v.value +} + +func (v *NullablePaymentChannelListLinksInnerAllOf) Set(val *PaymentChannelListLinksInnerAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentChannelListLinksInnerAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentChannelListLinksInnerAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentChannelListLinksInnerAllOf(val *PaymentChannelListLinksInnerAllOf) *NullablePaymentChannelListLinksInnerAllOf { + return &NullablePaymentChannelListLinksInnerAllOf{value: val, isSet: true} +} + +func (v NullablePaymentChannelListLinksInnerAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentChannelListLinksInnerAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method.go b/payment_method/model_payment_method.go new file mode 100644 index 00000000..4162a002 --- /dev/null +++ b/payment_method/model_payment_method.go @@ -0,0 +1,980 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the PaymentMethod type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethod{} + +// PaymentMethod struct for PaymentMethod +type PaymentMethod struct { + Id string `json:"id"` + BusinessId *string `json:"business_id,omitempty"` + Type *PaymentMethodType `json:"type,omitempty"` + Country *PaymentMethodCountry `json:"country,omitempty"` + CustomerId NullableString `json:"customer_id,omitempty"` + Customer map[string]interface{} `json:"customer,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + Description NullableString `json:"description,omitempty"` + Status *PaymentMethodStatus `json:"status,omitempty"` + Reusability *PaymentMethodReusability `json:"reusability,omitempty"` + Actions []PaymentMethodAction `json:"actions,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + BillingInformation NullableBillingInformation `json:"billing_information,omitempty"` + FailureCode NullableString `json:"failure_code,omitempty"` + Created *time.Time `json:"created,omitempty"` + Updated *time.Time `json:"updated,omitempty"` + Ewallet NullableEWallet `json:"ewallet,omitempty"` + DirectDebit NullableDirectDebit `json:"direct_debit,omitempty"` + OverTheCounter NullableOverTheCounter `json:"over_the_counter,omitempty"` + Card NullableCard `json:"card,omitempty"` + QrCode NullableQRCode `json:"qr_code,omitempty"` + VirtualAccount NullableVirtualAccount `json:"virtual_account,omitempty"` +} + +// NewPaymentMethod instantiates a new PaymentMethod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethod(id string) *PaymentMethod { + this := PaymentMethod{} + this.Id = id + return &this +} + +// NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodWithDefaults() *PaymentMethod { + this := PaymentMethod{} + return &this +} + +// GetId returns the Id field value +func (o *PaymentMethod) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentMethod) SetId(v string) { + o.Id = v +} + +// GetBusinessId returns the BusinessId field value if set, zero value otherwise. +func (o *PaymentMethod) GetBusinessId() string { + if o == nil || utils.IsNil(o.BusinessId) { + var ret string + return ret + } + return *o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetBusinessIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.BusinessId) { + return nil, false + } + return o.BusinessId, true +} + +// HasBusinessId returns a boolean if a field has been set. +func (o *PaymentMethod) HasBusinessId() bool { + if o != nil && !utils.IsNil(o.BusinessId) { + return true + } + + return false +} + +// SetBusinessId gets a reference to the given string and assigns it to the BusinessId field. +func (o *PaymentMethod) SetBusinessId(v string) { + o.BusinessId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PaymentMethod) GetType() PaymentMethodType { + if o == nil || utils.IsNil(o.Type) { + var ret PaymentMethodType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetTypeOk() (*PaymentMethodType, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PaymentMethod) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PaymentMethodType and assigns it to the Type field. +func (o *PaymentMethod) SetType(v PaymentMethodType) { + o.Type = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *PaymentMethod) GetCountry() PaymentMethodCountry { + if o == nil || utils.IsNil(o.Country) { + var ret PaymentMethodCountry + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCountryOk() (*PaymentMethodCountry, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *PaymentMethod) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given PaymentMethodCountry and assigns it to the Country field. +func (o *PaymentMethod) SetCountry(v PaymentMethodCountry) { + o.Country = &v +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *PaymentMethod) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *PaymentMethod) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *PaymentMethod) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *PaymentMethod) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetCustomer returns the Customer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetCustomer() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetCustomerOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Customer) { + return map[string]interface{}{}, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *PaymentMethod) HasCustomer() bool { + if o != nil && utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given map[string]interface{} and assigns it to the Customer field. +func (o *PaymentMethod) SetCustomer(v map[string]interface{}) { + o.Customer = v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentMethod) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentMethod) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentMethod) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentMethod) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentMethod) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentMethod) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentMethod) UnsetDescription() { + o.Description.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PaymentMethod) GetStatus() PaymentMethodStatus { + if o == nil || utils.IsNil(o.Status) { + var ret PaymentMethodStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetStatusOk() (*PaymentMethodStatus, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PaymentMethod) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PaymentMethodStatus and assigns it to the Status field. +func (o *PaymentMethod) SetStatus(v PaymentMethodStatus) { + o.Status = &v +} + +// GetReusability returns the Reusability field value if set, zero value otherwise. +func (o *PaymentMethod) GetReusability() PaymentMethodReusability { + if o == nil || utils.IsNil(o.Reusability) { + var ret PaymentMethodReusability + return ret + } + return *o.Reusability +} + +// GetReusabilityOk returns a tuple with the Reusability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetReusabilityOk() (*PaymentMethodReusability, bool) { + if o == nil || utils.IsNil(o.Reusability) { + return nil, false + } + return o.Reusability, true +} + +// HasReusability returns a boolean if a field has been set. +func (o *PaymentMethod) HasReusability() bool { + if o != nil && !utils.IsNil(o.Reusability) { + return true + } + + return false +} + +// SetReusability gets a reference to the given PaymentMethodReusability and assigns it to the Reusability field. +func (o *PaymentMethod) SetReusability(v PaymentMethodReusability) { + o.Reusability = &v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *PaymentMethod) GetActions() []PaymentMethodAction { + if o == nil || utils.IsNil(o.Actions) { + var ret []PaymentMethodAction + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetActionsOk() ([]PaymentMethodAction, bool) { + if o == nil || utils.IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *PaymentMethod) HasActions() bool { + if o != nil && !utils.IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []PaymentMethodAction and assigns it to the Actions field. +func (o *PaymentMethod) SetActions(v []PaymentMethodAction) { + o.Actions = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentMethod) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentMethod) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetBillingInformation returns the BillingInformation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetBillingInformation() BillingInformation { + if o == nil || utils.IsNil(o.BillingInformation.Get()) { + var ret BillingInformation + return ret + } + return *o.BillingInformation.Get() +} + +// GetBillingInformationOk returns a tuple with the BillingInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetBillingInformationOk() (*BillingInformation, bool) { + if o == nil { + return nil, false + } + return o.BillingInformation.Get(), o.BillingInformation.IsSet() +} + +// HasBillingInformation returns a boolean if a field has been set. +func (o *PaymentMethod) HasBillingInformation() bool { + if o != nil && o.BillingInformation.IsSet() { + return true + } + + return false +} + +// SetBillingInformation gets a reference to the given NullableBillingInformation and assigns it to the BillingInformation field. +func (o *PaymentMethod) SetBillingInformation(v BillingInformation) { + o.BillingInformation.Set(&v) +} +// SetBillingInformationNil sets the value for BillingInformation to be an explicit nil +func (o *PaymentMethod) SetBillingInformationNil() { + o.BillingInformation.Set(nil) +} + +// UnsetBillingInformation ensures that no value is present for BillingInformation, not even an explicit nil +func (o *PaymentMethod) UnsetBillingInformation() { + o.BillingInformation.Unset() +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode.Get()) { + var ret string + return ret + } + return *o.FailureCode.Get() +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetFailureCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureCode.Get(), o.FailureCode.IsSet() +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *PaymentMethod) HasFailureCode() bool { + if o != nil && o.FailureCode.IsSet() { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given NullableString and assigns it to the FailureCode field. +func (o *PaymentMethod) SetFailureCode(v string) { + o.FailureCode.Set(&v) +} +// SetFailureCodeNil sets the value for FailureCode to be an explicit nil +func (o *PaymentMethod) SetFailureCodeNil() { + o.FailureCode.Set(nil) +} + +// UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +func (o *PaymentMethod) UnsetFailureCode() { + o.FailureCode.Unset() +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *PaymentMethod) GetCreated() time.Time { + if o == nil || utils.IsNil(o.Created) { + var ret time.Time + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCreatedOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *PaymentMethod) HasCreated() bool { + if o != nil && !utils.IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *PaymentMethod) SetCreated(v time.Time) { + o.Created = &v +} + +// GetUpdated returns the Updated field value if set, zero value otherwise. +func (o *PaymentMethod) GetUpdated() time.Time { + if o == nil || utils.IsNil(o.Updated) { + var ret time.Time + return ret + } + return *o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetUpdatedOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.Updated) { + return nil, false + } + return o.Updated, true +} + +// HasUpdated returns a boolean if a field has been set. +func (o *PaymentMethod) HasUpdated() bool { + if o != nil && !utils.IsNil(o.Updated) { + return true + } + + return false +} + +// SetUpdated gets a reference to the given time.Time and assigns it to the Updated field. +func (o *PaymentMethod) SetUpdated(v time.Time) { + o.Updated = &v +} + +// GetEwallet returns the Ewallet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetEwallet() EWallet { + if o == nil || utils.IsNil(o.Ewallet.Get()) { + var ret EWallet + return ret + } + return *o.Ewallet.Get() +} + +// GetEwalletOk returns a tuple with the Ewallet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetEwalletOk() (*EWallet, bool) { + if o == nil { + return nil, false + } + return o.Ewallet.Get(), o.Ewallet.IsSet() +} + +// HasEwallet returns a boolean if a field has been set. +func (o *PaymentMethod) HasEwallet() bool { + if o != nil && o.Ewallet.IsSet() { + return true + } + + return false +} + +// SetEwallet gets a reference to the given NullableEWallet and assigns it to the Ewallet field. +func (o *PaymentMethod) SetEwallet(v EWallet) { + o.Ewallet.Set(&v) +} +// SetEwalletNil sets the value for Ewallet to be an explicit nil +func (o *PaymentMethod) SetEwalletNil() { + o.Ewallet.Set(nil) +} + +// UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +func (o *PaymentMethod) UnsetEwallet() { + o.Ewallet.Unset() +} + +// GetDirectDebit returns the DirectDebit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetDirectDebit() DirectDebit { + if o == nil || utils.IsNil(o.DirectDebit.Get()) { + var ret DirectDebit + return ret + } + return *o.DirectDebit.Get() +} + +// GetDirectDebitOk returns a tuple with the DirectDebit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetDirectDebitOk() (*DirectDebit, bool) { + if o == nil { + return nil, false + } + return o.DirectDebit.Get(), o.DirectDebit.IsSet() +} + +// HasDirectDebit returns a boolean if a field has been set. +func (o *PaymentMethod) HasDirectDebit() bool { + if o != nil && o.DirectDebit.IsSet() { + return true + } + + return false +} + +// SetDirectDebit gets a reference to the given NullableDirectDebit and assigns it to the DirectDebit field. +func (o *PaymentMethod) SetDirectDebit(v DirectDebit) { + o.DirectDebit.Set(&v) +} +// SetDirectDebitNil sets the value for DirectDebit to be an explicit nil +func (o *PaymentMethod) SetDirectDebitNil() { + o.DirectDebit.Set(nil) +} + +// UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +func (o *PaymentMethod) UnsetDirectDebit() { + o.DirectDebit.Unset() +} + +// GetOverTheCounter returns the OverTheCounter field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetOverTheCounter() OverTheCounter { + if o == nil || utils.IsNil(o.OverTheCounter.Get()) { + var ret OverTheCounter + return ret + } + return *o.OverTheCounter.Get() +} + +// GetOverTheCounterOk returns a tuple with the OverTheCounter field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetOverTheCounterOk() (*OverTheCounter, bool) { + if o == nil { + return nil, false + } + return o.OverTheCounter.Get(), o.OverTheCounter.IsSet() +} + +// HasOverTheCounter returns a boolean if a field has been set. +func (o *PaymentMethod) HasOverTheCounter() bool { + if o != nil && o.OverTheCounter.IsSet() { + return true + } + + return false +} + +// SetOverTheCounter gets a reference to the given NullableOverTheCounter and assigns it to the OverTheCounter field. +func (o *PaymentMethod) SetOverTheCounter(v OverTheCounter) { + o.OverTheCounter.Set(&v) +} +// SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil +func (o *PaymentMethod) SetOverTheCounterNil() { + o.OverTheCounter.Set(nil) +} + +// UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +func (o *PaymentMethod) UnsetOverTheCounter() { + o.OverTheCounter.Unset() +} + +// GetCard returns the Card field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetCard() Card { + if o == nil || utils.IsNil(o.Card.Get()) { + var ret Card + return ret + } + return *o.Card.Get() +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetCardOk() (*Card, bool) { + if o == nil { + return nil, false + } + return o.Card.Get(), o.Card.IsSet() +} + +// HasCard returns a boolean if a field has been set. +func (o *PaymentMethod) HasCard() bool { + if o != nil && o.Card.IsSet() { + return true + } + + return false +} + +// SetCard gets a reference to the given NullableCard and assigns it to the Card field. +func (o *PaymentMethod) SetCard(v Card) { + o.Card.Set(&v) +} +// SetCardNil sets the value for Card to be an explicit nil +func (o *PaymentMethod) SetCardNil() { + o.Card.Set(nil) +} + +// UnsetCard ensures that no value is present for Card, not even an explicit nil +func (o *PaymentMethod) UnsetCard() { + o.Card.Unset() +} + +// GetQrCode returns the QrCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetQrCode() QRCode { + if o == nil || utils.IsNil(o.QrCode.Get()) { + var ret QRCode + return ret + } + return *o.QrCode.Get() +} + +// GetQrCodeOk returns a tuple with the QrCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetQrCodeOk() (*QRCode, bool) { + if o == nil { + return nil, false + } + return o.QrCode.Get(), o.QrCode.IsSet() +} + +// HasQrCode returns a boolean if a field has been set. +func (o *PaymentMethod) HasQrCode() bool { + if o != nil && o.QrCode.IsSet() { + return true + } + + return false +} + +// SetQrCode gets a reference to the given NullableQRCode and assigns it to the QrCode field. +func (o *PaymentMethod) SetQrCode(v QRCode) { + o.QrCode.Set(&v) +} +// SetQrCodeNil sets the value for QrCode to be an explicit nil +func (o *PaymentMethod) SetQrCodeNil() { + o.QrCode.Set(nil) +} + +// UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil +func (o *PaymentMethod) UnsetQrCode() { + o.QrCode.Unset() +} + +// GetVirtualAccount returns the VirtualAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetVirtualAccount() VirtualAccount { + if o == nil || utils.IsNil(o.VirtualAccount.Get()) { + var ret VirtualAccount + return ret + } + return *o.VirtualAccount.Get() +} + +// GetVirtualAccountOk returns a tuple with the VirtualAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetVirtualAccountOk() (*VirtualAccount, bool) { + if o == nil { + return nil, false + } + return o.VirtualAccount.Get(), o.VirtualAccount.IsSet() +} + +// HasVirtualAccount returns a boolean if a field has been set. +func (o *PaymentMethod) HasVirtualAccount() bool { + if o != nil && o.VirtualAccount.IsSet() { + return true + } + + return false +} + +// SetVirtualAccount gets a reference to the given NullableVirtualAccount and assigns it to the VirtualAccount field. +func (o *PaymentMethod) SetVirtualAccount(v VirtualAccount) { + o.VirtualAccount.Set(&v) +} +// SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil +func (o *PaymentMethod) SetVirtualAccountNil() { + o.VirtualAccount.Set(nil) +} + +// UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil +func (o *PaymentMethod) UnsetVirtualAccount() { + o.VirtualAccount.Unset() +} + +func (o PaymentMethod) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !utils.IsNil(o.BusinessId) { + toSerialize["business_id"] = o.BusinessId + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + if o.Customer != nil { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !utils.IsNil(o.Reusability) { + toSerialize["reusability"] = o.Reusability + } + if !utils.IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.BillingInformation.IsSet() { + toSerialize["billing_information"] = o.BillingInformation.Get() + } + if o.FailureCode.IsSet() { + toSerialize["failure_code"] = o.FailureCode.Get() + } + if !utils.IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !utils.IsNil(o.Updated) { + toSerialize["updated"] = o.Updated + } + if o.Ewallet.IsSet() { + toSerialize["ewallet"] = o.Ewallet.Get() + } + if o.DirectDebit.IsSet() { + toSerialize["direct_debit"] = o.DirectDebit.Get() + } + if o.OverTheCounter.IsSet() { + toSerialize["over_the_counter"] = o.OverTheCounter.Get() + } + if o.Card.IsSet() { + toSerialize["card"] = o.Card.Get() + } + if o.QrCode.IsSet() { + toSerialize["qr_code"] = o.QrCode.Get() + } + if o.VirtualAccount.IsSet() { + toSerialize["virtual_account"] = o.VirtualAccount.Get() + } + return toSerialize, nil +} + +type NullablePaymentMethod struct { + value *PaymentMethod + isSet bool +} + +func (v NullablePaymentMethod) Get() *PaymentMethod { + return v.value +} + +func (v *NullablePaymentMethod) Set(val *PaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethod(val *PaymentMethod) *NullablePaymentMethod { + return &NullablePaymentMethod{value: val, isSet: true} +} + +func (v NullablePaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_action.go b/payment_method/model_payment_method_action.go new file mode 100644 index 00000000..eccac364 --- /dev/null +++ b/payment_method/model_payment_method_action.go @@ -0,0 +1,238 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodAction type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodAction{} + +// PaymentMethodAction struct for PaymentMethodAction +type PaymentMethodAction struct { + Action *string `json:"action,omitempty"` + Method *string `json:"method,omitempty"` + Url *string `json:"url,omitempty"` + UrlType *string `json:"url_type,omitempty"` +} + +// NewPaymentMethodAction instantiates a new PaymentMethodAction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodAction() *PaymentMethodAction { + this := PaymentMethodAction{} + return &this +} + +// NewPaymentMethodActionWithDefaults instantiates a new PaymentMethodAction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodActionWithDefaults() *PaymentMethodAction { + this := PaymentMethodAction{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *PaymentMethodAction) GetAction() string { + if o == nil || utils.IsNil(o.Action) { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodAction) GetActionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *PaymentMethodAction) HasAction() bool { + if o != nil && !utils.IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *PaymentMethodAction) SetAction(v string) { + o.Action = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *PaymentMethodAction) GetMethod() string { + if o == nil || utils.IsNil(o.Method) { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodAction) GetMethodOk() (*string, bool) { + if o == nil || utils.IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *PaymentMethodAction) HasMethod() bool { + if o != nil && !utils.IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *PaymentMethodAction) SetMethod(v string) { + o.Method = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *PaymentMethodAction) GetUrl() string { + if o == nil || utils.IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodAction) GetUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *PaymentMethodAction) HasUrl() bool { + if o != nil && !utils.IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *PaymentMethodAction) SetUrl(v string) { + o.Url = &v +} + +// GetUrlType returns the UrlType field value if set, zero value otherwise. +func (o *PaymentMethodAction) GetUrlType() string { + if o == nil || utils.IsNil(o.UrlType) { + var ret string + return ret + } + return *o.UrlType +} + +// GetUrlTypeOk returns a tuple with the UrlType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodAction) GetUrlTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.UrlType) { + return nil, false + } + return o.UrlType, true +} + +// HasUrlType returns a boolean if a field has been set. +func (o *PaymentMethodAction) HasUrlType() bool { + if o != nil && !utils.IsNil(o.UrlType) { + return true + } + + return false +} + +// SetUrlType gets a reference to the given string and assigns it to the UrlType field. +func (o *PaymentMethodAction) SetUrlType(v string) { + o.UrlType = &v +} + +func (o PaymentMethodAction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodAction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !utils.IsNil(o.Method) { + toSerialize["method"] = o.Method + } + if !utils.IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !utils.IsNil(o.UrlType) { + toSerialize["url_type"] = o.UrlType + } + return toSerialize, nil +} + +type NullablePaymentMethodAction struct { + value *PaymentMethodAction + isSet bool +} + +func (v NullablePaymentMethodAction) Get() *PaymentMethodAction { + return v.value +} + +func (v *NullablePaymentMethodAction) Set(val *PaymentMethodAction) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodAction(val *PaymentMethodAction) *NullablePaymentMethodAction { + return &NullablePaymentMethodAction{value: val, isSet: true} +} + +func (v NullablePaymentMethodAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_auth_parameters.go b/payment_method/model_payment_method_auth_parameters.go new file mode 100644 index 00000000..9313457b --- /dev/null +++ b/payment_method/model_payment_method_auth_parameters.go @@ -0,0 +1,121 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodAuthParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodAuthParameters{} + +// PaymentMethodAuthParameters struct for PaymentMethodAuthParameters +type PaymentMethodAuthParameters struct { + AuthCode string `json:"auth_code"` +} + +// NewPaymentMethodAuthParameters instantiates a new PaymentMethodAuthParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodAuthParameters(authCode string) *PaymentMethodAuthParameters { + this := PaymentMethodAuthParameters{} + this.AuthCode = authCode + return &this +} + +// NewPaymentMethodAuthParametersWithDefaults instantiates a new PaymentMethodAuthParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodAuthParametersWithDefaults() *PaymentMethodAuthParameters { + this := PaymentMethodAuthParameters{} + return &this +} + +// GetAuthCode returns the AuthCode field value +func (o *PaymentMethodAuthParameters) GetAuthCode() string { + if o == nil { + var ret string + return ret + } + + return o.AuthCode +} + +// GetAuthCodeOk returns a tuple with the AuthCode field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodAuthParameters) GetAuthCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthCode, true +} + +// SetAuthCode sets field value +func (o *PaymentMethodAuthParameters) SetAuthCode(v string) { + o.AuthCode = v +} + +func (o PaymentMethodAuthParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodAuthParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["auth_code"] = o.AuthCode + return toSerialize, nil +} + +type NullablePaymentMethodAuthParameters struct { + value *PaymentMethodAuthParameters + isSet bool +} + +func (v NullablePaymentMethodAuthParameters) Get() *PaymentMethodAuthParameters { + return v.value +} + +func (v *NullablePaymentMethodAuthParameters) Set(val *PaymentMethodAuthParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodAuthParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodAuthParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodAuthParameters(val *PaymentMethodAuthParameters) *NullablePaymentMethodAuthParameters { + return &NullablePaymentMethodAuthParameters{value: val, isSet: true} +} + +func (v NullablePaymentMethodAuthParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodAuthParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_country.go b/payment_method/model_payment_method_country.go new file mode 100644 index 00000000..74eb689e --- /dev/null +++ b/payment_method/model_payment_method_country.go @@ -0,0 +1,121 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodCountry the model 'PaymentMethodCountry' +type PaymentMethodCountry string + +// List of PaymentMethodCountry +const ( + PAYMENTMETHODCOUNTRY_PH PaymentMethodCountry = "PH" + PAYMENTMETHODCOUNTRY_ID PaymentMethodCountry = "ID" + PAYMENTMETHODCOUNTRY_VN PaymentMethodCountry = "VN" + PAYMENTMETHODCOUNTRY_TH PaymentMethodCountry = "TH" + PAYMENTMETHODCOUNTRY_MY PaymentMethodCountry = "MY" +) + +// All allowed values of PaymentMethodCountry enum +var AllowedPaymentMethodCountryEnumValues = []PaymentMethodCountry{ + "PH", + "ID", + "VN", + "TH", + "MY", +} + +func (v *PaymentMethodCountry) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodCountry(value) + for _, existing := range AllowedPaymentMethodCountryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodCountry", value) +} + +// NewPaymentMethodCountryFromValue returns a pointer to a valid PaymentMethodCountry +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodCountryFromValue(v string) (*PaymentMethodCountry, error) { + ev := PaymentMethodCountry(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodCountry: valid values are %v", v, AllowedPaymentMethodCountryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodCountry) IsValid() bool { + for _, existing := range AllowedPaymentMethodCountryEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodCountry) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodCountry value +func (v PaymentMethodCountry) Ptr() *PaymentMethodCountry { + return &v +} + +type NullablePaymentMethodCountry struct { + value *PaymentMethodCountry + isSet bool +} + +func (v NullablePaymentMethodCountry) Get() *PaymentMethodCountry { + return v.value +} + +func (v *NullablePaymentMethodCountry) Set(val *PaymentMethodCountry) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodCountry) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodCountry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodCountry(val *PaymentMethodCountry) *NullablePaymentMethodCountry { + return &NullablePaymentMethodCountry{value: val, isSet: true} +} + +func (v NullablePaymentMethodCountry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodCountry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_payment_method_expire_parameters.go b/payment_method/model_payment_method_expire_parameters.go new file mode 100644 index 00000000..addc0701 --- /dev/null +++ b/payment_method/model_payment_method_expire_parameters.go @@ -0,0 +1,188 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodExpireParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodExpireParameters{} + +// PaymentMethodExpireParameters struct for PaymentMethodExpireParameters +type PaymentMethodExpireParameters struct { + // URL where the end customer is redirected if the unlinking authorization is successful. + SuccessReturnUrl NullableString `json:"success_return_url,omitempty"` + // URL where the end customer is redirected if the unlinking authorization is failed. + FailureReturnUrl NullableString `json:"failure_return_url,omitempty"` +} + +// NewPaymentMethodExpireParameters instantiates a new PaymentMethodExpireParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodExpireParameters() *PaymentMethodExpireParameters { + this := PaymentMethodExpireParameters{} + return &this +} + +// NewPaymentMethodExpireParametersWithDefaults instantiates a new PaymentMethodExpireParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodExpireParametersWithDefaults() *PaymentMethodExpireParameters { + this := PaymentMethodExpireParameters{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodExpireParameters) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl.Get()) { + var ret string + return ret + } + return *o.SuccessReturnUrl.Get() +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodExpireParameters) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SuccessReturnUrl.Get(), o.SuccessReturnUrl.IsSet() +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *PaymentMethodExpireParameters) HasSuccessReturnUrl() bool { + if o != nil && o.SuccessReturnUrl.IsSet() { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given NullableString and assigns it to the SuccessReturnUrl field. +func (o *PaymentMethodExpireParameters) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl.Set(&v) +} +// SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil +func (o *PaymentMethodExpireParameters) SetSuccessReturnUrlNil() { + o.SuccessReturnUrl.Set(nil) +} + +// UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +func (o *PaymentMethodExpireParameters) UnsetSuccessReturnUrl() { + o.SuccessReturnUrl.Unset() +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodExpireParameters) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl.Get()) { + var ret string + return ret + } + return *o.FailureReturnUrl.Get() +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodExpireParameters) GetFailureReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureReturnUrl.Get(), o.FailureReturnUrl.IsSet() +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *PaymentMethodExpireParameters) HasFailureReturnUrl() bool { + if o != nil && o.FailureReturnUrl.IsSet() { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given NullableString and assigns it to the FailureReturnUrl field. +func (o *PaymentMethodExpireParameters) SetFailureReturnUrl(v string) { + o.FailureReturnUrl.Set(&v) +} +// SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil +func (o *PaymentMethodExpireParameters) SetFailureReturnUrlNil() { + o.FailureReturnUrl.Set(nil) +} + +// UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +func (o *PaymentMethodExpireParameters) UnsetFailureReturnUrl() { + o.FailureReturnUrl.Unset() +} + +func (o PaymentMethodExpireParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodExpireParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.SuccessReturnUrl.IsSet() { + toSerialize["success_return_url"] = o.SuccessReturnUrl.Get() + } + if o.FailureReturnUrl.IsSet() { + toSerialize["failure_return_url"] = o.FailureReturnUrl.Get() + } + return toSerialize, nil +} + +type NullablePaymentMethodExpireParameters struct { + value *PaymentMethodExpireParameters + isSet bool +} + +func (v NullablePaymentMethodExpireParameters) Get() *PaymentMethodExpireParameters { + return v.value +} + +func (v *NullablePaymentMethodExpireParameters) Set(val *PaymentMethodExpireParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodExpireParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodExpireParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodExpireParameters(val *PaymentMethodExpireParameters) *NullablePaymentMethodExpireParameters { + return &NullablePaymentMethodExpireParameters{value: val, isSet: true} +} + +func (v NullablePaymentMethodExpireParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodExpireParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_list.go b/payment_method/model_payment_method_list.go new file mode 100644 index 00000000..a0f2623a --- /dev/null +++ b/payment_method/model_payment_method_list.go @@ -0,0 +1,157 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodList type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodList{} + +// PaymentMethodList struct for PaymentMethodList +type PaymentMethodList struct { + Data []PaymentMethod `json:"data"` + HasMore *bool `json:"has_more,omitempty"` +} + +// NewPaymentMethodList instantiates a new PaymentMethodList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodList(data []PaymentMethod) *PaymentMethodList { + this := PaymentMethodList{} + this.Data = data + return &this +} + +// NewPaymentMethodListWithDefaults instantiates a new PaymentMethodList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodListWithDefaults() *PaymentMethodList { + this := PaymentMethodList{} + return &this +} + +// GetData returns the Data field value +func (o *PaymentMethodList) GetData() []PaymentMethod { + if o == nil { + var ret []PaymentMethod + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodList) GetDataOk() ([]PaymentMethod, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *PaymentMethodList) SetData(v []PaymentMethod) { + o.Data = v +} + +// GetHasMore returns the HasMore field value if set, zero value otherwise. +func (o *PaymentMethodList) GetHasMore() bool { + if o == nil || utils.IsNil(o.HasMore) { + var ret bool + return ret + } + return *o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodList) GetHasMoreOk() (*bool, bool) { + if o == nil || utils.IsNil(o.HasMore) { + return nil, false + } + return o.HasMore, true +} + +// HasHasMore returns a boolean if a field has been set. +func (o *PaymentMethodList) HasHasMore() bool { + if o != nil && !utils.IsNil(o.HasMore) { + return true + } + + return false +} + +// SetHasMore gets a reference to the given bool and assigns it to the HasMore field. +func (o *PaymentMethodList) SetHasMore(v bool) { + o.HasMore = &v +} + +func (o PaymentMethodList) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + if !utils.IsNil(o.HasMore) { + toSerialize["has_more"] = o.HasMore + } + return toSerialize, nil +} + +type NullablePaymentMethodList struct { + value *PaymentMethodList + isSet bool +} + +func (v NullablePaymentMethodList) Get() *PaymentMethodList { + return v.value +} + +func (v *NullablePaymentMethodList) Set(val *PaymentMethodList) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodList(val *PaymentMethodList) *NullablePaymentMethodList { + return &NullablePaymentMethodList{value: val, isSet: true} +} + +func (v NullablePaymentMethodList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_parameters.go b/payment_method/model_payment_method_parameters.go new file mode 100644 index 00000000..e62d3f83 --- /dev/null +++ b/payment_method/model_payment_method_parameters.go @@ -0,0 +1,621 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodParameters{} + +// PaymentMethodParameters struct for PaymentMethodParameters +type PaymentMethodParameters struct { + Type PaymentMethodType `json:"type"` + Country NullableString `json:"country,omitempty"` + Reusability PaymentMethodReusability `json:"reusability"` + CustomerId NullableString `json:"customer_id,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + Description NullableString `json:"description,omitempty"` + Card *CardParameters `json:"card,omitempty"` + DirectDebit *DirectDebitParameters `json:"direct_debit,omitempty"` + Ewallet *EWalletParameters `json:"ewallet,omitempty"` + OverTheCounter *OverTheCounterParameters `json:"over_the_counter,omitempty"` + VirtualAccount *VirtualAccountParameters `json:"virtual_account,omitempty"` + QrCode *QRCodeParameters `json:"qr_code,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + BillingInformation NullableBillingInformation `json:"billing_information,omitempty"` +} + +// NewPaymentMethodParameters instantiates a new PaymentMethodParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodParameters(type_ PaymentMethodType, reusability PaymentMethodReusability) *PaymentMethodParameters { + this := PaymentMethodParameters{} + this.Type = type_ + this.Reusability = reusability + return &this +} + +// NewPaymentMethodParametersWithDefaults instantiates a new PaymentMethodParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodParametersWithDefaults() *PaymentMethodParameters { + this := PaymentMethodParameters{} + return &this +} + +// GetType returns the Type field value +func (o *PaymentMethodParameters) GetType() PaymentMethodType { + if o == nil { + var ret PaymentMethodType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetTypeOk() (*PaymentMethodType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentMethodParameters) SetType(v PaymentMethodType) { + o.Type = v +} + +// GetCountry returns the Country field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetCountry() string { + if o == nil || utils.IsNil(o.Country.Get()) { + var ret string + return ret + } + return *o.Country.Get() +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Country.Get(), o.Country.IsSet() +} + +// HasCountry returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasCountry() bool { + if o != nil && o.Country.IsSet() { + return true + } + + return false +} + +// SetCountry gets a reference to the given NullableString and assigns it to the Country field. +func (o *PaymentMethodParameters) SetCountry(v string) { + o.Country.Set(&v) +} +// SetCountryNil sets the value for Country to be an explicit nil +func (o *PaymentMethodParameters) SetCountryNil() { + o.Country.Set(nil) +} + +// UnsetCountry ensures that no value is present for Country, not even an explicit nil +func (o *PaymentMethodParameters) UnsetCountry() { + o.Country.Unset() +} + +// GetReusability returns the Reusability field value +func (o *PaymentMethodParameters) GetReusability() PaymentMethodReusability { + if o == nil { + var ret PaymentMethodReusability + return ret + } + + return o.Reusability +} + +// GetReusabilityOk returns a tuple with the Reusability field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetReusabilityOk() (*PaymentMethodReusability, bool) { + if o == nil { + return nil, false + } + return &o.Reusability, true +} + +// SetReusability sets field value +func (o *PaymentMethodParameters) SetReusability(v PaymentMethodReusability) { + o.Reusability = v +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *PaymentMethodParameters) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *PaymentMethodParameters) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *PaymentMethodParameters) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentMethodParameters) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentMethodParameters) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentMethodParameters) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentMethodParameters) UnsetDescription() { + o.Description.Unset() +} + +// GetCard returns the Card field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetCard() CardParameters { + if o == nil || utils.IsNil(o.Card) { + var ret CardParameters + return ret + } + return *o.Card +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetCardOk() (*CardParameters, bool) { + if o == nil || utils.IsNil(o.Card) { + return nil, false + } + return o.Card, true +} + +// HasCard returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasCard() bool { + if o != nil && !utils.IsNil(o.Card) { + return true + } + + return false +} + +// SetCard gets a reference to the given CardParameters and assigns it to the Card field. +func (o *PaymentMethodParameters) SetCard(v CardParameters) { + o.Card = &v +} + +// GetDirectDebit returns the DirectDebit field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetDirectDebit() DirectDebitParameters { + if o == nil || utils.IsNil(o.DirectDebit) { + var ret DirectDebitParameters + return ret + } + return *o.DirectDebit +} + +// GetDirectDebitOk returns a tuple with the DirectDebit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetDirectDebitOk() (*DirectDebitParameters, bool) { + if o == nil || utils.IsNil(o.DirectDebit) { + return nil, false + } + return o.DirectDebit, true +} + +// HasDirectDebit returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasDirectDebit() bool { + if o != nil && !utils.IsNil(o.DirectDebit) { + return true + } + + return false +} + +// SetDirectDebit gets a reference to the given DirectDebitParameters and assigns it to the DirectDebit field. +func (o *PaymentMethodParameters) SetDirectDebit(v DirectDebitParameters) { + o.DirectDebit = &v +} + +// GetEwallet returns the Ewallet field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetEwallet() EWalletParameters { + if o == nil || utils.IsNil(o.Ewallet) { + var ret EWalletParameters + return ret + } + return *o.Ewallet +} + +// GetEwalletOk returns a tuple with the Ewallet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetEwalletOk() (*EWalletParameters, bool) { + if o == nil || utils.IsNil(o.Ewallet) { + return nil, false + } + return o.Ewallet, true +} + +// HasEwallet returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasEwallet() bool { + if o != nil && !utils.IsNil(o.Ewallet) { + return true + } + + return false +} + +// SetEwallet gets a reference to the given EWalletParameters and assigns it to the Ewallet field. +func (o *PaymentMethodParameters) SetEwallet(v EWalletParameters) { + o.Ewallet = &v +} + +// GetOverTheCounter returns the OverTheCounter field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetOverTheCounter() OverTheCounterParameters { + if o == nil || utils.IsNil(o.OverTheCounter) { + var ret OverTheCounterParameters + return ret + } + return *o.OverTheCounter +} + +// GetOverTheCounterOk returns a tuple with the OverTheCounter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetOverTheCounterOk() (*OverTheCounterParameters, bool) { + if o == nil || utils.IsNil(o.OverTheCounter) { + return nil, false + } + return o.OverTheCounter, true +} + +// HasOverTheCounter returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasOverTheCounter() bool { + if o != nil && !utils.IsNil(o.OverTheCounter) { + return true + } + + return false +} + +// SetOverTheCounter gets a reference to the given OverTheCounterParameters and assigns it to the OverTheCounter field. +func (o *PaymentMethodParameters) SetOverTheCounter(v OverTheCounterParameters) { + o.OverTheCounter = &v +} + +// GetVirtualAccount returns the VirtualAccount field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetVirtualAccount() VirtualAccountParameters { + if o == nil || utils.IsNil(o.VirtualAccount) { + var ret VirtualAccountParameters + return ret + } + return *o.VirtualAccount +} + +// GetVirtualAccountOk returns a tuple with the VirtualAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetVirtualAccountOk() (*VirtualAccountParameters, bool) { + if o == nil || utils.IsNil(o.VirtualAccount) { + return nil, false + } + return o.VirtualAccount, true +} + +// HasVirtualAccount returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasVirtualAccount() bool { + if o != nil && !utils.IsNil(o.VirtualAccount) { + return true + } + + return false +} + +// SetVirtualAccount gets a reference to the given VirtualAccountParameters and assigns it to the VirtualAccount field. +func (o *PaymentMethodParameters) SetVirtualAccount(v VirtualAccountParameters) { + o.VirtualAccount = &v +} + +// GetQrCode returns the QrCode field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetQrCode() QRCodeParameters { + if o == nil || utils.IsNil(o.QrCode) { + var ret QRCodeParameters + return ret + } + return *o.QrCode +} + +// GetQrCodeOk returns a tuple with the QrCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetQrCodeOk() (*QRCodeParameters, bool) { + if o == nil || utils.IsNil(o.QrCode) { + return nil, false + } + return o.QrCode, true +} + +// HasQrCode returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasQrCode() bool { + if o != nil && !utils.IsNil(o.QrCode) { + return true + } + + return false +} + +// SetQrCode gets a reference to the given QRCodeParameters and assigns it to the QrCode field. +func (o *PaymentMethodParameters) SetQrCode(v QRCodeParameters) { + o.QrCode = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentMethodParameters) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetBillingInformation returns the BillingInformation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetBillingInformation() BillingInformation { + if o == nil || utils.IsNil(o.BillingInformation.Get()) { + var ret BillingInformation + return ret + } + return *o.BillingInformation.Get() +} + +// GetBillingInformationOk returns a tuple with the BillingInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetBillingInformationOk() (*BillingInformation, bool) { + if o == nil { + return nil, false + } + return o.BillingInformation.Get(), o.BillingInformation.IsSet() +} + +// HasBillingInformation returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasBillingInformation() bool { + if o != nil && o.BillingInformation.IsSet() { + return true + } + + return false +} + +// SetBillingInformation gets a reference to the given NullableBillingInformation and assigns it to the BillingInformation field. +func (o *PaymentMethodParameters) SetBillingInformation(v BillingInformation) { + o.BillingInformation.Set(&v) +} +// SetBillingInformationNil sets the value for BillingInformation to be an explicit nil +func (o *PaymentMethodParameters) SetBillingInformationNil() { + o.BillingInformation.Set(nil) +} + +// UnsetBillingInformation ensures that no value is present for BillingInformation, not even an explicit nil +func (o *PaymentMethodParameters) UnsetBillingInformation() { + o.BillingInformation.Unset() +} + +func (o PaymentMethodParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if o.Country.IsSet() { + toSerialize["country"] = o.Country.Get() + } + toSerialize["reusability"] = o.Reusability + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !utils.IsNil(o.Card) { + toSerialize["card"] = o.Card + } + if !utils.IsNil(o.DirectDebit) { + toSerialize["direct_debit"] = o.DirectDebit + } + if !utils.IsNil(o.Ewallet) { + toSerialize["ewallet"] = o.Ewallet + } + if !utils.IsNil(o.OverTheCounter) { + toSerialize["over_the_counter"] = o.OverTheCounter + } + if !utils.IsNil(o.VirtualAccount) { + toSerialize["virtual_account"] = o.VirtualAccount + } + if !utils.IsNil(o.QrCode) { + toSerialize["qr_code"] = o.QrCode + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.BillingInformation.IsSet() { + toSerialize["billing_information"] = o.BillingInformation.Get() + } + return toSerialize, nil +} + +type NullablePaymentMethodParameters struct { + value *PaymentMethodParameters + isSet bool +} + +func (v NullablePaymentMethodParameters) Get() *PaymentMethodParameters { + return v.value +} + +func (v *NullablePaymentMethodParameters) Set(val *PaymentMethodParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodParameters(val *PaymentMethodParameters) *NullablePaymentMethodParameters { + return &NullablePaymentMethodParameters{value: val, isSet: true} +} + +func (v NullablePaymentMethodParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_reusability.go b/payment_method/model_payment_method_reusability.go new file mode 100644 index 00000000..d4d520d8 --- /dev/null +++ b/payment_method/model_payment_method_reusability.go @@ -0,0 +1,115 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodReusability the model 'PaymentMethodReusability' +type PaymentMethodReusability string + +// List of PaymentMethodReusability +const ( + PAYMENTMETHODREUSABILITY_MULTIPLE_USE PaymentMethodReusability = "MULTIPLE_USE" + PAYMENTMETHODREUSABILITY_ONE_TIME_USE PaymentMethodReusability = "ONE_TIME_USE" +) + +// All allowed values of PaymentMethodReusability enum +var AllowedPaymentMethodReusabilityEnumValues = []PaymentMethodReusability{ + "MULTIPLE_USE", + "ONE_TIME_USE", +} + +func (v *PaymentMethodReusability) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodReusability(value) + for _, existing := range AllowedPaymentMethodReusabilityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodReusability", value) +} + +// NewPaymentMethodReusabilityFromValue returns a pointer to a valid PaymentMethodReusability +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodReusabilityFromValue(v string) (*PaymentMethodReusability, error) { + ev := PaymentMethodReusability(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodReusability: valid values are %v", v, AllowedPaymentMethodReusabilityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodReusability) IsValid() bool { + for _, existing := range AllowedPaymentMethodReusabilityEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodReusability) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodReusability value +func (v PaymentMethodReusability) Ptr() *PaymentMethodReusability { + return &v +} + +type NullablePaymentMethodReusability struct { + value *PaymentMethodReusability + isSet bool +} + +func (v NullablePaymentMethodReusability) Get() *PaymentMethodReusability { + return v.value +} + +func (v *NullablePaymentMethodReusability) Set(val *PaymentMethodReusability) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodReusability) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodReusability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodReusability(val *PaymentMethodReusability) *NullablePaymentMethodReusability { + return &NullablePaymentMethodReusability{value: val, isSet: true} +} + +func (v NullablePaymentMethodReusability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodReusability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_payment_method_status.go b/payment_method/model_payment_method_status.go new file mode 100644 index 00000000..ae0bfa46 --- /dev/null +++ b/payment_method/model_payment_method_status.go @@ -0,0 +1,123 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodStatus the model 'PaymentMethodStatus' +type PaymentMethodStatus string + +// List of PaymentMethodStatus +const ( + PAYMENTMETHODSTATUS_ACTIVE PaymentMethodStatus = "ACTIVE" + PAYMENTMETHODSTATUS_EXPIRED PaymentMethodStatus = "EXPIRED" + PAYMENTMETHODSTATUS_INACTIVE PaymentMethodStatus = "INACTIVE" + PAYMENTMETHODSTATUS_PENDING PaymentMethodStatus = "PENDING" + PAYMENTMETHODSTATUS_REQUIRES_ACTION PaymentMethodStatus = "REQUIRES_ACTION" + PAYMENTMETHODSTATUS_FAILED PaymentMethodStatus = "FAILED" +) + +// All allowed values of PaymentMethodStatus enum +var AllowedPaymentMethodStatusEnumValues = []PaymentMethodStatus{ + "ACTIVE", + "EXPIRED", + "INACTIVE", + "PENDING", + "REQUIRES_ACTION", + "FAILED", +} + +func (v *PaymentMethodStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodStatus(value) + for _, existing := range AllowedPaymentMethodStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodStatus", value) +} + +// NewPaymentMethodStatusFromValue returns a pointer to a valid PaymentMethodStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodStatusFromValue(v string) (*PaymentMethodStatus, error) { + ev := PaymentMethodStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodStatus: valid values are %v", v, AllowedPaymentMethodStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodStatus) IsValid() bool { + for _, existing := range AllowedPaymentMethodStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodStatus) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodStatus value +func (v PaymentMethodStatus) Ptr() *PaymentMethodStatus { + return &v +} + +type NullablePaymentMethodStatus struct { + value *PaymentMethodStatus + isSet bool +} + +func (v NullablePaymentMethodStatus) Get() *PaymentMethodStatus { + return v.value +} + +func (v *NullablePaymentMethodStatus) Set(val *PaymentMethodStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodStatus(val *PaymentMethodStatus) *NullablePaymentMethodStatus { + return &NullablePaymentMethodStatus{value: val, isSet: true} +} + +func (v NullablePaymentMethodStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_payment_method_type.go b/payment_method/model_payment_method_type.go new file mode 100644 index 00000000..f31b4c6f --- /dev/null +++ b/payment_method/model_payment_method_type.go @@ -0,0 +1,127 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodType the model 'PaymentMethodType' +type PaymentMethodType string + +// List of PaymentMethodType +const ( + PAYMENTMETHODTYPE_CARD PaymentMethodType = "CARD" + PAYMENTMETHODTYPE_CRYPTOCURRENCY PaymentMethodType = "CRYPTOCURRENCY" + PAYMENTMETHODTYPE_DIRECT_BANK_TRANSFER PaymentMethodType = "DIRECT_BANK_TRANSFER" + PAYMENTMETHODTYPE_DIRECT_DEBIT PaymentMethodType = "DIRECT_DEBIT" + PAYMENTMETHODTYPE_EWALLET PaymentMethodType = "EWALLET" + PAYMENTMETHODTYPE_OVER_THE_COUNTER PaymentMethodType = "OVER_THE_COUNTER" + PAYMENTMETHODTYPE_QR_CODE PaymentMethodType = "QR_CODE" + PAYMENTMETHODTYPE_VIRTUAL_ACCOUNT PaymentMethodType = "VIRTUAL_ACCOUNT" +) + +// All allowed values of PaymentMethodType enum +var AllowedPaymentMethodTypeEnumValues = []PaymentMethodType{ + "CARD", + "CRYPTOCURRENCY", + "DIRECT_BANK_TRANSFER", + "DIRECT_DEBIT", + "EWALLET", + "OVER_THE_COUNTER", + "QR_CODE", + "VIRTUAL_ACCOUNT", +} + +func (v *PaymentMethodType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodType(value) + for _, existing := range AllowedPaymentMethodTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodType", value) +} + +// NewPaymentMethodTypeFromValue returns a pointer to a valid PaymentMethodType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodTypeFromValue(v string) (*PaymentMethodType, error) { + ev := PaymentMethodType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodType: valid values are %v", v, AllowedPaymentMethodTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodType) IsValid() bool { + for _, existing := range AllowedPaymentMethodTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodType) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodType value +func (v PaymentMethodType) Ptr() *PaymentMethodType { + return &v +} + +type NullablePaymentMethodType struct { + value *PaymentMethodType + isSet bool +} + +func (v NullablePaymentMethodType) Get() *PaymentMethodType { + return v.value +} + +func (v *NullablePaymentMethodType) Set(val *PaymentMethodType) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodType) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodType(val *PaymentMethodType) *NullablePaymentMethodType { + return &NullablePaymentMethodType{value: val, isSet: true} +} + +func (v NullablePaymentMethodType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_payment_method_update_parameters.go b/payment_method/model_payment_method_update_parameters.go new file mode 100644 index 00000000..ca340f83 --- /dev/null +++ b/payment_method/model_payment_method_update_parameters.go @@ -0,0 +1,310 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodUpdateParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodUpdateParameters{} + +// PaymentMethodUpdateParameters struct for PaymentMethodUpdateParameters +type PaymentMethodUpdateParameters struct { + Description *string `json:"description,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + Reusability *PaymentMethodReusability `json:"reusability,omitempty"` + Status *PaymentMethodStatus `json:"status,omitempty"` + OverTheCounter *OverTheCounterUpdateParameters `json:"over_the_counter,omitempty"` + VirtualAccount *VirtualAccountUpdateParameters `json:"virtual_account,omitempty"` +} + +// NewPaymentMethodUpdateParameters instantiates a new PaymentMethodUpdateParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodUpdateParameters() *PaymentMethodUpdateParameters { + this := PaymentMethodUpdateParameters{} + return &this +} + +// NewPaymentMethodUpdateParametersWithDefaults instantiates a new PaymentMethodUpdateParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodUpdateParametersWithDefaults() *PaymentMethodUpdateParameters { + this := PaymentMethodUpdateParameters{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PaymentMethodUpdateParameters) SetDescription(v string) { + o.Description = &v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentMethodUpdateParameters) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetReusability returns the Reusability field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetReusability() PaymentMethodReusability { + if o == nil || utils.IsNil(o.Reusability) { + var ret PaymentMethodReusability + return ret + } + return *o.Reusability +} + +// GetReusabilityOk returns a tuple with the Reusability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetReusabilityOk() (*PaymentMethodReusability, bool) { + if o == nil || utils.IsNil(o.Reusability) { + return nil, false + } + return o.Reusability, true +} + +// HasReusability returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasReusability() bool { + if o != nil && !utils.IsNil(o.Reusability) { + return true + } + + return false +} + +// SetReusability gets a reference to the given PaymentMethodReusability and assigns it to the Reusability field. +func (o *PaymentMethodUpdateParameters) SetReusability(v PaymentMethodReusability) { + o.Reusability = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetStatus() PaymentMethodStatus { + if o == nil || utils.IsNil(o.Status) { + var ret PaymentMethodStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetStatusOk() (*PaymentMethodStatus, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given PaymentMethodStatus and assigns it to the Status field. +func (o *PaymentMethodUpdateParameters) SetStatus(v PaymentMethodStatus) { + o.Status = &v +} + +// GetOverTheCounter returns the OverTheCounter field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetOverTheCounter() OverTheCounterUpdateParameters { + if o == nil || utils.IsNil(o.OverTheCounter) { + var ret OverTheCounterUpdateParameters + return ret + } + return *o.OverTheCounter +} + +// GetOverTheCounterOk returns a tuple with the OverTheCounter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetOverTheCounterOk() (*OverTheCounterUpdateParameters, bool) { + if o == nil || utils.IsNil(o.OverTheCounter) { + return nil, false + } + return o.OverTheCounter, true +} + +// HasOverTheCounter returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasOverTheCounter() bool { + if o != nil && !utils.IsNil(o.OverTheCounter) { + return true + } + + return false +} + +// SetOverTheCounter gets a reference to the given OverTheCounterUpdateParameters and assigns it to the OverTheCounter field. +func (o *PaymentMethodUpdateParameters) SetOverTheCounter(v OverTheCounterUpdateParameters) { + o.OverTheCounter = &v +} + +// GetVirtualAccount returns the VirtualAccount field value if set, zero value otherwise. +func (o *PaymentMethodUpdateParameters) GetVirtualAccount() VirtualAccountUpdateParameters { + if o == nil || utils.IsNil(o.VirtualAccount) { + var ret VirtualAccountUpdateParameters + return ret + } + return *o.VirtualAccount +} + +// GetVirtualAccountOk returns a tuple with the VirtualAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateParameters) GetVirtualAccountOk() (*VirtualAccountUpdateParameters, bool) { + if o == nil || utils.IsNil(o.VirtualAccount) { + return nil, false + } + return o.VirtualAccount, true +} + +// HasVirtualAccount returns a boolean if a field has been set. +func (o *PaymentMethodUpdateParameters) HasVirtualAccount() bool { + if o != nil && !utils.IsNil(o.VirtualAccount) { + return true + } + + return false +} + +// SetVirtualAccount gets a reference to the given VirtualAccountUpdateParameters and assigns it to the VirtualAccount field. +func (o *PaymentMethodUpdateParameters) SetVirtualAccount(v VirtualAccountUpdateParameters) { + o.VirtualAccount = &v +} + +func (o PaymentMethodUpdateParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodUpdateParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.Reusability) { + toSerialize["reusability"] = o.Reusability + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !utils.IsNil(o.OverTheCounter) { + toSerialize["over_the_counter"] = o.OverTheCounter + } + if !utils.IsNil(o.VirtualAccount) { + toSerialize["virtual_account"] = o.VirtualAccount + } + return toSerialize, nil +} + +type NullablePaymentMethodUpdateParameters struct { + value *PaymentMethodUpdateParameters + isSet bool +} + +func (v NullablePaymentMethodUpdateParameters) Get() *PaymentMethodUpdateParameters { + return v.value +} + +func (v *NullablePaymentMethodUpdateParameters) Set(val *PaymentMethodUpdateParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodUpdateParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodUpdateParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodUpdateParameters(val *PaymentMethodUpdateParameters) *NullablePaymentMethodUpdateParameters { + return &NullablePaymentMethodUpdateParameters{value: val, isSet: true} +} + +func (v NullablePaymentMethodUpdateParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodUpdateParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_qr_code.go b/payment_method/model_qr_code.go new file mode 100644 index 00000000..05c2ef3a --- /dev/null +++ b/payment_method/model_qr_code.go @@ -0,0 +1,268 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the QRCode type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCode{} + +// QRCode QR Code Payment Method Details +type QRCode struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode NullableQRCodeChannelCode `json:"channel_code,omitempty"` + ChannelProperties NullableQRCodeChannelProperties `json:"channel_properties,omitempty"` +} + +// NewQRCode instantiates a new QRCode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCode() *QRCode { + this := QRCode{} + return &this +} + +// NewQRCodeWithDefaults instantiates a new QRCode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeWithDefaults() *QRCode { + this := QRCode{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCode) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCode) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *QRCode) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *QRCode) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *QRCode) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *QRCode) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *QRCode) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCode) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *QRCode) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *QRCode) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCode) GetChannelCode() QRCodeChannelCode { + if o == nil || utils.IsNil(o.ChannelCode.Get()) { + var ret QRCodeChannelCode + return ret + } + return *o.ChannelCode.Get() +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCode) GetChannelCodeOk() (*QRCodeChannelCode, bool) { + if o == nil { + return nil, false + } + return o.ChannelCode.Get(), o.ChannelCode.IsSet() +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *QRCode) HasChannelCode() bool { + if o != nil && o.ChannelCode.IsSet() { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given NullableQRCodeChannelCode and assigns it to the ChannelCode field. +func (o *QRCode) SetChannelCode(v QRCodeChannelCode) { + o.ChannelCode.Set(&v) +} +// SetChannelCodeNil sets the value for ChannelCode to be an explicit nil +func (o *QRCode) SetChannelCodeNil() { + o.ChannelCode.Set(nil) +} + +// UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +func (o *QRCode) UnsetChannelCode() { + o.ChannelCode.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCode) GetChannelProperties() QRCodeChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties.Get()) { + var ret QRCodeChannelProperties + return ret + } + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCode) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *QRCode) HasChannelProperties() bool { + if o != nil && o.ChannelProperties.IsSet() { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given NullableQRCodeChannelProperties and assigns it to the ChannelProperties field. +func (o *QRCode) SetChannelProperties(v QRCodeChannelProperties) { + o.ChannelProperties.Set(&v) +} +// SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil +func (o *QRCode) SetChannelPropertiesNil() { + o.ChannelProperties.Set(nil) +} + +// UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +func (o *QRCode) UnsetChannelProperties() { + o.ChannelProperties.Unset() +} + +func (o QRCode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if o.ChannelCode.IsSet() { + toSerialize["channel_code"] = o.ChannelCode.Get() + } + if o.ChannelProperties.IsSet() { + toSerialize["channel_properties"] = o.ChannelProperties.Get() + } + return toSerialize, nil +} + +type NullableQRCode struct { + value *QRCode + isSet bool +} + +func (v NullableQRCode) Get() *QRCode { + return v.value +} + +func (v *NullableQRCode) Set(val *QRCode) { + v.value = val + v.isSet = true +} + +func (v NullableQRCode) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCode(val *QRCode) *NullableQRCode { + return &NullableQRCode{value: val, isSet: true} +} + +func (v NullableQRCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_qr_code_channel_code.go b/payment_method/model_qr_code_channel_code.go new file mode 100644 index 00000000..24f9e3aa --- /dev/null +++ b/payment_method/model_qr_code_channel_code.go @@ -0,0 +1,121 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// QRCodeChannelCode QR Code Channel Code +type QRCodeChannelCode string + +// List of QRCodeChannelCode +const ( + QRCODECHANNELCODE_QRIS QRCodeChannelCode = "QRIS" + QRCODECHANNELCODE_DANA QRCodeChannelCode = "DANA" + QRCODECHANNELCODE_RCBC QRCodeChannelCode = "RCBC" + QRCODECHANNELCODE_PROMPTPAY QRCodeChannelCode = "PROMPTPAY" + QRCODECHANNELCODE_LINKAJA QRCodeChannelCode = "LINKAJA" +) + +// All allowed values of QRCodeChannelCode enum +var AllowedQRCodeChannelCodeEnumValues = []QRCodeChannelCode{ + "QRIS", + "DANA", + "RCBC", + "PROMPTPAY", + "LINKAJA", +} + +func (v *QRCodeChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := QRCodeChannelCode(value) + for _, existing := range AllowedQRCodeChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid QRCodeChannelCode", value) +} + +// NewQRCodeChannelCodeFromValue returns a pointer to a valid QRCodeChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewQRCodeChannelCodeFromValue(v string) (*QRCodeChannelCode, error) { + ev := QRCodeChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for QRCodeChannelCode: valid values are %v", v, AllowedQRCodeChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v QRCodeChannelCode) IsValid() bool { + for _, existing := range AllowedQRCodeChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v QRCodeChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to QRCodeChannelCode value +func (v QRCodeChannelCode) Ptr() *QRCodeChannelCode { + return &v +} + +type NullableQRCodeChannelCode struct { + value *QRCodeChannelCode + isSet bool +} + +func (v NullableQRCodeChannelCode) Get() *QRCodeChannelCode { + return v.value +} + +func (v *NullableQRCodeChannelCode) Set(val *QRCodeChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeChannelCode(val *QRCodeChannelCode) *NullableQRCodeChannelCode { + return &NullableQRCodeChannelCode{value: val, isSet: true} +} + +func (v NullableQRCodeChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_qr_code_channel_properties.go b/payment_method/model_qr_code_channel_properties.go new file mode 100644 index 00000000..e09aec5b --- /dev/null +++ b/payment_method/model_qr_code_channel_properties.go @@ -0,0 +1,168 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the QRCodeChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCodeChannelProperties{} + +// QRCodeChannelProperties QR Code Channel Properties +type QRCodeChannelProperties struct { + // QR string to be rendered for display to end users. QR string to image rendering are commonly available in software libraries (e.g Nodejs, PHP, Java) + QrString *string `json:"qr_string,omitempty"` + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +// NewQRCodeChannelProperties instantiates a new QRCodeChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCodeChannelProperties() *QRCodeChannelProperties { + this := QRCodeChannelProperties{} + return &this +} + +// NewQRCodeChannelPropertiesWithDefaults instantiates a new QRCodeChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeChannelPropertiesWithDefaults() *QRCodeChannelProperties { + this := QRCodeChannelProperties{} + return &this +} + +// GetQrString returns the QrString field value if set, zero value otherwise. +func (o *QRCodeChannelProperties) GetQrString() string { + if o == nil || utils.IsNil(o.QrString) { + var ret string + return ret + } + return *o.QrString +} + +// GetQrStringOk returns a tuple with the QrString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeChannelProperties) GetQrStringOk() (*string, bool) { + if o == nil || utils.IsNil(o.QrString) { + return nil, false + } + return o.QrString, true +} + +// HasQrString returns a boolean if a field has been set. +func (o *QRCodeChannelProperties) HasQrString() bool { + if o != nil && !utils.IsNil(o.QrString) { + return true + } + + return false +} + +// SetQrString gets a reference to the given string and assigns it to the QrString field. +func (o *QRCodeChannelProperties) SetQrString(v string) { + o.QrString = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *QRCodeChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *QRCodeChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *QRCodeChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +func (o QRCodeChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCodeChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.QrString) { + toSerialize["qr_string"] = o.QrString + } + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + return toSerialize, nil +} + +type NullableQRCodeChannelProperties struct { + value *QRCodeChannelProperties + isSet bool +} + +func (v NullableQRCodeChannelProperties) Get() *QRCodeChannelProperties { + return v.value +} + +func (v *NullableQRCodeChannelProperties) Set(val *QRCodeChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeChannelProperties(val *QRCodeChannelProperties) *NullableQRCodeChannelProperties { + return &NullableQRCodeChannelProperties{value: val, isSet: true} +} + +func (v NullableQRCodeChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_qr_code_parameters.go b/payment_method/model_qr_code_parameters.go new file mode 100644 index 00000000..e34a1a9b --- /dev/null +++ b/payment_method/model_qr_code_parameters.go @@ -0,0 +1,268 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the QRCodeParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCodeParameters{} + +// QRCodeParameters struct for QRCodeParameters +type QRCodeParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode NullableQRCodeChannelCode `json:"channel_code,omitempty"` + ChannelProperties NullableQRCodeChannelProperties `json:"channel_properties,omitempty"` +} + +// NewQRCodeParameters instantiates a new QRCodeParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCodeParameters() *QRCodeParameters { + this := QRCodeParameters{} + return &this +} + +// NewQRCodeParametersWithDefaults instantiates a new QRCodeParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeParametersWithDefaults() *QRCodeParameters { + this := QRCodeParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCodeParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCodeParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *QRCodeParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *QRCodeParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *QRCodeParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *QRCodeParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *QRCodeParameters) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeParameters) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *QRCodeParameters) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *QRCodeParameters) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCodeParameters) GetChannelCode() QRCodeChannelCode { + if o == nil || utils.IsNil(o.ChannelCode.Get()) { + var ret QRCodeChannelCode + return ret + } + return *o.ChannelCode.Get() +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCodeParameters) GetChannelCodeOk() (*QRCodeChannelCode, bool) { + if o == nil { + return nil, false + } + return o.ChannelCode.Get(), o.ChannelCode.IsSet() +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *QRCodeParameters) HasChannelCode() bool { + if o != nil && o.ChannelCode.IsSet() { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given NullableQRCodeChannelCode and assigns it to the ChannelCode field. +func (o *QRCodeParameters) SetChannelCode(v QRCodeChannelCode) { + o.ChannelCode.Set(&v) +} +// SetChannelCodeNil sets the value for ChannelCode to be an explicit nil +func (o *QRCodeParameters) SetChannelCodeNil() { + o.ChannelCode.Set(nil) +} + +// UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +func (o *QRCodeParameters) UnsetChannelCode() { + o.ChannelCode.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCodeParameters) GetChannelProperties() QRCodeChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties.Get()) { + var ret QRCodeChannelProperties + return ret + } + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCodeParameters) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *QRCodeParameters) HasChannelProperties() bool { + if o != nil && o.ChannelProperties.IsSet() { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given NullableQRCodeChannelProperties and assigns it to the ChannelProperties field. +func (o *QRCodeParameters) SetChannelProperties(v QRCodeChannelProperties) { + o.ChannelProperties.Set(&v) +} +// SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil +func (o *QRCodeParameters) SetChannelPropertiesNil() { + o.ChannelProperties.Set(nil) +} + +// UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +func (o *QRCodeParameters) UnsetChannelProperties() { + o.ChannelProperties.Unset() +} + +func (o QRCodeParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCodeParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if o.ChannelCode.IsSet() { + toSerialize["channel_code"] = o.ChannelCode.Get() + } + if o.ChannelProperties.IsSet() { + toSerialize["channel_properties"] = o.ChannelProperties.Get() + } + return toSerialize, nil +} + +type NullableQRCodeParameters struct { + value *QRCodeParameters + isSet bool +} + +func (v NullableQRCodeParameters) Get() *QRCodeParameters { + return v.value +} + +func (v *NullableQRCodeParameters) Set(val *QRCodeParameters) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeParameters(val *QRCodeParameters) *NullableQRCodeParameters { + return &NullableQRCodeParameters{value: val, isSet: true} +} + +func (v NullableQRCodeParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_simulate_payment_request.go b/payment_method/model_simulate_payment_request.go new file mode 100644 index 00000000..4547dcd1 --- /dev/null +++ b/payment_method/model_simulate_payment_request.go @@ -0,0 +1,130 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the SimulatePaymentRequest type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &SimulatePaymentRequest{} + +// SimulatePaymentRequest struct for SimulatePaymentRequest +type SimulatePaymentRequest struct { + Amount *float64 `json:"amount,omitempty"` +} + +// NewSimulatePaymentRequest instantiates a new SimulatePaymentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSimulatePaymentRequest() *SimulatePaymentRequest { + this := SimulatePaymentRequest{} + return &this +} + +// NewSimulatePaymentRequestWithDefaults instantiates a new SimulatePaymentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSimulatePaymentRequestWithDefaults() *SimulatePaymentRequest { + this := SimulatePaymentRequest{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *SimulatePaymentRequest) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount) { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SimulatePaymentRequest) GetAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *SimulatePaymentRequest) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *SimulatePaymentRequest) SetAmount(v float64) { + o.Amount = &v +} + +func (o SimulatePaymentRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SimulatePaymentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + return toSerialize, nil +} + +type NullableSimulatePaymentRequest struct { + value *SimulatePaymentRequest + isSet bool +} + +func (v NullableSimulatePaymentRequest) Get() *SimulatePaymentRequest { + return v.value +} + +func (v *NullableSimulatePaymentRequest) Set(val *SimulatePaymentRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSimulatePaymentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSimulatePaymentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSimulatePaymentRequest(val *SimulatePaymentRequest) *NullableSimulatePaymentRequest { + return &NullableSimulatePaymentRequest{value: val, isSet: true} +} + +func (v NullableSimulatePaymentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSimulatePaymentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_tokenized_card_information.go b/payment_method/model_tokenized_card_information.go new file mode 100644 index 00000000..59904e1e --- /dev/null +++ b/payment_method/model_tokenized_card_information.go @@ -0,0 +1,392 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the TokenizedCardInformation type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &TokenizedCardInformation{} + +// TokenizedCardInformation Tokenized Card Information +type TokenizedCardInformation struct { + TokenId string `json:"token_id"` + // 1st 6 and last 4 digits of the card + MaskedCardNumber string `json:"masked_card_number"` + // Cardholder name is optional but recommended for 3DS 2 / AVS verification + CardholderName NullableString `json:"cardholder_name,omitempty"` + // Card expiry month in MM format + ExpiryMonth string `json:"expiry_month"` + // Card expiry month in YY format + ExpiryYear string `json:"expiry_year"` + // Xendit-generated identifier for the unique card number. Multiple payment method objects can be created for the same account - e.g. if the user first creates a one-time payment request, and then later on creates a multiple-use payment method using the same account. The fingerprint helps to identify the unique account being used. + Fingerprint string `json:"fingerprint"` + // Whether the card is a credit or debit card + Type string `json:"type"` + // Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA + Network string `json:"network"` + // Country where the card was issued ISO 3166-1 Alpha-2 + Country string `json:"country"` + // Issuer of the card, most often an issuing bank For example, “BCA”, “MANDIRI” + Issuer string `json:"issuer"` +} + +// NewTokenizedCardInformation instantiates a new TokenizedCardInformation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenizedCardInformation(tokenId string, maskedCardNumber string, expiryMonth string, expiryYear string, fingerprint string, type_ string, network string, country string, issuer string) *TokenizedCardInformation { + this := TokenizedCardInformation{} + this.TokenId = tokenId + this.MaskedCardNumber = maskedCardNumber + this.ExpiryMonth = expiryMonth + this.ExpiryYear = expiryYear + this.Fingerprint = fingerprint + this.Type = type_ + this.Network = network + this.Country = country + this.Issuer = issuer + return &this +} + +// NewTokenizedCardInformationWithDefaults instantiates a new TokenizedCardInformation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenizedCardInformationWithDefaults() *TokenizedCardInformation { + this := TokenizedCardInformation{} + return &this +} + +// GetTokenId returns the TokenId field value +func (o *TokenizedCardInformation) GetTokenId() string { + if o == nil { + var ret string + return ret + } + + return o.TokenId +} + +// GetTokenIdOk returns a tuple with the TokenId field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetTokenIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenId, true +} + +// SetTokenId sets field value +func (o *TokenizedCardInformation) SetTokenId(v string) { + o.TokenId = v +} + +// GetMaskedCardNumber returns the MaskedCardNumber field value +func (o *TokenizedCardInformation) GetMaskedCardNumber() string { + if o == nil { + var ret string + return ret + } + + return o.MaskedCardNumber +} + +// GetMaskedCardNumberOk returns a tuple with the MaskedCardNumber field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetMaskedCardNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MaskedCardNumber, true +} + +// SetMaskedCardNumber sets field value +func (o *TokenizedCardInformation) SetMaskedCardNumber(v string) { + o.MaskedCardNumber = v +} + +// GetCardholderName returns the CardholderName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenizedCardInformation) GetCardholderName() string { + if o == nil || utils.IsNil(o.CardholderName.Get()) { + var ret string + return ret + } + return *o.CardholderName.Get() +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenizedCardInformation) GetCardholderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardholderName.Get(), o.CardholderName.IsSet() +} + +// HasCardholderName returns a boolean if a field has been set. +func (o *TokenizedCardInformation) HasCardholderName() bool { + if o != nil && o.CardholderName.IsSet() { + return true + } + + return false +} + +// SetCardholderName gets a reference to the given NullableString and assigns it to the CardholderName field. +func (o *TokenizedCardInformation) SetCardholderName(v string) { + o.CardholderName.Set(&v) +} +// SetCardholderNameNil sets the value for CardholderName to be an explicit nil +func (o *TokenizedCardInformation) SetCardholderNameNil() { + o.CardholderName.Set(nil) +} + +// UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +func (o *TokenizedCardInformation) UnsetCardholderName() { + o.CardholderName.Unset() +} + +// GetExpiryMonth returns the ExpiryMonth field value +func (o *TokenizedCardInformation) GetExpiryMonth() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryMonth +} + +// GetExpiryMonthOk returns a tuple with the ExpiryMonth field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetExpiryMonthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryMonth, true +} + +// SetExpiryMonth sets field value +func (o *TokenizedCardInformation) SetExpiryMonth(v string) { + o.ExpiryMonth = v +} + +// GetExpiryYear returns the ExpiryYear field value +func (o *TokenizedCardInformation) GetExpiryYear() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryYear +} + +// GetExpiryYearOk returns a tuple with the ExpiryYear field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetExpiryYearOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryYear, true +} + +// SetExpiryYear sets field value +func (o *TokenizedCardInformation) SetExpiryYear(v string) { + o.ExpiryYear = v +} + +// GetFingerprint returns the Fingerprint field value +func (o *TokenizedCardInformation) GetFingerprint() string { + if o == nil { + var ret string + return ret + } + + return o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetFingerprintOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Fingerprint, true +} + +// SetFingerprint sets field value +func (o *TokenizedCardInformation) SetFingerprint(v string) { + o.Fingerprint = v +} + +// GetType returns the Type field value +func (o *TokenizedCardInformation) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *TokenizedCardInformation) SetType(v string) { + o.Type = v +} + +// GetNetwork returns the Network field value +func (o *TokenizedCardInformation) GetNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *TokenizedCardInformation) SetNetwork(v string) { + o.Network = v +} + +// GetCountry returns the Country field value +func (o *TokenizedCardInformation) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *TokenizedCardInformation) SetCountry(v string) { + o.Country = v +} + +// GetIssuer returns the Issuer field value +func (o *TokenizedCardInformation) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *TokenizedCardInformation) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *TokenizedCardInformation) SetIssuer(v string) { + o.Issuer = v +} + +func (o TokenizedCardInformation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenizedCardInformation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token_id"] = o.TokenId + toSerialize["masked_card_number"] = o.MaskedCardNumber + if o.CardholderName.IsSet() { + toSerialize["cardholder_name"] = o.CardholderName.Get() + } + toSerialize["expiry_month"] = o.ExpiryMonth + toSerialize["expiry_year"] = o.ExpiryYear + toSerialize["fingerprint"] = o.Fingerprint + toSerialize["type"] = o.Type + toSerialize["network"] = o.Network + toSerialize["country"] = o.Country + toSerialize["issuer"] = o.Issuer + return toSerialize, nil +} + +type NullableTokenizedCardInformation struct { + value *TokenizedCardInformation + isSet bool +} + +func (v NullableTokenizedCardInformation) Get() *TokenizedCardInformation { + return v.value +} + +func (v *NullableTokenizedCardInformation) Set(val *TokenizedCardInformation) { + v.value = val + v.isSet = true +} + +func (v NullableTokenizedCardInformation) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenizedCardInformation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenizedCardInformation(val *TokenizedCardInformation) *NullableTokenizedCardInformation { + return &NullableTokenizedCardInformation{value: val, isSet: true} +} + +func (v NullableTokenizedCardInformation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenizedCardInformation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account.go b/payment_method/model_virtual_account.go new file mode 100644 index 00000000..4097997a --- /dev/null +++ b/payment_method/model_virtual_account.go @@ -0,0 +1,395 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccount{} + +// VirtualAccount Virtual Account Payment Method Details +type VirtualAccount struct { + Amount NullableFloat64 `json:"amount,omitempty"` + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode VirtualAccountChannelCode `json:"channel_code"` + ChannelProperties VirtualAccountChannelProperties `json:"channel_properties"` + // For payments in Vietnam only, alternative display requested for the virtual account + AlternativeDisplayTypes []string `json:"alternative_display_types,omitempty"` + AlternativeDisplays []VirtualAccountAlternativeDisplay `json:"alternative_displays,omitempty"` +} + +// NewVirtualAccount instantiates a new VirtualAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccount(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties) *VirtualAccount { + this := VirtualAccount{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewVirtualAccountWithDefaults instantiates a new VirtualAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountWithDefaults() *VirtualAccount { + this := VirtualAccount{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *VirtualAccount) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *VirtualAccount) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *VirtualAccount) UnsetAmount() { + o.Amount.Unset() +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *VirtualAccount) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *VirtualAccount) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *VirtualAccount) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *VirtualAccount) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *VirtualAccount) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *VirtualAccount) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *VirtualAccount) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *VirtualAccount) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *VirtualAccount) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *VirtualAccount) GetChannelCode() VirtualAccountChannelCode { + if o == nil { + var ret VirtualAccountChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetChannelCodeOk() (*VirtualAccountChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *VirtualAccount) SetChannelCode(v VirtualAccountChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *VirtualAccount) GetChannelProperties() VirtualAccountChannelProperties { + if o == nil { + var ret VirtualAccountChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *VirtualAccount) SetChannelProperties(v VirtualAccountChannelProperties) { + o.ChannelProperties = v +} + +// GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field value if set, zero value otherwise. +func (o *VirtualAccount) GetAlternativeDisplayTypes() []string { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + var ret []string + return ret + } + return o.AlternativeDisplayTypes +} + +// GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetAlternativeDisplayTypesOk() ([]string, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + return nil, false + } + return o.AlternativeDisplayTypes, true +} + +// HasAlternativeDisplayTypes returns a boolean if a field has been set. +func (o *VirtualAccount) HasAlternativeDisplayTypes() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplayTypes) { + return true + } + + return false +} + +// SetAlternativeDisplayTypes gets a reference to the given []string and assigns it to the AlternativeDisplayTypes field. +func (o *VirtualAccount) SetAlternativeDisplayTypes(v []string) { + o.AlternativeDisplayTypes = v +} + +// GetAlternativeDisplays returns the AlternativeDisplays field value if set, zero value otherwise. +func (o *VirtualAccount) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + var ret []VirtualAccountAlternativeDisplay + return ret + } + return o.AlternativeDisplays +} + +// GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetAlternativeDisplaysOk() ([]VirtualAccountAlternativeDisplay, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + return nil, false + } + return o.AlternativeDisplays, true +} + +// HasAlternativeDisplays returns a boolean if a field has been set. +func (o *VirtualAccount) HasAlternativeDisplays() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplays) { + return true + } + + return false +} + +// SetAlternativeDisplays gets a reference to the given []VirtualAccountAlternativeDisplay and assigns it to the AlternativeDisplays field. +func (o *VirtualAccount) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay) { + o.AlternativeDisplays = v +} + +func (o VirtualAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + if !utils.IsNil(o.AlternativeDisplayTypes) { + toSerialize["alternative_display_types"] = o.AlternativeDisplayTypes + } + if !utils.IsNil(o.AlternativeDisplays) { + toSerialize["alternative_displays"] = o.AlternativeDisplays + } + return toSerialize, nil +} + +type NullableVirtualAccount struct { + value *VirtualAccount + isSet bool +} + +func (v NullableVirtualAccount) Get() *VirtualAccount { + return v.value +} + +func (v *NullableVirtualAccount) Set(val *VirtualAccount) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccount(val *VirtualAccount) *NullableVirtualAccount { + return &NullableVirtualAccount{value: val, isSet: true} +} + +func (v NullableVirtualAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_all_of.go b/payment_method/model_virtual_account_all_of.go new file mode 100644 index 00000000..a7e18178 --- /dev/null +++ b/payment_method/model_virtual_account_all_of.go @@ -0,0 +1,130 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountAllOf{} + +// VirtualAccountAllOf struct for VirtualAccountAllOf +type VirtualAccountAllOf struct { + AlternativeDisplays []VirtualAccountAlternativeDisplay `json:"alternative_displays,omitempty"` +} + +// NewVirtualAccountAllOf instantiates a new VirtualAccountAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountAllOf() *VirtualAccountAllOf { + this := VirtualAccountAllOf{} + return &this +} + +// NewVirtualAccountAllOfWithDefaults instantiates a new VirtualAccountAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountAllOfWithDefaults() *VirtualAccountAllOf { + this := VirtualAccountAllOf{} + return &this +} + +// GetAlternativeDisplays returns the AlternativeDisplays field value if set, zero value otherwise. +func (o *VirtualAccountAllOf) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + var ret []VirtualAccountAlternativeDisplay + return ret + } + return o.AlternativeDisplays +} + +// GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAllOf) GetAlternativeDisplaysOk() ([]VirtualAccountAlternativeDisplay, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + return nil, false + } + return o.AlternativeDisplays, true +} + +// HasAlternativeDisplays returns a boolean if a field has been set. +func (o *VirtualAccountAllOf) HasAlternativeDisplays() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplays) { + return true + } + + return false +} + +// SetAlternativeDisplays gets a reference to the given []VirtualAccountAlternativeDisplay and assigns it to the AlternativeDisplays field. +func (o *VirtualAccountAllOf) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay) { + o.AlternativeDisplays = v +} + +func (o VirtualAccountAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.AlternativeDisplays) { + toSerialize["alternative_displays"] = o.AlternativeDisplays + } + return toSerialize, nil +} + +type NullableVirtualAccountAllOf struct { + value *VirtualAccountAllOf + isSet bool +} + +func (v NullableVirtualAccountAllOf) Get() *VirtualAccountAllOf { + return v.value +} + +func (v *NullableVirtualAccountAllOf) Set(val *VirtualAccountAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountAllOf(val *VirtualAccountAllOf) *NullableVirtualAccountAllOf { + return &NullableVirtualAccountAllOf{value: val, isSet: true} +} + +func (v NullableVirtualAccountAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_alternative_display.go b/payment_method/model_virtual_account_alternative_display.go new file mode 100644 index 00000000..f710a2f8 --- /dev/null +++ b/payment_method/model_virtual_account_alternative_display.go @@ -0,0 +1,168 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountAlternativeDisplay type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountAlternativeDisplay{} + +// VirtualAccountAlternativeDisplay Alternative Display Object +type VirtualAccountAlternativeDisplay struct { + // Type of the alternative display + Type *string `json:"type,omitempty"` + // Data payload of the given alternative display + Data *string `json:"data,omitempty"` +} + +// NewVirtualAccountAlternativeDisplay instantiates a new VirtualAccountAlternativeDisplay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountAlternativeDisplay() *VirtualAccountAlternativeDisplay { + this := VirtualAccountAlternativeDisplay{} + return &this +} + +// NewVirtualAccountAlternativeDisplayWithDefaults instantiates a new VirtualAccountAlternativeDisplay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountAlternativeDisplayWithDefaults() *VirtualAccountAlternativeDisplay { + this := VirtualAccountAlternativeDisplay{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VirtualAccountAlternativeDisplay) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAlternativeDisplay) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VirtualAccountAlternativeDisplay) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VirtualAccountAlternativeDisplay) SetType(v string) { + o.Type = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *VirtualAccountAlternativeDisplay) GetData() string { + if o == nil || utils.IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAlternativeDisplay) GetDataOk() (*string, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *VirtualAccountAlternativeDisplay) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *VirtualAccountAlternativeDisplay) SetData(v string) { + o.Data = &v +} + +func (o VirtualAccountAlternativeDisplay) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountAlternativeDisplay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableVirtualAccountAlternativeDisplay struct { + value *VirtualAccountAlternativeDisplay + isSet bool +} + +func (v NullableVirtualAccountAlternativeDisplay) Get() *VirtualAccountAlternativeDisplay { + return v.value +} + +func (v *NullableVirtualAccountAlternativeDisplay) Set(val *VirtualAccountAlternativeDisplay) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountAlternativeDisplay) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountAlternativeDisplay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountAlternativeDisplay(val *VirtualAccountAlternativeDisplay) *NullableVirtualAccountAlternativeDisplay { + return &NullableVirtualAccountAlternativeDisplay{value: val, isSet: true} +} + +func (v NullableVirtualAccountAlternativeDisplay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountAlternativeDisplay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_channel_code.go b/payment_method/model_virtual_account_channel_code.go new file mode 100644 index 00000000..a25ac025 --- /dev/null +++ b/payment_method/model_virtual_account_channel_code.go @@ -0,0 +1,141 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + "fmt" +) + +// VirtualAccountChannelCode Virtual Account Channel Code +type VirtualAccountChannelCode string + +// List of VirtualAccountChannelCode +const ( + VIRTUALACCOUNTCHANNELCODE_BCA VirtualAccountChannelCode = "BCA" + VIRTUALACCOUNTCHANNELCODE_BJB VirtualAccountChannelCode = "BJB" + VIRTUALACCOUNTCHANNELCODE_BNI VirtualAccountChannelCode = "BNI" + VIRTUALACCOUNTCHANNELCODE_BRI VirtualAccountChannelCode = "BRI" + VIRTUALACCOUNTCHANNELCODE_MANDIRI VirtualAccountChannelCode = "MANDIRI" + VIRTUALACCOUNTCHANNELCODE_PERMATA VirtualAccountChannelCode = "PERMATA" + VIRTUALACCOUNTCHANNELCODE_BSI VirtualAccountChannelCode = "BSI" + VIRTUALACCOUNTCHANNELCODE_CIMB VirtualAccountChannelCode = "CIMB" + VIRTUALACCOUNTCHANNELCODE_SAHABAT_SAMPOERNA VirtualAccountChannelCode = "SAHABAT_SAMPOERNA" + VIRTUALACCOUNTCHANNELCODE_ARTAJASA VirtualAccountChannelCode = "ARTAJASA" + VIRTUALACCOUNTCHANNELCODE_PV VirtualAccountChannelCode = "PV" + VIRTUALACCOUNTCHANNELCODE_VIETCAPITAL VirtualAccountChannelCode = "VIETCAPITAL" + VIRTUALACCOUNTCHANNELCODE_WOORI VirtualAccountChannelCode = "WOORI" + VIRTUALACCOUNTCHANNELCODE_MSB VirtualAccountChannelCode = "MSB" + VIRTUALACCOUNTCHANNELCODE_STANDARD_CHARTERED VirtualAccountChannelCode = "STANDARD_CHARTERED" +) + +// All allowed values of VirtualAccountChannelCode enum +var AllowedVirtualAccountChannelCodeEnumValues = []VirtualAccountChannelCode{ + "BCA", + "BJB", + "BNI", + "BRI", + "MANDIRI", + "PERMATA", + "BSI", + "CIMB", + "SAHABAT_SAMPOERNA", + "ARTAJASA", + "PV", + "VIETCAPITAL", + "WOORI", + "MSB", + "STANDARD_CHARTERED", +} + +func (v *VirtualAccountChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VirtualAccountChannelCode(value) + for _, existing := range AllowedVirtualAccountChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VirtualAccountChannelCode", value) +} + +// NewVirtualAccountChannelCodeFromValue returns a pointer to a valid VirtualAccountChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVirtualAccountChannelCodeFromValue(v string) (*VirtualAccountChannelCode, error) { + ev := VirtualAccountChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VirtualAccountChannelCode: valid values are %v", v, AllowedVirtualAccountChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VirtualAccountChannelCode) IsValid() bool { + for _, existing := range AllowedVirtualAccountChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v VirtualAccountChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to VirtualAccountChannelCode value +func (v VirtualAccountChannelCode) Ptr() *VirtualAccountChannelCode { + return &v +} + +type NullableVirtualAccountChannelCode struct { + value *VirtualAccountChannelCode + isSet bool +} + +func (v NullableVirtualAccountChannelCode) Get() *VirtualAccountChannelCode { + return v.value +} + +func (v *NullableVirtualAccountChannelCode) Set(val *VirtualAccountChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountChannelCode(val *VirtualAccountChannelCode) *NullableVirtualAccountChannelCode { + return &NullableVirtualAccountChannelCode{value: val, isSet: true} +} + +func (v NullableVirtualAccountChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_method/model_virtual_account_channel_properties.go b/payment_method/model_virtual_account_channel_properties.go new file mode 100644 index 00000000..e83b3b30 --- /dev/null +++ b/payment_method/model_virtual_account_channel_properties.go @@ -0,0 +1,243 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the VirtualAccountChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountChannelProperties{} + +// VirtualAccountChannelProperties Virtual Account Channel Properties +type VirtualAccountChannelProperties struct { + // Name of customer. + CustomerName *string `json:"customer_name,omitempty"` + // You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range. + VirtualAccountNumber *string `json:"virtual_account_number,omitempty"` + // The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) + SuggestedAmount *float64 `json:"suggested_amount,omitempty"` +} + +// NewVirtualAccountChannelProperties instantiates a new VirtualAccountChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountChannelProperties() *VirtualAccountChannelProperties { + this := VirtualAccountChannelProperties{} + return &this +} + +// NewVirtualAccountChannelPropertiesWithDefaults instantiates a new VirtualAccountChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountChannelPropertiesWithDefaults() *VirtualAccountChannelProperties { + this := VirtualAccountChannelProperties{} + return &this +} + +// GetCustomerName returns the CustomerName field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetCustomerName() string { + if o == nil || utils.IsNil(o.CustomerName) { + var ret string + return ret + } + return *o.CustomerName +} + +// GetCustomerNameOk returns a tuple with the CustomerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetCustomerNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.CustomerName) { + return nil, false + } + return o.CustomerName, true +} + +// HasCustomerName returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasCustomerName() bool { + if o != nil && !utils.IsNil(o.CustomerName) { + return true + } + + return false +} + +// SetCustomerName gets a reference to the given string and assigns it to the CustomerName field. +func (o *VirtualAccountChannelProperties) SetCustomerName(v string) { + o.CustomerName = &v +} + +// GetVirtualAccountNumber returns the VirtualAccountNumber field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetVirtualAccountNumber() string { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + var ret string + return ret + } + return *o.VirtualAccountNumber +} + +// GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetVirtualAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + return nil, false + } + return o.VirtualAccountNumber, true +} + +// HasVirtualAccountNumber returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasVirtualAccountNumber() bool { + if o != nil && !utils.IsNil(o.VirtualAccountNumber) { + return true + } + + return false +} + +// SetVirtualAccountNumber gets a reference to the given string and assigns it to the VirtualAccountNumber field. +func (o *VirtualAccountChannelProperties) SetVirtualAccountNumber(v string) { + o.VirtualAccountNumber = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *VirtualAccountChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +// GetSuggestedAmount returns the SuggestedAmount field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetSuggestedAmount() float64 { + if o == nil || utils.IsNil(o.SuggestedAmount) { + var ret float64 + return ret + } + return *o.SuggestedAmount +} + +// GetSuggestedAmountOk returns a tuple with the SuggestedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetSuggestedAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.SuggestedAmount) { + return nil, false + } + return o.SuggestedAmount, true +} + +// HasSuggestedAmount returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasSuggestedAmount() bool { + if o != nil && !utils.IsNil(o.SuggestedAmount) { + return true + } + + return false +} + +// SetSuggestedAmount gets a reference to the given float64 and assigns it to the SuggestedAmount field. +func (o *VirtualAccountChannelProperties) SetSuggestedAmount(v float64) { + o.SuggestedAmount = &v +} + +func (o VirtualAccountChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.CustomerName) { + toSerialize["customer_name"] = o.CustomerName + } + if !utils.IsNil(o.VirtualAccountNumber) { + toSerialize["virtual_account_number"] = o.VirtualAccountNumber + } + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + if !utils.IsNil(o.SuggestedAmount) { + toSerialize["suggested_amount"] = o.SuggestedAmount + } + return toSerialize, nil +} + +type NullableVirtualAccountChannelProperties struct { + value *VirtualAccountChannelProperties + isSet bool +} + +func (v NullableVirtualAccountChannelProperties) Get() *VirtualAccountChannelProperties { + return v.value +} + +func (v *NullableVirtualAccountChannelProperties) Set(val *VirtualAccountChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountChannelProperties(val *VirtualAccountChannelProperties) *NullableVirtualAccountChannelProperties { + return &NullableVirtualAccountChannelProperties{value: val, isSet: true} +} + +func (v NullableVirtualAccountChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_channel_properties_patch.go b/payment_method/model_virtual_account_channel_properties_patch.go new file mode 100644 index 00000000..6d277925 --- /dev/null +++ b/payment_method/model_virtual_account_channel_properties_patch.go @@ -0,0 +1,169 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the VirtualAccountChannelPropertiesPatch type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountChannelPropertiesPatch{} + +// VirtualAccountChannelPropertiesPatch Virtual Account Channel Properties +type VirtualAccountChannelPropertiesPatch struct { + // The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) + SuggestedAmount *float64 `json:"suggested_amount,omitempty"` +} + +// NewVirtualAccountChannelPropertiesPatch instantiates a new VirtualAccountChannelPropertiesPatch object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountChannelPropertiesPatch() *VirtualAccountChannelPropertiesPatch { + this := VirtualAccountChannelPropertiesPatch{} + return &this +} + +// NewVirtualAccountChannelPropertiesPatchWithDefaults instantiates a new VirtualAccountChannelPropertiesPatch object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountChannelPropertiesPatchWithDefaults() *VirtualAccountChannelPropertiesPatch { + this := VirtualAccountChannelPropertiesPatch{} + return &this +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *VirtualAccountChannelPropertiesPatch) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelPropertiesPatch) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *VirtualAccountChannelPropertiesPatch) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *VirtualAccountChannelPropertiesPatch) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +// GetSuggestedAmount returns the SuggestedAmount field value if set, zero value otherwise. +func (o *VirtualAccountChannelPropertiesPatch) GetSuggestedAmount() float64 { + if o == nil || utils.IsNil(o.SuggestedAmount) { + var ret float64 + return ret + } + return *o.SuggestedAmount +} + +// GetSuggestedAmountOk returns a tuple with the SuggestedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelPropertiesPatch) GetSuggestedAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.SuggestedAmount) { + return nil, false + } + return o.SuggestedAmount, true +} + +// HasSuggestedAmount returns a boolean if a field has been set. +func (o *VirtualAccountChannelPropertiesPatch) HasSuggestedAmount() bool { + if o != nil && !utils.IsNil(o.SuggestedAmount) { + return true + } + + return false +} + +// SetSuggestedAmount gets a reference to the given float64 and assigns it to the SuggestedAmount field. +func (o *VirtualAccountChannelPropertiesPatch) SetSuggestedAmount(v float64) { + o.SuggestedAmount = &v +} + +func (o VirtualAccountChannelPropertiesPatch) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountChannelPropertiesPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + if !utils.IsNil(o.SuggestedAmount) { + toSerialize["suggested_amount"] = o.SuggestedAmount + } + return toSerialize, nil +} + +type NullableVirtualAccountChannelPropertiesPatch struct { + value *VirtualAccountChannelPropertiesPatch + isSet bool +} + +func (v NullableVirtualAccountChannelPropertiesPatch) Get() *VirtualAccountChannelPropertiesPatch { + return v.value +} + +func (v *NullableVirtualAccountChannelPropertiesPatch) Set(val *VirtualAccountChannelPropertiesPatch) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountChannelPropertiesPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountChannelPropertiesPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountChannelPropertiesPatch(val *VirtualAccountChannelPropertiesPatch) *NullableVirtualAccountChannelPropertiesPatch { + return &NullableVirtualAccountChannelPropertiesPatch{value: val, isSet: true} +} + +func (v NullableVirtualAccountChannelPropertiesPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountChannelPropertiesPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_parameters.go b/payment_method/model_virtual_account_parameters.go new file mode 100644 index 00000000..a8784103 --- /dev/null +++ b/payment_method/model_virtual_account_parameters.go @@ -0,0 +1,359 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountParameters{} + +// VirtualAccountParameters struct for VirtualAccountParameters +type VirtualAccountParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + Currency *string `json:"currency,omitempty"` + ChannelCode VirtualAccountChannelCode `json:"channel_code"` + ChannelProperties VirtualAccountChannelProperties `json:"channel_properties"` + // For payments in Vietnam only, alternative display requested for the virtual account + AlternativeDisplayTypes []string `json:"alternative_display_types,omitempty"` +} + +// NewVirtualAccountParameters instantiates a new VirtualAccountParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountParameters(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties) *VirtualAccountParameters { + this := VirtualAccountParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewVirtualAccountParametersWithDefaults instantiates a new VirtualAccountParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountParametersWithDefaults() *VirtualAccountParameters { + this := VirtualAccountParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *VirtualAccountParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *VirtualAccountParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *VirtualAccountParameters) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *VirtualAccountParameters) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *VirtualAccountParameters) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *VirtualAccountParameters) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *VirtualAccountParameters) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *VirtualAccountParameters) SetCurrency(v string) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *VirtualAccountParameters) GetChannelCode() VirtualAccountChannelCode { + if o == nil { + var ret VirtualAccountChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetChannelCodeOk() (*VirtualAccountChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *VirtualAccountParameters) SetChannelCode(v VirtualAccountChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *VirtualAccountParameters) GetChannelProperties() VirtualAccountChannelProperties { + if o == nil { + var ret VirtualAccountChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *VirtualAccountParameters) SetChannelProperties(v VirtualAccountChannelProperties) { + o.ChannelProperties = v +} + +// GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field value if set, zero value otherwise. +func (o *VirtualAccountParameters) GetAlternativeDisplayTypes() []string { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + var ret []string + return ret + } + return o.AlternativeDisplayTypes +} + +// GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetAlternativeDisplayTypesOk() ([]string, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + return nil, false + } + return o.AlternativeDisplayTypes, true +} + +// HasAlternativeDisplayTypes returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasAlternativeDisplayTypes() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplayTypes) { + return true + } + + return false +} + +// SetAlternativeDisplayTypes gets a reference to the given []string and assigns it to the AlternativeDisplayTypes field. +func (o *VirtualAccountParameters) SetAlternativeDisplayTypes(v []string) { + o.AlternativeDisplayTypes = v +} + +func (o VirtualAccountParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + if !utils.IsNil(o.AlternativeDisplayTypes) { + toSerialize["alternative_display_types"] = o.AlternativeDisplayTypes + } + return toSerialize, nil +} + +type NullableVirtualAccountParameters struct { + value *VirtualAccountParameters + isSet bool +} + +func (v NullableVirtualAccountParameters) Get() *VirtualAccountParameters { + return v.value +} + +func (v *NullableVirtualAccountParameters) Set(val *VirtualAccountParameters) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountParameters(val *VirtualAccountParameters) *NullableVirtualAccountParameters { + return &NullableVirtualAccountParameters{value: val, isSet: true} +} + +func (v NullableVirtualAccountParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_virtual_account_update_parameters.go b/payment_method/model_virtual_account_update_parameters.go new file mode 100644 index 00000000..b7fe242d --- /dev/null +++ b/payment_method/model_virtual_account_update_parameters.go @@ -0,0 +1,305 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.87.2 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_method + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountUpdateParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountUpdateParameters{} + +// VirtualAccountUpdateParameters struct for VirtualAccountUpdateParameters +type VirtualAccountUpdateParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + ChannelProperties *VirtualAccountChannelPropertiesPatch `json:"channel_properties,omitempty"` + // For payments in Vietnam only, alternative display requested for the virtual account + AlternativeDisplayTypes []string `json:"alternative_display_types,omitempty"` +} + +// NewVirtualAccountUpdateParameters instantiates a new VirtualAccountUpdateParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountUpdateParameters() *VirtualAccountUpdateParameters { + this := VirtualAccountUpdateParameters{} + return &this +} + +// NewVirtualAccountUpdateParametersWithDefaults instantiates a new VirtualAccountUpdateParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountUpdateParametersWithDefaults() *VirtualAccountUpdateParameters { + this := VirtualAccountUpdateParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountUpdateParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountUpdateParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *VirtualAccountUpdateParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *VirtualAccountUpdateParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *VirtualAccountUpdateParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *VirtualAccountUpdateParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountUpdateParameters) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountUpdateParameters) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *VirtualAccountUpdateParameters) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *VirtualAccountUpdateParameters) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *VirtualAccountUpdateParameters) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *VirtualAccountUpdateParameters) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountUpdateParameters) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountUpdateParameters) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *VirtualAccountUpdateParameters) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *VirtualAccountUpdateParameters) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *VirtualAccountUpdateParameters) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *VirtualAccountUpdateParameters) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *VirtualAccountUpdateParameters) GetChannelProperties() VirtualAccountChannelPropertiesPatch { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret VirtualAccountChannelPropertiesPatch + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountUpdateParameters) GetChannelPropertiesOk() (*VirtualAccountChannelPropertiesPatch, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *VirtualAccountUpdateParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given VirtualAccountChannelPropertiesPatch and assigns it to the ChannelProperties field. +func (o *VirtualAccountUpdateParameters) SetChannelProperties(v VirtualAccountChannelPropertiesPatch) { + o.ChannelProperties = &v +} + +// GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field value if set, zero value otherwise. +func (o *VirtualAccountUpdateParameters) GetAlternativeDisplayTypes() []string { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + var ret []string + return ret + } + return o.AlternativeDisplayTypes +} + +// GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountUpdateParameters) GetAlternativeDisplayTypesOk() ([]string, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + return nil, false + } + return o.AlternativeDisplayTypes, true +} + +// HasAlternativeDisplayTypes returns a boolean if a field has been set. +func (o *VirtualAccountUpdateParameters) HasAlternativeDisplayTypes() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplayTypes) { + return true + } + + return false +} + +// SetAlternativeDisplayTypes gets a reference to the given []string and assigns it to the AlternativeDisplayTypes field. +func (o *VirtualAccountUpdateParameters) SetAlternativeDisplayTypes(v []string) { + o.AlternativeDisplayTypes = v +} + +func (o VirtualAccountUpdateParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountUpdateParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.AlternativeDisplayTypes) { + toSerialize["alternative_display_types"] = o.AlternativeDisplayTypes + } + return toSerialize, nil +} + +type NullableVirtualAccountUpdateParameters struct { + value *VirtualAccountUpdateParameters + isSet bool +} + +func (v NullableVirtualAccountUpdateParameters) Get() *VirtualAccountUpdateParameters { + return v.value +} + +func (v *NullableVirtualAccountUpdateParameters) Set(val *VirtualAccountUpdateParameters) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountUpdateParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountUpdateParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountUpdateParameters(val *VirtualAccountUpdateParameters) *NullableVirtualAccountUpdateParameters { + return &NullableVirtualAccountUpdateParameters{value: val, isSet: true} +} + +func (v NullableVirtualAccountUpdateParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountUpdateParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/nullable.go b/payment_method/nullable.go new file mode 100644 index 00000000..93ccc83f --- /dev/null +++ b/payment_method/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package payment_method + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/payment_request/api_payment_request.go b/payment_request/api_payment_request.go new file mode 100644 index 00000000..714a60a1 --- /dev/null +++ b/payment_request/api_payment_request.go @@ -0,0 +1,882 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package payment_request + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" + "reflect" +) + + +type PaymentRequestApi interface { + + /* + AuthorizePaymentRequest Payment Request Authorize + + Payment Request Authorize + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiAuthorizePaymentRequestRequest + */ + AuthorizePaymentRequest(ctx context.Context, paymentRequestId string) ApiAuthorizePaymentRequestRequest + + // AuthorizePaymentRequestExecute executes the request + // @return PaymentRequest + AuthorizePaymentRequestExecute(r ApiAuthorizePaymentRequestRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) + + /* + CapturePaymentRequest Payment Request Capture + + Payment Request Capture + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiCapturePaymentRequestRequest + */ + CapturePaymentRequest(ctx context.Context, paymentRequestId string) ApiCapturePaymentRequestRequest + + // CapturePaymentRequestExecute executes the request + // @return Capture + CapturePaymentRequestExecute(r ApiCapturePaymentRequestRequest) (*Capture, *http.Response, *common.XenditSdkError) + + /* + CreatePaymentRequest Create Payment Request + + Create Payment Request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePaymentRequestRequest + */ + CreatePaymentRequest(ctx context.Context) ApiCreatePaymentRequestRequest + + // CreatePaymentRequestExecute executes the request + // @return PaymentRequest + CreatePaymentRequestExecute(r ApiCreatePaymentRequestRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) + + /* + GetAllPaymentRequests Get all payment requests by filter + + Get all payment requests by filter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentRequestsRequest + */ + GetAllPaymentRequests(ctx context.Context) ApiGetAllPaymentRequestsRequest + + // GetAllPaymentRequestsExecute executes the request + // @return PaymentRequestListResponse + GetAllPaymentRequestsExecute(r ApiGetAllPaymentRequestsRequest) (*PaymentRequestListResponse, *http.Response, *common.XenditSdkError) + + /* + GetPaymentRequestByID Get payment request by ID + + Get payment request by ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiGetPaymentRequestByIDRequest + */ + GetPaymentRequestByID(ctx context.Context, paymentRequestId string) ApiGetPaymentRequestByIDRequest + + // GetPaymentRequestByIDExecute executes the request + // @return PaymentRequest + GetPaymentRequestByIDExecute(r ApiGetPaymentRequestByIDRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) + + /* + GetPaymentRequestCaptures Get Payment Request Capture + + Get Payment Request Capture + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiGetPaymentRequestCapturesRequest + */ + GetPaymentRequestCaptures(ctx context.Context, paymentRequestId string) ApiGetPaymentRequestCapturesRequest + + // GetPaymentRequestCapturesExecute executes the request + // @return CaptureListResponse + GetPaymentRequestCapturesExecute(r ApiGetPaymentRequestCapturesRequest) (*CaptureListResponse, *http.Response, *common.XenditSdkError) + + /* + ResendPaymentRequestAuth Payment Request Resend Auth + + Payment Request Resend Auth + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiResendPaymentRequestAuthRequest + */ + ResendPaymentRequestAuth(ctx context.Context, paymentRequestId string) ApiResendPaymentRequestAuthRequest + + // ResendPaymentRequestAuthExecute executes the request + // @return PaymentRequest + ResendPaymentRequestAuthExecute(r ApiResendPaymentRequestAuthRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) +} + +// PaymentRequestApiService PaymentRequestApi service +type PaymentRequestApiService struct { + client common.IClient +} + +// NewPaymentRequestApi Create a new PaymentRequestApi service +func NewPaymentRequestApi (client common.IClient) PaymentRequestApi { + return &PaymentRequestApiService{ + client: client, + } +} + + +type ApiAuthorizePaymentRequestRequest struct { + ctx context.Context + ApiService PaymentRequestApi + paymentRequestId string + paymentRequestAuthParameters *PaymentRequestAuthParameters +} + +func (r ApiAuthorizePaymentRequestRequest) PaymentRequestAuthParameters(paymentRequestAuthParameters PaymentRequestAuthParameters) ApiAuthorizePaymentRequestRequest { + r.paymentRequestAuthParameters = &paymentRequestAuthParameters + return r +} + +func (r ApiAuthorizePaymentRequestRequest) Execute() (*PaymentRequest, *http.Response, *common.XenditSdkError) { + return r.ApiService.AuthorizePaymentRequestExecute(r) +} + +/* +AuthorizePaymentRequest Payment Request Authorize + +Payment Request Authorize + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiAuthorizePaymentRequestRequest +*/ +func (a *PaymentRequestApiService) AuthorizePaymentRequest(ctx context.Context, paymentRequestId string) ApiAuthorizePaymentRequestRequest { + return ApiAuthorizePaymentRequestRequest{ + ApiService: a, + ctx: ctx, + paymentRequestId: paymentRequestId, + } +} + +// Execute executes the request +// @return PaymentRequest +func (a *PaymentRequestApiService) AuthorizePaymentRequestExecute(r ApiAuthorizePaymentRequestRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentRequest + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.AuthorizePaymentRequest") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.AuthorizePaymentRequestExecute") + } + + localVarPath := localBasePath + "/payment_requests/{paymentRequestId}/auth" + localVarPath = strings.Replace(localVarPath, "{"+"paymentRequestId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentRequestId, "paymentRequestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentRequestAuthParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.AuthorizePaymentRequestExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCapturePaymentRequestRequest struct { + ctx context.Context + ApiService PaymentRequestApi + paymentRequestId string + captureParameters *CaptureParameters +} + +func (r ApiCapturePaymentRequestRequest) CaptureParameters(captureParameters CaptureParameters) ApiCapturePaymentRequestRequest { + r.captureParameters = &captureParameters + return r +} + +func (r ApiCapturePaymentRequestRequest) Execute() (*Capture, *http.Response, *common.XenditSdkError) { + return r.ApiService.CapturePaymentRequestExecute(r) +} + +/* +CapturePaymentRequest Payment Request Capture + +Payment Request Capture + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiCapturePaymentRequestRequest +*/ +func (a *PaymentRequestApiService) CapturePaymentRequest(ctx context.Context, paymentRequestId string) ApiCapturePaymentRequestRequest { + return ApiCapturePaymentRequestRequest{ + ApiService: a, + ctx: ctx, + paymentRequestId: paymentRequestId, + } +} + +// Execute executes the request +// @return Capture +func (a *PaymentRequestApiService) CapturePaymentRequestExecute(r ApiCapturePaymentRequestRequest) (*Capture, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Capture + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.CapturePaymentRequest") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.CapturePaymentRequestExecute") + } + + localVarPath := localBasePath + "/payment_requests/{paymentRequestId}/captures" + localVarPath = strings.Replace(localVarPath, "{"+"paymentRequestId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentRequestId, "paymentRequestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.captureParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.CapturePaymentRequestExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreatePaymentRequestRequest struct { + ctx context.Context + ApiService PaymentRequestApi + idempotencyKey *string + paymentRequestParameters *PaymentRequestParameters +} + +func (r ApiCreatePaymentRequestRequest) IdempotencyKey(idempotencyKey string) ApiCreatePaymentRequestRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiCreatePaymentRequestRequest) PaymentRequestParameters(paymentRequestParameters PaymentRequestParameters) ApiCreatePaymentRequestRequest { + r.paymentRequestParameters = &paymentRequestParameters + return r +} + +func (r ApiCreatePaymentRequestRequest) Execute() (*PaymentRequest, *http.Response, *common.XenditSdkError) { + return r.ApiService.CreatePaymentRequestExecute(r) +} + +/* +CreatePaymentRequest Create Payment Request + +Create Payment Request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePaymentRequestRequest +*/ +func (a *PaymentRequestApiService) CreatePaymentRequest(ctx context.Context) ApiCreatePaymentRequestRequest { + return ApiCreatePaymentRequestRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaymentRequest +func (a *PaymentRequestApiService) CreatePaymentRequestExecute(r ApiCreatePaymentRequestRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentRequest + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.CreatePaymentRequest") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.CreatePaymentRequestExecute") + } + + localVarPath := localBasePath + "/payment_requests" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") + } + // body params + localVarPostBody = r.paymentRequestParameters + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.CreatePaymentRequestExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAllPaymentRequestsRequest struct { + ctx context.Context + ApiService PaymentRequestApi + referenceId *[]string + id *[]string + customerId *[]string + limit *int32 + beforeId *string + afterId *string +} + +func (r ApiGetAllPaymentRequestsRequest) ReferenceId(referenceId []string) ApiGetAllPaymentRequestsRequest { + r.referenceId = &referenceId + return r +} + +func (r ApiGetAllPaymentRequestsRequest) Id(id []string) ApiGetAllPaymentRequestsRequest { + r.id = &id + return r +} + +func (r ApiGetAllPaymentRequestsRequest) CustomerId(customerId []string) ApiGetAllPaymentRequestsRequest { + r.customerId = &customerId + return r +} + +func (r ApiGetAllPaymentRequestsRequest) Limit(limit int32) ApiGetAllPaymentRequestsRequest { + r.limit = &limit + return r +} + +func (r ApiGetAllPaymentRequestsRequest) BeforeId(beforeId string) ApiGetAllPaymentRequestsRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetAllPaymentRequestsRequest) AfterId(afterId string) ApiGetAllPaymentRequestsRequest { + r.afterId = &afterId + return r +} + +func (r ApiGetAllPaymentRequestsRequest) Execute() (*PaymentRequestListResponse, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetAllPaymentRequestsExecute(r) +} + +/* +GetAllPaymentRequests Get all payment requests by filter + +Get all payment requests by filter + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllPaymentRequestsRequest +*/ +func (a *PaymentRequestApiService) GetAllPaymentRequests(ctx context.Context) ApiGetAllPaymentRequestsRequest { + return ApiGetAllPaymentRequestsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return PaymentRequestListResponse +func (a *PaymentRequestApiService) GetAllPaymentRequestsExecute(r ApiGetAllPaymentRequestsRequest) (*PaymentRequestListResponse, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentRequestListResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.GetAllPaymentRequests") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetAllPaymentRequestsExecute") + } + + localVarPath := localBasePath + "/payment_requests" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.referenceId != nil { + t := *r.referenceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", t, "multi") + } + } + if r.id != nil { + t := *r.id + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "id", t, "multi") + } + } + if r.customerId != nil { + t := *r.customerId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "customer_id", s.Index(i), "multi") + } + } else { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "customer_id", t, "multi") + } + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetAllPaymentRequestsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPaymentRequestByIDRequest struct { + ctx context.Context + ApiService PaymentRequestApi + paymentRequestId string +} + +func (r ApiGetPaymentRequestByIDRequest) Execute() (*PaymentRequest, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPaymentRequestByIDExecute(r) +} + +/* +GetPaymentRequestByID Get payment request by ID + +Get payment request by ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiGetPaymentRequestByIDRequest +*/ +func (a *PaymentRequestApiService) GetPaymentRequestByID(ctx context.Context, paymentRequestId string) ApiGetPaymentRequestByIDRequest { + return ApiGetPaymentRequestByIDRequest{ + ApiService: a, + ctx: ctx, + paymentRequestId: paymentRequestId, + } +} + +// Execute executes the request +// @return PaymentRequest +func (a *PaymentRequestApiService) GetPaymentRequestByIDExecute(r ApiGetPaymentRequestByIDRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentRequest + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.GetPaymentRequestByID") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestByIDExecute") + } + + localVarPath := localBasePath + "/payment_requests/{paymentRequestId}" + localVarPath = strings.Replace(localVarPath, "{"+"paymentRequestId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentRequestId, "paymentRequestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestByIDExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPaymentRequestCapturesRequest struct { + ctx context.Context + ApiService PaymentRequestApi + paymentRequestId string + limit *int32 + afterId *string + beforeId *string +} + +func (r ApiGetPaymentRequestCapturesRequest) Limit(limit int32) ApiGetPaymentRequestCapturesRequest { + r.limit = &limit + return r +} + +func (r ApiGetPaymentRequestCapturesRequest) AfterId(afterId string) ApiGetPaymentRequestCapturesRequest { + r.afterId = &afterId + return r +} + +func (r ApiGetPaymentRequestCapturesRequest) BeforeId(beforeId string) ApiGetPaymentRequestCapturesRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetPaymentRequestCapturesRequest) Execute() (*CaptureListResponse, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPaymentRequestCapturesExecute(r) +} + +/* +GetPaymentRequestCaptures Get Payment Request Capture + +Get Payment Request Capture + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiGetPaymentRequestCapturesRequest +*/ +func (a *PaymentRequestApiService) GetPaymentRequestCaptures(ctx context.Context, paymentRequestId string) ApiGetPaymentRequestCapturesRequest { + return ApiGetPaymentRequestCapturesRequest{ + ApiService: a, + ctx: ctx, + paymentRequestId: paymentRequestId, + } +} + +// Execute executes the request +// @return CaptureListResponse +func (a *PaymentRequestApiService) GetPaymentRequestCapturesExecute(r ApiGetPaymentRequestCapturesRequest) (*CaptureListResponse, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *CaptureListResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.GetPaymentRequestCaptures") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestCapturesExecute") + } + + localVarPath := localBasePath + "/payment_requests/{paymentRequestId}/captures" + localVarPath = strings.Replace(localVarPath, "{"+"paymentRequestId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentRequestId, "paymentRequestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.GetPaymentRequestCapturesExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiResendPaymentRequestAuthRequest struct { + ctx context.Context + ApiService PaymentRequestApi + paymentRequestId string +} + +func (r ApiResendPaymentRequestAuthRequest) Execute() (*PaymentRequest, *http.Response, *common.XenditSdkError) { + return r.ApiService.ResendPaymentRequestAuthExecute(r) +} + +/* +ResendPaymentRequestAuth Payment Request Resend Auth + +Payment Request Resend Auth + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param paymentRequestId + @return ApiResendPaymentRequestAuthRequest +*/ +func (a *PaymentRequestApiService) ResendPaymentRequestAuth(ctx context.Context, paymentRequestId string) ApiResendPaymentRequestAuthRequest { + return ApiResendPaymentRequestAuthRequest{ + ApiService: a, + ctx: ctx, + paymentRequestId: paymentRequestId, + } +} + +// Execute executes the request +// @return PaymentRequest +func (a *PaymentRequestApiService) ResendPaymentRequestAuthExecute(r ApiResendPaymentRequestAuthRequest) (*PaymentRequest, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *PaymentRequest + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PaymentRequestApiService.ResendPaymentRequestAuth") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.ResendPaymentRequestAuthExecute") + } + + localVarPath := localBasePath + "/payment_requests/{paymentRequestId}/auth/resend" + localVarPath = strings.Replace(localVarPath, "{"+"paymentRequestId"+"}", url.PathEscape(utils.ParameterValueToString(r.paymentRequestId, "paymentRequestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PaymentRequestApiService.ResendPaymentRequestAuthExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/payment_request/model_capture.go b/payment_request/model_capture.go new file mode 100644 index 00000000..0b399114 --- /dev/null +++ b/payment_request/model_capture.go @@ -0,0 +1,511 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Capture type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Capture{} + +// Capture struct for Capture +type Capture struct { + Id string `json:"id"` + PaymentRequestId string `json:"payment_request_id"` + PaymentId string `json:"payment_id"` + ReferenceId string `json:"reference_id"` + Currency string `json:"currency"` + AuthorizedAmount float64 `json:"authorized_amount"` + CapturedAmount float64 `json:"captured_amount"` + Status string `json:"status"` + PaymentMethod PaymentMethod `json:"payment_method"` + FailureCode NullableString `json:"failure_code"` + CustomerId NullableString `json:"customer_id"` + Metadata map[string]interface{} `json:"metadata"` + ChannelProperties map[string]interface{} `json:"channel_properties"` + Created string `json:"created"` + Updated string `json:"updated"` +} + +// NewCapture instantiates a new Capture object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapture(id string, paymentRequestId string, paymentId string, referenceId string, currency string, authorizedAmount float64, capturedAmount float64, status string, paymentMethod PaymentMethod, failureCode NullableString, customerId NullableString, metadata map[string]interface{}, channelProperties map[string]interface{}, created string, updated string) *Capture { + this := Capture{} + this.Id = id + this.PaymentRequestId = paymentRequestId + this.PaymentId = paymentId + this.ReferenceId = referenceId + this.Currency = currency + this.AuthorizedAmount = authorizedAmount + this.CapturedAmount = capturedAmount + this.Status = status + this.PaymentMethod = paymentMethod + this.FailureCode = failureCode + this.CustomerId = customerId + this.Metadata = metadata + this.ChannelProperties = channelProperties + this.Created = created + this.Updated = updated + return &this +} + +// NewCaptureWithDefaults instantiates a new Capture object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptureWithDefaults() *Capture { + this := Capture{} + return &this +} + +// GetId returns the Id field value +func (o *Capture) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Capture) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Capture) SetId(v string) { + o.Id = v +} + +// GetPaymentRequestId returns the PaymentRequestId field value +func (o *Capture) GetPaymentRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentRequestId +} + +// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value +// and a boolean to check if the value has been set. +func (o *Capture) GetPaymentRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentRequestId, true +} + +// SetPaymentRequestId sets field value +func (o *Capture) SetPaymentRequestId(v string) { + o.PaymentRequestId = v +} + +// GetPaymentId returns the PaymentId field value +func (o *Capture) GetPaymentId() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentId +} + +// GetPaymentIdOk returns a tuple with the PaymentId field value +// and a boolean to check if the value has been set. +func (o *Capture) GetPaymentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentId, true +} + +// SetPaymentId sets field value +func (o *Capture) SetPaymentId(v string) { + o.PaymentId = v +} + +// GetReferenceId returns the ReferenceId field value +func (o *Capture) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *Capture) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *Capture) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetCurrency returns the Currency field value +func (o *Capture) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Capture) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Capture) SetCurrency(v string) { + o.Currency = v +} + +// GetAuthorizedAmount returns the AuthorizedAmount field value +func (o *Capture) GetAuthorizedAmount() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.AuthorizedAmount +} + +// GetAuthorizedAmountOk returns a tuple with the AuthorizedAmount field value +// and a boolean to check if the value has been set. +func (o *Capture) GetAuthorizedAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizedAmount, true +} + +// SetAuthorizedAmount sets field value +func (o *Capture) SetAuthorizedAmount(v float64) { + o.AuthorizedAmount = v +} + +// GetCapturedAmount returns the CapturedAmount field value +func (o *Capture) GetCapturedAmount() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.CapturedAmount +} + +// GetCapturedAmountOk returns a tuple with the CapturedAmount field value +// and a boolean to check if the value has been set. +func (o *Capture) GetCapturedAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.CapturedAmount, true +} + +// SetCapturedAmount sets field value +func (o *Capture) SetCapturedAmount(v float64) { + o.CapturedAmount = v +} + +// GetStatus returns the Status field value +func (o *Capture) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Capture) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Capture) SetStatus(v string) { + o.Status = v +} + +// GetPaymentMethod returns the PaymentMethod field value +func (o *Capture) GetPaymentMethod() PaymentMethod { + if o == nil { + var ret PaymentMethod + return ret + } + + return o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value +// and a boolean to check if the value has been set. +func (o *Capture) GetPaymentMethodOk() (*PaymentMethod, bool) { + if o == nil { + return nil, false + } + return &o.PaymentMethod, true +} + +// SetPaymentMethod sets field value +func (o *Capture) SetPaymentMethod(v PaymentMethod) { + o.PaymentMethod = v +} + +// GetFailureCode returns the FailureCode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Capture) GetFailureCode() string { + if o == nil || o.FailureCode.Get() == nil { + var ret string + return ret + } + + return *o.FailureCode.Get() +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Capture) GetFailureCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureCode.Get(), o.FailureCode.IsSet() +} + +// SetFailureCode sets field value +func (o *Capture) SetFailureCode(v string) { + o.FailureCode.Set(&v) +} + +// GetCustomerId returns the CustomerId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Capture) GetCustomerId() string { + if o == nil || o.CustomerId.Get() == nil { + var ret string + return ret + } + + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Capture) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// SetCustomerId sets field value +func (o *Capture) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} + +// GetMetadata returns the Metadata field value +// If the value is explicit nil, the zero value for map[string]interface{} will be returned +func (o *Capture) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Capture) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *Capture) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for map[string]interface{} will be returned +func (o *Capture) GetChannelProperties() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Capture) GetChannelPropertiesOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return map[string]interface{}{}, false + } + return o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *Capture) SetChannelProperties(v map[string]interface{}) { + o.ChannelProperties = v +} + +// GetCreated returns the Created field value +func (o *Capture) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Capture) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Capture) SetCreated(v string) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *Capture) GetUpdated() string { + if o == nil { + var ret string + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *Capture) GetUpdatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *Capture) SetUpdated(v string) { + o.Updated = v +} + +func (o Capture) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Capture) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["payment_request_id"] = o.PaymentRequestId + toSerialize["payment_id"] = o.PaymentId + toSerialize["reference_id"] = o.ReferenceId + toSerialize["currency"] = o.Currency + toSerialize["authorized_amount"] = o.AuthorizedAmount + toSerialize["captured_amount"] = o.CapturedAmount + toSerialize["status"] = o.Status + toSerialize["payment_method"] = o.PaymentMethod + toSerialize["failure_code"] = o.FailureCode.Get() + toSerialize["customer_id"] = o.CustomerId.Get() + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.ChannelProperties != nil { + toSerialize["channel_properties"] = o.ChannelProperties + } + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + return toSerialize, nil +} + +type NullableCapture struct { + value *Capture + isSet bool +} + +func (v NullableCapture) Get() *Capture { + return v.value +} + +func (v *NullableCapture) Set(val *Capture) { + v.value = val + v.isSet = true +} + +func (v NullableCapture) IsSet() bool { + return v.isSet +} + +func (v *NullableCapture) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapture(val *Capture) *NullableCapture { + return &NullableCapture{value: val, isSet: true} +} + +func (v NullableCapture) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapture) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_capture_list_response.go b/payment_request/model_capture_list_response.go new file mode 100644 index 00000000..fa433e65 --- /dev/null +++ b/payment_request/model_capture_list_response.go @@ -0,0 +1,148 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CaptureListResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CaptureListResponse{} + +// CaptureListResponse struct for CaptureListResponse +type CaptureListResponse struct { + Data []Capture `json:"data"` + HasMore bool `json:"has_more"` +} + +// NewCaptureListResponse instantiates a new CaptureListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptureListResponse(data []Capture, hasMore bool) *CaptureListResponse { + this := CaptureListResponse{} + this.Data = data + this.HasMore = hasMore + return &this +} + +// NewCaptureListResponseWithDefaults instantiates a new CaptureListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptureListResponseWithDefaults() *CaptureListResponse { + this := CaptureListResponse{} + return &this +} + +// GetData returns the Data field value +func (o *CaptureListResponse) GetData() []Capture { + if o == nil { + var ret []Capture + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CaptureListResponse) GetDataOk() ([]Capture, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *CaptureListResponse) SetData(v []Capture) { + o.Data = v +} + +// GetHasMore returns the HasMore field value +func (o *CaptureListResponse) GetHasMore() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value +// and a boolean to check if the value has been set. +func (o *CaptureListResponse) GetHasMoreOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasMore, true +} + +// SetHasMore sets field value +func (o *CaptureListResponse) SetHasMore(v bool) { + o.HasMore = v +} + +func (o CaptureListResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptureListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["has_more"] = o.HasMore + return toSerialize, nil +} + +type NullableCaptureListResponse struct { + value *CaptureListResponse + isSet bool +} + +func (v NullableCaptureListResponse) Get() *CaptureListResponse { + return v.value +} + +func (v *NullableCaptureListResponse) Set(val *CaptureListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCaptureListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptureListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptureListResponse(val *CaptureListResponse) *NullableCaptureListResponse { + return &NullableCaptureListResponse{value: val, isSet: true} +} + +func (v NullableCaptureListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptureListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_capture_parameters.go b/payment_request/model_capture_parameters.go new file mode 100644 index 00000000..036d76c1 --- /dev/null +++ b/payment_request/model_capture_parameters.go @@ -0,0 +1,167 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CaptureParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CaptureParameters{} + +// CaptureParameters struct for CaptureParameters +type CaptureParameters struct { + ReferenceId NullableString `json:"reference_id,omitempty"` + CaptureAmount float64 `json:"capture_amount"` +} + +// NewCaptureParameters instantiates a new CaptureParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptureParameters(captureAmount float64) *CaptureParameters { + this := CaptureParameters{} + this.CaptureAmount = captureAmount + return &this +} + +// NewCaptureParametersWithDefaults instantiates a new CaptureParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptureParametersWithDefaults() *CaptureParameters { + this := CaptureParameters{} + return &this +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CaptureParameters) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId.Get()) { + var ret string + return ret + } + return *o.ReferenceId.Get() +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CaptureParameters) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ReferenceId.Get(), o.ReferenceId.IsSet() +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *CaptureParameters) HasReferenceId() bool { + if o != nil && o.ReferenceId.IsSet() { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given NullableString and assigns it to the ReferenceId field. +func (o *CaptureParameters) SetReferenceId(v string) { + o.ReferenceId.Set(&v) +} +// SetReferenceIdNil sets the value for ReferenceId to be an explicit nil +func (o *CaptureParameters) SetReferenceIdNil() { + o.ReferenceId.Set(nil) +} + +// UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +func (o *CaptureParameters) UnsetReferenceId() { + o.ReferenceId.Unset() +} + +// GetCaptureAmount returns the CaptureAmount field value +func (o *CaptureParameters) GetCaptureAmount() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.CaptureAmount +} + +// GetCaptureAmountOk returns a tuple with the CaptureAmount field value +// and a boolean to check if the value has been set. +func (o *CaptureParameters) GetCaptureAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.CaptureAmount, true +} + +// SetCaptureAmount sets field value +func (o *CaptureParameters) SetCaptureAmount(v float64) { + o.CaptureAmount = v +} + +func (o CaptureParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptureParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ReferenceId.IsSet() { + toSerialize["reference_id"] = o.ReferenceId.Get() + } + toSerialize["capture_amount"] = o.CaptureAmount + return toSerialize, nil +} + +type NullableCaptureParameters struct { + value *CaptureParameters + isSet bool +} + +func (v NullableCaptureParameters) Get() *CaptureParameters { + return v.value +} + +func (v *NullableCaptureParameters) Set(val *CaptureParameters) { + v.value = val + v.isSet = true +} + +func (v NullableCaptureParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptureParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptureParameters(val *CaptureParameters) *NullableCaptureParameters { + return &NullableCaptureParameters{value: val, isSet: true} +} + +func (v NullableCaptureParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptureParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_card.go b/payment_request/model_card.go new file mode 100644 index 00000000..48c85d11 --- /dev/null +++ b/payment_request/model_card.go @@ -0,0 +1,221 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Card type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Card{} + +// Card struct for Card +type Card struct { + Currency PaymentRequestCurrency `json:"currency"` + ChannelProperties CardChannelProperties `json:"channel_properties"` + CardInformation CardInformation `json:"card_information"` + CardVerificationResults NullableCardVerificationResults `json:"card_verification_results,omitempty"` +} + +// NewCard instantiates a new Card object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCard(currency PaymentRequestCurrency, channelProperties CardChannelProperties, cardInformation CardInformation) *Card { + this := Card{} + this.Currency = currency + this.ChannelProperties = channelProperties + this.CardInformation = cardInformation + return &this +} + +// NewCardWithDefaults instantiates a new Card object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardWithDefaults() *Card { + this := Card{} + return &this +} + +// GetCurrency returns the Currency field value +func (o *Card) GetCurrency() PaymentRequestCurrency { + if o == nil { + var ret PaymentRequestCurrency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Card) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Card) SetCurrency(v PaymentRequestCurrency) { + o.Currency = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *Card) GetChannelProperties() CardChannelProperties { + if o == nil { + var ret CardChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *Card) GetChannelPropertiesOk() (*CardChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *Card) SetChannelProperties(v CardChannelProperties) { + o.ChannelProperties = v +} + +// GetCardInformation returns the CardInformation field value +func (o *Card) GetCardInformation() CardInformation { + if o == nil { + var ret CardInformation + return ret + } + + return o.CardInformation +} + +// GetCardInformationOk returns a tuple with the CardInformation field value +// and a boolean to check if the value has been set. +func (o *Card) GetCardInformationOk() (*CardInformation, bool) { + if o == nil { + return nil, false + } + return &o.CardInformation, true +} + +// SetCardInformation sets field value +func (o *Card) SetCardInformation(v CardInformation) { + o.CardInformation = v +} + +// GetCardVerificationResults returns the CardVerificationResults field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Card) GetCardVerificationResults() CardVerificationResults { + if o == nil || utils.IsNil(o.CardVerificationResults.Get()) { + var ret CardVerificationResults + return ret + } + return *o.CardVerificationResults.Get() +} + +// GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Card) GetCardVerificationResultsOk() (*CardVerificationResults, bool) { + if o == nil { + return nil, false + } + return o.CardVerificationResults.Get(), o.CardVerificationResults.IsSet() +} + +// HasCardVerificationResults returns a boolean if a field has been set. +func (o *Card) HasCardVerificationResults() bool { + if o != nil && o.CardVerificationResults.IsSet() { + return true + } + + return false +} + +// SetCardVerificationResults gets a reference to the given NullableCardVerificationResults and assigns it to the CardVerificationResults field. +func (o *Card) SetCardVerificationResults(v CardVerificationResults) { + o.CardVerificationResults.Set(&v) +} +// SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil +func (o *Card) SetCardVerificationResultsNil() { + o.CardVerificationResults.Set(nil) +} + +// UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil +func (o *Card) UnsetCardVerificationResults() { + o.CardVerificationResults.Unset() +} + +func (o Card) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Card) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["currency"] = o.Currency + toSerialize["channel_properties"] = o.ChannelProperties + toSerialize["card_information"] = o.CardInformation + if o.CardVerificationResults.IsSet() { + toSerialize["card_verification_results"] = o.CardVerificationResults.Get() + } + return toSerialize, nil +} + +type NullableCard struct { + value *Card + isSet bool +} + +func (v NullableCard) Get() *Card { + return v.value +} + +func (v *NullableCard) Set(val *Card) { + v.value = val + v.isSet = true +} + +func (v NullableCard) IsSet() bool { + return v.isSet +} + +func (v *NullableCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCard(val *Card) *NullableCard { + return &NullableCard{value: val, isSet: true} +} + +func (v NullableCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_card_channel_properties.go b/payment_request/model_card_channel_properties.go new file mode 100644 index 00000000..26cd2a6b --- /dev/null +++ b/payment_request/model_card_channel_properties.go @@ -0,0 +1,319 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardChannelProperties{} + +// CardChannelProperties Card Channel Properties +type CardChannelProperties struct { + // To indicate whether to perform 3DS during the linking phase + SkipThreeDSecure NullableBool `json:"skip_three_d_secure,omitempty"` + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl NullableString `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl NullableString `json:"failure_return_url,omitempty"` + // Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. + CardonfileType NullableString `json:"cardonfile_type,omitempty"` + // Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use + MerchantIdTag *string `json:"merchant_id_tag,omitempty"` +} + +// NewCardChannelProperties instantiates a new CardChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardChannelProperties() *CardChannelProperties { + this := CardChannelProperties{} + return &this +} + +// NewCardChannelPropertiesWithDefaults instantiates a new CardChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardChannelPropertiesWithDefaults() *CardChannelProperties { + this := CardChannelProperties{} + return &this +} + +// GetSkipThreeDSecure returns the SkipThreeDSecure field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetSkipThreeDSecure() bool { + if o == nil || utils.IsNil(o.SkipThreeDSecure.Get()) { + var ret bool + return ret + } + return *o.SkipThreeDSecure.Get() +} + +// GetSkipThreeDSecureOk returns a tuple with the SkipThreeDSecure field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetSkipThreeDSecureOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.SkipThreeDSecure.Get(), o.SkipThreeDSecure.IsSet() +} + +// HasSkipThreeDSecure returns a boolean if a field has been set. +func (o *CardChannelProperties) HasSkipThreeDSecure() bool { + if o != nil && o.SkipThreeDSecure.IsSet() { + return true + } + + return false +} + +// SetSkipThreeDSecure gets a reference to the given NullableBool and assigns it to the SkipThreeDSecure field. +func (o *CardChannelProperties) SetSkipThreeDSecure(v bool) { + o.SkipThreeDSecure.Set(&v) +} +// SetSkipThreeDSecureNil sets the value for SkipThreeDSecure to be an explicit nil +func (o *CardChannelProperties) SetSkipThreeDSecureNil() { + o.SkipThreeDSecure.Set(nil) +} + +// UnsetSkipThreeDSecure ensures that no value is present for SkipThreeDSecure, not even an explicit nil +func (o *CardChannelProperties) UnsetSkipThreeDSecure() { + o.SkipThreeDSecure.Unset() +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl.Get()) { + var ret string + return ret + } + return *o.SuccessReturnUrl.Get() +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SuccessReturnUrl.Get(), o.SuccessReturnUrl.IsSet() +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *CardChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && o.SuccessReturnUrl.IsSet() { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given NullableString and assigns it to the SuccessReturnUrl field. +func (o *CardChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl.Set(&v) +} +// SetSuccessReturnUrlNil sets the value for SuccessReturnUrl to be an explicit nil +func (o *CardChannelProperties) SetSuccessReturnUrlNil() { + o.SuccessReturnUrl.Set(nil) +} + +// UnsetSuccessReturnUrl ensures that no value is present for SuccessReturnUrl, not even an explicit nil +func (o *CardChannelProperties) UnsetSuccessReturnUrl() { + o.SuccessReturnUrl.Unset() +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl.Get()) { + var ret string + return ret + } + return *o.FailureReturnUrl.Get() +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureReturnUrl.Get(), o.FailureReturnUrl.IsSet() +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *CardChannelProperties) HasFailureReturnUrl() bool { + if o != nil && o.FailureReturnUrl.IsSet() { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given NullableString and assigns it to the FailureReturnUrl field. +func (o *CardChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl.Set(&v) +} +// SetFailureReturnUrlNil sets the value for FailureReturnUrl to be an explicit nil +func (o *CardChannelProperties) SetFailureReturnUrlNil() { + o.FailureReturnUrl.Set(nil) +} + +// UnsetFailureReturnUrl ensures that no value is present for FailureReturnUrl, not even an explicit nil +func (o *CardChannelProperties) UnsetFailureReturnUrl() { + o.FailureReturnUrl.Unset() +} + +// GetCardonfileType returns the CardonfileType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardChannelProperties) GetCardonfileType() string { + if o == nil || utils.IsNil(o.CardonfileType.Get()) { + var ret string + return ret + } + return *o.CardonfileType.Get() +} + +// GetCardonfileTypeOk returns a tuple with the CardonfileType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardChannelProperties) GetCardonfileTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardonfileType.Get(), o.CardonfileType.IsSet() +} + +// HasCardonfileType returns a boolean if a field has been set. +func (o *CardChannelProperties) HasCardonfileType() bool { + if o != nil && o.CardonfileType.IsSet() { + return true + } + + return false +} + +// SetCardonfileType gets a reference to the given NullableString and assigns it to the CardonfileType field. +func (o *CardChannelProperties) SetCardonfileType(v string) { + o.CardonfileType.Set(&v) +} +// SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil +func (o *CardChannelProperties) SetCardonfileTypeNil() { + o.CardonfileType.Set(nil) +} + +// UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +func (o *CardChannelProperties) UnsetCardonfileType() { + o.CardonfileType.Unset() +} + +// GetMerchantIdTag returns the MerchantIdTag field value if set, zero value otherwise. +func (o *CardChannelProperties) GetMerchantIdTag() string { + if o == nil || utils.IsNil(o.MerchantIdTag) { + var ret string + return ret + } + return *o.MerchantIdTag +} + +// GetMerchantIdTagOk returns a tuple with the MerchantIdTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardChannelProperties) GetMerchantIdTagOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantIdTag) { + return nil, false + } + return o.MerchantIdTag, true +} + +// HasMerchantIdTag returns a boolean if a field has been set. +func (o *CardChannelProperties) HasMerchantIdTag() bool { + if o != nil && !utils.IsNil(o.MerchantIdTag) { + return true + } + + return false +} + +// SetMerchantIdTag gets a reference to the given string and assigns it to the MerchantIdTag field. +func (o *CardChannelProperties) SetMerchantIdTag(v string) { + o.MerchantIdTag = &v +} + +func (o CardChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.SkipThreeDSecure.IsSet() { + toSerialize["skip_three_d_secure"] = o.SkipThreeDSecure.Get() + } + if o.SuccessReturnUrl.IsSet() { + toSerialize["success_return_url"] = o.SuccessReturnUrl.Get() + } + if o.FailureReturnUrl.IsSet() { + toSerialize["failure_return_url"] = o.FailureReturnUrl.Get() + } + if o.CardonfileType.IsSet() { + toSerialize["cardonfile_type"] = o.CardonfileType.Get() + } + if !utils.IsNil(o.MerchantIdTag) { + toSerialize["merchant_id_tag"] = o.MerchantIdTag + } + return toSerialize, nil +} + +type NullableCardChannelProperties struct { + value *CardChannelProperties + isSet bool +} + +func (v NullableCardChannelProperties) Get() *CardChannelProperties { + return v.value +} + +func (v *NullableCardChannelProperties) Set(val *CardChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableCardChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableCardChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardChannelProperties(val *CardChannelProperties) *NullableCardChannelProperties { + return &NullableCardChannelProperties{value: val, isSet: true} +} + +func (v NullableCardChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_card_information.go b/payment_request/model_card_information.go new file mode 100644 index 00000000..502a6931 --- /dev/null +++ b/payment_request/model_card_information.go @@ -0,0 +1,432 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardInformation type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardInformation{} + +// CardInformation Card Information +type CardInformation struct { + TokenId string `json:"token_id"` + // 1st 6 and last 4 digits of the card + MaskedCardNumber string `json:"masked_card_number"` + // Card expiry month in MM format + ExpiryMonth string `json:"expiry_month"` + // Card expiry month in YY format + ExpiryYear string `json:"expiry_year"` + // Cardholder name + CardholderName NullableString `json:"cardholder_name,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + Type *string `json:"type,omitempty"` + Network *string `json:"network,omitempty"` + Country *string `json:"country,omitempty"` + Issuer *string `json:"issuer,omitempty"` +} + +// NewCardInformation instantiates a new CardInformation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardInformation(tokenId string, maskedCardNumber string, expiryMonth string, expiryYear string) *CardInformation { + this := CardInformation{} + this.TokenId = tokenId + this.MaskedCardNumber = maskedCardNumber + this.ExpiryMonth = expiryMonth + this.ExpiryYear = expiryYear + return &this +} + +// NewCardInformationWithDefaults instantiates a new CardInformation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardInformationWithDefaults() *CardInformation { + this := CardInformation{} + return &this +} + +// GetTokenId returns the TokenId field value +func (o *CardInformation) GetTokenId() string { + if o == nil { + var ret string + return ret + } + + return o.TokenId +} + +// GetTokenIdOk returns a tuple with the TokenId field value +// and a boolean to check if the value has been set. +func (o *CardInformation) GetTokenIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenId, true +} + +// SetTokenId sets field value +func (o *CardInformation) SetTokenId(v string) { + o.TokenId = v +} + +// GetMaskedCardNumber returns the MaskedCardNumber field value +func (o *CardInformation) GetMaskedCardNumber() string { + if o == nil { + var ret string + return ret + } + + return o.MaskedCardNumber +} + +// GetMaskedCardNumberOk returns a tuple with the MaskedCardNumber field value +// and a boolean to check if the value has been set. +func (o *CardInformation) GetMaskedCardNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MaskedCardNumber, true +} + +// SetMaskedCardNumber sets field value +func (o *CardInformation) SetMaskedCardNumber(v string) { + o.MaskedCardNumber = v +} + +// GetExpiryMonth returns the ExpiryMonth field value +func (o *CardInformation) GetExpiryMonth() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryMonth +} + +// GetExpiryMonthOk returns a tuple with the ExpiryMonth field value +// and a boolean to check if the value has been set. +func (o *CardInformation) GetExpiryMonthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryMonth, true +} + +// SetExpiryMonth sets field value +func (o *CardInformation) SetExpiryMonth(v string) { + o.ExpiryMonth = v +} + +// GetExpiryYear returns the ExpiryYear field value +func (o *CardInformation) GetExpiryYear() string { + if o == nil { + var ret string + return ret + } + + return o.ExpiryYear +} + +// GetExpiryYearOk returns a tuple with the ExpiryYear field value +// and a boolean to check if the value has been set. +func (o *CardInformation) GetExpiryYearOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExpiryYear, true +} + +// SetExpiryYear sets field value +func (o *CardInformation) SetExpiryYear(v string) { + o.ExpiryYear = v +} + +// GetCardholderName returns the CardholderName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardInformation) GetCardholderName() string { + if o == nil || utils.IsNil(o.CardholderName.Get()) { + var ret string + return ret + } + return *o.CardholderName.Get() +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardInformation) GetCardholderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardholderName.Get(), o.CardholderName.IsSet() +} + +// HasCardholderName returns a boolean if a field has been set. +func (o *CardInformation) HasCardholderName() bool { + if o != nil && o.CardholderName.IsSet() { + return true + } + + return false +} + +// SetCardholderName gets a reference to the given NullableString and assigns it to the CardholderName field. +func (o *CardInformation) SetCardholderName(v string) { + o.CardholderName.Set(&v) +} +// SetCardholderNameNil sets the value for CardholderName to be an explicit nil +func (o *CardInformation) SetCardholderNameNil() { + o.CardholderName.Set(nil) +} + +// UnsetCardholderName ensures that no value is present for CardholderName, not even an explicit nil +func (o *CardInformation) UnsetCardholderName() { + o.CardholderName.Unset() +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *CardInformation) GetFingerprint() string { + if o == nil || utils.IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardInformation) GetFingerprintOk() (*string, bool) { + if o == nil || utils.IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *CardInformation) HasFingerprint() bool { + if o != nil && !utils.IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *CardInformation) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CardInformation) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardInformation) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CardInformation) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CardInformation) SetType(v string) { + o.Type = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *CardInformation) GetNetwork() string { + if o == nil || utils.IsNil(o.Network) { + var ret string + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardInformation) GetNetworkOk() (*string, bool) { + if o == nil || utils.IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *CardInformation) HasNetwork() bool { + if o != nil && !utils.IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given string and assigns it to the Network field. +func (o *CardInformation) SetNetwork(v string) { + o.Network = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *CardInformation) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardInformation) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *CardInformation) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *CardInformation) SetCountry(v string) { + o.Country = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *CardInformation) GetIssuer() string { + if o == nil || utils.IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardInformation) GetIssuerOk() (*string, bool) { + if o == nil || utils.IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *CardInformation) HasIssuer() bool { + if o != nil && !utils.IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *CardInformation) SetIssuer(v string) { + o.Issuer = &v +} + +func (o CardInformation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardInformation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token_id"] = o.TokenId + toSerialize["masked_card_number"] = o.MaskedCardNumber + toSerialize["expiry_month"] = o.ExpiryMonth + toSerialize["expiry_year"] = o.ExpiryYear + if o.CardholderName.IsSet() { + toSerialize["cardholder_name"] = o.CardholderName.Get() + } + if !utils.IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + return toSerialize, nil +} + +type NullableCardInformation struct { + value *CardInformation + isSet bool +} + +func (v NullableCardInformation) Get() *CardInformation { + return v.value +} + +func (v *NullableCardInformation) Set(val *CardInformation) { + v.value = val + v.isSet = true +} + +func (v NullableCardInformation) IsSet() bool { + return v.isSet +} + +func (v *NullableCardInformation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardInformation(val *CardInformation) *NullableCardInformation { + return &NullableCardInformation{value: val, isSet: true} +} + +func (v NullableCardInformation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardInformation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_card_verification_results.go b/payment_request/model_card_verification_results.go new file mode 100644 index 00000000..01c5ea75 --- /dev/null +++ b/payment_request/model_card_verification_results.go @@ -0,0 +1,222 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardVerificationResults type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardVerificationResults{} + +// CardVerificationResults struct for CardVerificationResults +type CardVerificationResults struct { + ThreeDSecure *CardVerificationResultsThreeDSecure `json:"three_d_secure,omitempty"` + CvvResult NullableString `json:"cvv_result,omitempty"` + AddressVerificationResult NullableString `json:"address_verification_result,omitempty"` +} + +// NewCardVerificationResults instantiates a new CardVerificationResults object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardVerificationResults() *CardVerificationResults { + this := CardVerificationResults{} + return &this +} + +// NewCardVerificationResultsWithDefaults instantiates a new CardVerificationResults object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardVerificationResultsWithDefaults() *CardVerificationResults { + this := CardVerificationResults{} + return &this +} + +// GetThreeDSecure returns the ThreeDSecure field value if set, zero value otherwise. +func (o *CardVerificationResults) GetThreeDSecure() CardVerificationResultsThreeDSecure { + if o == nil || utils.IsNil(o.ThreeDSecure) { + var ret CardVerificationResultsThreeDSecure + return ret + } + return *o.ThreeDSecure +} + +// GetThreeDSecureOk returns a tuple with the ThreeDSecure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CardVerificationResults) GetThreeDSecureOk() (*CardVerificationResultsThreeDSecure, bool) { + if o == nil || utils.IsNil(o.ThreeDSecure) { + return nil, false + } + return o.ThreeDSecure, true +} + +// HasThreeDSecure returns a boolean if a field has been set. +func (o *CardVerificationResults) HasThreeDSecure() bool { + if o != nil && !utils.IsNil(o.ThreeDSecure) { + return true + } + + return false +} + +// SetThreeDSecure gets a reference to the given CardVerificationResultsThreeDSecure and assigns it to the ThreeDSecure field. +func (o *CardVerificationResults) SetThreeDSecure(v CardVerificationResultsThreeDSecure) { + o.ThreeDSecure = &v +} + +// GetCvvResult returns the CvvResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResults) GetCvvResult() string { + if o == nil || utils.IsNil(o.CvvResult.Get()) { + var ret string + return ret + } + return *o.CvvResult.Get() +} + +// GetCvvResultOk returns a tuple with the CvvResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResults) GetCvvResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CvvResult.Get(), o.CvvResult.IsSet() +} + +// HasCvvResult returns a boolean if a field has been set. +func (o *CardVerificationResults) HasCvvResult() bool { + if o != nil && o.CvvResult.IsSet() { + return true + } + + return false +} + +// SetCvvResult gets a reference to the given NullableString and assigns it to the CvvResult field. +func (o *CardVerificationResults) SetCvvResult(v string) { + o.CvvResult.Set(&v) +} +// SetCvvResultNil sets the value for CvvResult to be an explicit nil +func (o *CardVerificationResults) SetCvvResultNil() { + o.CvvResult.Set(nil) +} + +// UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +func (o *CardVerificationResults) UnsetCvvResult() { + o.CvvResult.Unset() +} + +// GetAddressVerificationResult returns the AddressVerificationResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResults) GetAddressVerificationResult() string { + if o == nil || utils.IsNil(o.AddressVerificationResult.Get()) { + var ret string + return ret + } + return *o.AddressVerificationResult.Get() +} + +// GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResults) GetAddressVerificationResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AddressVerificationResult.Get(), o.AddressVerificationResult.IsSet() +} + +// HasAddressVerificationResult returns a boolean if a field has been set. +func (o *CardVerificationResults) HasAddressVerificationResult() bool { + if o != nil && o.AddressVerificationResult.IsSet() { + return true + } + + return false +} + +// SetAddressVerificationResult gets a reference to the given NullableString and assigns it to the AddressVerificationResult field. +func (o *CardVerificationResults) SetAddressVerificationResult(v string) { + o.AddressVerificationResult.Set(&v) +} +// SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil +func (o *CardVerificationResults) SetAddressVerificationResultNil() { + o.AddressVerificationResult.Set(nil) +} + +// UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil +func (o *CardVerificationResults) UnsetAddressVerificationResult() { + o.AddressVerificationResult.Unset() +} + +func (o CardVerificationResults) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardVerificationResults) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ThreeDSecure) { + toSerialize["three_d_secure"] = o.ThreeDSecure + } + if o.CvvResult.IsSet() { + toSerialize["cvv_result"] = o.CvvResult.Get() + } + if o.AddressVerificationResult.IsSet() { + toSerialize["address_verification_result"] = o.AddressVerificationResult.Get() + } + return toSerialize, nil +} + +type NullableCardVerificationResults struct { + value *CardVerificationResults + isSet bool +} + +func (v NullableCardVerificationResults) Get() *CardVerificationResults { + return v.value +} + +func (v *NullableCardVerificationResults) Set(val *CardVerificationResults) { + v.value = val + v.isSet = true +} + +func (v NullableCardVerificationResults) IsSet() bool { + return v.isSet +} + +func (v *NullableCardVerificationResults) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardVerificationResults(val *CardVerificationResults) *NullableCardVerificationResults { + return &NullableCardVerificationResults{value: val, isSet: true} +} + +func (v NullableCardVerificationResults) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardVerificationResults) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_card_verification_results_three_d_secure.go b/payment_request/model_card_verification_results_three_d_secure.go new file mode 100644 index 00000000..0d18b4f5 --- /dev/null +++ b/payment_request/model_card_verification_results_three_d_secure.go @@ -0,0 +1,324 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CardVerificationResultsThreeDSecure type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CardVerificationResultsThreeDSecure{} + +// CardVerificationResultsThreeDSecure struct for CardVerificationResultsThreeDSecure +type CardVerificationResultsThreeDSecure struct { + ThreeDSecureFlow NullableString `json:"three_d_secure_flow,omitempty"` + EciCode NullableString `json:"eci_code,omitempty"` + ThreeDSecureResult NullableString `json:"three_d_secure_result,omitempty"` + ThreeDSecureResultReason NullableString `json:"three_d_secure_result_reason,omitempty"` + ThreeDSecureVersion NullableString `json:"three_d_secure_version,omitempty"` +} + +// NewCardVerificationResultsThreeDSecure instantiates a new CardVerificationResultsThreeDSecure object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCardVerificationResultsThreeDSecure() *CardVerificationResultsThreeDSecure { + this := CardVerificationResultsThreeDSecure{} + return &this +} + +// NewCardVerificationResultsThreeDSecureWithDefaults instantiates a new CardVerificationResultsThreeDSecure object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCardVerificationResultsThreeDSecureWithDefaults() *CardVerificationResultsThreeDSecure { + this := CardVerificationResultsThreeDSecure{} + return &this +} + +// GetThreeDSecureFlow returns the ThreeDSecureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlow() string { + if o == nil || utils.IsNil(o.ThreeDSecureFlow.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureFlow.Get() +} + +// GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureFlow.Get(), o.ThreeDSecureFlow.IsSet() +} + +// HasThreeDSecureFlow returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureFlow() bool { + if o != nil && o.ThreeDSecureFlow.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureFlow gets a reference to the given NullableString and assigns it to the ThreeDSecureFlow field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlow(v string) { + o.ThreeDSecureFlow.Set(&v) +} +// SetThreeDSecureFlowNil sets the value for ThreeDSecureFlow to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureFlowNil() { + o.ThreeDSecureFlow.Set(nil) +} + +// UnsetThreeDSecureFlow ensures that no value is present for ThreeDSecureFlow, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureFlow() { + o.ThreeDSecureFlow.Unset() +} + +// GetEciCode returns the EciCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetEciCode() string { + if o == nil || utils.IsNil(o.EciCode.Get()) { + var ret string + return ret + } + return *o.EciCode.Get() +} + +// GetEciCodeOk returns a tuple with the EciCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetEciCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EciCode.Get(), o.EciCode.IsSet() +} + +// HasEciCode returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasEciCode() bool { + if o != nil && o.EciCode.IsSet() { + return true + } + + return false +} + +// SetEciCode gets a reference to the given NullableString and assigns it to the EciCode field. +func (o *CardVerificationResultsThreeDSecure) SetEciCode(v string) { + o.EciCode.Set(&v) +} +// SetEciCodeNil sets the value for EciCode to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetEciCodeNil() { + o.EciCode.Set(nil) +} + +// UnsetEciCode ensures that no value is present for EciCode, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetEciCode() { + o.EciCode.Unset() +} + +// GetThreeDSecureResult returns the ThreeDSecureResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResult() string { + if o == nil || utils.IsNil(o.ThreeDSecureResult.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureResult.Get() +} + +// GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureResult.Get(), o.ThreeDSecureResult.IsSet() +} + +// HasThreeDSecureResult returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResult() bool { + if o != nil && o.ThreeDSecureResult.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureResult gets a reference to the given NullableString and assigns it to the ThreeDSecureResult field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResult(v string) { + o.ThreeDSecureResult.Set(&v) +} +// SetThreeDSecureResultNil sets the value for ThreeDSecureResult to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultNil() { + o.ThreeDSecureResult.Set(nil) +} + +// UnsetThreeDSecureResult ensures that no value is present for ThreeDSecureResult, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResult() { + o.ThreeDSecureResult.Unset() +} + +// GetThreeDSecureResultReason returns the ThreeDSecureResultReason field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReason() string { + if o == nil || utils.IsNil(o.ThreeDSecureResultReason.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureResultReason.Get() +} + +// GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureResultReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureResultReason.Get(), o.ThreeDSecureResultReason.IsSet() +} + +// HasThreeDSecureResultReason returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureResultReason() bool { + if o != nil && o.ThreeDSecureResultReason.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureResultReason gets a reference to the given NullableString and assigns it to the ThreeDSecureResultReason field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReason(v string) { + o.ThreeDSecureResultReason.Set(&v) +} +// SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureResultReasonNil() { + o.ThreeDSecureResultReason.Set(nil) +} + +// UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureResultReason() { + o.ThreeDSecureResultReason.Unset() +} + +// GetThreeDSecureVersion returns the ThreeDSecureVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersion() string { + if o == nil || utils.IsNil(o.ThreeDSecureVersion.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureVersion.Get() +} + +// GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CardVerificationResultsThreeDSecure) GetThreeDSecureVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureVersion.Get(), o.ThreeDSecureVersion.IsSet() +} + +// HasThreeDSecureVersion returns a boolean if a field has been set. +func (o *CardVerificationResultsThreeDSecure) HasThreeDSecureVersion() bool { + if o != nil && o.ThreeDSecureVersion.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureVersion gets a reference to the given NullableString and assigns it to the ThreeDSecureVersion field. +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersion(v string) { + o.ThreeDSecureVersion.Set(&v) +} +// SetThreeDSecureVersionNil sets the value for ThreeDSecureVersion to be an explicit nil +func (o *CardVerificationResultsThreeDSecure) SetThreeDSecureVersionNil() { + o.ThreeDSecureVersion.Set(nil) +} + +// UnsetThreeDSecureVersion ensures that no value is present for ThreeDSecureVersion, not even an explicit nil +func (o *CardVerificationResultsThreeDSecure) UnsetThreeDSecureVersion() { + o.ThreeDSecureVersion.Unset() +} + +func (o CardVerificationResultsThreeDSecure) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CardVerificationResultsThreeDSecure) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ThreeDSecureFlow.IsSet() { + toSerialize["three_d_secure_flow"] = o.ThreeDSecureFlow.Get() + } + if o.EciCode.IsSet() { + toSerialize["eci_code"] = o.EciCode.Get() + } + if o.ThreeDSecureResult.IsSet() { + toSerialize["three_d_secure_result"] = o.ThreeDSecureResult.Get() + } + if o.ThreeDSecureResultReason.IsSet() { + toSerialize["three_d_secure_result_reason"] = o.ThreeDSecureResultReason.Get() + } + if o.ThreeDSecureVersion.IsSet() { + toSerialize["three_d_secure_version"] = o.ThreeDSecureVersion.Get() + } + return toSerialize, nil +} + +type NullableCardVerificationResultsThreeDSecure struct { + value *CardVerificationResultsThreeDSecure + isSet bool +} + +func (v NullableCardVerificationResultsThreeDSecure) Get() *CardVerificationResultsThreeDSecure { + return v.value +} + +func (v *NullableCardVerificationResultsThreeDSecure) Set(val *CardVerificationResultsThreeDSecure) { + v.value = val + v.isSet = true +} + +func (v NullableCardVerificationResultsThreeDSecure) IsSet() bool { + return v.isSet +} + +func (v *NullableCardVerificationResultsThreeDSecure) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCardVerificationResultsThreeDSecure(val *CardVerificationResultsThreeDSecure) *NullableCardVerificationResultsThreeDSecure { + return &NullableCardVerificationResultsThreeDSecure{value: val, isSet: true} +} + +func (v NullableCardVerificationResultsThreeDSecure) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCardVerificationResultsThreeDSecure) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit.go b/payment_request/model_direct_debit.go new file mode 100644 index 00000000..3afc8ac5 --- /dev/null +++ b/payment_request/model_direct_debit.go @@ -0,0 +1,269 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebit type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebit{} + +// DirectDebit Direct Debit Payment Method Details +type DirectDebit struct { + ChannelCode DirectDebitChannelCode `json:"channel_code"` + ChannelProperties NullableDirectDebitChannelProperties `json:"channel_properties"` + Type DirectDebitType `json:"type"` + BankAccount NullableDirectDebitBankAccount `json:"bank_account,omitempty"` + DebitCard NullableDirectDebitDebitCard `json:"debit_card,omitempty"` +} + +// NewDirectDebit instantiates a new DirectDebit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebit(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties, type_ DirectDebitType) *DirectDebit { + this := DirectDebit{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + this.Type = type_ + return &this +} + +// NewDirectDebitWithDefaults instantiates a new DirectDebit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitWithDefaults() *DirectDebit { + this := DirectDebit{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *DirectDebit) GetChannelCode() DirectDebitChannelCode { + if o == nil { + var ret DirectDebitChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *DirectDebit) GetChannelCodeOk() (*DirectDebitChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *DirectDebit) SetChannelCode(v DirectDebitChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for DirectDebitChannelProperties will be returned +func (o *DirectDebit) GetChannelProperties() DirectDebitChannelProperties { + if o == nil || o.ChannelProperties.Get() == nil { + var ret DirectDebitChannelProperties + return ret + } + + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// SetChannelProperties sets field value +func (o *DirectDebit) SetChannelProperties(v DirectDebitChannelProperties) { + o.ChannelProperties.Set(&v) +} + +// GetType returns the Type field value +func (o *DirectDebit) GetType() DirectDebitType { + if o == nil { + var ret DirectDebitType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DirectDebit) GetTypeOk() (*DirectDebitType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DirectDebit) SetType(v DirectDebitType) { + o.Type = v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebit) GetBankAccount() DirectDebitBankAccount { + if o == nil || utils.IsNil(o.BankAccount.Get()) { + var ret DirectDebitBankAccount + return ret + } + return *o.BankAccount.Get() +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetBankAccountOk() (*DirectDebitBankAccount, bool) { + if o == nil { + return nil, false + } + return o.BankAccount.Get(), o.BankAccount.IsSet() +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *DirectDebit) HasBankAccount() bool { + if o != nil && o.BankAccount.IsSet() { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given NullableDirectDebitBankAccount and assigns it to the BankAccount field. +func (o *DirectDebit) SetBankAccount(v DirectDebitBankAccount) { + o.BankAccount.Set(&v) +} +// SetBankAccountNil sets the value for BankAccount to be an explicit nil +func (o *DirectDebit) SetBankAccountNil() { + o.BankAccount.Set(nil) +} + +// UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +func (o *DirectDebit) UnsetBankAccount() { + o.BankAccount.Unset() +} + +// GetDebitCard returns the DebitCard field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebit) GetDebitCard() DirectDebitDebitCard { + if o == nil || utils.IsNil(o.DebitCard.Get()) { + var ret DirectDebitDebitCard + return ret + } + return *o.DebitCard.Get() +} + +// GetDebitCardOk returns a tuple with the DebitCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebit) GetDebitCardOk() (*DirectDebitDebitCard, bool) { + if o == nil { + return nil, false + } + return o.DebitCard.Get(), o.DebitCard.IsSet() +} + +// HasDebitCard returns a boolean if a field has been set. +func (o *DirectDebit) HasDebitCard() bool { + if o != nil && o.DebitCard.IsSet() { + return true + } + + return false +} + +// SetDebitCard gets a reference to the given NullableDirectDebitDebitCard and assigns it to the DebitCard field. +func (o *DirectDebit) SetDebitCard(v DirectDebitDebitCard) { + o.DebitCard.Set(&v) +} +// SetDebitCardNil sets the value for DebitCard to be an explicit nil +func (o *DirectDebit) SetDebitCardNil() { + o.DebitCard.Set(nil) +} + +// UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil +func (o *DirectDebit) UnsetDebitCard() { + o.DebitCard.Unset() +} + +func (o DirectDebit) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties.Get() + toSerialize["type"] = o.Type + if o.BankAccount.IsSet() { + toSerialize["bank_account"] = o.BankAccount.Get() + } + if o.DebitCard.IsSet() { + toSerialize["debit_card"] = o.DebitCard.Get() + } + return toSerialize, nil +} + +type NullableDirectDebit struct { + value *DirectDebit + isSet bool +} + +func (v NullableDirectDebit) Get() *DirectDebit { + return v.value +} + +func (v *NullableDirectDebit) Set(val *DirectDebit) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebit) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebit(val *DirectDebit) *NullableDirectDebit { + return &NullableDirectDebit{value: val, isSet: true} +} + +func (v NullableDirectDebit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_all_of.go b/payment_request/model_direct_debit_all_of.go new file mode 100644 index 00000000..b56db01d --- /dev/null +++ b/payment_request/model_direct_debit_all_of.go @@ -0,0 +1,213 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitAllOf{} + +// DirectDebitAllOf struct for DirectDebitAllOf +type DirectDebitAllOf struct { + Type DirectDebitType `json:"type"` + BankAccount NullableDirectDebitBankAccount `json:"bank_account,omitempty"` + DebitCard NullableDirectDebitDebitCard `json:"debit_card,omitempty"` +} + +// NewDirectDebitAllOf instantiates a new DirectDebitAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitAllOf(type_ DirectDebitType) *DirectDebitAllOf { + this := DirectDebitAllOf{} + this.Type = type_ + return &this +} + +// NewDirectDebitAllOfWithDefaults instantiates a new DirectDebitAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitAllOfWithDefaults() *DirectDebitAllOf { + this := DirectDebitAllOf{} + return &this +} + +// GetType returns the Type field value +func (o *DirectDebitAllOf) GetType() DirectDebitType { + if o == nil { + var ret DirectDebitType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DirectDebitAllOf) GetTypeOk() (*DirectDebitType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DirectDebitAllOf) SetType(v DirectDebitType) { + o.Type = v +} + +// GetBankAccount returns the BankAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitAllOf) GetBankAccount() DirectDebitBankAccount { + if o == nil || utils.IsNil(o.BankAccount.Get()) { + var ret DirectDebitBankAccount + return ret + } + return *o.BankAccount.Get() +} + +// GetBankAccountOk returns a tuple with the BankAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitAllOf) GetBankAccountOk() (*DirectDebitBankAccount, bool) { + if o == nil { + return nil, false + } + return o.BankAccount.Get(), o.BankAccount.IsSet() +} + +// HasBankAccount returns a boolean if a field has been set. +func (o *DirectDebitAllOf) HasBankAccount() bool { + if o != nil && o.BankAccount.IsSet() { + return true + } + + return false +} + +// SetBankAccount gets a reference to the given NullableDirectDebitBankAccount and assigns it to the BankAccount field. +func (o *DirectDebitAllOf) SetBankAccount(v DirectDebitBankAccount) { + o.BankAccount.Set(&v) +} +// SetBankAccountNil sets the value for BankAccount to be an explicit nil +func (o *DirectDebitAllOf) SetBankAccountNil() { + o.BankAccount.Set(nil) +} + +// UnsetBankAccount ensures that no value is present for BankAccount, not even an explicit nil +func (o *DirectDebitAllOf) UnsetBankAccount() { + o.BankAccount.Unset() +} + +// GetDebitCard returns the DebitCard field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitAllOf) GetDebitCard() DirectDebitDebitCard { + if o == nil || utils.IsNil(o.DebitCard.Get()) { + var ret DirectDebitDebitCard + return ret + } + return *o.DebitCard.Get() +} + +// GetDebitCardOk returns a tuple with the DebitCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitAllOf) GetDebitCardOk() (*DirectDebitDebitCard, bool) { + if o == nil { + return nil, false + } + return o.DebitCard.Get(), o.DebitCard.IsSet() +} + +// HasDebitCard returns a boolean if a field has been set. +func (o *DirectDebitAllOf) HasDebitCard() bool { + if o != nil && o.DebitCard.IsSet() { + return true + } + + return false +} + +// SetDebitCard gets a reference to the given NullableDirectDebitDebitCard and assigns it to the DebitCard field. +func (o *DirectDebitAllOf) SetDebitCard(v DirectDebitDebitCard) { + o.DebitCard.Set(&v) +} +// SetDebitCardNil sets the value for DebitCard to be an explicit nil +func (o *DirectDebitAllOf) SetDebitCardNil() { + o.DebitCard.Set(nil) +} + +// UnsetDebitCard ensures that no value is present for DebitCard, not even an explicit nil +func (o *DirectDebitAllOf) UnsetDebitCard() { + o.DebitCard.Unset() +} + +func (o DirectDebitAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if o.BankAccount.IsSet() { + toSerialize["bank_account"] = o.BankAccount.Get() + } + if o.DebitCard.IsSet() { + toSerialize["debit_card"] = o.DebitCard.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitAllOf struct { + value *DirectDebitAllOf + isSet bool +} + +func (v NullableDirectDebitAllOf) Get() *DirectDebitAllOf { + return v.value +} + +func (v *NullableDirectDebitAllOf) Set(val *DirectDebitAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitAllOf(val *DirectDebitAllOf) *NullableDirectDebitAllOf { + return &NullableDirectDebitAllOf{value: val, isSet: true} +} + +func (v NullableDirectDebitAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_bank_account.go b/payment_request/model_direct_debit_bank_account.go new file mode 100644 index 00000000..3ee172bf --- /dev/null +++ b/payment_request/model_direct_debit_bank_account.go @@ -0,0 +1,186 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitBankAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitBankAccount{} + +// DirectDebitBankAccount struct for DirectDebitBankAccount +type DirectDebitBankAccount struct { + MaskedBankAccountNumber NullableString `json:"masked_bank_account_number,omitempty"` + BankAccountHash NullableString `json:"bank_account_hash,omitempty"` +} + +// NewDirectDebitBankAccount instantiates a new DirectDebitBankAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitBankAccount() *DirectDebitBankAccount { + this := DirectDebitBankAccount{} + return &this +} + +// NewDirectDebitBankAccountWithDefaults instantiates a new DirectDebitBankAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitBankAccountWithDefaults() *DirectDebitBankAccount { + this := DirectDebitBankAccount{} + return &this +} + +// GetMaskedBankAccountNumber returns the MaskedBankAccountNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetMaskedBankAccountNumber() string { + if o == nil || utils.IsNil(o.MaskedBankAccountNumber.Get()) { + var ret string + return ret + } + return *o.MaskedBankAccountNumber.Get() +} + +// GetMaskedBankAccountNumberOk returns a tuple with the MaskedBankAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetMaskedBankAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MaskedBankAccountNumber.Get(), o.MaskedBankAccountNumber.IsSet() +} + +// HasMaskedBankAccountNumber returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasMaskedBankAccountNumber() bool { + if o != nil && o.MaskedBankAccountNumber.IsSet() { + return true + } + + return false +} + +// SetMaskedBankAccountNumber gets a reference to the given NullableString and assigns it to the MaskedBankAccountNumber field. +func (o *DirectDebitBankAccount) SetMaskedBankAccountNumber(v string) { + o.MaskedBankAccountNumber.Set(&v) +} +// SetMaskedBankAccountNumberNil sets the value for MaskedBankAccountNumber to be an explicit nil +func (o *DirectDebitBankAccount) SetMaskedBankAccountNumberNil() { + o.MaskedBankAccountNumber.Set(nil) +} + +// UnsetMaskedBankAccountNumber ensures that no value is present for MaskedBankAccountNumber, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetMaskedBankAccountNumber() { + o.MaskedBankAccountNumber.Unset() +} + +// GetBankAccountHash returns the BankAccountHash field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitBankAccount) GetBankAccountHash() string { + if o == nil || utils.IsNil(o.BankAccountHash.Get()) { + var ret string + return ret + } + return *o.BankAccountHash.Get() +} + +// GetBankAccountHashOk returns a tuple with the BankAccountHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitBankAccount) GetBankAccountHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.BankAccountHash.Get(), o.BankAccountHash.IsSet() +} + +// HasBankAccountHash returns a boolean if a field has been set. +func (o *DirectDebitBankAccount) HasBankAccountHash() bool { + if o != nil && o.BankAccountHash.IsSet() { + return true + } + + return false +} + +// SetBankAccountHash gets a reference to the given NullableString and assigns it to the BankAccountHash field. +func (o *DirectDebitBankAccount) SetBankAccountHash(v string) { + o.BankAccountHash.Set(&v) +} +// SetBankAccountHashNil sets the value for BankAccountHash to be an explicit nil +func (o *DirectDebitBankAccount) SetBankAccountHashNil() { + o.BankAccountHash.Set(nil) +} + +// UnsetBankAccountHash ensures that no value is present for BankAccountHash, not even an explicit nil +func (o *DirectDebitBankAccount) UnsetBankAccountHash() { + o.BankAccountHash.Unset() +} + +func (o DirectDebitBankAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitBankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MaskedBankAccountNumber.IsSet() { + toSerialize["masked_bank_account_number"] = o.MaskedBankAccountNumber.Get() + } + if o.BankAccountHash.IsSet() { + toSerialize["bank_account_hash"] = o.BankAccountHash.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitBankAccount struct { + value *DirectDebitBankAccount + isSet bool +} + +func (v NullableDirectDebitBankAccount) Get() *DirectDebitBankAccount { + return v.value +} + +func (v *NullableDirectDebitBankAccount) Set(val *DirectDebitBankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitBankAccount(val *DirectDebitBankAccount) *NullableDirectDebitBankAccount { + return &NullableDirectDebitBankAccount{value: val, isSet: true} +} + +func (v NullableDirectDebitBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_channel_code.go b/payment_request/model_direct_debit_channel_code.go new file mode 100644 index 00000000..600301a7 --- /dev/null +++ b/payment_request/model_direct_debit_channel_code.go @@ -0,0 +1,237 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitChannelCode Direct Debit Channel Code +type DirectDebitChannelCode string + +// List of DirectDebitChannelCode +const ( + DIRECTDEBITCHANNELCODE_BCA_KLIKPAY DirectDebitChannelCode = "BCA_KLIKPAY" + DIRECTDEBITCHANNELCODE_BCA_ONEKLIK DirectDebitChannelCode = "BCA_ONEKLIK" + DIRECTDEBITCHANNELCODE_BRI DirectDebitChannelCode = "BRI" + DIRECTDEBITCHANNELCODE_BNI DirectDebitChannelCode = "BNI" + DIRECTDEBITCHANNELCODE_MANDIRI DirectDebitChannelCode = "MANDIRI" + DIRECTDEBITCHANNELCODE_BPI DirectDebitChannelCode = "BPI" + DIRECTDEBITCHANNELCODE_BDO DirectDebitChannelCode = "BDO" + DIRECTDEBITCHANNELCODE_CIMBNIAGA DirectDebitChannelCode = "CIMBNIAGA" + DIRECTDEBITCHANNELCODE_MTB DirectDebitChannelCode = "MTB" + DIRECTDEBITCHANNELCODE_RCBC DirectDebitChannelCode = "RCBC" + DIRECTDEBITCHANNELCODE_UBP DirectDebitChannelCode = "UBP" + DIRECTDEBITCHANNELCODE_AUTODEBIT_UBP DirectDebitChannelCode = "AUTODEBIT_UBP" + DIRECTDEBITCHANNELCODE_CHINABANK DirectDebitChannelCode = "CHINABANK" + DIRECTDEBITCHANNELCODE_BAY DirectDebitChannelCode = "BAY" + DIRECTDEBITCHANNELCODE_KTB DirectDebitChannelCode = "KTB" + DIRECTDEBITCHANNELCODE_BBL DirectDebitChannelCode = "BBL" + DIRECTDEBITCHANNELCODE_SCB DirectDebitChannelCode = "SCB" + DIRECTDEBITCHANNELCODE_KBANK_MB DirectDebitChannelCode = "KBANK_MB" + DIRECTDEBITCHANNELCODE_BAY_MB DirectDebitChannelCode = "BAY_MB" + DIRECTDEBITCHANNELCODE_KTB_MB DirectDebitChannelCode = "KTB_MB" + DIRECTDEBITCHANNELCODE_BBL_MB DirectDebitChannelCode = "BBL_MB" + DIRECTDEBITCHANNELCODE_SCB_MB DirectDebitChannelCode = "SCB_MB" + DIRECTDEBITCHANNELCODE_BDO_EPAY DirectDebitChannelCode = "BDO_EPAY" + DIRECTDEBITCHANNELCODE_AFFIN_FPX DirectDebitChannelCode = "AFFIN_FPX" + DIRECTDEBITCHANNELCODE_AGRO_FPX DirectDebitChannelCode = "AGRO_FPX" + DIRECTDEBITCHANNELCODE_ALLIANCE_FPX DirectDebitChannelCode = "ALLIANCE_FPX" + DIRECTDEBITCHANNELCODE_AMBANK_FPX DirectDebitChannelCode = "AMBANK_FPX" + DIRECTDEBITCHANNELCODE_ISLAM_FPX DirectDebitChannelCode = "ISLAM_FPX" + DIRECTDEBITCHANNELCODE_MUAMALAT_FPX DirectDebitChannelCode = "MUAMALAT_FPX" + DIRECTDEBITCHANNELCODE_BOC_FPX DirectDebitChannelCode = "BOC_FPX" + DIRECTDEBITCHANNELCODE_RAKYAT_FPX DirectDebitChannelCode = "RAKYAT_FPX" + DIRECTDEBITCHANNELCODE_BSN_FPX DirectDebitChannelCode = "BSN_FPX" + DIRECTDEBITCHANNELCODE_CIMB_FPX DirectDebitChannelCode = "CIMB_FPX" + DIRECTDEBITCHANNELCODE_HLB_FPX DirectDebitChannelCode = "HLB_FPX" + DIRECTDEBITCHANNELCODE_HSBC_FPX DirectDebitChannelCode = "HSBC_FPX" + DIRECTDEBITCHANNELCODE_KFH_FPX DirectDebitChannelCode = "KFH_FPX" + DIRECTDEBITCHANNELCODE_MAYB2_E_FPX DirectDebitChannelCode = "MAYB2E_FPX" + DIRECTDEBITCHANNELCODE_MAYB2_U_FPX DirectDebitChannelCode = "MAYB2U_FPX" + DIRECTDEBITCHANNELCODE_OCBC_FPX DirectDebitChannelCode = "OCBC_FPX" + DIRECTDEBITCHANNELCODE_PUBLIC_FPX DirectDebitChannelCode = "PUBLIC_FPX" + DIRECTDEBITCHANNELCODE_RHB_FPX DirectDebitChannelCode = "RHB_FPX" + DIRECTDEBITCHANNELCODE_SCH_FPX DirectDebitChannelCode = "SCH_FPX" + DIRECTDEBITCHANNELCODE_UOB_FPX DirectDebitChannelCode = "UOB_FPX" + DIRECTDEBITCHANNELCODE_AFFIN_FPX_BUSINESS DirectDebitChannelCode = "AFFIN_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_AGRO_FPX_BUSINESS DirectDebitChannelCode = "AGRO_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_ALLIANCE_FPX_BUSINESS DirectDebitChannelCode = "ALLIANCE_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_AMBANK_FPX_BUSINESS DirectDebitChannelCode = "AMBANK_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_ISLAM_FPX_BUSINESS DirectDebitChannelCode = "ISLAM_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_MUAMALAT_FPX_BUSINESS DirectDebitChannelCode = "MUAMALAT_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_BNP_FPX_BUSINESS DirectDebitChannelCode = "BNP_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_CIMB_FPX_BUSINESS DirectDebitChannelCode = "CIMB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_CITIBANK_FPX_BUSINESS DirectDebitChannelCode = "CITIBANK_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_DEUTSCHE_FPX_BUSINESS DirectDebitChannelCode = "DEUTSCHE_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_HLB_FPX_BUSINESS DirectDebitChannelCode = "HLB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_HSBC_FPX_BUSINESS DirectDebitChannelCode = "HSBC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_RAKYAT_FPX_BUSINESS DirectDebitChannelCode = "RAKYAT_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_KFH_FPX_BUSINESS DirectDebitChannelCode = "KFH_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_MAYB2_E_FPX_BUSINESS DirectDebitChannelCode = "MAYB2E_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_OCBC_FPX_BUSINESS DirectDebitChannelCode = "OCBC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_PUBLIC_FPX_BUSINESS DirectDebitChannelCode = "PUBLIC_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_RHB_FPX_BUSINESS DirectDebitChannelCode = "RHB_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_SCH_FPX_BUSINESS DirectDebitChannelCode = "SCH_FPX_BUSINESS" + DIRECTDEBITCHANNELCODE_UOB_FPX_BUSINESS DirectDebitChannelCode = "UOB_FPX_BUSINESS" +) + +// All allowed values of DirectDebitChannelCode enum +var AllowedDirectDebitChannelCodeEnumValues = []DirectDebitChannelCode{ + "BCA_KLIKPAY", + "BCA_ONEKLIK", + "BRI", + "BNI", + "MANDIRI", + "BPI", + "BDO", + "CIMBNIAGA", + "MTB", + "RCBC", + "UBP", + "AUTODEBIT_UBP", + "CHINABANK", + "BAY", + "KTB", + "BBL", + "SCB", + "KBANK_MB", + "BAY_MB", + "KTB_MB", + "BBL_MB", + "SCB_MB", + "BDO_EPAY", + "AFFIN_FPX", + "AGRO_FPX", + "ALLIANCE_FPX", + "AMBANK_FPX", + "ISLAM_FPX", + "MUAMALAT_FPX", + "BOC_FPX", + "RAKYAT_FPX", + "BSN_FPX", + "CIMB_FPX", + "HLB_FPX", + "HSBC_FPX", + "KFH_FPX", + "MAYB2E_FPX", + "MAYB2U_FPX", + "OCBC_FPX", + "PUBLIC_FPX", + "RHB_FPX", + "SCH_FPX", + "UOB_FPX", + "AFFIN_FPX_BUSINESS", + "AGRO_FPX_BUSINESS", + "ALLIANCE_FPX_BUSINESS", + "AMBANK_FPX_BUSINESS", + "ISLAM_FPX_BUSINESS", + "MUAMALAT_FPX_BUSINESS", + "BNP_FPX_BUSINESS", + "CIMB_FPX_BUSINESS", + "CITIBANK_FPX_BUSINESS", + "DEUTSCHE_FPX_BUSINESS", + "HLB_FPX_BUSINESS", + "HSBC_FPX_BUSINESS", + "RAKYAT_FPX_BUSINESS", + "KFH_FPX_BUSINESS", + "MAYB2E_FPX_BUSINESS", + "OCBC_FPX_BUSINESS", + "PUBLIC_FPX_BUSINESS", + "RHB_FPX_BUSINESS", + "SCH_FPX_BUSINESS", + "UOB_FPX_BUSINESS", +} + +func (v *DirectDebitChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DirectDebitChannelCode(value) + for _, existing := range AllowedDirectDebitChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DirectDebitChannelCode", value) +} + +// NewDirectDebitChannelCodeFromValue returns a pointer to a valid DirectDebitChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDirectDebitChannelCodeFromValue(v string) (*DirectDebitChannelCode, error) { + ev := DirectDebitChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DirectDebitChannelCode: valid values are %v", v, AllowedDirectDebitChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DirectDebitChannelCode) IsValid() bool { + for _, existing := range AllowedDirectDebitChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v DirectDebitChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to DirectDebitChannelCode value +func (v DirectDebitChannelCode) Ptr() *DirectDebitChannelCode { + return &v +} + +type NullableDirectDebitChannelCode struct { + value *DirectDebitChannelCode + isSet bool +} + +func (v NullableDirectDebitChannelCode) Get() *DirectDebitChannelCode { + return v.value +} + +func (v *NullableDirectDebitChannelCode) Set(val *DirectDebitChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelCode(val *DirectDebitChannelCode) *NullableDirectDebitChannelCode { + return &NullableDirectDebitChannelCode{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_direct_debit_channel_properties.go b/payment_request/model_direct_debit_channel_properties.go new file mode 100644 index 00000000..2b46e5ef --- /dev/null +++ b/payment_request/model_direct_debit_channel_properties.go @@ -0,0 +1,129 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitChannelProperties struct for DirectDebitChannelProperties +type DirectDebitChannelProperties struct { + DirectDebitChannelPropertiesBankAccount *DirectDebitChannelPropertiesBankAccount + DirectDebitChannelPropertiesBankRedirect *DirectDebitChannelPropertiesBankRedirect + DirectDebitChannelPropertiesDebitCard *DirectDebitChannelPropertiesDebitCard +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *DirectDebitChannelProperties) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + // try to unmarshal JSON data into DirectDebitChannelPropertiesBankAccount + err = json.Unmarshal(data, &dst.DirectDebitChannelPropertiesBankAccount); + if err == nil { + jsonDirectDebitChannelPropertiesBankAccount, _ := json.Marshal(dst.DirectDebitChannelPropertiesBankAccount) + if string(jsonDirectDebitChannelPropertiesBankAccount) == "{}" { // empty struct + dst.DirectDebitChannelPropertiesBankAccount = nil + } else { + return nil // data stored in dst.DirectDebitChannelPropertiesBankAccount, return on the first match + } + } else { + dst.DirectDebitChannelPropertiesBankAccount = nil + } + + // try to unmarshal JSON data into DirectDebitChannelPropertiesBankRedirect + err = json.Unmarshal(data, &dst.DirectDebitChannelPropertiesBankRedirect); + if err == nil { + jsonDirectDebitChannelPropertiesBankRedirect, _ := json.Marshal(dst.DirectDebitChannelPropertiesBankRedirect) + if string(jsonDirectDebitChannelPropertiesBankRedirect) == "{}" { // empty struct + dst.DirectDebitChannelPropertiesBankRedirect = nil + } else { + return nil // data stored in dst.DirectDebitChannelPropertiesBankRedirect, return on the first match + } + } else { + dst.DirectDebitChannelPropertiesBankRedirect = nil + } + + // try to unmarshal JSON data into DirectDebitChannelPropertiesDebitCard + err = json.Unmarshal(data, &dst.DirectDebitChannelPropertiesDebitCard); + if err == nil { + jsonDirectDebitChannelPropertiesDebitCard, _ := json.Marshal(dst.DirectDebitChannelPropertiesDebitCard) + if string(jsonDirectDebitChannelPropertiesDebitCard) == "{}" { // empty struct + dst.DirectDebitChannelPropertiesDebitCard = nil + } else { + return nil // data stored in dst.DirectDebitChannelPropertiesDebitCard, return on the first match + } + } else { + dst.DirectDebitChannelPropertiesDebitCard = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(DirectDebitChannelProperties)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *DirectDebitChannelProperties) MarshalJSON() ([]byte, error) { + if src.DirectDebitChannelPropertiesBankAccount != nil { + return json.Marshal(&src.DirectDebitChannelPropertiesBankAccount) + } + + if src.DirectDebitChannelPropertiesBankRedirect != nil { + return json.Marshal(&src.DirectDebitChannelPropertiesBankRedirect) + } + + if src.DirectDebitChannelPropertiesDebitCard != nil { + return json.Marshal(&src.DirectDebitChannelPropertiesDebitCard) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableDirectDebitChannelProperties struct { + value *DirectDebitChannelProperties + isSet bool +} + +func (v NullableDirectDebitChannelProperties) Get() *DirectDebitChannelProperties { + return v.value +} + +func (v *NullableDirectDebitChannelProperties) Set(val *DirectDebitChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelProperties(val *DirectDebitChannelProperties) *NullableDirectDebitChannelProperties { + return &NullableDirectDebitChannelProperties{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_channel_properties_bank_account.go b/payment_request/model_direct_debit_channel_properties_bank_account.go new file mode 100644 index 00000000..878fd63b --- /dev/null +++ b/payment_request/model_direct_debit_channel_properties_bank_account.go @@ -0,0 +1,238 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitChannelPropertiesBankAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitChannelPropertiesBankAccount{} + +// DirectDebitChannelPropertiesBankAccount Direct Debit Bank Account Channel Properties +type DirectDebitChannelPropertiesBankAccount struct { + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + FailureReturnUrl *string `json:"failure_return_url,omitempty"` + MobileNumber *string `json:"mobile_number,omitempty"` + IdentityDocumentNumber *string `json:"identity_document_number,omitempty"` +} + +// NewDirectDebitChannelPropertiesBankAccount instantiates a new DirectDebitChannelPropertiesBankAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitChannelPropertiesBankAccount() *DirectDebitChannelPropertiesBankAccount { + this := DirectDebitChannelPropertiesBankAccount{} + return &this +} + +// NewDirectDebitChannelPropertiesBankAccountWithDefaults instantiates a new DirectDebitChannelPropertiesBankAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitChannelPropertiesBankAccountWithDefaults() *DirectDebitChannelPropertiesBankAccount { + this := DirectDebitChannelPropertiesBankAccount{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankAccount) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankAccount) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankAccount) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *DirectDebitChannelPropertiesBankAccount) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankAccount) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankAccount) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankAccount) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *DirectDebitChannelPropertiesBankAccount) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankAccount) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankAccount) GetMobileNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.MobileNumber) { + return nil, false + } + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankAccount) HasMobileNumber() bool { + if o != nil && !utils.IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *DirectDebitChannelPropertiesBankAccount) SetMobileNumber(v string) { + o.MobileNumber = &v +} + +// GetIdentityDocumentNumber returns the IdentityDocumentNumber field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankAccount) GetIdentityDocumentNumber() string { + if o == nil || utils.IsNil(o.IdentityDocumentNumber) { + var ret string + return ret + } + return *o.IdentityDocumentNumber +} + +// GetIdentityDocumentNumberOk returns a tuple with the IdentityDocumentNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankAccount) GetIdentityDocumentNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.IdentityDocumentNumber) { + return nil, false + } + return o.IdentityDocumentNumber, true +} + +// HasIdentityDocumentNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankAccount) HasIdentityDocumentNumber() bool { + if o != nil && !utils.IsNil(o.IdentityDocumentNumber) { + return true + } + + return false +} + +// SetIdentityDocumentNumber gets a reference to the given string and assigns it to the IdentityDocumentNumber field. +func (o *DirectDebitChannelPropertiesBankAccount) SetIdentityDocumentNumber(v string) { + o.IdentityDocumentNumber = &v +} + +func (o DirectDebitChannelPropertiesBankAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitChannelPropertiesBankAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + if !utils.IsNil(o.MobileNumber) { + toSerialize["mobile_number"] = o.MobileNumber + } + if !utils.IsNil(o.IdentityDocumentNumber) { + toSerialize["identity_document_number"] = o.IdentityDocumentNumber + } + return toSerialize, nil +} + +type NullableDirectDebitChannelPropertiesBankAccount struct { + value *DirectDebitChannelPropertiesBankAccount + isSet bool +} + +func (v NullableDirectDebitChannelPropertiesBankAccount) Get() *DirectDebitChannelPropertiesBankAccount { + return v.value +} + +func (v *NullableDirectDebitChannelPropertiesBankAccount) Set(val *DirectDebitChannelPropertiesBankAccount) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelPropertiesBankAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelPropertiesBankAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelPropertiesBankAccount(val *DirectDebitChannelPropertiesBankAccount) *NullableDirectDebitChannelPropertiesBankAccount { + return &NullableDirectDebitChannelPropertiesBankAccount{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelPropertiesBankAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelPropertiesBankAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_channel_properties_bank_redirect.go b/payment_request/model_direct_debit_channel_properties_bank_redirect.go new file mode 100644 index 00000000..fc2b5371 --- /dev/null +++ b/payment_request/model_direct_debit_channel_properties_bank_redirect.go @@ -0,0 +1,203 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitChannelPropertiesBankRedirect type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitChannelPropertiesBankRedirect{} + +// DirectDebitChannelPropertiesBankRedirect Direct Debit Bank Account Channel Properties +type DirectDebitChannelPropertiesBankRedirect struct { + // Mobile number of the customer that is registered to channel + MobileNumber *string `json:"mobile_number,omitempty"` + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + FailureReturnUrl *string `json:"failure_return_url,omitempty"` +} + +// NewDirectDebitChannelPropertiesBankRedirect instantiates a new DirectDebitChannelPropertiesBankRedirect object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitChannelPropertiesBankRedirect() *DirectDebitChannelPropertiesBankRedirect { + this := DirectDebitChannelPropertiesBankRedirect{} + return &this +} + +// NewDirectDebitChannelPropertiesBankRedirectWithDefaults instantiates a new DirectDebitChannelPropertiesBankRedirect object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitChannelPropertiesBankRedirectWithDefaults() *DirectDebitChannelPropertiesBankRedirect { + this := DirectDebitChannelPropertiesBankRedirect{} + return &this +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankRedirect) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) GetMobileNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.MobileNumber) { + return nil, false + } + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) HasMobileNumber() bool { + if o != nil && !utils.IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *DirectDebitChannelPropertiesBankRedirect) SetMobileNumber(v string) { + o.MobileNumber = &v +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankRedirect) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *DirectDebitChannelPropertiesBankRedirect) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesBankRedirect) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesBankRedirect) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *DirectDebitChannelPropertiesBankRedirect) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +func (o DirectDebitChannelPropertiesBankRedirect) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitChannelPropertiesBankRedirect) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.MobileNumber) { + toSerialize["mobile_number"] = o.MobileNumber + } + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + return toSerialize, nil +} + +type NullableDirectDebitChannelPropertiesBankRedirect struct { + value *DirectDebitChannelPropertiesBankRedirect + isSet bool +} + +func (v NullableDirectDebitChannelPropertiesBankRedirect) Get() *DirectDebitChannelPropertiesBankRedirect { + return v.value +} + +func (v *NullableDirectDebitChannelPropertiesBankRedirect) Set(val *DirectDebitChannelPropertiesBankRedirect) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelPropertiesBankRedirect) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelPropertiesBankRedirect) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelPropertiesBankRedirect(val *DirectDebitChannelPropertiesBankRedirect) *NullableDirectDebitChannelPropertiesBankRedirect { + return &NullableDirectDebitChannelPropertiesBankRedirect{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelPropertiesBankRedirect) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelPropertiesBankRedirect) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_channel_properties_debit_card.go b/payment_request/model_direct_debit_channel_properties_debit_card.go new file mode 100644 index 00000000..1af27978 --- /dev/null +++ b/payment_request/model_direct_debit_channel_properties_debit_card.go @@ -0,0 +1,278 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitChannelPropertiesDebitCard type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitChannelPropertiesDebitCard{} + +// DirectDebitChannelPropertiesDebitCard Direct Debit Debit Card Channel Properties +type DirectDebitChannelPropertiesDebitCard struct { + // Mobile number of the customer registered to the partner channel + MobileNumber *string `json:"mobile_number,omitempty"` + AccountNumber *string `json:"account_number,omitempty"` + // Last four digits of the debit card + CardLastFour *string `json:"card_last_four,omitempty"` + // Expiry month and year of the debit card (in MM/YY format) + CardExpiry *string `json:"card_expiry,omitempty"` + // Email address of the customer that is registered to the partner channel + Email *string `json:"email,omitempty"` +} + +// NewDirectDebitChannelPropertiesDebitCard instantiates a new DirectDebitChannelPropertiesDebitCard object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitChannelPropertiesDebitCard() *DirectDebitChannelPropertiesDebitCard { + this := DirectDebitChannelPropertiesDebitCard{} + return &this +} + +// NewDirectDebitChannelPropertiesDebitCardWithDefaults instantiates a new DirectDebitChannelPropertiesDebitCard object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitChannelPropertiesDebitCardWithDefaults() *DirectDebitChannelPropertiesDebitCard { + this := DirectDebitChannelPropertiesDebitCard{} + return &this +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesDebitCard) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber) { + var ret string + return ret + } + return *o.MobileNumber +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesDebitCard) GetMobileNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.MobileNumber) { + return nil, false + } + return o.MobileNumber, true +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesDebitCard) HasMobileNumber() bool { + if o != nil && !utils.IsNil(o.MobileNumber) { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given string and assigns it to the MobileNumber field. +func (o *DirectDebitChannelPropertiesDebitCard) SetMobileNumber(v string) { + o.MobileNumber = &v +} + +// GetAccountNumber returns the AccountNumber field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesDebitCard) GetAccountNumber() string { + if o == nil || utils.IsNil(o.AccountNumber) { + var ret string + return ret + } + return *o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesDebitCard) GetAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.AccountNumber) { + return nil, false + } + return o.AccountNumber, true +} + +// HasAccountNumber returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesDebitCard) HasAccountNumber() bool { + if o != nil && !utils.IsNil(o.AccountNumber) { + return true + } + + return false +} + +// SetAccountNumber gets a reference to the given string and assigns it to the AccountNumber field. +func (o *DirectDebitChannelPropertiesDebitCard) SetAccountNumber(v string) { + o.AccountNumber = &v +} + +// GetCardLastFour returns the CardLastFour field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesDebitCard) GetCardLastFour() string { + if o == nil || utils.IsNil(o.CardLastFour) { + var ret string + return ret + } + return *o.CardLastFour +} + +// GetCardLastFourOk returns a tuple with the CardLastFour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesDebitCard) GetCardLastFourOk() (*string, bool) { + if o == nil || utils.IsNil(o.CardLastFour) { + return nil, false + } + return o.CardLastFour, true +} + +// HasCardLastFour returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesDebitCard) HasCardLastFour() bool { + if o != nil && !utils.IsNil(o.CardLastFour) { + return true + } + + return false +} + +// SetCardLastFour gets a reference to the given string and assigns it to the CardLastFour field. +func (o *DirectDebitChannelPropertiesDebitCard) SetCardLastFour(v string) { + o.CardLastFour = &v +} + +// GetCardExpiry returns the CardExpiry field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesDebitCard) GetCardExpiry() string { + if o == nil || utils.IsNil(o.CardExpiry) { + var ret string + return ret + } + return *o.CardExpiry +} + +// GetCardExpiryOk returns a tuple with the CardExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesDebitCard) GetCardExpiryOk() (*string, bool) { + if o == nil || utils.IsNil(o.CardExpiry) { + return nil, false + } + return o.CardExpiry, true +} + +// HasCardExpiry returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesDebitCard) HasCardExpiry() bool { + if o != nil && !utils.IsNil(o.CardExpiry) { + return true + } + + return false +} + +// SetCardExpiry gets a reference to the given string and assigns it to the CardExpiry field. +func (o *DirectDebitChannelPropertiesDebitCard) SetCardExpiry(v string) { + o.CardExpiry = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *DirectDebitChannelPropertiesDebitCard) GetEmail() string { + if o == nil || utils.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitChannelPropertiesDebitCard) GetEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *DirectDebitChannelPropertiesDebitCard) HasEmail() bool { + if o != nil && !utils.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *DirectDebitChannelPropertiesDebitCard) SetEmail(v string) { + o.Email = &v +} + +func (o DirectDebitChannelPropertiesDebitCard) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitChannelPropertiesDebitCard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.MobileNumber) { + toSerialize["mobile_number"] = o.MobileNumber + } + if !utils.IsNil(o.AccountNumber) { + toSerialize["account_number"] = o.AccountNumber + } + if !utils.IsNil(o.CardLastFour) { + toSerialize["card_last_four"] = o.CardLastFour + } + if !utils.IsNil(o.CardExpiry) { + toSerialize["card_expiry"] = o.CardExpiry + } + if !utils.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + return toSerialize, nil +} + +type NullableDirectDebitChannelPropertiesDebitCard struct { + value *DirectDebitChannelPropertiesDebitCard + isSet bool +} + +func (v NullableDirectDebitChannelPropertiesDebitCard) Get() *DirectDebitChannelPropertiesDebitCard { + return v.value +} + +func (v *NullableDirectDebitChannelPropertiesDebitCard) Set(val *DirectDebitChannelPropertiesDebitCard) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitChannelPropertiesDebitCard) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitChannelPropertiesDebitCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitChannelPropertiesDebitCard(val *DirectDebitChannelPropertiesDebitCard) *NullableDirectDebitChannelPropertiesDebitCard { + return &NullableDirectDebitChannelPropertiesDebitCard{value: val, isSet: true} +} + +func (v NullableDirectDebitChannelPropertiesDebitCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitChannelPropertiesDebitCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_debit_card.go b/payment_request/model_direct_debit_debit_card.go new file mode 100644 index 00000000..ae34955f --- /dev/null +++ b/payment_request/model_direct_debit_debit_card.go @@ -0,0 +1,318 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitDebitCard type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitDebitCard{} + +// DirectDebitDebitCard struct for DirectDebitDebitCard +type DirectDebitDebitCard struct { + // Mobile number of the customer registered to the partner channel + MobileNumber NullableString `json:"mobile_number,omitempty"` + AccountNumber *string `json:"account_number,omitempty"` + // Last four digits of the debit card + CardLastFour NullableString `json:"card_last_four,omitempty"` + // Expiry month and year of the debit card (in MM/YY format) + CardExpiry NullableString `json:"card_expiry,omitempty"` + // Email address of the customer that is registered to the partner channel + Email NullableString `json:"email,omitempty"` +} + +// NewDirectDebitDebitCard instantiates a new DirectDebitDebitCard object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitDebitCard() *DirectDebitDebitCard { + this := DirectDebitDebitCard{} + return &this +} + +// NewDirectDebitDebitCardWithDefaults instantiates a new DirectDebitDebitCard object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitDebitCardWithDefaults() *DirectDebitDebitCard { + this := DirectDebitDebitCard{} + return &this +} + +// GetMobileNumber returns the MobileNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetMobileNumber() string { + if o == nil || utils.IsNil(o.MobileNumber.Get()) { + var ret string + return ret + } + return *o.MobileNumber.Get() +} + +// GetMobileNumberOk returns a tuple with the MobileNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetMobileNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MobileNumber.Get(), o.MobileNumber.IsSet() +} + +// HasMobileNumber returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasMobileNumber() bool { + if o != nil && o.MobileNumber.IsSet() { + return true + } + + return false +} + +// SetMobileNumber gets a reference to the given NullableString and assigns it to the MobileNumber field. +func (o *DirectDebitDebitCard) SetMobileNumber(v string) { + o.MobileNumber.Set(&v) +} +// SetMobileNumberNil sets the value for MobileNumber to be an explicit nil +func (o *DirectDebitDebitCard) SetMobileNumberNil() { + o.MobileNumber.Set(nil) +} + +// UnsetMobileNumber ensures that no value is present for MobileNumber, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetMobileNumber() { + o.MobileNumber.Unset() +} + +// GetAccountNumber returns the AccountNumber field value if set, zero value otherwise. +func (o *DirectDebitDebitCard) GetAccountNumber() string { + if o == nil || utils.IsNil(o.AccountNumber) { + var ret string + return ret + } + return *o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitDebitCard) GetAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.AccountNumber) { + return nil, false + } + return o.AccountNumber, true +} + +// HasAccountNumber returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasAccountNumber() bool { + if o != nil && !utils.IsNil(o.AccountNumber) { + return true + } + + return false +} + +// SetAccountNumber gets a reference to the given string and assigns it to the AccountNumber field. +func (o *DirectDebitDebitCard) SetAccountNumber(v string) { + o.AccountNumber = &v +} + +// GetCardLastFour returns the CardLastFour field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetCardLastFour() string { + if o == nil || utils.IsNil(o.CardLastFour.Get()) { + var ret string + return ret + } + return *o.CardLastFour.Get() +} + +// GetCardLastFourOk returns a tuple with the CardLastFour field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetCardLastFourOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardLastFour.Get(), o.CardLastFour.IsSet() +} + +// HasCardLastFour returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasCardLastFour() bool { + if o != nil && o.CardLastFour.IsSet() { + return true + } + + return false +} + +// SetCardLastFour gets a reference to the given NullableString and assigns it to the CardLastFour field. +func (o *DirectDebitDebitCard) SetCardLastFour(v string) { + o.CardLastFour.Set(&v) +} +// SetCardLastFourNil sets the value for CardLastFour to be an explicit nil +func (o *DirectDebitDebitCard) SetCardLastFourNil() { + o.CardLastFour.Set(nil) +} + +// UnsetCardLastFour ensures that no value is present for CardLastFour, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetCardLastFour() { + o.CardLastFour.Unset() +} + +// GetCardExpiry returns the CardExpiry field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetCardExpiry() string { + if o == nil || utils.IsNil(o.CardExpiry.Get()) { + var ret string + return ret + } + return *o.CardExpiry.Get() +} + +// GetCardExpiryOk returns a tuple with the CardExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetCardExpiryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardExpiry.Get(), o.CardExpiry.IsSet() +} + +// HasCardExpiry returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasCardExpiry() bool { + if o != nil && o.CardExpiry.IsSet() { + return true + } + + return false +} + +// SetCardExpiry gets a reference to the given NullableString and assigns it to the CardExpiry field. +func (o *DirectDebitDebitCard) SetCardExpiry(v string) { + o.CardExpiry.Set(&v) +} +// SetCardExpiryNil sets the value for CardExpiry to be an explicit nil +func (o *DirectDebitDebitCard) SetCardExpiryNil() { + o.CardExpiry.Set(nil) +} + +// UnsetCardExpiry ensures that no value is present for CardExpiry, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetCardExpiry() { + o.CardExpiry.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DirectDebitDebitCard) GetEmail() string { + if o == nil || utils.IsNil(o.Email.Get()) { + var ret string + return ret + } + return *o.Email.Get() +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitDebitCard) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Email.Get(), o.Email.IsSet() +} + +// HasEmail returns a boolean if a field has been set. +func (o *DirectDebitDebitCard) HasEmail() bool { + if o != nil && o.Email.IsSet() { + return true + } + + return false +} + +// SetEmail gets a reference to the given NullableString and assigns it to the Email field. +func (o *DirectDebitDebitCard) SetEmail(v string) { + o.Email.Set(&v) +} +// SetEmailNil sets the value for Email to be an explicit nil +func (o *DirectDebitDebitCard) SetEmailNil() { + o.Email.Set(nil) +} + +// UnsetEmail ensures that no value is present for Email, not even an explicit nil +func (o *DirectDebitDebitCard) UnsetEmail() { + o.Email.Unset() +} + +func (o DirectDebitDebitCard) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitDebitCard) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MobileNumber.IsSet() { + toSerialize["mobile_number"] = o.MobileNumber.Get() + } + if !utils.IsNil(o.AccountNumber) { + toSerialize["account_number"] = o.AccountNumber + } + if o.CardLastFour.IsSet() { + toSerialize["card_last_four"] = o.CardLastFour.Get() + } + if o.CardExpiry.IsSet() { + toSerialize["card_expiry"] = o.CardExpiry.Get() + } + if o.Email.IsSet() { + toSerialize["email"] = o.Email.Get() + } + return toSerialize, nil +} + +type NullableDirectDebitDebitCard struct { + value *DirectDebitDebitCard + isSet bool +} + +func (v NullableDirectDebitDebitCard) Get() *DirectDebitDebitCard { + return v.value +} + +func (v *NullableDirectDebitDebitCard) Set(val *DirectDebitDebitCard) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitDebitCard) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitDebitCard) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitDebitCard(val *DirectDebitDebitCard) *NullableDirectDebitDebitCard { + return &NullableDirectDebitDebitCard{value: val, isSet: true} +} + +func (v NullableDirectDebitDebitCard) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitDebitCard) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_parameters.go b/payment_request/model_direct_debit_parameters.go new file mode 100644 index 00000000..df158f23 --- /dev/null +++ b/payment_request/model_direct_debit_parameters.go @@ -0,0 +1,186 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DirectDebitParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DirectDebitParameters{} + +// DirectDebitParameters struct for DirectDebitParameters +type DirectDebitParameters struct { + ChannelCode DirectDebitChannelCode `json:"channel_code"` + ChannelProperties NullableDirectDebitChannelProperties `json:"channel_properties"` + Type *DirectDebitType `json:"type,omitempty"` +} + +// NewDirectDebitParameters instantiates a new DirectDebitParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDirectDebitParameters(channelCode DirectDebitChannelCode, channelProperties NullableDirectDebitChannelProperties) *DirectDebitParameters { + this := DirectDebitParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewDirectDebitParametersWithDefaults instantiates a new DirectDebitParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDirectDebitParametersWithDefaults() *DirectDebitParameters { + this := DirectDebitParameters{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *DirectDebitParameters) GetChannelCode() DirectDebitChannelCode { + if o == nil { + var ret DirectDebitChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *DirectDebitParameters) GetChannelCodeOk() (*DirectDebitChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *DirectDebitParameters) SetChannelCode(v DirectDebitChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +// If the value is explicit nil, the zero value for DirectDebitChannelProperties will be returned +func (o *DirectDebitParameters) GetChannelProperties() DirectDebitChannelProperties { + if o == nil || o.ChannelProperties.Get() == nil { + var ret DirectDebitChannelProperties + return ret + } + + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DirectDebitParameters) GetChannelPropertiesOk() (*DirectDebitChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// SetChannelProperties sets field value +func (o *DirectDebitParameters) SetChannelProperties(v DirectDebitChannelProperties) { + o.ChannelProperties.Set(&v) +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DirectDebitParameters) GetType() DirectDebitType { + if o == nil || utils.IsNil(o.Type) { + var ret DirectDebitType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DirectDebitParameters) GetTypeOk() (*DirectDebitType, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DirectDebitParameters) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given DirectDebitType and assigns it to the Type field. +func (o *DirectDebitParameters) SetType(v DirectDebitType) { + o.Type = &v +} + +func (o DirectDebitParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DirectDebitParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties.Get() + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableDirectDebitParameters struct { + value *DirectDebitParameters + isSet bool +} + +func (v NullableDirectDebitParameters) Get() *DirectDebitParameters { + return v.value +} + +func (v *NullableDirectDebitParameters) Set(val *DirectDebitParameters) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitParameters(val *DirectDebitParameters) *NullableDirectDebitParameters { + return &NullableDirectDebitParameters{value: val, isSet: true} +} + +func (v NullableDirectDebitParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_direct_debit_type.go b/payment_request/model_direct_debit_type.go new file mode 100644 index 00000000..33ea6fe0 --- /dev/null +++ b/payment_request/model_direct_debit_type.go @@ -0,0 +1,117 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// DirectDebitType the model 'DirectDebitType' +type DirectDebitType string + +// List of DirectDebitType +const ( + DIRECTDEBITTYPE_DEBIT_CARD DirectDebitType = "DEBIT_CARD" + DIRECTDEBITTYPE_BANK_ACCOUNT DirectDebitType = "BANK_ACCOUNT" + DIRECTDEBITTYPE_BANK_REDIRECT DirectDebitType = "BANK_REDIRECT" +) + +// All allowed values of DirectDebitType enum +var AllowedDirectDebitTypeEnumValues = []DirectDebitType{ + "DEBIT_CARD", + "BANK_ACCOUNT", + "BANK_REDIRECT", +} + +func (v *DirectDebitType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DirectDebitType(value) + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DirectDebitType", value) +} + +// NewDirectDebitTypeFromValue returns a pointer to a valid DirectDebitType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDirectDebitTypeFromValue(v string) (*DirectDebitType, error) { + ev := DirectDebitType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DirectDebitType: valid values are %v", v, AllowedDirectDebitTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DirectDebitType) IsValid() bool { + for _, existing := range AllowedDirectDebitTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v DirectDebitType) String() string { + return string(v) +} + +// Ptr returns reference to DirectDebitType value +func (v DirectDebitType) Ptr() *DirectDebitType { + return &v +} + +type NullableDirectDebitType struct { + value *DirectDebitType + isSet bool +} + +func (v NullableDirectDebitType) Get() *DirectDebitType { + return v.value +} + +func (v *NullableDirectDebitType) Set(val *DirectDebitType) { + v.value = val + v.isSet = true +} + +func (v NullableDirectDebitType) IsSet() bool { + return v.isSet +} + +func (v *NullableDirectDebitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDirectDebitType(val *DirectDebitType) *NullableDirectDebitType { + return &NullableDirectDebitType{value: val, isSet: true} +} + +func (v NullableDirectDebitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDirectDebitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_e_wallet.go b/payment_request/model_e_wallet.go new file mode 100644 index 00000000..219ec3dd --- /dev/null +++ b/payment_request/model_e_wallet.go @@ -0,0 +1,202 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWallet type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWallet{} + +// EWallet Ewallet Payment Method Details +type EWallet struct { + ChannelCode *EWalletChannelCode `json:"channel_code,omitempty"` + ChannelProperties *EWalletChannelProperties `json:"channel_properties,omitempty"` + Account *EWalletAccount `json:"account,omitempty"` +} + +// NewEWallet instantiates a new EWallet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWallet() *EWallet { + this := EWallet{} + return &this +} + +// NewEWalletWithDefaults instantiates a new EWallet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletWithDefaults() *EWallet { + this := EWallet{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise. +func (o *EWallet) GetChannelCode() EWalletChannelCode { + if o == nil || utils.IsNil(o.ChannelCode) { + var ret EWalletChannelCode + return ret + } + return *o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWallet) GetChannelCodeOk() (*EWalletChannelCode, bool) { + if o == nil || utils.IsNil(o.ChannelCode) { + return nil, false + } + return o.ChannelCode, true +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *EWallet) HasChannelCode() bool { + if o != nil && !utils.IsNil(o.ChannelCode) { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given EWalletChannelCode and assigns it to the ChannelCode field. +func (o *EWallet) SetChannelCode(v EWalletChannelCode) { + o.ChannelCode = &v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *EWallet) GetChannelProperties() EWalletChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret EWalletChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWallet) GetChannelPropertiesOk() (*EWalletChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *EWallet) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given EWalletChannelProperties and assigns it to the ChannelProperties field. +func (o *EWallet) SetChannelProperties(v EWalletChannelProperties) { + o.ChannelProperties = &v +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *EWallet) GetAccount() EWalletAccount { + if o == nil || utils.IsNil(o.Account) { + var ret EWalletAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWallet) GetAccountOk() (*EWalletAccount, bool) { + if o == nil || utils.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *EWallet) HasAccount() bool { + if o != nil && !utils.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given EWalletAccount and assigns it to the Account field. +func (o *EWallet) SetAccount(v EWalletAccount) { + o.Account = &v +} + +func (o EWallet) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWallet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ChannelCode) { + toSerialize["channel_code"] = o.ChannelCode + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if !utils.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + return toSerialize, nil +} + +type NullableEWallet struct { + value *EWallet + isSet bool +} + +func (v NullableEWallet) Get() *EWallet { + return v.value +} + +func (v *NullableEWallet) Set(val *EWallet) { + v.value = val + v.isSet = true +} + +func (v NullableEWallet) IsSet() bool { + return v.isSet +} + +func (v *NullableEWallet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWallet(val *EWallet) *NullableEWallet { + return &NullableEWallet{value: val, isSet: true} +} + +func (v NullableEWallet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWallet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_e_wallet_account.go b/payment_request/model_e_wallet_account.go new file mode 100644 index 00000000..e81b24b9 --- /dev/null +++ b/payment_request/model_e_wallet_account.go @@ -0,0 +1,282 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletAccount{} + +// EWalletAccount EWallet Account Properties +type EWalletAccount struct { + // Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable + Name NullableString `json:"name,omitempty"` + // Identifier from eWallet provider e.g. phone number. The value is null if unavailable + AccountDetails NullableString `json:"account_details,omitempty"` + // The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable + Balance NullableFloat64 `json:"balance,omitempty"` + // The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl + PointBalance NullableFloat64 `json:"point_balance,omitempty"` +} + +// NewEWalletAccount instantiates a new EWalletAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletAccount() *EWalletAccount { + this := EWalletAccount{} + return &this +} + +// NewEWalletAccountWithDefaults instantiates a new EWalletAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletAccountWithDefaults() *EWalletAccount { + this := EWalletAccount{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetName() string { + if o == nil || utils.IsNil(o.Name.Get()) { + var ret string + return ret + } + return *o.Name.Get() +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name.Get(), o.Name.IsSet() +} + +// HasName returns a boolean if a field has been set. +func (o *EWalletAccount) HasName() bool { + if o != nil && o.Name.IsSet() { + return true + } + + return false +} + +// SetName gets a reference to the given NullableString and assigns it to the Name field. +func (o *EWalletAccount) SetName(v string) { + o.Name.Set(&v) +} +// SetNameNil sets the value for Name to be an explicit nil +func (o *EWalletAccount) SetNameNil() { + o.Name.Set(nil) +} + +// UnsetName ensures that no value is present for Name, not even an explicit nil +func (o *EWalletAccount) UnsetName() { + o.Name.Unset() +} + +// GetAccountDetails returns the AccountDetails field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetAccountDetails() string { + if o == nil || utils.IsNil(o.AccountDetails.Get()) { + var ret string + return ret + } + return *o.AccountDetails.Get() +} + +// GetAccountDetailsOk returns a tuple with the AccountDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetAccountDetailsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccountDetails.Get(), o.AccountDetails.IsSet() +} + +// HasAccountDetails returns a boolean if a field has been set. +func (o *EWalletAccount) HasAccountDetails() bool { + if o != nil && o.AccountDetails.IsSet() { + return true + } + + return false +} + +// SetAccountDetails gets a reference to the given NullableString and assigns it to the AccountDetails field. +func (o *EWalletAccount) SetAccountDetails(v string) { + o.AccountDetails.Set(&v) +} +// SetAccountDetailsNil sets the value for AccountDetails to be an explicit nil +func (o *EWalletAccount) SetAccountDetailsNil() { + o.AccountDetails.Set(nil) +} + +// UnsetAccountDetails ensures that no value is present for AccountDetails, not even an explicit nil +func (o *EWalletAccount) UnsetAccountDetails() { + o.AccountDetails.Unset() +} + +// GetBalance returns the Balance field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetBalance() float64 { + if o == nil || utils.IsNil(o.Balance.Get()) { + var ret float64 + return ret + } + return *o.Balance.Get() +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetBalanceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Balance.Get(), o.Balance.IsSet() +} + +// HasBalance returns a boolean if a field has been set. +func (o *EWalletAccount) HasBalance() bool { + if o != nil && o.Balance.IsSet() { + return true + } + + return false +} + +// SetBalance gets a reference to the given NullableFloat64 and assigns it to the Balance field. +func (o *EWalletAccount) SetBalance(v float64) { + o.Balance.Set(&v) +} +// SetBalanceNil sets the value for Balance to be an explicit nil +func (o *EWalletAccount) SetBalanceNil() { + o.Balance.Set(nil) +} + +// UnsetBalance ensures that no value is present for Balance, not even an explicit nil +func (o *EWalletAccount) UnsetBalance() { + o.Balance.Unset() +} + +// GetPointBalance returns the PointBalance field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EWalletAccount) GetPointBalance() float64 { + if o == nil || utils.IsNil(o.PointBalance.Get()) { + var ret float64 + return ret + } + return *o.PointBalance.Get() +} + +// GetPointBalanceOk returns a tuple with the PointBalance field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EWalletAccount) GetPointBalanceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.PointBalance.Get(), o.PointBalance.IsSet() +} + +// HasPointBalance returns a boolean if a field has been set. +func (o *EWalletAccount) HasPointBalance() bool { + if o != nil && o.PointBalance.IsSet() { + return true + } + + return false +} + +// SetPointBalance gets a reference to the given NullableFloat64 and assigns it to the PointBalance field. +func (o *EWalletAccount) SetPointBalance(v float64) { + o.PointBalance.Set(&v) +} +// SetPointBalanceNil sets the value for PointBalance to be an explicit nil +func (o *EWalletAccount) SetPointBalanceNil() { + o.PointBalance.Set(nil) +} + +// UnsetPointBalance ensures that no value is present for PointBalance, not even an explicit nil +func (o *EWalletAccount) UnsetPointBalance() { + o.PointBalance.Unset() +} + +func (o EWalletAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Name.IsSet() { + toSerialize["name"] = o.Name.Get() + } + if o.AccountDetails.IsSet() { + toSerialize["account_details"] = o.AccountDetails.Get() + } + if o.Balance.IsSet() { + toSerialize["balance"] = o.Balance.Get() + } + if o.PointBalance.IsSet() { + toSerialize["point_balance"] = o.PointBalance.Get() + } + return toSerialize, nil +} + +type NullableEWalletAccount struct { + value *EWalletAccount + isSet bool +} + +func (v NullableEWalletAccount) Get() *EWalletAccount { + return v.value +} + +func (v *NullableEWalletAccount) Set(val *EWalletAccount) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletAccount(val *EWalletAccount) *NullableEWalletAccount { + return &NullableEWalletAccount{value: val, isSet: true} +} + +func (v NullableEWalletAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_e_wallet_all_of.go b/payment_request/model_e_wallet_all_of.go new file mode 100644 index 00000000..e48403b5 --- /dev/null +++ b/payment_request/model_e_wallet_all_of.go @@ -0,0 +1,130 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletAllOf{} + +// EWalletAllOf struct for EWalletAllOf +type EWalletAllOf struct { + Account *EWalletAccount `json:"account,omitempty"` +} + +// NewEWalletAllOf instantiates a new EWalletAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletAllOf() *EWalletAllOf { + this := EWalletAllOf{} + return &this +} + +// NewEWalletAllOfWithDefaults instantiates a new EWalletAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletAllOfWithDefaults() *EWalletAllOf { + this := EWalletAllOf{} + return &this +} + +// GetAccount returns the Account field value if set, zero value otherwise. +func (o *EWalletAllOf) GetAccount() EWalletAccount { + if o == nil || utils.IsNil(o.Account) { + var ret EWalletAccount + return ret + } + return *o.Account +} + +// GetAccountOk returns a tuple with the Account field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletAllOf) GetAccountOk() (*EWalletAccount, bool) { + if o == nil || utils.IsNil(o.Account) { + return nil, false + } + return o.Account, true +} + +// HasAccount returns a boolean if a field has been set. +func (o *EWalletAllOf) HasAccount() bool { + if o != nil && !utils.IsNil(o.Account) { + return true + } + + return false +} + +// SetAccount gets a reference to the given EWalletAccount and assigns it to the Account field. +func (o *EWalletAllOf) SetAccount(v EWalletAccount) { + o.Account = &v +} + +func (o EWalletAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Account) { + toSerialize["account"] = o.Account + } + return toSerialize, nil +} + +type NullableEWalletAllOf struct { + value *EWalletAllOf + isSet bool +} + +func (v NullableEWalletAllOf) Get() *EWalletAllOf { + return v.value +} + +func (v *NullableEWalletAllOf) Set(val *EWalletAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletAllOf(val *EWalletAllOf) *NullableEWalletAllOf { + return &NullableEWalletAllOf{value: val, isSet: true} +} + +func (v NullableEWalletAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_e_wallet_channel_code.go b/payment_request/model_e_wallet_channel_code.go new file mode 100644 index 00000000..d60aea80 --- /dev/null +++ b/payment_request/model_e_wallet_channel_code.go @@ -0,0 +1,149 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// EWalletChannelCode Ewallet Channel Code +type EWalletChannelCode string + +// List of EWalletChannelCode +const ( + EWALLETCHANNELCODE_GCASH EWalletChannelCode = "GCASH" + EWALLETCHANNELCODE_GRABPAY EWalletChannelCode = "GRABPAY" + EWALLETCHANNELCODE_PAYMAYA EWalletChannelCode = "PAYMAYA" + EWALLETCHANNELCODE_DANA EWalletChannelCode = "DANA" + EWALLETCHANNELCODE_OVO EWalletChannelCode = "OVO" + EWALLETCHANNELCODE_LINKAJA EWalletChannelCode = "LINKAJA" + EWALLETCHANNELCODE_SHOPEEPAY EWalletChannelCode = "SHOPEEPAY" + EWALLETCHANNELCODE_NEXCASH EWalletChannelCode = "NEXCASH" + EWALLETCHANNELCODE_ASTRAPAY EWalletChannelCode = "ASTRAPAY" + EWALLETCHANNELCODE_JENIUSPAY EWalletChannelCode = "JENIUSPAY" + EWALLETCHANNELCODE_APPOTA EWalletChannelCode = "APPOTA" + EWALLETCHANNELCODE_MOMO EWalletChannelCode = "MOMO" + EWALLETCHANNELCODE_VNPTWALLET EWalletChannelCode = "VNPTWALLET" + EWALLETCHANNELCODE_VIETTELPAY EWalletChannelCode = "VIETTELPAY" + EWALLETCHANNELCODE_ZALOPAY EWalletChannelCode = "ZALOPAY" + EWALLETCHANNELCODE_WECHATPAY EWalletChannelCode = "WECHATPAY" + EWALLETCHANNELCODE_LINEPAY EWalletChannelCode = "LINEPAY" + EWALLETCHANNELCODE_TRUEMONEY EWalletChannelCode = "TRUEMONEY" + EWALLETCHANNELCODE_ALIPAY EWalletChannelCode = "ALIPAY" +) + +// All allowed values of EWalletChannelCode enum +var AllowedEWalletChannelCodeEnumValues = []EWalletChannelCode{ + "GCASH", + "GRABPAY", + "PAYMAYA", + "DANA", + "OVO", + "LINKAJA", + "SHOPEEPAY", + "NEXCASH", + "ASTRAPAY", + "JENIUSPAY", + "APPOTA", + "MOMO", + "VNPTWALLET", + "VIETTELPAY", + "ZALOPAY", + "WECHATPAY", + "LINEPAY", + "TRUEMONEY", + "ALIPAY", +} + +func (v *EWalletChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EWalletChannelCode(value) + for _, existing := range AllowedEWalletChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EWalletChannelCode", value) +} + +// NewEWalletChannelCodeFromValue returns a pointer to a valid EWalletChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEWalletChannelCodeFromValue(v string) (*EWalletChannelCode, error) { + ev := EWalletChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EWalletChannelCode: valid values are %v", v, AllowedEWalletChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EWalletChannelCode) IsValid() bool { + for _, existing := range AllowedEWalletChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v EWalletChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to EWalletChannelCode value +func (v EWalletChannelCode) Ptr() *EWalletChannelCode { + return &v +} + +type NullableEWalletChannelCode struct { + value *EWalletChannelCode + isSet bool +} + +func (v NullableEWalletChannelCode) Get() *EWalletChannelCode { + return v.value +} + +func (v *NullableEWalletChannelCode) Set(val *EWalletChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletChannelCode(val *EWalletChannelCode) *NullableEWalletChannelCode { + return &NullableEWalletChannelCode{value: val, isSet: true} +} + +func (v NullableEWalletChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_e_wallet_channel_properties.go b/payment_request/model_e_wallet_channel_properties.go new file mode 100644 index 00000000..2b8df817 --- /dev/null +++ b/payment_request/model_e_wallet_channel_properties.go @@ -0,0 +1,314 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletChannelProperties{} + +// EWalletChannelProperties Ewallet Channel Properties +type EWalletChannelProperties struct { + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl *string `json:"failure_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization cancelled + CancelReturnUrl *string `json:"cancel_return_url,omitempty"` + // REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. + RedeemPoints *string `json:"redeem_points,omitempty"` + Mobilenumber *string `json:"mobile:number,omitempty"` + Cashtag *string `json:"cashtag,omitempty"` +} + +// NewEWalletChannelProperties instantiates a new EWalletChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletChannelProperties() *EWalletChannelProperties { + this := EWalletChannelProperties{} + return &this +} + +// NewEWalletChannelPropertiesWithDefaults instantiates a new EWalletChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletChannelPropertiesWithDefaults() *EWalletChannelProperties { + this := EWalletChannelProperties{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *EWalletChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *EWalletChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +// GetCancelReturnUrl returns the CancelReturnUrl field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetCancelReturnUrl() string { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + var ret string + return ret + } + return *o.CancelReturnUrl +} + +// GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetCancelReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + return nil, false + } + return o.CancelReturnUrl, true +} + +// HasCancelReturnUrl returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasCancelReturnUrl() bool { + if o != nil && !utils.IsNil(o.CancelReturnUrl) { + return true + } + + return false +} + +// SetCancelReturnUrl gets a reference to the given string and assigns it to the CancelReturnUrl field. +func (o *EWalletChannelProperties) SetCancelReturnUrl(v string) { + o.CancelReturnUrl = &v +} + +// GetRedeemPoints returns the RedeemPoints field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetRedeemPoints() string { + if o == nil || utils.IsNil(o.RedeemPoints) { + var ret string + return ret + } + return *o.RedeemPoints +} + +// GetRedeemPointsOk returns a tuple with the RedeemPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetRedeemPointsOk() (*string, bool) { + if o == nil || utils.IsNil(o.RedeemPoints) { + return nil, false + } + return o.RedeemPoints, true +} + +// HasRedeemPoints returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasRedeemPoints() bool { + if o != nil && !utils.IsNil(o.RedeemPoints) { + return true + } + + return false +} + +// SetRedeemPoints gets a reference to the given string and assigns it to the RedeemPoints field. +func (o *EWalletChannelProperties) SetRedeemPoints(v string) { + o.RedeemPoints = &v +} + +// GetMobilenumber returns the Mobilenumber field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetMobilenumber() string { + if o == nil || utils.IsNil(o.Mobilenumber) { + var ret string + return ret + } + return *o.Mobilenumber +} + +// GetMobilenumberOk returns a tuple with the Mobilenumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetMobilenumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.Mobilenumber) { + return nil, false + } + return o.Mobilenumber, true +} + +// HasMobilenumber returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasMobilenumber() bool { + if o != nil && !utils.IsNil(o.Mobilenumber) { + return true + } + + return false +} + +// SetMobilenumber gets a reference to the given string and assigns it to the Mobilenumber field. +func (o *EWalletChannelProperties) SetMobilenumber(v string) { + o.Mobilenumber = &v +} + +// GetCashtag returns the Cashtag field value if set, zero value otherwise. +func (o *EWalletChannelProperties) GetCashtag() string { + if o == nil || utils.IsNil(o.Cashtag) { + var ret string + return ret + } + return *o.Cashtag +} + +// GetCashtagOk returns a tuple with the Cashtag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletChannelProperties) GetCashtagOk() (*string, bool) { + if o == nil || utils.IsNil(o.Cashtag) { + return nil, false + } + return o.Cashtag, true +} + +// HasCashtag returns a boolean if a field has been set. +func (o *EWalletChannelProperties) HasCashtag() bool { + if o != nil && !utils.IsNil(o.Cashtag) { + return true + } + + return false +} + +// SetCashtag gets a reference to the given string and assigns it to the Cashtag field. +func (o *EWalletChannelProperties) SetCashtag(v string) { + o.Cashtag = &v +} + +func (o EWalletChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + if !utils.IsNil(o.CancelReturnUrl) { + toSerialize["cancel_return_url"] = o.CancelReturnUrl + } + if !utils.IsNil(o.RedeemPoints) { + toSerialize["redeem_points"] = o.RedeemPoints + } + if !utils.IsNil(o.Mobilenumber) { + toSerialize["mobile:number"] = o.Mobilenumber + } + if !utils.IsNil(o.Cashtag) { + toSerialize["cashtag"] = o.Cashtag + } + return toSerialize, nil +} + +type NullableEWalletChannelProperties struct { + value *EWalletChannelProperties + isSet bool +} + +func (v NullableEWalletChannelProperties) Get() *EWalletChannelProperties { + return v.value +} + +func (v *NullableEWalletChannelProperties) Set(val *EWalletChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletChannelProperties(val *EWalletChannelProperties) *NullableEWalletChannelProperties { + return &NullableEWalletChannelProperties{value: val, isSet: true} +} + +func (v NullableEWalletChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_e_wallet_parameters.go b/payment_request/model_e_wallet_parameters.go new file mode 100644 index 00000000..7e3ce877 --- /dev/null +++ b/payment_request/model_e_wallet_parameters.go @@ -0,0 +1,166 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the EWalletParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &EWalletParameters{} + +// EWalletParameters struct for EWalletParameters +type EWalletParameters struct { + ChannelCode *EWalletChannelCode `json:"channel_code,omitempty"` + ChannelProperties *EWalletChannelProperties `json:"channel_properties,omitempty"` +} + +// NewEWalletParameters instantiates a new EWalletParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEWalletParameters() *EWalletParameters { + this := EWalletParameters{} + return &this +} + +// NewEWalletParametersWithDefaults instantiates a new EWalletParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEWalletParametersWithDefaults() *EWalletParameters { + this := EWalletParameters{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise. +func (o *EWalletParameters) GetChannelCode() EWalletChannelCode { + if o == nil || utils.IsNil(o.ChannelCode) { + var ret EWalletChannelCode + return ret + } + return *o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletParameters) GetChannelCodeOk() (*EWalletChannelCode, bool) { + if o == nil || utils.IsNil(o.ChannelCode) { + return nil, false + } + return o.ChannelCode, true +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *EWalletParameters) HasChannelCode() bool { + if o != nil && !utils.IsNil(o.ChannelCode) { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given EWalletChannelCode and assigns it to the ChannelCode field. +func (o *EWalletParameters) SetChannelCode(v EWalletChannelCode) { + o.ChannelCode = &v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *EWalletParameters) GetChannelProperties() EWalletChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret EWalletChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EWalletParameters) GetChannelPropertiesOk() (*EWalletChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *EWalletParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given EWalletChannelProperties and assigns it to the ChannelProperties field. +func (o *EWalletParameters) SetChannelProperties(v EWalletChannelProperties) { + o.ChannelProperties = &v +} + +func (o EWalletParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EWalletParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ChannelCode) { + toSerialize["channel_code"] = o.ChannelCode + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + return toSerialize, nil +} + +type NullableEWalletParameters struct { + value *EWalletParameters + isSet bool +} + +func (v NullableEWalletParameters) Get() *EWalletParameters { + return v.value +} + +func (v *NullableEWalletParameters) Set(val *EWalletParameters) { + v.value = val + v.isSet = true +} + +func (v NullableEWalletParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableEWalletParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEWalletParameters(val *EWalletParameters) *NullableEWalletParameters { + return &NullableEWalletParameters{value: val, isSet: true} +} + +func (v NullableEWalletParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEWalletParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_error.go b/payment_request/model_error.go new file mode 100644 index 00000000..21601c7e --- /dev/null +++ b/payment_request/model_error.go @@ -0,0 +1,186 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + ErrorCode NullableString `json:"error_code,omitempty"` + Message NullableString `json:"message,omitempty"` +} + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError() *Error { + this := Error{} + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Error) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode.Get()) { + var ret string + return ret + } + return *o.ErrorCode.Get() +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Error) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ErrorCode.Get(), o.ErrorCode.IsSet() +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *Error) HasErrorCode() bool { + if o != nil && o.ErrorCode.IsSet() { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given NullableString and assigns it to the ErrorCode field. +func (o *Error) SetErrorCode(v string) { + o.ErrorCode.Set(&v) +} +// SetErrorCodeNil sets the value for ErrorCode to be an explicit nil +func (o *Error) SetErrorCodeNil() { + o.ErrorCode.Set(nil) +} + +// UnsetErrorCode ensures that no value is present for ErrorCode, not even an explicit nil +func (o *Error) UnsetErrorCode() { + o.ErrorCode.Unset() +} + +// GetMessage returns the Message field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Error) GetMessage() string { + if o == nil || utils.IsNil(o.Message.Get()) { + var ret string + return ret + } + return *o.Message.Get() +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message.Get(), o.Message.IsSet() +} + +// HasMessage returns a boolean if a field has been set. +func (o *Error) HasMessage() bool { + if o != nil && o.Message.IsSet() { + return true + } + + return false +} + +// SetMessage gets a reference to the given NullableString and assigns it to the Message field. +func (o *Error) SetMessage(v string) { + o.Message.Set(&v) +} +// SetMessageNil sets the value for Message to be an explicit nil +func (o *Error) SetMessageNil() { + o.Message.Set(nil) +} + +// UnsetMessage ensures that no value is present for Message, not even an explicit nil +func (o *Error) UnsetMessage() { + o.Message.Unset() +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ErrorCode.IsSet() { + toSerialize["error_code"] = o.ErrorCode.Get() + } + if o.Message.IsSet() { + toSerialize["message"] = o.Message.Get() + } + return toSerialize, nil +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_over_the_counter.go b/payment_request/model_over_the_counter.go new file mode 100644 index 00000000..23f3a0fa --- /dev/null +++ b/payment_request/model_over_the_counter.go @@ -0,0 +1,230 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the OverTheCounter type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounter{} + +// OverTheCounter Over the Counter Payment Method Details +type OverTheCounter struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *PaymentRequestCurrency `json:"currency,omitempty"` + ChannelCode OverTheCounterChannelCode `json:"channel_code"` + ChannelProperties OverTheCounterChannelProperties `json:"channel_properties"` +} + +// NewOverTheCounter instantiates a new OverTheCounter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounter(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties) *OverTheCounter { + this := OverTheCounter{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewOverTheCounterWithDefaults instantiates a new OverTheCounter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterWithDefaults() *OverTheCounter { + this := OverTheCounter{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OverTheCounter) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OverTheCounter) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *OverTheCounter) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *OverTheCounter) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *OverTheCounter) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *OverTheCounter) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *OverTheCounter) GetCurrency() PaymentRequestCurrency { + if o == nil || utils.IsNil(o.Currency) { + var ret PaymentRequestCurrency + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *OverTheCounter) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given PaymentRequestCurrency and assigns it to the Currency field. +func (o *OverTheCounter) SetCurrency(v PaymentRequestCurrency) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *OverTheCounter) GetChannelCode() OverTheCounterChannelCode { + if o == nil { + var ret OverTheCounterChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetChannelCodeOk() (*OverTheCounterChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *OverTheCounter) SetChannelCode(v OverTheCounterChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *OverTheCounter) GetChannelProperties() OverTheCounterChannelProperties { + if o == nil { + var ret OverTheCounterChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *OverTheCounter) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *OverTheCounter) SetChannelProperties(v OverTheCounterChannelProperties) { + o.ChannelProperties = v +} + +func (o OverTheCounter) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + return toSerialize, nil +} + +type NullableOverTheCounter struct { + value *OverTheCounter + isSet bool +} + +func (v NullableOverTheCounter) Get() *OverTheCounter { + return v.value +} + +func (v *NullableOverTheCounter) Set(val *OverTheCounter) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounter) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounter(val *OverTheCounter) *NullableOverTheCounter { + return &NullableOverTheCounter{value: val, isSet: true} +} + +func (v NullableOverTheCounter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_over_the_counter_channel_code.go b/payment_request/model_over_the_counter_channel_code.go new file mode 100644 index 00000000..61f67b84 --- /dev/null +++ b/payment_request/model_over_the_counter_channel_code.go @@ -0,0 +1,143 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// OverTheCounterChannelCode Over The Counter Channel Code +type OverTheCounterChannelCode string + +// List of OverTheCounterChannelCode +const ( + OVERTHECOUNTERCHANNELCODE__7_ELEVEN OverTheCounterChannelCode = "7ELEVEN" + OVERTHECOUNTERCHANNELCODE__7_ELEVEN_CLIQQ OverTheCounterChannelCode = "7ELEVEN_CLIQQ" + OVERTHECOUNTERCHANNELCODE_CEBUANA OverTheCounterChannelCode = "CEBUANA" + OVERTHECOUNTERCHANNELCODE_ECPAY OverTheCounterChannelCode = "ECPAY" + OVERTHECOUNTERCHANNELCODE_PALAWAN OverTheCounterChannelCode = "PALAWAN" + OVERTHECOUNTERCHANNELCODE_MLHUILLIER OverTheCounterChannelCode = "MLHUILLIER" + OVERTHECOUNTERCHANNELCODE_ECPAY_DRAGONLOAN OverTheCounterChannelCode = "ECPAY_DRAGONLOAN" + OVERTHECOUNTERCHANNELCODE_LBC OverTheCounterChannelCode = "LBC" + OVERTHECOUNTERCHANNELCODE_ECPAY_SCHOOL OverTheCounterChannelCode = "ECPAY_SCHOOL" + OVERTHECOUNTERCHANNELCODE_RD_PAWNSHOP OverTheCounterChannelCode = "RD_PAWNSHOP" + OVERTHECOUNTERCHANNELCODE_CVM OverTheCounterChannelCode = "CVM" + OVERTHECOUNTERCHANNELCODE_USSC OverTheCounterChannelCode = "USSC" + OVERTHECOUNTERCHANNELCODE_SM_BILLS OverTheCounterChannelCode = "SM_BILLS" + OVERTHECOUNTERCHANNELCODE_ROBINSONS_BILLS OverTheCounterChannelCode = "ROBINSONS_BILLS" + OVERTHECOUNTERCHANNELCODE_ALFAMART OverTheCounterChannelCode = "ALFAMART" + OVERTHECOUNTERCHANNELCODE_INDOMARET OverTheCounterChannelCode = "INDOMARET" +) + +// All allowed values of OverTheCounterChannelCode enum +var AllowedOverTheCounterChannelCodeEnumValues = []OverTheCounterChannelCode{ + "7ELEVEN", + "7ELEVEN_CLIQQ", + "CEBUANA", + "ECPAY", + "PALAWAN", + "MLHUILLIER", + "ECPAY_DRAGONLOAN", + "LBC", + "ECPAY_SCHOOL", + "RD_PAWNSHOP", + "CVM", + "USSC", + "SM_BILLS", + "ROBINSONS_BILLS", + "ALFAMART", + "INDOMARET", +} + +func (v *OverTheCounterChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OverTheCounterChannelCode(value) + for _, existing := range AllowedOverTheCounterChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OverTheCounterChannelCode", value) +} + +// NewOverTheCounterChannelCodeFromValue returns a pointer to a valid OverTheCounterChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOverTheCounterChannelCodeFromValue(v string) (*OverTheCounterChannelCode, error) { + ev := OverTheCounterChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OverTheCounterChannelCode: valid values are %v", v, AllowedOverTheCounterChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OverTheCounterChannelCode) IsValid() bool { + for _, existing := range AllowedOverTheCounterChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v OverTheCounterChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to OverTheCounterChannelCode value +func (v OverTheCounterChannelCode) Ptr() *OverTheCounterChannelCode { + return &v +} + +type NullableOverTheCounterChannelCode struct { + value *OverTheCounterChannelCode + isSet bool +} + +func (v NullableOverTheCounterChannelCode) Get() *OverTheCounterChannelCode { + return v.value +} + +func (v *NullableOverTheCounterChannelCode) Set(val *OverTheCounterChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterChannelCode(val *OverTheCounterChannelCode) *NullableOverTheCounterChannelCode { + return &NullableOverTheCounterChannelCode{value: val, isSet: true} +} + +func (v NullableOverTheCounterChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_over_the_counter_channel_properties.go b/payment_request/model_over_the_counter_channel_properties.go new file mode 100644 index 00000000..7aceb842 --- /dev/null +++ b/payment_request/model_over_the_counter_channel_properties.go @@ -0,0 +1,197 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the OverTheCounterChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterChannelProperties{} + +// OverTheCounterChannelProperties Over The Counter Channel Properties +type OverTheCounterChannelProperties struct { + // The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random. + PaymentCode *string `json:"payment_code,omitempty"` + // Name of customer. + CustomerName string `json:"customer_name"` + // The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +// NewOverTheCounterChannelProperties instantiates a new OverTheCounterChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterChannelProperties(customerName string) *OverTheCounterChannelProperties { + this := OverTheCounterChannelProperties{} + this.CustomerName = customerName + return &this +} + +// NewOverTheCounterChannelPropertiesWithDefaults instantiates a new OverTheCounterChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterChannelPropertiesWithDefaults() *OverTheCounterChannelProperties { + this := OverTheCounterChannelProperties{} + return &this +} + +// GetPaymentCode returns the PaymentCode field value if set, zero value otherwise. +func (o *OverTheCounterChannelProperties) GetPaymentCode() string { + if o == nil || utils.IsNil(o.PaymentCode) { + var ret string + return ret + } + return *o.PaymentCode +} + +// GetPaymentCodeOk returns a tuple with the PaymentCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetPaymentCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentCode) { + return nil, false + } + return o.PaymentCode, true +} + +// HasPaymentCode returns a boolean if a field has been set. +func (o *OverTheCounterChannelProperties) HasPaymentCode() bool { + if o != nil && !utils.IsNil(o.PaymentCode) { + return true + } + + return false +} + +// SetPaymentCode gets a reference to the given string and assigns it to the PaymentCode field. +func (o *OverTheCounterChannelProperties) SetPaymentCode(v string) { + o.PaymentCode = &v +} + +// GetCustomerName returns the CustomerName field value +func (o *OverTheCounterChannelProperties) GetCustomerName() string { + if o == nil { + var ret string + return ret + } + + return o.CustomerName +} + +// GetCustomerNameOk returns a tuple with the CustomerName field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetCustomerNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CustomerName, true +} + +// SetCustomerName sets field value +func (o *OverTheCounterChannelProperties) SetCustomerName(v string) { + o.CustomerName = v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *OverTheCounterChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *OverTheCounterChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *OverTheCounterChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +func (o OverTheCounterChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.PaymentCode) { + toSerialize["payment_code"] = o.PaymentCode + } + toSerialize["customer_name"] = o.CustomerName + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + return toSerialize, nil +} + +type NullableOverTheCounterChannelProperties struct { + value *OverTheCounterChannelProperties + isSet bool +} + +func (v NullableOverTheCounterChannelProperties) Get() *OverTheCounterChannelProperties { + return v.value +} + +func (v *NullableOverTheCounterChannelProperties) Set(val *OverTheCounterChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterChannelProperties(val *OverTheCounterChannelProperties) *NullableOverTheCounterChannelProperties { + return &NullableOverTheCounterChannelProperties{value: val, isSet: true} +} + +func (v NullableOverTheCounterChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_over_the_counter_parameters.go b/payment_request/model_over_the_counter_parameters.go new file mode 100644 index 00000000..f7282feb --- /dev/null +++ b/payment_request/model_over_the_counter_parameters.go @@ -0,0 +1,230 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the OverTheCounterParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &OverTheCounterParameters{} + +// OverTheCounterParameters struct for OverTheCounterParameters +type OverTheCounterParameters struct { + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *PaymentRequestCurrency `json:"currency,omitempty"` + ChannelCode OverTheCounterChannelCode `json:"channel_code"` + ChannelProperties OverTheCounterChannelProperties `json:"channel_properties"` +} + +// NewOverTheCounterParameters instantiates a new OverTheCounterParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOverTheCounterParameters(channelCode OverTheCounterChannelCode, channelProperties OverTheCounterChannelProperties) *OverTheCounterParameters { + this := OverTheCounterParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewOverTheCounterParametersWithDefaults instantiates a new OverTheCounterParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOverTheCounterParametersWithDefaults() *OverTheCounterParameters { + this := OverTheCounterParameters{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OverTheCounterParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OverTheCounterParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *OverTheCounterParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *OverTheCounterParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *OverTheCounterParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *OverTheCounterParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *OverTheCounterParameters) GetCurrency() PaymentRequestCurrency { + if o == nil || utils.IsNil(o.Currency) { + var ret PaymentRequestCurrency + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *OverTheCounterParameters) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given PaymentRequestCurrency and assigns it to the Currency field. +func (o *OverTheCounterParameters) SetCurrency(v PaymentRequestCurrency) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *OverTheCounterParameters) GetChannelCode() OverTheCounterChannelCode { + if o == nil { + var ret OverTheCounterChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetChannelCodeOk() (*OverTheCounterChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *OverTheCounterParameters) SetChannelCode(v OverTheCounterChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *OverTheCounterParameters) GetChannelProperties() OverTheCounterChannelProperties { + if o == nil { + var ret OverTheCounterChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *OverTheCounterParameters) GetChannelPropertiesOk() (*OverTheCounterChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *OverTheCounterParameters) SetChannelProperties(v OverTheCounterChannelProperties) { + o.ChannelProperties = v +} + +func (o OverTheCounterParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OverTheCounterParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + return toSerialize, nil +} + +type NullableOverTheCounterParameters struct { + value *OverTheCounterParameters + isSet bool +} + +func (v NullableOverTheCounterParameters) Get() *OverTheCounterParameters { + return v.value +} + +func (v *NullableOverTheCounterParameters) Set(val *OverTheCounterParameters) { + v.value = val + v.isSet = true +} + +func (v NullableOverTheCounterParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableOverTheCounterParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOverTheCounterParameters(val *OverTheCounterParameters) *NullableOverTheCounterParameters { + return &NullableOverTheCounterParameters{value: val, isSet: true} +} + +func (v NullableOverTheCounterParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOverTheCounterParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_method.go b/payment_request/model_payment_method.go new file mode 100644 index 00000000..55431c5e --- /dev/null +++ b/payment_request/model_payment_method.go @@ -0,0 +1,669 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethod type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethod{} + +// PaymentMethod struct for PaymentMethod +type PaymentMethod struct { + Id string `json:"id"` + Type PaymentMethodType `json:"type"` + Created *string `json:"created,omitempty"` + Updated *string `json:"updated,omitempty"` + Description NullableString `json:"description,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + Card NullableCard `json:"card,omitempty"` + DirectDebit NullableDirectDebit `json:"direct_debit,omitempty"` + Ewallet NullableEWallet `json:"ewallet,omitempty"` + OverTheCounter NullableOverTheCounter `json:"over_the_counter,omitempty"` + VirtualAccount NullableVirtualAccount `json:"virtual_account,omitempty"` + QrCode NullableQRCode `json:"qr_code,omitempty"` + Reusability PaymentMethodReusability `json:"reusability"` + Status PaymentMethodStatus `json:"status"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewPaymentMethod instantiates a new PaymentMethod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethod(id string, type_ PaymentMethodType, reusability PaymentMethodReusability, status PaymentMethodStatus) *PaymentMethod { + this := PaymentMethod{} + this.Id = id + this.Type = type_ + this.Reusability = reusability + this.Status = status + return &this +} + +// NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodWithDefaults() *PaymentMethod { + this := PaymentMethod{} + return &this +} + +// GetId returns the Id field value +func (o *PaymentMethod) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentMethod) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *PaymentMethod) GetType() PaymentMethodType { + if o == nil { + var ret PaymentMethodType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetTypeOk() (*PaymentMethodType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentMethod) SetType(v PaymentMethodType) { + o.Type = v +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *PaymentMethod) GetCreated() string { + if o == nil || utils.IsNil(o.Created) { + var ret string + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCreatedOk() (*string, bool) { + if o == nil || utils.IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *PaymentMethod) HasCreated() bool { + if o != nil && !utils.IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given string and assigns it to the Created field. +func (o *PaymentMethod) SetCreated(v string) { + o.Created = &v +} + +// GetUpdated returns the Updated field value if set, zero value otherwise. +func (o *PaymentMethod) GetUpdated() string { + if o == nil || utils.IsNil(o.Updated) { + var ret string + return ret + } + return *o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetUpdatedOk() (*string, bool) { + if o == nil || utils.IsNil(o.Updated) { + return nil, false + } + return o.Updated, true +} + +// HasUpdated returns a boolean if a field has been set. +func (o *PaymentMethod) HasUpdated() bool { + if o != nil && !utils.IsNil(o.Updated) { + return true + } + + return false +} + +// SetUpdated gets a reference to the given string and assigns it to the Updated field. +func (o *PaymentMethod) SetUpdated(v string) { + o.Updated = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentMethod) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentMethod) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentMethod) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentMethod) UnsetDescription() { + o.Description.Unset() +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentMethod) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentMethod) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentMethod) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetCard returns the Card field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetCard() Card { + if o == nil || utils.IsNil(o.Card.Get()) { + var ret Card + return ret + } + return *o.Card.Get() +} + +// GetCardOk returns a tuple with the Card field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetCardOk() (*Card, bool) { + if o == nil { + return nil, false + } + return o.Card.Get(), o.Card.IsSet() +} + +// HasCard returns a boolean if a field has been set. +func (o *PaymentMethod) HasCard() bool { + if o != nil && o.Card.IsSet() { + return true + } + + return false +} + +// SetCard gets a reference to the given NullableCard and assigns it to the Card field. +func (o *PaymentMethod) SetCard(v Card) { + o.Card.Set(&v) +} +// SetCardNil sets the value for Card to be an explicit nil +func (o *PaymentMethod) SetCardNil() { + o.Card.Set(nil) +} + +// UnsetCard ensures that no value is present for Card, not even an explicit nil +func (o *PaymentMethod) UnsetCard() { + o.Card.Unset() +} + +// GetDirectDebit returns the DirectDebit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetDirectDebit() DirectDebit { + if o == nil || utils.IsNil(o.DirectDebit.Get()) { + var ret DirectDebit + return ret + } + return *o.DirectDebit.Get() +} + +// GetDirectDebitOk returns a tuple with the DirectDebit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetDirectDebitOk() (*DirectDebit, bool) { + if o == nil { + return nil, false + } + return o.DirectDebit.Get(), o.DirectDebit.IsSet() +} + +// HasDirectDebit returns a boolean if a field has been set. +func (o *PaymentMethod) HasDirectDebit() bool { + if o != nil && o.DirectDebit.IsSet() { + return true + } + + return false +} + +// SetDirectDebit gets a reference to the given NullableDirectDebit and assigns it to the DirectDebit field. +func (o *PaymentMethod) SetDirectDebit(v DirectDebit) { + o.DirectDebit.Set(&v) +} +// SetDirectDebitNil sets the value for DirectDebit to be an explicit nil +func (o *PaymentMethod) SetDirectDebitNil() { + o.DirectDebit.Set(nil) +} + +// UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +func (o *PaymentMethod) UnsetDirectDebit() { + o.DirectDebit.Unset() +} + +// GetEwallet returns the Ewallet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetEwallet() EWallet { + if o == nil || utils.IsNil(o.Ewallet.Get()) { + var ret EWallet + return ret + } + return *o.Ewallet.Get() +} + +// GetEwalletOk returns a tuple with the Ewallet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetEwalletOk() (*EWallet, bool) { + if o == nil { + return nil, false + } + return o.Ewallet.Get(), o.Ewallet.IsSet() +} + +// HasEwallet returns a boolean if a field has been set. +func (o *PaymentMethod) HasEwallet() bool { + if o != nil && o.Ewallet.IsSet() { + return true + } + + return false +} + +// SetEwallet gets a reference to the given NullableEWallet and assigns it to the Ewallet field. +func (o *PaymentMethod) SetEwallet(v EWallet) { + o.Ewallet.Set(&v) +} +// SetEwalletNil sets the value for Ewallet to be an explicit nil +func (o *PaymentMethod) SetEwalletNil() { + o.Ewallet.Set(nil) +} + +// UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +func (o *PaymentMethod) UnsetEwallet() { + o.Ewallet.Unset() +} + +// GetOverTheCounter returns the OverTheCounter field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetOverTheCounter() OverTheCounter { + if o == nil || utils.IsNil(o.OverTheCounter.Get()) { + var ret OverTheCounter + return ret + } + return *o.OverTheCounter.Get() +} + +// GetOverTheCounterOk returns a tuple with the OverTheCounter field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetOverTheCounterOk() (*OverTheCounter, bool) { + if o == nil { + return nil, false + } + return o.OverTheCounter.Get(), o.OverTheCounter.IsSet() +} + +// HasOverTheCounter returns a boolean if a field has been set. +func (o *PaymentMethod) HasOverTheCounter() bool { + if o != nil && o.OverTheCounter.IsSet() { + return true + } + + return false +} + +// SetOverTheCounter gets a reference to the given NullableOverTheCounter and assigns it to the OverTheCounter field. +func (o *PaymentMethod) SetOverTheCounter(v OverTheCounter) { + o.OverTheCounter.Set(&v) +} +// SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil +func (o *PaymentMethod) SetOverTheCounterNil() { + o.OverTheCounter.Set(nil) +} + +// UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +func (o *PaymentMethod) UnsetOverTheCounter() { + o.OverTheCounter.Unset() +} + +// GetVirtualAccount returns the VirtualAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetVirtualAccount() VirtualAccount { + if o == nil || utils.IsNil(o.VirtualAccount.Get()) { + var ret VirtualAccount + return ret + } + return *o.VirtualAccount.Get() +} + +// GetVirtualAccountOk returns a tuple with the VirtualAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetVirtualAccountOk() (*VirtualAccount, bool) { + if o == nil { + return nil, false + } + return o.VirtualAccount.Get(), o.VirtualAccount.IsSet() +} + +// HasVirtualAccount returns a boolean if a field has been set. +func (o *PaymentMethod) HasVirtualAccount() bool { + if o != nil && o.VirtualAccount.IsSet() { + return true + } + + return false +} + +// SetVirtualAccount gets a reference to the given NullableVirtualAccount and assigns it to the VirtualAccount field. +func (o *PaymentMethod) SetVirtualAccount(v VirtualAccount) { + o.VirtualAccount.Set(&v) +} +// SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil +func (o *PaymentMethod) SetVirtualAccountNil() { + o.VirtualAccount.Set(nil) +} + +// UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil +func (o *PaymentMethod) UnsetVirtualAccount() { + o.VirtualAccount.Unset() +} + +// GetQrCode returns the QrCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetQrCode() QRCode { + if o == nil || utils.IsNil(o.QrCode.Get()) { + var ret QRCode + return ret + } + return *o.QrCode.Get() +} + +// GetQrCodeOk returns a tuple with the QrCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetQrCodeOk() (*QRCode, bool) { + if o == nil { + return nil, false + } + return o.QrCode.Get(), o.QrCode.IsSet() +} + +// HasQrCode returns a boolean if a field has been set. +func (o *PaymentMethod) HasQrCode() bool { + if o != nil && o.QrCode.IsSet() { + return true + } + + return false +} + +// SetQrCode gets a reference to the given NullableQRCode and assigns it to the QrCode field. +func (o *PaymentMethod) SetQrCode(v QRCode) { + o.QrCode.Set(&v) +} +// SetQrCodeNil sets the value for QrCode to be an explicit nil +func (o *PaymentMethod) SetQrCodeNil() { + o.QrCode.Set(nil) +} + +// UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil +func (o *PaymentMethod) UnsetQrCode() { + o.QrCode.Unset() +} + +// GetReusability returns the Reusability field value +func (o *PaymentMethod) GetReusability() PaymentMethodReusability { + if o == nil { + var ret PaymentMethodReusability + return ret + } + + return o.Reusability +} + +// GetReusabilityOk returns a tuple with the Reusability field value +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetReusabilityOk() (*PaymentMethodReusability, bool) { + if o == nil { + return nil, false + } + return &o.Reusability, true +} + +// SetReusability sets field value +func (o *PaymentMethod) SetReusability(v PaymentMethodReusability) { + o.Reusability = v +} + +// GetStatus returns the Status field value +func (o *PaymentMethod) GetStatus() PaymentMethodStatus { + if o == nil { + var ret PaymentMethodStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetStatusOk() (*PaymentMethodStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *PaymentMethod) SetStatus(v PaymentMethodStatus) { + o.Status = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethod) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethod) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentMethod) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentMethod) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o PaymentMethod) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + if !utils.IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !utils.IsNil(o.Updated) { + toSerialize["updated"] = o.Updated + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if o.Card.IsSet() { + toSerialize["card"] = o.Card.Get() + } + if o.DirectDebit.IsSet() { + toSerialize["direct_debit"] = o.DirectDebit.Get() + } + if o.Ewallet.IsSet() { + toSerialize["ewallet"] = o.Ewallet.Get() + } + if o.OverTheCounter.IsSet() { + toSerialize["over_the_counter"] = o.OverTheCounter.Get() + } + if o.VirtualAccount.IsSet() { + toSerialize["virtual_account"] = o.VirtualAccount.Get() + } + if o.QrCode.IsSet() { + toSerialize["qr_code"] = o.QrCode.Get() + } + toSerialize["reusability"] = o.Reusability + toSerialize["status"] = o.Status + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullablePaymentMethod struct { + value *PaymentMethod + isSet bool +} + +func (v NullablePaymentMethod) Get() *PaymentMethod { + return v.value +} + +func (v *NullablePaymentMethod) Set(val *PaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethod(val *PaymentMethod) *NullablePaymentMethod { + return &NullablePaymentMethod{value: val, isSet: true} +} + +func (v NullablePaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_method_parameters.go b/payment_request/model_payment_method_parameters.go new file mode 100644 index 00000000..a33cc8e4 --- /dev/null +++ b/payment_request/model_payment_method_parameters.go @@ -0,0 +1,460 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentMethodParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodParameters{} + +// PaymentMethodParameters struct for PaymentMethodParameters +type PaymentMethodParameters struct { + Type PaymentMethodType `json:"type"` + Reusability PaymentMethodReusability `json:"reusability"` + Description NullableString `json:"description,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + DirectDebit NullableDirectDebitParameters `json:"direct_debit,omitempty"` + Ewallet NullableEWalletParameters `json:"ewallet,omitempty"` + OverTheCounter NullableOverTheCounterParameters `json:"over_the_counter,omitempty"` + VirtualAccount NullableVirtualAccountParameters `json:"virtual_account,omitempty"` + QrCode NullableQRCodeParameters `json:"qr_code,omitempty"` +} + +// NewPaymentMethodParameters instantiates a new PaymentMethodParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodParameters(type_ PaymentMethodType, reusability PaymentMethodReusability) *PaymentMethodParameters { + this := PaymentMethodParameters{} + this.Type = type_ + this.Reusability = reusability + return &this +} + +// NewPaymentMethodParametersWithDefaults instantiates a new PaymentMethodParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodParametersWithDefaults() *PaymentMethodParameters { + this := PaymentMethodParameters{} + return &this +} + +// GetType returns the Type field value +func (o *PaymentMethodParameters) GetType() PaymentMethodType { + if o == nil { + var ret PaymentMethodType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetTypeOk() (*PaymentMethodType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PaymentMethodParameters) SetType(v PaymentMethodType) { + o.Type = v +} + +// GetReusability returns the Reusability field value +func (o *PaymentMethodParameters) GetReusability() PaymentMethodReusability { + if o == nil { + var ret PaymentMethodReusability + return ret + } + + return o.Reusability +} + +// GetReusabilityOk returns a tuple with the Reusability field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetReusabilityOk() (*PaymentMethodReusability, bool) { + if o == nil { + return nil, false + } + return &o.Reusability, true +} + +// SetReusability sets field value +func (o *PaymentMethodParameters) SetReusability(v PaymentMethodReusability) { + o.Reusability = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentMethodParameters) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentMethodParameters) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentMethodParameters) UnsetDescription() { + o.Description.Unset() +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentMethodParameters) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodParameters) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentMethodParameters) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetDirectDebit returns the DirectDebit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetDirectDebit() DirectDebitParameters { + if o == nil || utils.IsNil(o.DirectDebit.Get()) { + var ret DirectDebitParameters + return ret + } + return *o.DirectDebit.Get() +} + +// GetDirectDebitOk returns a tuple with the DirectDebit field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetDirectDebitOk() (*DirectDebitParameters, bool) { + if o == nil { + return nil, false + } + return o.DirectDebit.Get(), o.DirectDebit.IsSet() +} + +// HasDirectDebit returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasDirectDebit() bool { + if o != nil && o.DirectDebit.IsSet() { + return true + } + + return false +} + +// SetDirectDebit gets a reference to the given NullableDirectDebitParameters and assigns it to the DirectDebit field. +func (o *PaymentMethodParameters) SetDirectDebit(v DirectDebitParameters) { + o.DirectDebit.Set(&v) +} +// SetDirectDebitNil sets the value for DirectDebit to be an explicit nil +func (o *PaymentMethodParameters) SetDirectDebitNil() { + o.DirectDebit.Set(nil) +} + +// UnsetDirectDebit ensures that no value is present for DirectDebit, not even an explicit nil +func (o *PaymentMethodParameters) UnsetDirectDebit() { + o.DirectDebit.Unset() +} + +// GetEwallet returns the Ewallet field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetEwallet() EWalletParameters { + if o == nil || utils.IsNil(o.Ewallet.Get()) { + var ret EWalletParameters + return ret + } + return *o.Ewallet.Get() +} + +// GetEwalletOk returns a tuple with the Ewallet field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetEwalletOk() (*EWalletParameters, bool) { + if o == nil { + return nil, false + } + return o.Ewallet.Get(), o.Ewallet.IsSet() +} + +// HasEwallet returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasEwallet() bool { + if o != nil && o.Ewallet.IsSet() { + return true + } + + return false +} + +// SetEwallet gets a reference to the given NullableEWalletParameters and assigns it to the Ewallet field. +func (o *PaymentMethodParameters) SetEwallet(v EWalletParameters) { + o.Ewallet.Set(&v) +} +// SetEwalletNil sets the value for Ewallet to be an explicit nil +func (o *PaymentMethodParameters) SetEwalletNil() { + o.Ewallet.Set(nil) +} + +// UnsetEwallet ensures that no value is present for Ewallet, not even an explicit nil +func (o *PaymentMethodParameters) UnsetEwallet() { + o.Ewallet.Unset() +} + +// GetOverTheCounter returns the OverTheCounter field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetOverTheCounter() OverTheCounterParameters { + if o == nil || utils.IsNil(o.OverTheCounter.Get()) { + var ret OverTheCounterParameters + return ret + } + return *o.OverTheCounter.Get() +} + +// GetOverTheCounterOk returns a tuple with the OverTheCounter field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetOverTheCounterOk() (*OverTheCounterParameters, bool) { + if o == nil { + return nil, false + } + return o.OverTheCounter.Get(), o.OverTheCounter.IsSet() +} + +// HasOverTheCounter returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasOverTheCounter() bool { + if o != nil && o.OverTheCounter.IsSet() { + return true + } + + return false +} + +// SetOverTheCounter gets a reference to the given NullableOverTheCounterParameters and assigns it to the OverTheCounter field. +func (o *PaymentMethodParameters) SetOverTheCounter(v OverTheCounterParameters) { + o.OverTheCounter.Set(&v) +} +// SetOverTheCounterNil sets the value for OverTheCounter to be an explicit nil +func (o *PaymentMethodParameters) SetOverTheCounterNil() { + o.OverTheCounter.Set(nil) +} + +// UnsetOverTheCounter ensures that no value is present for OverTheCounter, not even an explicit nil +func (o *PaymentMethodParameters) UnsetOverTheCounter() { + o.OverTheCounter.Unset() +} + +// GetVirtualAccount returns the VirtualAccount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetVirtualAccount() VirtualAccountParameters { + if o == nil || utils.IsNil(o.VirtualAccount.Get()) { + var ret VirtualAccountParameters + return ret + } + return *o.VirtualAccount.Get() +} + +// GetVirtualAccountOk returns a tuple with the VirtualAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetVirtualAccountOk() (*VirtualAccountParameters, bool) { + if o == nil { + return nil, false + } + return o.VirtualAccount.Get(), o.VirtualAccount.IsSet() +} + +// HasVirtualAccount returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasVirtualAccount() bool { + if o != nil && o.VirtualAccount.IsSet() { + return true + } + + return false +} + +// SetVirtualAccount gets a reference to the given NullableVirtualAccountParameters and assigns it to the VirtualAccount field. +func (o *PaymentMethodParameters) SetVirtualAccount(v VirtualAccountParameters) { + o.VirtualAccount.Set(&v) +} +// SetVirtualAccountNil sets the value for VirtualAccount to be an explicit nil +func (o *PaymentMethodParameters) SetVirtualAccountNil() { + o.VirtualAccount.Set(nil) +} + +// UnsetVirtualAccount ensures that no value is present for VirtualAccount, not even an explicit nil +func (o *PaymentMethodParameters) UnsetVirtualAccount() { + o.VirtualAccount.Unset() +} + +// GetQrCode returns the QrCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentMethodParameters) GetQrCode() QRCodeParameters { + if o == nil || utils.IsNil(o.QrCode.Get()) { + var ret QRCodeParameters + return ret + } + return *o.QrCode.Get() +} + +// GetQrCodeOk returns a tuple with the QrCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentMethodParameters) GetQrCodeOk() (*QRCodeParameters, bool) { + if o == nil { + return nil, false + } + return o.QrCode.Get(), o.QrCode.IsSet() +} + +// HasQrCode returns a boolean if a field has been set. +func (o *PaymentMethodParameters) HasQrCode() bool { + if o != nil && o.QrCode.IsSet() { + return true + } + + return false +} + +// SetQrCode gets a reference to the given NullableQRCodeParameters and assigns it to the QrCode field. +func (o *PaymentMethodParameters) SetQrCode(v QRCodeParameters) { + o.QrCode.Set(&v) +} +// SetQrCodeNil sets the value for QrCode to be an explicit nil +func (o *PaymentMethodParameters) SetQrCodeNil() { + o.QrCode.Set(nil) +} + +// UnsetQrCode ensures that no value is present for QrCode, not even an explicit nil +func (o *PaymentMethodParameters) UnsetQrCode() { + o.QrCode.Unset() +} + +func (o PaymentMethodParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["reusability"] = o.Reusability + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if o.DirectDebit.IsSet() { + toSerialize["direct_debit"] = o.DirectDebit.Get() + } + if o.Ewallet.IsSet() { + toSerialize["ewallet"] = o.Ewallet.Get() + } + if o.OverTheCounter.IsSet() { + toSerialize["over_the_counter"] = o.OverTheCounter.Get() + } + if o.VirtualAccount.IsSet() { + toSerialize["virtual_account"] = o.VirtualAccount.Get() + } + if o.QrCode.IsSet() { + toSerialize["qr_code"] = o.QrCode.Get() + } + return toSerialize, nil +} + +type NullablePaymentMethodParameters struct { + value *PaymentMethodParameters + isSet bool +} + +func (v NullablePaymentMethodParameters) Get() *PaymentMethodParameters { + return v.value +} + +func (v *NullablePaymentMethodParameters) Set(val *PaymentMethodParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodParameters(val *PaymentMethodParameters) *NullablePaymentMethodParameters { + return &NullablePaymentMethodParameters{value: val, isSet: true} +} + +func (v NullablePaymentMethodParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_method_reusability.go b/payment_request/model_payment_method_reusability.go new file mode 100644 index 00000000..2d8047e2 --- /dev/null +++ b/payment_request/model_payment_method_reusability.go @@ -0,0 +1,115 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodReusability the model 'PaymentMethodReusability' +type PaymentMethodReusability string + +// List of PaymentMethodReusability +const ( + PAYMENTMETHODREUSABILITY_MULTIPLE_USE PaymentMethodReusability = "MULTIPLE_USE" + PAYMENTMETHODREUSABILITY_ONE_TIME_USE PaymentMethodReusability = "ONE_TIME_USE" +) + +// All allowed values of PaymentMethodReusability enum +var AllowedPaymentMethodReusabilityEnumValues = []PaymentMethodReusability{ + "MULTIPLE_USE", + "ONE_TIME_USE", +} + +func (v *PaymentMethodReusability) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodReusability(value) + for _, existing := range AllowedPaymentMethodReusabilityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodReusability", value) +} + +// NewPaymentMethodReusabilityFromValue returns a pointer to a valid PaymentMethodReusability +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodReusabilityFromValue(v string) (*PaymentMethodReusability, error) { + ev := PaymentMethodReusability(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodReusability: valid values are %v", v, AllowedPaymentMethodReusabilityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodReusability) IsValid() bool { + for _, existing := range AllowedPaymentMethodReusabilityEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodReusability) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodReusability value +func (v PaymentMethodReusability) Ptr() *PaymentMethodReusability { + return &v +} + +type NullablePaymentMethodReusability struct { + value *PaymentMethodReusability + isSet bool +} + +func (v NullablePaymentMethodReusability) Get() *PaymentMethodReusability { + return v.value +} + +func (v *NullablePaymentMethodReusability) Set(val *PaymentMethodReusability) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodReusability) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodReusability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodReusability(val *PaymentMethodReusability) *NullablePaymentMethodReusability { + return &NullablePaymentMethodReusability{value: val, isSet: true} +} + +func (v NullablePaymentMethodReusability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodReusability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_method_status.go b/payment_request/model_payment_method_status.go new file mode 100644 index 00000000..07ae0baa --- /dev/null +++ b/payment_request/model_payment_method_status.go @@ -0,0 +1,121 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodStatus the model 'PaymentMethodStatus' +type PaymentMethodStatus string + +// List of PaymentMethodStatus +const ( + PAYMENTMETHODSTATUS_ACTIVE PaymentMethodStatus = "ACTIVE" + PAYMENTMETHODSTATUS_INACTIVE PaymentMethodStatus = "INACTIVE" + PAYMENTMETHODSTATUS_PENDING PaymentMethodStatus = "PENDING" + PAYMENTMETHODSTATUS_EXPIRED PaymentMethodStatus = "EXPIRED" + PAYMENTMETHODSTATUS_FAILED PaymentMethodStatus = "FAILED" +) + +// All allowed values of PaymentMethodStatus enum +var AllowedPaymentMethodStatusEnumValues = []PaymentMethodStatus{ + "ACTIVE", + "INACTIVE", + "PENDING", + "EXPIRED", + "FAILED", +} + +func (v *PaymentMethodStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodStatus(value) + for _, existing := range AllowedPaymentMethodStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodStatus", value) +} + +// NewPaymentMethodStatusFromValue returns a pointer to a valid PaymentMethodStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodStatusFromValue(v string) (*PaymentMethodStatus, error) { + ev := PaymentMethodStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodStatus: valid values are %v", v, AllowedPaymentMethodStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodStatus) IsValid() bool { + for _, existing := range AllowedPaymentMethodStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodStatus) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodStatus value +func (v PaymentMethodStatus) Ptr() *PaymentMethodStatus { + return &v +} + +type NullablePaymentMethodStatus struct { + value *PaymentMethodStatus + isSet bool +} + +func (v NullablePaymentMethodStatus) Get() *PaymentMethodStatus { + return v.value +} + +func (v *NullablePaymentMethodStatus) Set(val *PaymentMethodStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodStatus(val *PaymentMethodStatus) *NullablePaymentMethodStatus { + return &NullablePaymentMethodStatus{value: val, isSet: true} +} + +func (v NullablePaymentMethodStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_method_type.go b/payment_request/model_payment_method_type.go new file mode 100644 index 00000000..3fdaf746 --- /dev/null +++ b/payment_request/model_payment_method_type.go @@ -0,0 +1,123 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentMethodType the model 'PaymentMethodType' +type PaymentMethodType string + +// List of PaymentMethodType +const ( + PAYMENTMETHODTYPE_CARD PaymentMethodType = "CARD" + PAYMENTMETHODTYPE_DIRECT_DEBIT PaymentMethodType = "DIRECT_DEBIT" + PAYMENTMETHODTYPE_EWALLET PaymentMethodType = "EWALLET" + PAYMENTMETHODTYPE_OVER_THE_COUNTER PaymentMethodType = "OVER_THE_COUNTER" + PAYMENTMETHODTYPE_QR_CODE PaymentMethodType = "QR_CODE" + PAYMENTMETHODTYPE_VIRTUAL_ACCOUNT PaymentMethodType = "VIRTUAL_ACCOUNT" +) + +// All allowed values of PaymentMethodType enum +var AllowedPaymentMethodTypeEnumValues = []PaymentMethodType{ + "CARD", + "DIRECT_DEBIT", + "EWALLET", + "OVER_THE_COUNTER", + "QR_CODE", + "VIRTUAL_ACCOUNT", +} + +func (v *PaymentMethodType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentMethodType(value) + for _, existing := range AllowedPaymentMethodTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentMethodType", value) +} + +// NewPaymentMethodTypeFromValue returns a pointer to a valid PaymentMethodType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentMethodTypeFromValue(v string) (*PaymentMethodType, error) { + ev := PaymentMethodType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentMethodType: valid values are %v", v, AllowedPaymentMethodTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentMethodType) IsValid() bool { + for _, existing := range AllowedPaymentMethodTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentMethodType) String() string { + return string(v) +} + +// Ptr returns reference to PaymentMethodType value +func (v PaymentMethodType) Ptr() *PaymentMethodType { + return &v +} + +type NullablePaymentMethodType struct { + value *PaymentMethodType + isSet bool +} + +func (v NullablePaymentMethodType) Get() *PaymentMethodType { + return v.value +} + +func (v *NullablePaymentMethodType) Set(val *PaymentMethodType) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodType) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodType(val *PaymentMethodType) *NullablePaymentMethodType { + return &NullablePaymentMethodType{value: val, isSet: true} +} + +func (v NullablePaymentMethodType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_request.go b/payment_request/model_payment_request.go new file mode 100644 index 00000000..afad95ca --- /dev/null +++ b/payment_request/model_payment_request.go @@ -0,0 +1,943 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequest type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequest{} + +// PaymentRequest struct for PaymentRequest +type PaymentRequest struct { + Id string `json:"id"` + Created string `json:"created"` + Updated string `json:"updated"` + ReferenceId string `json:"reference_id"` + BusinessId string `json:"business_id"` + CustomerId NullableString `json:"customer_id,omitempty"` + Customer map[string]interface{} `json:"customer,omitempty"` + Amount *float64 `json:"amount,omitempty"` + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + Country *PaymentRequestCountry `json:"country,omitempty"` + Currency PaymentRequestCurrency `json:"currency"` + PaymentMethod PaymentMethod `json:"payment_method"` + Description NullableString `json:"description,omitempty"` + FailureCode NullableString `json:"failure_code,omitempty"` + CaptureMethod NullablePaymentRequestCaptureMethod `json:"capture_method,omitempty"` + Initiator NullablePaymentRequestInitiator `json:"initiator,omitempty"` + CardVerificationResults NullablePaymentRequestCardVerificationResults `json:"card_verification_results,omitempty"` + Status PaymentRequestStatus `json:"status"` + Actions []PaymentRequestAction `json:"actions,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + ShippingInformation NullablePaymentRequestShippingInformation `json:"shipping_information,omitempty"` + Items []PaymentRequestBasketItem `json:"items,omitempty"` +} + +// NewPaymentRequest instantiates a new PaymentRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequest(id string, created string, updated string, referenceId string, businessId string, currency PaymentRequestCurrency, paymentMethod PaymentMethod, status PaymentRequestStatus) *PaymentRequest { + this := PaymentRequest{} + this.Id = id + this.Created = created + this.Updated = updated + this.ReferenceId = referenceId + this.BusinessId = businessId + this.Currency = currency + this.PaymentMethod = paymentMethod + this.Status = status + return &this +} + +// NewPaymentRequestWithDefaults instantiates a new PaymentRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestWithDefaults() *PaymentRequest { + this := PaymentRequest{} + return &this +} + +// GetId returns the Id field value +func (o *PaymentRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentRequest) SetId(v string) { + o.Id = v +} + +// GetCreated returns the Created field value +func (o *PaymentRequest) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *PaymentRequest) SetCreated(v string) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *PaymentRequest) GetUpdated() string { + if o == nil { + var ret string + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetUpdatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *PaymentRequest) SetUpdated(v string) { + o.Updated = v +} + +// GetReferenceId returns the ReferenceId field value +func (o *PaymentRequest) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *PaymentRequest) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetBusinessId returns the BusinessId field value +func (o *PaymentRequest) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *PaymentRequest) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *PaymentRequest) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *PaymentRequest) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *PaymentRequest) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *PaymentRequest) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetCustomer returns the Customer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetCustomer() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetCustomerOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Customer) { + return map[string]interface{}{}, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *PaymentRequest) HasCustomer() bool { + if o != nil && utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given map[string]interface{} and assigns it to the Customer field. +func (o *PaymentRequest) SetCustomer(v map[string]interface{}) { + o.Customer = v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *PaymentRequest) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount) { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *PaymentRequest) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *PaymentRequest) SetAmount(v float64) { + o.Amount = &v +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *PaymentRequest) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *PaymentRequest) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *PaymentRequest) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *PaymentRequest) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *PaymentRequest) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *PaymentRequest) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *PaymentRequest) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *PaymentRequest) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *PaymentRequest) GetCountry() PaymentRequestCountry { + if o == nil || utils.IsNil(o.Country) { + var ret PaymentRequestCountry + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetCountryOk() (*PaymentRequestCountry, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *PaymentRequest) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given PaymentRequestCountry and assigns it to the Country field. +func (o *PaymentRequest) SetCountry(v PaymentRequestCountry) { + o.Country = &v +} + +// GetCurrency returns the Currency field value +func (o *PaymentRequest) GetCurrency() PaymentRequestCurrency { + if o == nil { + var ret PaymentRequestCurrency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *PaymentRequest) SetCurrency(v PaymentRequestCurrency) { + o.Currency = v +} + +// GetPaymentMethod returns the PaymentMethod field value +func (o *PaymentRequest) GetPaymentMethod() PaymentMethod { + if o == nil { + var ret PaymentMethod + return ret + } + + return o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetPaymentMethodOk() (*PaymentMethod, bool) { + if o == nil { + return nil, false + } + return &o.PaymentMethod, true +} + +// SetPaymentMethod sets field value +func (o *PaymentRequest) SetPaymentMethod(v PaymentMethod) { + o.PaymentMethod = v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentRequest) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentRequest) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentRequest) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentRequest) UnsetDescription() { + o.Description.Unset() +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode.Get()) { + var ret string + return ret + } + return *o.FailureCode.Get() +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetFailureCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureCode.Get(), o.FailureCode.IsSet() +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *PaymentRequest) HasFailureCode() bool { + if o != nil && o.FailureCode.IsSet() { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given NullableString and assigns it to the FailureCode field. +func (o *PaymentRequest) SetFailureCode(v string) { + o.FailureCode.Set(&v) +} +// SetFailureCodeNil sets the value for FailureCode to be an explicit nil +func (o *PaymentRequest) SetFailureCodeNil() { + o.FailureCode.Set(nil) +} + +// UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +func (o *PaymentRequest) UnsetFailureCode() { + o.FailureCode.Unset() +} + +// GetCaptureMethod returns the CaptureMethod field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetCaptureMethod() PaymentRequestCaptureMethod { + if o == nil || utils.IsNil(o.CaptureMethod.Get()) { + var ret PaymentRequestCaptureMethod + return ret + } + return *o.CaptureMethod.Get() +} + +// GetCaptureMethodOk returns a tuple with the CaptureMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetCaptureMethodOk() (*PaymentRequestCaptureMethod, bool) { + if o == nil { + return nil, false + } + return o.CaptureMethod.Get(), o.CaptureMethod.IsSet() +} + +// HasCaptureMethod returns a boolean if a field has been set. +func (o *PaymentRequest) HasCaptureMethod() bool { + if o != nil && o.CaptureMethod.IsSet() { + return true + } + + return false +} + +// SetCaptureMethod gets a reference to the given NullablePaymentRequestCaptureMethod and assigns it to the CaptureMethod field. +func (o *PaymentRequest) SetCaptureMethod(v PaymentRequestCaptureMethod) { + o.CaptureMethod.Set(&v) +} +// SetCaptureMethodNil sets the value for CaptureMethod to be an explicit nil +func (o *PaymentRequest) SetCaptureMethodNil() { + o.CaptureMethod.Set(nil) +} + +// UnsetCaptureMethod ensures that no value is present for CaptureMethod, not even an explicit nil +func (o *PaymentRequest) UnsetCaptureMethod() { + o.CaptureMethod.Unset() +} + +// GetInitiator returns the Initiator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetInitiator() PaymentRequestInitiator { + if o == nil || utils.IsNil(o.Initiator.Get()) { + var ret PaymentRequestInitiator + return ret + } + return *o.Initiator.Get() +} + +// GetInitiatorOk returns a tuple with the Initiator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetInitiatorOk() (*PaymentRequestInitiator, bool) { + if o == nil { + return nil, false + } + return o.Initiator.Get(), o.Initiator.IsSet() +} + +// HasInitiator returns a boolean if a field has been set. +func (o *PaymentRequest) HasInitiator() bool { + if o != nil && o.Initiator.IsSet() { + return true + } + + return false +} + +// SetInitiator gets a reference to the given NullablePaymentRequestInitiator and assigns it to the Initiator field. +func (o *PaymentRequest) SetInitiator(v PaymentRequestInitiator) { + o.Initiator.Set(&v) +} +// SetInitiatorNil sets the value for Initiator to be an explicit nil +func (o *PaymentRequest) SetInitiatorNil() { + o.Initiator.Set(nil) +} + +// UnsetInitiator ensures that no value is present for Initiator, not even an explicit nil +func (o *PaymentRequest) UnsetInitiator() { + o.Initiator.Unset() +} + +// GetCardVerificationResults returns the CardVerificationResults field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetCardVerificationResults() PaymentRequestCardVerificationResults { + if o == nil || utils.IsNil(o.CardVerificationResults.Get()) { + var ret PaymentRequestCardVerificationResults + return ret + } + return *o.CardVerificationResults.Get() +} + +// GetCardVerificationResultsOk returns a tuple with the CardVerificationResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetCardVerificationResultsOk() (*PaymentRequestCardVerificationResults, bool) { + if o == nil { + return nil, false + } + return o.CardVerificationResults.Get(), o.CardVerificationResults.IsSet() +} + +// HasCardVerificationResults returns a boolean if a field has been set. +func (o *PaymentRequest) HasCardVerificationResults() bool { + if o != nil && o.CardVerificationResults.IsSet() { + return true + } + + return false +} + +// SetCardVerificationResults gets a reference to the given NullablePaymentRequestCardVerificationResults and assigns it to the CardVerificationResults field. +func (o *PaymentRequest) SetCardVerificationResults(v PaymentRequestCardVerificationResults) { + o.CardVerificationResults.Set(&v) +} +// SetCardVerificationResultsNil sets the value for CardVerificationResults to be an explicit nil +func (o *PaymentRequest) SetCardVerificationResultsNil() { + o.CardVerificationResults.Set(nil) +} + +// UnsetCardVerificationResults ensures that no value is present for CardVerificationResults, not even an explicit nil +func (o *PaymentRequest) UnsetCardVerificationResults() { + o.CardVerificationResults.Unset() +} + +// GetStatus returns the Status field value +func (o *PaymentRequest) GetStatus() PaymentRequestStatus { + if o == nil { + var ret PaymentRequestStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetStatusOk() (*PaymentRequestStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *PaymentRequest) SetStatus(v PaymentRequestStatus) { + o.Status = v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *PaymentRequest) GetActions() []PaymentRequestAction { + if o == nil || utils.IsNil(o.Actions) { + var ret []PaymentRequestAction + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequest) GetActionsOk() ([]PaymentRequestAction, bool) { + if o == nil || utils.IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *PaymentRequest) HasActions() bool { + if o != nil && !utils.IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []PaymentRequestAction and assigns it to the Actions field. +func (o *PaymentRequest) SetActions(v []PaymentRequestAction) { + o.Actions = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentRequest) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentRequest) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetShippingInformation returns the ShippingInformation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetShippingInformation() PaymentRequestShippingInformation { + if o == nil || utils.IsNil(o.ShippingInformation.Get()) { + var ret PaymentRequestShippingInformation + return ret + } + return *o.ShippingInformation.Get() +} + +// GetShippingInformationOk returns a tuple with the ShippingInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetShippingInformationOk() (*PaymentRequestShippingInformation, bool) { + if o == nil { + return nil, false + } + return o.ShippingInformation.Get(), o.ShippingInformation.IsSet() +} + +// HasShippingInformation returns a boolean if a field has been set. +func (o *PaymentRequest) HasShippingInformation() bool { + if o != nil && o.ShippingInformation.IsSet() { + return true + } + + return false +} + +// SetShippingInformation gets a reference to the given NullablePaymentRequestShippingInformation and assigns it to the ShippingInformation field. +func (o *PaymentRequest) SetShippingInformation(v PaymentRequestShippingInformation) { + o.ShippingInformation.Set(&v) +} +// SetShippingInformationNil sets the value for ShippingInformation to be an explicit nil +func (o *PaymentRequest) SetShippingInformationNil() { + o.ShippingInformation.Set(nil) +} + +// UnsetShippingInformation ensures that no value is present for ShippingInformation, not even an explicit nil +func (o *PaymentRequest) UnsetShippingInformation() { + o.ShippingInformation.Unset() +} + +// GetItems returns the Items field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequest) GetItems() []PaymentRequestBasketItem { + if o == nil { + var ret []PaymentRequestBasketItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequest) GetItemsOk() ([]PaymentRequestBasketItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *PaymentRequest) HasItems() bool { + if o != nil && utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []PaymentRequestBasketItem and assigns it to the Items field. +func (o *PaymentRequest) SetItems(v []PaymentRequestBasketItem) { + o.Items = v +} + +func (o PaymentRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + toSerialize["reference_id"] = o.ReferenceId + toSerialize["business_id"] = o.BusinessId + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + if o.Customer != nil { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + toSerialize["currency"] = o.Currency + toSerialize["payment_method"] = o.PaymentMethod + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.FailureCode.IsSet() { + toSerialize["failure_code"] = o.FailureCode.Get() + } + if o.CaptureMethod.IsSet() { + toSerialize["capture_method"] = o.CaptureMethod.Get() + } + if o.Initiator.IsSet() { + toSerialize["initiator"] = o.Initiator.Get() + } + if o.CardVerificationResults.IsSet() { + toSerialize["card_verification_results"] = o.CardVerificationResults.Get() + } + toSerialize["status"] = o.Status + if !utils.IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.ShippingInformation.IsSet() { + toSerialize["shipping_information"] = o.ShippingInformation.Get() + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullablePaymentRequest struct { + value *PaymentRequest + isSet bool +} + +func (v NullablePaymentRequest) Get() *PaymentRequest { + return v.value +} + +func (v *NullablePaymentRequest) Set(val *PaymentRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequest(val *PaymentRequest) *NullablePaymentRequest { + return &NullablePaymentRequest{value: val, isSet: true} +} + +func (v NullablePaymentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_action.go b/payment_request/model_payment_request_action.go new file mode 100644 index 00000000..888584a4 --- /dev/null +++ b/payment_request/model_payment_request_action.go @@ -0,0 +1,235 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestAction type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestAction{} + +// PaymentRequestAction struct for PaymentRequestAction +type PaymentRequestAction struct { + Action string `json:"action"` + UrlType string `json:"url_type"` + Method NullableString `json:"method"` + Url NullableString `json:"url"` + QrCode NullableString `json:"qr_code"` +} + +// NewPaymentRequestAction instantiates a new PaymentRequestAction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestAction(action string, urlType string, method NullableString, url NullableString, qrCode NullableString) *PaymentRequestAction { + this := PaymentRequestAction{} + this.Action = action + this.UrlType = urlType + this.Method = method + this.Url = url + this.QrCode = qrCode + return &this +} + +// NewPaymentRequestActionWithDefaults instantiates a new PaymentRequestAction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestActionWithDefaults() *PaymentRequestAction { + this := PaymentRequestAction{} + return &this +} + +// GetAction returns the Action field value +func (o *PaymentRequestAction) GetAction() string { + if o == nil { + var ret string + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestAction) GetActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *PaymentRequestAction) SetAction(v string) { + o.Action = v +} + +// GetUrlType returns the UrlType field value +func (o *PaymentRequestAction) GetUrlType() string { + if o == nil { + var ret string + return ret + } + + return o.UrlType +} + +// GetUrlTypeOk returns a tuple with the UrlType field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestAction) GetUrlTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlType, true +} + +// SetUrlType sets field value +func (o *PaymentRequestAction) SetUrlType(v string) { + o.UrlType = v +} + +// GetMethod returns the Method field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaymentRequestAction) GetMethod() string { + if o == nil || o.Method.Get() == nil { + var ret string + return ret + } + + return *o.Method.Get() +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestAction) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Method.Get(), o.Method.IsSet() +} + +// SetMethod sets field value +func (o *PaymentRequestAction) SetMethod(v string) { + o.Method.Set(&v) +} + +// GetUrl returns the Url field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaymentRequestAction) GetUrl() string { + if o == nil || o.Url.Get() == nil { + var ret string + return ret + } + + return *o.Url.Get() +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestAction) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Url.Get(), o.Url.IsSet() +} + +// SetUrl sets field value +func (o *PaymentRequestAction) SetUrl(v string) { + o.Url.Set(&v) +} + +// GetQrCode returns the QrCode field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PaymentRequestAction) GetQrCode() string { + if o == nil || o.QrCode.Get() == nil { + var ret string + return ret + } + + return *o.QrCode.Get() +} + +// GetQrCodeOk returns a tuple with the QrCode field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestAction) GetQrCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.QrCode.Get(), o.QrCode.IsSet() +} + +// SetQrCode sets field value +func (o *PaymentRequestAction) SetQrCode(v string) { + o.QrCode.Set(&v) +} + +func (o PaymentRequestAction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestAction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["url_type"] = o.UrlType + toSerialize["method"] = o.Method.Get() + toSerialize["url"] = o.Url.Get() + toSerialize["qr_code"] = o.QrCode.Get() + return toSerialize, nil +} + +type NullablePaymentRequestAction struct { + value *PaymentRequestAction + isSet bool +} + +func (v NullablePaymentRequestAction) Get() *PaymentRequestAction { + return v.value +} + +func (v *NullablePaymentRequestAction) Set(val *PaymentRequestAction) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestAction) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestAction(val *PaymentRequestAction) *NullablePaymentRequestAction { + return &NullablePaymentRequestAction{value: val, isSet: true} +} + +func (v NullablePaymentRequestAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_auth_parameters.go b/payment_request/model_payment_request_auth_parameters.go new file mode 100644 index 00000000..1ec2695f --- /dev/null +++ b/payment_request/model_payment_request_auth_parameters.go @@ -0,0 +1,121 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestAuthParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestAuthParameters{} + +// PaymentRequestAuthParameters struct for PaymentRequestAuthParameters +type PaymentRequestAuthParameters struct { + AuthCode string `json:"auth_code"` +} + +// NewPaymentRequestAuthParameters instantiates a new PaymentRequestAuthParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestAuthParameters(authCode string) *PaymentRequestAuthParameters { + this := PaymentRequestAuthParameters{} + this.AuthCode = authCode + return &this +} + +// NewPaymentRequestAuthParametersWithDefaults instantiates a new PaymentRequestAuthParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestAuthParametersWithDefaults() *PaymentRequestAuthParameters { + this := PaymentRequestAuthParameters{} + return &this +} + +// GetAuthCode returns the AuthCode field value +func (o *PaymentRequestAuthParameters) GetAuthCode() string { + if o == nil { + var ret string + return ret + } + + return o.AuthCode +} + +// GetAuthCodeOk returns a tuple with the AuthCode field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestAuthParameters) GetAuthCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthCode, true +} + +// SetAuthCode sets field value +func (o *PaymentRequestAuthParameters) SetAuthCode(v string) { + o.AuthCode = v +} + +func (o PaymentRequestAuthParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestAuthParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["auth_code"] = o.AuthCode + return toSerialize, nil +} + +type NullablePaymentRequestAuthParameters struct { + value *PaymentRequestAuthParameters + isSet bool +} + +func (v NullablePaymentRequestAuthParameters) Get() *PaymentRequestAuthParameters { + return v.value +} + +func (v *NullablePaymentRequestAuthParameters) Set(val *PaymentRequestAuthParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestAuthParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestAuthParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestAuthParameters(val *PaymentRequestAuthParameters) *NullablePaymentRequestAuthParameters { + return &NullablePaymentRequestAuthParameters{value: val, isSet: true} +} + +func (v NullablePaymentRequestAuthParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestAuthParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_basket_item.go b/payment_request/model_payment_request_basket_item.go new file mode 100644 index 00000000..c1ca59a9 --- /dev/null +++ b/payment_request/model_payment_request_basket_item.go @@ -0,0 +1,517 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestBasketItem type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestBasketItem{} + +// PaymentRequestBasketItem struct for PaymentRequestBasketItem +type PaymentRequestBasketItem struct { + ReferenceId *string `json:"reference_id,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Type *string `json:"type,omitempty"` + Category string `json:"category"` + SubCategory *string `json:"sub_category,omitempty"` + Currency string `json:"currency"` + Quantity float64 `json:"quantity"` + Price float64 `json:"price"` + PayerChargedCurrency *string `json:"payer_charged_currency,omitempty"` + PayerChargedPrice *float64 `json:"payer_charged_price,omitempty"` + Url *string `json:"url,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewPaymentRequestBasketItem instantiates a new PaymentRequestBasketItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestBasketItem(name string, category string, currency string, quantity float64, price float64) *PaymentRequestBasketItem { + this := PaymentRequestBasketItem{} + this.Name = name + this.Category = category + this.Currency = currency + this.Quantity = quantity + this.Price = price + return &this +} + +// NewPaymentRequestBasketItemWithDefaults instantiates a new PaymentRequestBasketItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestBasketItemWithDefaults() *PaymentRequestBasketItem { + this := PaymentRequestBasketItem{} + return &this +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentRequestBasketItem) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetName returns the Name field value +func (o *PaymentRequestBasketItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PaymentRequestBasketItem) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PaymentRequestBasketItem) SetDescription(v string) { + o.Description = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PaymentRequestBasketItem) SetType(v string) { + o.Type = &v +} + +// GetCategory returns the Category field value +func (o *PaymentRequestBasketItem) GetCategory() string { + if o == nil { + var ret string + return ret + } + + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetCategoryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value +func (o *PaymentRequestBasketItem) SetCategory(v string) { + o.Category = v +} + +// GetSubCategory returns the SubCategory field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetSubCategory() string { + if o == nil || utils.IsNil(o.SubCategory) { + var ret string + return ret + } + return *o.SubCategory +} + +// GetSubCategoryOk returns a tuple with the SubCategory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetSubCategoryOk() (*string, bool) { + if o == nil || utils.IsNil(o.SubCategory) { + return nil, false + } + return o.SubCategory, true +} + +// HasSubCategory returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasSubCategory() bool { + if o != nil && !utils.IsNil(o.SubCategory) { + return true + } + + return false +} + +// SetSubCategory gets a reference to the given string and assigns it to the SubCategory field. +func (o *PaymentRequestBasketItem) SetSubCategory(v string) { + o.SubCategory = &v +} + +// GetCurrency returns the Currency field value +func (o *PaymentRequestBasketItem) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *PaymentRequestBasketItem) SetCurrency(v string) { + o.Currency = v +} + +// GetQuantity returns the Quantity field value +func (o *PaymentRequestBasketItem) GetQuantity() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetQuantityOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *PaymentRequestBasketItem) SetQuantity(v float64) { + o.Quantity = v +} + +// GetPrice returns the Price field value +func (o *PaymentRequestBasketItem) GetPrice() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetPriceOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *PaymentRequestBasketItem) SetPrice(v float64) { + o.Price = v +} + +// GetPayerChargedCurrency returns the PayerChargedCurrency field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetPayerChargedCurrency() string { + if o == nil || utils.IsNil(o.PayerChargedCurrency) { + var ret string + return ret + } + return *o.PayerChargedCurrency +} + +// GetPayerChargedCurrencyOk returns a tuple with the PayerChargedCurrency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetPayerChargedCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.PayerChargedCurrency) { + return nil, false + } + return o.PayerChargedCurrency, true +} + +// HasPayerChargedCurrency returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasPayerChargedCurrency() bool { + if o != nil && !utils.IsNil(o.PayerChargedCurrency) { + return true + } + + return false +} + +// SetPayerChargedCurrency gets a reference to the given string and assigns it to the PayerChargedCurrency field. +func (o *PaymentRequestBasketItem) SetPayerChargedCurrency(v string) { + o.PayerChargedCurrency = &v +} + +// GetPayerChargedPrice returns the PayerChargedPrice field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetPayerChargedPrice() float64 { + if o == nil || utils.IsNil(o.PayerChargedPrice) { + var ret float64 + return ret + } + return *o.PayerChargedPrice +} + +// GetPayerChargedPriceOk returns a tuple with the PayerChargedPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetPayerChargedPriceOk() (*float64, bool) { + if o == nil || utils.IsNil(o.PayerChargedPrice) { + return nil, false + } + return o.PayerChargedPrice, true +} + +// HasPayerChargedPrice returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasPayerChargedPrice() bool { + if o != nil && !utils.IsNil(o.PayerChargedPrice) { + return true + } + + return false +} + +// SetPayerChargedPrice gets a reference to the given float64 and assigns it to the PayerChargedPrice field. +func (o *PaymentRequestBasketItem) SetPayerChargedPrice(v float64) { + o.PayerChargedPrice = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetUrl() string { + if o == nil || utils.IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasUrl() bool { + if o != nil && !utils.IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *PaymentRequestBasketItem) SetUrl(v string) { + o.Url = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *PaymentRequestBasketItem) GetMetadata() map[string]interface{} { + if o == nil || utils.IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestBasketItem) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentRequestBasketItem) HasMetadata() bool { + if o != nil && !utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentRequestBasketItem) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o PaymentRequestBasketItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestBasketItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + toSerialize["name"] = o.Name + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + toSerialize["category"] = o.Category + if !utils.IsNil(o.SubCategory) { + toSerialize["sub_category"] = o.SubCategory + } + toSerialize["currency"] = o.Currency + toSerialize["quantity"] = o.Quantity + toSerialize["price"] = o.Price + if !utils.IsNil(o.PayerChargedCurrency) { + toSerialize["payer_charged_currency"] = o.PayerChargedCurrency + } + if !utils.IsNil(o.PayerChargedPrice) { + toSerialize["payer_charged_price"] = o.PayerChargedPrice + } + if !utils.IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !utils.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullablePaymentRequestBasketItem struct { + value *PaymentRequestBasketItem + isSet bool +} + +func (v NullablePaymentRequestBasketItem) Get() *PaymentRequestBasketItem { + return v.value +} + +func (v *NullablePaymentRequestBasketItem) Set(val *PaymentRequestBasketItem) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestBasketItem) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestBasketItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestBasketItem(val *PaymentRequestBasketItem) *NullablePaymentRequestBasketItem { + return &NullablePaymentRequestBasketItem{value: val, isSet: true} +} + +func (v NullablePaymentRequestBasketItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestBasketItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_capture_method.go b/payment_request/model_payment_request_capture_method.go new file mode 100644 index 00000000..0a700f90 --- /dev/null +++ b/payment_request/model_payment_request_capture_method.go @@ -0,0 +1,115 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentRequestCaptureMethod the model 'PaymentRequestCaptureMethod' +type PaymentRequestCaptureMethod string + +// List of PaymentRequestCaptureMethod +const ( + PAYMENTREQUESTCAPTUREMETHOD_AUTOMATIC PaymentRequestCaptureMethod = "AUTOMATIC" + PAYMENTREQUESTCAPTUREMETHOD_MANUAL PaymentRequestCaptureMethod = "MANUAL" +) + +// All allowed values of PaymentRequestCaptureMethod enum +var AllowedPaymentRequestCaptureMethodEnumValues = []PaymentRequestCaptureMethod{ + "AUTOMATIC", + "MANUAL", +} + +func (v *PaymentRequestCaptureMethod) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentRequestCaptureMethod(value) + for _, existing := range AllowedPaymentRequestCaptureMethodEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentRequestCaptureMethod", value) +} + +// NewPaymentRequestCaptureMethodFromValue returns a pointer to a valid PaymentRequestCaptureMethod +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentRequestCaptureMethodFromValue(v string) (*PaymentRequestCaptureMethod, error) { + ev := PaymentRequestCaptureMethod(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentRequestCaptureMethod: valid values are %v", v, AllowedPaymentRequestCaptureMethodEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentRequestCaptureMethod) IsValid() bool { + for _, existing := range AllowedPaymentRequestCaptureMethodEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentRequestCaptureMethod) String() string { + return string(v) +} + +// Ptr returns reference to PaymentRequestCaptureMethod value +func (v PaymentRequestCaptureMethod) Ptr() *PaymentRequestCaptureMethod { + return &v +} + +type NullablePaymentRequestCaptureMethod struct { + value *PaymentRequestCaptureMethod + isSet bool +} + +func (v NullablePaymentRequestCaptureMethod) Get() *PaymentRequestCaptureMethod { + return v.value +} + +func (v *NullablePaymentRequestCaptureMethod) Set(val *PaymentRequestCaptureMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestCaptureMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestCaptureMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestCaptureMethod(val *PaymentRequestCaptureMethod) *NullablePaymentRequestCaptureMethod { + return &NullablePaymentRequestCaptureMethod{value: val, isSet: true} +} + +func (v NullablePaymentRequestCaptureMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestCaptureMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_request_card_verification_results.go b/payment_request/model_payment_request_card_verification_results.go new file mode 100644 index 00000000..1cff7265 --- /dev/null +++ b/payment_request/model_payment_request_card_verification_results.go @@ -0,0 +1,215 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestCardVerificationResults type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestCardVerificationResults{} + +// PaymentRequestCardVerificationResults struct for PaymentRequestCardVerificationResults +type PaymentRequestCardVerificationResults struct { + ThreeDSecure NullablePaymentRequestCardVerificationResultsThreeDeeSecure `json:"three_d_secure"` + CvvResult NullableString `json:"cvv_result,omitempty"` + AddressVerificationResult NullableString `json:"address_verification_result,omitempty"` +} + +// NewPaymentRequestCardVerificationResults instantiates a new PaymentRequestCardVerificationResults object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestCardVerificationResults(threeDSecure NullablePaymentRequestCardVerificationResultsThreeDeeSecure) *PaymentRequestCardVerificationResults { + this := PaymentRequestCardVerificationResults{} + this.ThreeDSecure = threeDSecure + return &this +} + +// NewPaymentRequestCardVerificationResultsWithDefaults instantiates a new PaymentRequestCardVerificationResults object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestCardVerificationResultsWithDefaults() *PaymentRequestCardVerificationResults { + this := PaymentRequestCardVerificationResults{} + return &this +} + +// GetThreeDSecure returns the ThreeDSecure field value +// If the value is explicit nil, the zero value for PaymentRequestCardVerificationResultsThreeDeeSecure will be returned +func (o *PaymentRequestCardVerificationResults) GetThreeDSecure() PaymentRequestCardVerificationResultsThreeDeeSecure { + if o == nil || o.ThreeDSecure.Get() == nil { + var ret PaymentRequestCardVerificationResultsThreeDeeSecure + return ret + } + + return *o.ThreeDSecure.Get() +} + +// GetThreeDSecureOk returns a tuple with the ThreeDSecure field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestCardVerificationResults) GetThreeDSecureOk() (*PaymentRequestCardVerificationResultsThreeDeeSecure, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecure.Get(), o.ThreeDSecure.IsSet() +} + +// SetThreeDSecure sets field value +func (o *PaymentRequestCardVerificationResults) SetThreeDSecure(v PaymentRequestCardVerificationResultsThreeDeeSecure) { + o.ThreeDSecure.Set(&v) +} + +// GetCvvResult returns the CvvResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestCardVerificationResults) GetCvvResult() string { + if o == nil || utils.IsNil(o.CvvResult.Get()) { + var ret string + return ret + } + return *o.CvvResult.Get() +} + +// GetCvvResultOk returns a tuple with the CvvResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestCardVerificationResults) GetCvvResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CvvResult.Get(), o.CvvResult.IsSet() +} + +// HasCvvResult returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResults) HasCvvResult() bool { + if o != nil && o.CvvResult.IsSet() { + return true + } + + return false +} + +// SetCvvResult gets a reference to the given NullableString and assigns it to the CvvResult field. +func (o *PaymentRequestCardVerificationResults) SetCvvResult(v string) { + o.CvvResult.Set(&v) +} +// SetCvvResultNil sets the value for CvvResult to be an explicit nil +func (o *PaymentRequestCardVerificationResults) SetCvvResultNil() { + o.CvvResult.Set(nil) +} + +// UnsetCvvResult ensures that no value is present for CvvResult, not even an explicit nil +func (o *PaymentRequestCardVerificationResults) UnsetCvvResult() { + o.CvvResult.Unset() +} + +// GetAddressVerificationResult returns the AddressVerificationResult field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestCardVerificationResults) GetAddressVerificationResult() string { + if o == nil || utils.IsNil(o.AddressVerificationResult.Get()) { + var ret string + return ret + } + return *o.AddressVerificationResult.Get() +} + +// GetAddressVerificationResultOk returns a tuple with the AddressVerificationResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestCardVerificationResults) GetAddressVerificationResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AddressVerificationResult.Get(), o.AddressVerificationResult.IsSet() +} + +// HasAddressVerificationResult returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResults) HasAddressVerificationResult() bool { + if o != nil && o.AddressVerificationResult.IsSet() { + return true + } + + return false +} + +// SetAddressVerificationResult gets a reference to the given NullableString and assigns it to the AddressVerificationResult field. +func (o *PaymentRequestCardVerificationResults) SetAddressVerificationResult(v string) { + o.AddressVerificationResult.Set(&v) +} +// SetAddressVerificationResultNil sets the value for AddressVerificationResult to be an explicit nil +func (o *PaymentRequestCardVerificationResults) SetAddressVerificationResultNil() { + o.AddressVerificationResult.Set(nil) +} + +// UnsetAddressVerificationResult ensures that no value is present for AddressVerificationResult, not even an explicit nil +func (o *PaymentRequestCardVerificationResults) UnsetAddressVerificationResult() { + o.AddressVerificationResult.Unset() +} + +func (o PaymentRequestCardVerificationResults) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestCardVerificationResults) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["three_d_secure"] = o.ThreeDSecure.Get() + if o.CvvResult.IsSet() { + toSerialize["cvv_result"] = o.CvvResult.Get() + } + if o.AddressVerificationResult.IsSet() { + toSerialize["address_verification_result"] = o.AddressVerificationResult.Get() + } + return toSerialize, nil +} + +type NullablePaymentRequestCardVerificationResults struct { + value *PaymentRequestCardVerificationResults + isSet bool +} + +func (v NullablePaymentRequestCardVerificationResults) Get() *PaymentRequestCardVerificationResults { + return v.value +} + +func (v *NullablePaymentRequestCardVerificationResults) Set(val *PaymentRequestCardVerificationResults) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestCardVerificationResults) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestCardVerificationResults) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestCardVerificationResults(val *PaymentRequestCardVerificationResults) *NullablePaymentRequestCardVerificationResults { + return &NullablePaymentRequestCardVerificationResults{value: val, isSet: true} +} + +func (v NullablePaymentRequestCardVerificationResults) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestCardVerificationResults) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_card_verification_results_three_dee_secure.go b/payment_request/model_payment_request_card_verification_results_three_dee_secure.go new file mode 100644 index 00000000..8dbc5c76 --- /dev/null +++ b/payment_request/model_payment_request_card_verification_results_three_dee_secure.go @@ -0,0 +1,284 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestCardVerificationResultsThreeDeeSecure type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestCardVerificationResultsThreeDeeSecure{} + +// PaymentRequestCardVerificationResultsThreeDeeSecure struct for PaymentRequestCardVerificationResultsThreeDeeSecure +type PaymentRequestCardVerificationResultsThreeDeeSecure struct { + ThreeDSecureFlow *string `json:"three_d_secure_flow,omitempty"` + EciCode *string `json:"eci_code,omitempty"` + ThreeDSecureResult *string `json:"three_d_secure_result,omitempty"` + ThreeDSecureResultReason NullableString `json:"three_d_secure_result_reason,omitempty"` + ThreeDSecureVersion *string `json:"three_d_secure_version,omitempty"` +} + +// NewPaymentRequestCardVerificationResultsThreeDeeSecure instantiates a new PaymentRequestCardVerificationResultsThreeDeeSecure object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestCardVerificationResultsThreeDeeSecure() *PaymentRequestCardVerificationResultsThreeDeeSecure { + this := PaymentRequestCardVerificationResultsThreeDeeSecure{} + return &this +} + +// NewPaymentRequestCardVerificationResultsThreeDeeSecureWithDefaults instantiates a new PaymentRequestCardVerificationResultsThreeDeeSecure object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestCardVerificationResultsThreeDeeSecureWithDefaults() *PaymentRequestCardVerificationResultsThreeDeeSecure { + this := PaymentRequestCardVerificationResultsThreeDeeSecure{} + return &this +} + +// GetThreeDSecureFlow returns the ThreeDSecureFlow field value if set, zero value otherwise. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureFlow() string { + if o == nil || utils.IsNil(o.ThreeDSecureFlow) { + var ret string + return ret + } + return *o.ThreeDSecureFlow +} + +// GetThreeDSecureFlowOk returns a tuple with the ThreeDSecureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureFlowOk() (*string, bool) { + if o == nil || utils.IsNil(o.ThreeDSecureFlow) { + return nil, false + } + return o.ThreeDSecureFlow, true +} + +// HasThreeDSecureFlow returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureFlow() bool { + if o != nil && !utils.IsNil(o.ThreeDSecureFlow) { + return true + } + + return false +} + +// SetThreeDSecureFlow gets a reference to the given string and assigns it to the ThreeDSecureFlow field. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureFlow(v string) { + o.ThreeDSecureFlow = &v +} + +// GetEciCode returns the EciCode field value if set, zero value otherwise. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetEciCode() string { + if o == nil || utils.IsNil(o.EciCode) { + var ret string + return ret + } + return *o.EciCode +} + +// GetEciCodeOk returns a tuple with the EciCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetEciCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.EciCode) { + return nil, false + } + return o.EciCode, true +} + +// HasEciCode returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasEciCode() bool { + if o != nil && !utils.IsNil(o.EciCode) { + return true + } + + return false +} + +// SetEciCode gets a reference to the given string and assigns it to the EciCode field. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetEciCode(v string) { + o.EciCode = &v +} + +// GetThreeDSecureResult returns the ThreeDSecureResult field value if set, zero value otherwise. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResult() string { + if o == nil || utils.IsNil(o.ThreeDSecureResult) { + var ret string + return ret + } + return *o.ThreeDSecureResult +} + +// GetThreeDSecureResultOk returns a tuple with the ThreeDSecureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultOk() (*string, bool) { + if o == nil || utils.IsNil(o.ThreeDSecureResult) { + return nil, false + } + return o.ThreeDSecureResult, true +} + +// HasThreeDSecureResult returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureResult() bool { + if o != nil && !utils.IsNil(o.ThreeDSecureResult) { + return true + } + + return false +} + +// SetThreeDSecureResult gets a reference to the given string and assigns it to the ThreeDSecureResult field. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResult(v string) { + o.ThreeDSecureResult = &v +} + +// GetThreeDSecureResultReason returns the ThreeDSecureResultReason field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultReason() string { + if o == nil || utils.IsNil(o.ThreeDSecureResultReason.Get()) { + var ret string + return ret + } + return *o.ThreeDSecureResultReason.Get() +} + +// GetThreeDSecureResultReasonOk returns a tuple with the ThreeDSecureResultReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureResultReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ThreeDSecureResultReason.Get(), o.ThreeDSecureResultReason.IsSet() +} + +// HasThreeDSecureResultReason returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureResultReason() bool { + if o != nil && o.ThreeDSecureResultReason.IsSet() { + return true + } + + return false +} + +// SetThreeDSecureResultReason gets a reference to the given NullableString and assigns it to the ThreeDSecureResultReason field. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResultReason(v string) { + o.ThreeDSecureResultReason.Set(&v) +} +// SetThreeDSecureResultReasonNil sets the value for ThreeDSecureResultReason to be an explicit nil +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureResultReasonNil() { + o.ThreeDSecureResultReason.Set(nil) +} + +// UnsetThreeDSecureResultReason ensures that no value is present for ThreeDSecureResultReason, not even an explicit nil +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) UnsetThreeDSecureResultReason() { + o.ThreeDSecureResultReason.Unset() +} + +// GetThreeDSecureVersion returns the ThreeDSecureVersion field value if set, zero value otherwise. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureVersion() string { + if o == nil || utils.IsNil(o.ThreeDSecureVersion) { + var ret string + return ret + } + return *o.ThreeDSecureVersion +} + +// GetThreeDSecureVersionOk returns a tuple with the ThreeDSecureVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) GetThreeDSecureVersionOk() (*string, bool) { + if o == nil || utils.IsNil(o.ThreeDSecureVersion) { + return nil, false + } + return o.ThreeDSecureVersion, true +} + +// HasThreeDSecureVersion returns a boolean if a field has been set. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) HasThreeDSecureVersion() bool { + if o != nil && !utils.IsNil(o.ThreeDSecureVersion) { + return true + } + + return false +} + +// SetThreeDSecureVersion gets a reference to the given string and assigns it to the ThreeDSecureVersion field. +func (o *PaymentRequestCardVerificationResultsThreeDeeSecure) SetThreeDSecureVersion(v string) { + o.ThreeDSecureVersion = &v +} + +func (o PaymentRequestCardVerificationResultsThreeDeeSecure) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestCardVerificationResultsThreeDeeSecure) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ThreeDSecureFlow) { + toSerialize["three_d_secure_flow"] = o.ThreeDSecureFlow + } + if !utils.IsNil(o.EciCode) { + toSerialize["eci_code"] = o.EciCode + } + if !utils.IsNil(o.ThreeDSecureResult) { + toSerialize["three_d_secure_result"] = o.ThreeDSecureResult + } + if o.ThreeDSecureResultReason.IsSet() { + toSerialize["three_d_secure_result_reason"] = o.ThreeDSecureResultReason.Get() + } + if !utils.IsNil(o.ThreeDSecureVersion) { + toSerialize["three_d_secure_version"] = o.ThreeDSecureVersion + } + return toSerialize, nil +} + +type NullablePaymentRequestCardVerificationResultsThreeDeeSecure struct { + value *PaymentRequestCardVerificationResultsThreeDeeSecure + isSet bool +} + +func (v NullablePaymentRequestCardVerificationResultsThreeDeeSecure) Get() *PaymentRequestCardVerificationResultsThreeDeeSecure { + return v.value +} + +func (v *NullablePaymentRequestCardVerificationResultsThreeDeeSecure) Set(val *PaymentRequestCardVerificationResultsThreeDeeSecure) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestCardVerificationResultsThreeDeeSecure) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestCardVerificationResultsThreeDeeSecure) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestCardVerificationResultsThreeDeeSecure(val *PaymentRequestCardVerificationResultsThreeDeeSecure) *NullablePaymentRequestCardVerificationResultsThreeDeeSecure { + return &NullablePaymentRequestCardVerificationResultsThreeDeeSecure{value: val, isSet: true} +} + +func (v NullablePaymentRequestCardVerificationResultsThreeDeeSecure) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestCardVerificationResultsThreeDeeSecure) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_channel_properties.go b/payment_request/model_payment_request_channel_properties.go new file mode 100644 index 00000000..bf60e8a0 --- /dev/null +++ b/payment_request/model_payment_request_channel_properties.go @@ -0,0 +1,363 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestChannelProperties{} + +// PaymentRequestChannelProperties struct for PaymentRequestChannelProperties +type PaymentRequestChannelProperties struct { + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl *string `json:"failure_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization cancelled + CancelReturnUrl *string `json:"cancel_return_url,omitempty"` + // REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. + RedeemPoints *string `json:"redeem_points,omitempty"` + // Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. + RequireAuth *bool `json:"require_auth,omitempty"` + // Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use + MerchantIdTag *string `json:"merchant_id_tag,omitempty"` + // Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. + CardonfileType NullableString `json:"cardonfile_type,omitempty"` +} + +// NewPaymentRequestChannelProperties instantiates a new PaymentRequestChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestChannelProperties() *PaymentRequestChannelProperties { + this := PaymentRequestChannelProperties{} + return &this +} + +// NewPaymentRequestChannelPropertiesWithDefaults instantiates a new PaymentRequestChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestChannelPropertiesWithDefaults() *PaymentRequestChannelProperties { + this := PaymentRequestChannelProperties{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *PaymentRequestChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *PaymentRequestChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +// GetCancelReturnUrl returns the CancelReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetCancelReturnUrl() string { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + var ret string + return ret + } + return *o.CancelReturnUrl +} + +// GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetCancelReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + return nil, false + } + return o.CancelReturnUrl, true +} + +// HasCancelReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasCancelReturnUrl() bool { + if o != nil && !utils.IsNil(o.CancelReturnUrl) { + return true + } + + return false +} + +// SetCancelReturnUrl gets a reference to the given string and assigns it to the CancelReturnUrl field. +func (o *PaymentRequestChannelProperties) SetCancelReturnUrl(v string) { + o.CancelReturnUrl = &v +} + +// GetRedeemPoints returns the RedeemPoints field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetRedeemPoints() string { + if o == nil || utils.IsNil(o.RedeemPoints) { + var ret string + return ret + } + return *o.RedeemPoints +} + +// GetRedeemPointsOk returns a tuple with the RedeemPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetRedeemPointsOk() (*string, bool) { + if o == nil || utils.IsNil(o.RedeemPoints) { + return nil, false + } + return o.RedeemPoints, true +} + +// HasRedeemPoints returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasRedeemPoints() bool { + if o != nil && !utils.IsNil(o.RedeemPoints) { + return true + } + + return false +} + +// SetRedeemPoints gets a reference to the given string and assigns it to the RedeemPoints field. +func (o *PaymentRequestChannelProperties) SetRedeemPoints(v string) { + o.RedeemPoints = &v +} + +// GetRequireAuth returns the RequireAuth field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetRequireAuth() bool { + if o == nil || utils.IsNil(o.RequireAuth) { + var ret bool + return ret + } + return *o.RequireAuth +} + +// GetRequireAuthOk returns a tuple with the RequireAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetRequireAuthOk() (*bool, bool) { + if o == nil || utils.IsNil(o.RequireAuth) { + return nil, false + } + return o.RequireAuth, true +} + +// HasRequireAuth returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasRequireAuth() bool { + if o != nil && !utils.IsNil(o.RequireAuth) { + return true + } + + return false +} + +// SetRequireAuth gets a reference to the given bool and assigns it to the RequireAuth field. +func (o *PaymentRequestChannelProperties) SetRequireAuth(v bool) { + o.RequireAuth = &v +} + +// GetMerchantIdTag returns the MerchantIdTag field value if set, zero value otherwise. +func (o *PaymentRequestChannelProperties) GetMerchantIdTag() string { + if o == nil || utils.IsNil(o.MerchantIdTag) { + var ret string + return ret + } + return *o.MerchantIdTag +} + +// GetMerchantIdTagOk returns a tuple with the MerchantIdTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestChannelProperties) GetMerchantIdTagOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantIdTag) { + return nil, false + } + return o.MerchantIdTag, true +} + +// HasMerchantIdTag returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasMerchantIdTag() bool { + if o != nil && !utils.IsNil(o.MerchantIdTag) { + return true + } + + return false +} + +// SetMerchantIdTag gets a reference to the given string and assigns it to the MerchantIdTag field. +func (o *PaymentRequestChannelProperties) SetMerchantIdTag(v string) { + o.MerchantIdTag = &v +} + +// GetCardonfileType returns the CardonfileType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestChannelProperties) GetCardonfileType() string { + if o == nil || utils.IsNil(o.CardonfileType.Get()) { + var ret string + return ret + } + return *o.CardonfileType.Get() +} + +// GetCardonfileTypeOk returns a tuple with the CardonfileType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestChannelProperties) GetCardonfileTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardonfileType.Get(), o.CardonfileType.IsSet() +} + +// HasCardonfileType returns a boolean if a field has been set. +func (o *PaymentRequestChannelProperties) HasCardonfileType() bool { + if o != nil && o.CardonfileType.IsSet() { + return true + } + + return false +} + +// SetCardonfileType gets a reference to the given NullableString and assigns it to the CardonfileType field. +func (o *PaymentRequestChannelProperties) SetCardonfileType(v string) { + o.CardonfileType.Set(&v) +} +// SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil +func (o *PaymentRequestChannelProperties) SetCardonfileTypeNil() { + o.CardonfileType.Set(nil) +} + +// UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +func (o *PaymentRequestChannelProperties) UnsetCardonfileType() { + o.CardonfileType.Unset() +} + +func (o PaymentRequestChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + if !utils.IsNil(o.CancelReturnUrl) { + toSerialize["cancel_return_url"] = o.CancelReturnUrl + } + if !utils.IsNil(o.RedeemPoints) { + toSerialize["redeem_points"] = o.RedeemPoints + } + if !utils.IsNil(o.RequireAuth) { + toSerialize["require_auth"] = o.RequireAuth + } + if !utils.IsNil(o.MerchantIdTag) { + toSerialize["merchant_id_tag"] = o.MerchantIdTag + } + if o.CardonfileType.IsSet() { + toSerialize["cardonfile_type"] = o.CardonfileType.Get() + } + return toSerialize, nil +} + +type NullablePaymentRequestChannelProperties struct { + value *PaymentRequestChannelProperties + isSet bool +} + +func (v NullablePaymentRequestChannelProperties) Get() *PaymentRequestChannelProperties { + return v.value +} + +func (v *NullablePaymentRequestChannelProperties) Set(val *PaymentRequestChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestChannelProperties(val *PaymentRequestChannelProperties) *NullablePaymentRequestChannelProperties { + return &NullablePaymentRequestChannelProperties{value: val, isSet: true} +} + +func (v NullablePaymentRequestChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_country.go b/payment_request/model_payment_request_country.go new file mode 100644 index 00000000..0863e0b3 --- /dev/null +++ b/payment_request/model_payment_request_country.go @@ -0,0 +1,121 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentRequestCountry the model 'PaymentRequestCountry' +type PaymentRequestCountry string + +// List of PaymentRequestCountry +const ( + PAYMENTREQUESTCOUNTRY_ID PaymentRequestCountry = "ID" + PAYMENTREQUESTCOUNTRY_PH PaymentRequestCountry = "PH" + PAYMENTREQUESTCOUNTRY_VN PaymentRequestCountry = "VN" + PAYMENTREQUESTCOUNTRY_TH PaymentRequestCountry = "TH" + PAYMENTREQUESTCOUNTRY_MY PaymentRequestCountry = "MY" +) + +// All allowed values of PaymentRequestCountry enum +var AllowedPaymentRequestCountryEnumValues = []PaymentRequestCountry{ + "ID", + "PH", + "VN", + "TH", + "MY", +} + +func (v *PaymentRequestCountry) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentRequestCountry(value) + for _, existing := range AllowedPaymentRequestCountryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentRequestCountry", value) +} + +// NewPaymentRequestCountryFromValue returns a pointer to a valid PaymentRequestCountry +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentRequestCountryFromValue(v string) (*PaymentRequestCountry, error) { + ev := PaymentRequestCountry(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentRequestCountry: valid values are %v", v, AllowedPaymentRequestCountryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentRequestCountry) IsValid() bool { + for _, existing := range AllowedPaymentRequestCountryEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentRequestCountry) String() string { + return string(v) +} + +// Ptr returns reference to PaymentRequestCountry value +func (v PaymentRequestCountry) Ptr() *PaymentRequestCountry { + return &v +} + +type NullablePaymentRequestCountry struct { + value *PaymentRequestCountry + isSet bool +} + +func (v NullablePaymentRequestCountry) Get() *PaymentRequestCountry { + return v.value +} + +func (v *NullablePaymentRequestCountry) Set(val *PaymentRequestCountry) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestCountry) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestCountry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestCountry(val *PaymentRequestCountry) *NullablePaymentRequestCountry { + return &NullablePaymentRequestCountry{value: val, isSet: true} +} + +func (v NullablePaymentRequestCountry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestCountry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_request_currency.go b/payment_request/model_payment_request_currency.go new file mode 100644 index 00000000..b92a9a73 --- /dev/null +++ b/payment_request/model_payment_request_currency.go @@ -0,0 +1,121 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentRequestCurrency the model 'PaymentRequestCurrency' +type PaymentRequestCurrency string + +// List of PaymentRequestCurrency +const ( + PAYMENTREQUESTCURRENCY_IDR PaymentRequestCurrency = "IDR" + PAYMENTREQUESTCURRENCY_PHP PaymentRequestCurrency = "PHP" + PAYMENTREQUESTCURRENCY_VND PaymentRequestCurrency = "VND" + PAYMENTREQUESTCURRENCY_THB PaymentRequestCurrency = "THB" + PAYMENTREQUESTCURRENCY_MYR PaymentRequestCurrency = "MYR" +) + +// All allowed values of PaymentRequestCurrency enum +var AllowedPaymentRequestCurrencyEnumValues = []PaymentRequestCurrency{ + "IDR", + "PHP", + "VND", + "THB", + "MYR", +} + +func (v *PaymentRequestCurrency) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentRequestCurrency(value) + for _, existing := range AllowedPaymentRequestCurrencyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentRequestCurrency", value) +} + +// NewPaymentRequestCurrencyFromValue returns a pointer to a valid PaymentRequestCurrency +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentRequestCurrencyFromValue(v string) (*PaymentRequestCurrency, error) { + ev := PaymentRequestCurrency(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentRequestCurrency: valid values are %v", v, AllowedPaymentRequestCurrencyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentRequestCurrency) IsValid() bool { + for _, existing := range AllowedPaymentRequestCurrencyEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentRequestCurrency) String() string { + return string(v) +} + +// Ptr returns reference to PaymentRequestCurrency value +func (v PaymentRequestCurrency) Ptr() *PaymentRequestCurrency { + return &v +} + +type NullablePaymentRequestCurrency struct { + value *PaymentRequestCurrency + isSet bool +} + +func (v NullablePaymentRequestCurrency) Get() *PaymentRequestCurrency { + return v.value +} + +func (v *NullablePaymentRequestCurrency) Set(val *PaymentRequestCurrency) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestCurrency) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestCurrency) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestCurrency(val *PaymentRequestCurrency) *NullablePaymentRequestCurrency { + return &NullablePaymentRequestCurrency{value: val, isSet: true} +} + +func (v NullablePaymentRequestCurrency) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestCurrency) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_request_initiator.go b/payment_request/model_payment_request_initiator.go new file mode 100644 index 00000000..632a031d --- /dev/null +++ b/payment_request/model_payment_request_initiator.go @@ -0,0 +1,115 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentRequestInitiator the model 'PaymentRequestInitiator' +type PaymentRequestInitiator string + +// List of PaymentRequestInitiator +const ( + PAYMENTREQUESTINITIATOR_CUSTOMER PaymentRequestInitiator = "CUSTOMER" + PAYMENTREQUESTINITIATOR_MERCHANT PaymentRequestInitiator = "MERCHANT" +) + +// All allowed values of PaymentRequestInitiator enum +var AllowedPaymentRequestInitiatorEnumValues = []PaymentRequestInitiator{ + "CUSTOMER", + "MERCHANT", +} + +func (v *PaymentRequestInitiator) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentRequestInitiator(value) + for _, existing := range AllowedPaymentRequestInitiatorEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentRequestInitiator", value) +} + +// NewPaymentRequestInitiatorFromValue returns a pointer to a valid PaymentRequestInitiator +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentRequestInitiatorFromValue(v string) (*PaymentRequestInitiator, error) { + ev := PaymentRequestInitiator(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentRequestInitiator: valid values are %v", v, AllowedPaymentRequestInitiatorEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentRequestInitiator) IsValid() bool { + for _, existing := range AllowedPaymentRequestInitiatorEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentRequestInitiator) String() string { + return string(v) +} + +// Ptr returns reference to PaymentRequestInitiator value +func (v PaymentRequestInitiator) Ptr() *PaymentRequestInitiator { + return &v +} + +type NullablePaymentRequestInitiator struct { + value *PaymentRequestInitiator + isSet bool +} + +func (v NullablePaymentRequestInitiator) Get() *PaymentRequestInitiator { + return v.value +} + +func (v *NullablePaymentRequestInitiator) Set(val *PaymentRequestInitiator) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestInitiator) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestInitiator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestInitiator(val *PaymentRequestInitiator) *NullablePaymentRequestInitiator { + return &NullablePaymentRequestInitiator{value: val, isSet: true} +} + +func (v NullablePaymentRequestInitiator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestInitiator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_payment_request_list_response.go b/payment_request/model_payment_request_list_response.go new file mode 100644 index 00000000..505d46aa --- /dev/null +++ b/payment_request/model_payment_request_list_response.go @@ -0,0 +1,148 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestListResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestListResponse{} + +// PaymentRequestListResponse struct for PaymentRequestListResponse +type PaymentRequestListResponse struct { + Data []PaymentRequest `json:"data"` + HasMore bool `json:"has_more"` +} + +// NewPaymentRequestListResponse instantiates a new PaymentRequestListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestListResponse(data []PaymentRequest, hasMore bool) *PaymentRequestListResponse { + this := PaymentRequestListResponse{} + this.Data = data + this.HasMore = hasMore + return &this +} + +// NewPaymentRequestListResponseWithDefaults instantiates a new PaymentRequestListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestListResponseWithDefaults() *PaymentRequestListResponse { + this := PaymentRequestListResponse{} + return &this +} + +// GetData returns the Data field value +func (o *PaymentRequestListResponse) GetData() []PaymentRequest { + if o == nil { + var ret []PaymentRequest + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestListResponse) GetDataOk() ([]PaymentRequest, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *PaymentRequestListResponse) SetData(v []PaymentRequest) { + o.Data = v +} + +// GetHasMore returns the HasMore field value +func (o *PaymentRequestListResponse) GetHasMore() bool { + if o == nil { + var ret bool + return ret + } + + return o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestListResponse) GetHasMoreOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HasMore, true +} + +// SetHasMore sets field value +func (o *PaymentRequestListResponse) SetHasMore(v bool) { + o.HasMore = v +} + +func (o PaymentRequestListResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["has_more"] = o.HasMore + return toSerialize, nil +} + +type NullablePaymentRequestListResponse struct { + value *PaymentRequestListResponse + isSet bool +} + +func (v NullablePaymentRequestListResponse) Get() *PaymentRequestListResponse { + return v.value +} + +func (v *NullablePaymentRequestListResponse) Set(val *PaymentRequestListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestListResponse(val *PaymentRequestListResponse) *NullablePaymentRequestListResponse { + return &NullablePaymentRequestListResponse{value: val, isSet: true} +} + +func (v NullablePaymentRequestListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_parameters.go b/payment_request/model_payment_request_parameters.go new file mode 100644 index 00000000..6cdab8a2 --- /dev/null +++ b/payment_request/model_payment_request_parameters.go @@ -0,0 +1,642 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestParameters{} + +// PaymentRequestParameters struct for PaymentRequestParameters +type PaymentRequestParameters struct { + ReferenceId *string `json:"reference_id,omitempty"` + Amount *float64 `json:"amount,omitempty"` + Currency PaymentRequestCurrency `json:"currency"` + PaymentMethod *PaymentMethodParameters `json:"payment_method,omitempty"` + Description NullableString `json:"description,omitempty"` + CaptureMethod NullablePaymentRequestCaptureMethod `json:"capture_method,omitempty"` + Initiator NullablePaymentRequestInitiator `json:"initiator,omitempty"` + PaymentMethodId *string `json:"payment_method_id,omitempty"` + ChannelProperties *PaymentRequestParametersChannelProperties `json:"channel_properties,omitempty"` + ShippingInformation NullablePaymentRequestShippingInformation `json:"shipping_information,omitempty"` + Items []PaymentRequestBasketItem `json:"items,omitempty"` + CustomerId NullableString `json:"customer_id,omitempty"` + Customer map[string]interface{} `json:"customer,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewPaymentRequestParameters instantiates a new PaymentRequestParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestParameters(currency PaymentRequestCurrency) *PaymentRequestParameters { + this := PaymentRequestParameters{} + this.Currency = currency + return &this +} + +// NewPaymentRequestParametersWithDefaults instantiates a new PaymentRequestParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestParametersWithDefaults() *PaymentRequestParameters { + this := PaymentRequestParameters{} + return &this +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *PaymentRequestParameters) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *PaymentRequestParameters) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *PaymentRequestParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount) { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *PaymentRequestParameters) SetAmount(v float64) { + o.Amount = &v +} + +// GetCurrency returns the Currency field value +func (o *PaymentRequestParameters) GetCurrency() PaymentRequestCurrency { + if o == nil { + var ret PaymentRequestCurrency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *PaymentRequestParameters) SetCurrency(v PaymentRequestCurrency) { + o.Currency = v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *PaymentRequestParameters) GetPaymentMethod() PaymentMethodParameters { + if o == nil || utils.IsNil(o.PaymentMethod) { + var ret PaymentMethodParameters + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetPaymentMethodOk() (*PaymentMethodParameters, bool) { + if o == nil || utils.IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasPaymentMethod() bool { + if o != nil && !utils.IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given PaymentMethodParameters and assigns it to the PaymentMethod field. +func (o *PaymentRequestParameters) SetPaymentMethod(v PaymentMethodParameters) { + o.PaymentMethod = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetDescription() string { + if o == nil || utils.IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PaymentRequestParameters) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PaymentRequestParameters) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PaymentRequestParameters) UnsetDescription() { + o.Description.Unset() +} + +// GetCaptureMethod returns the CaptureMethod field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetCaptureMethod() PaymentRequestCaptureMethod { + if o == nil || utils.IsNil(o.CaptureMethod.Get()) { + var ret PaymentRequestCaptureMethod + return ret + } + return *o.CaptureMethod.Get() +} + +// GetCaptureMethodOk returns a tuple with the CaptureMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetCaptureMethodOk() (*PaymentRequestCaptureMethod, bool) { + if o == nil { + return nil, false + } + return o.CaptureMethod.Get(), o.CaptureMethod.IsSet() +} + +// HasCaptureMethod returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasCaptureMethod() bool { + if o != nil && o.CaptureMethod.IsSet() { + return true + } + + return false +} + +// SetCaptureMethod gets a reference to the given NullablePaymentRequestCaptureMethod and assigns it to the CaptureMethod field. +func (o *PaymentRequestParameters) SetCaptureMethod(v PaymentRequestCaptureMethod) { + o.CaptureMethod.Set(&v) +} +// SetCaptureMethodNil sets the value for CaptureMethod to be an explicit nil +func (o *PaymentRequestParameters) SetCaptureMethodNil() { + o.CaptureMethod.Set(nil) +} + +// UnsetCaptureMethod ensures that no value is present for CaptureMethod, not even an explicit nil +func (o *PaymentRequestParameters) UnsetCaptureMethod() { + o.CaptureMethod.Unset() +} + +// GetInitiator returns the Initiator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetInitiator() PaymentRequestInitiator { + if o == nil || utils.IsNil(o.Initiator.Get()) { + var ret PaymentRequestInitiator + return ret + } + return *o.Initiator.Get() +} + +// GetInitiatorOk returns a tuple with the Initiator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetInitiatorOk() (*PaymentRequestInitiator, bool) { + if o == nil { + return nil, false + } + return o.Initiator.Get(), o.Initiator.IsSet() +} + +// HasInitiator returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasInitiator() bool { + if o != nil && o.Initiator.IsSet() { + return true + } + + return false +} + +// SetInitiator gets a reference to the given NullablePaymentRequestInitiator and assigns it to the Initiator field. +func (o *PaymentRequestParameters) SetInitiator(v PaymentRequestInitiator) { + o.Initiator.Set(&v) +} +// SetInitiatorNil sets the value for Initiator to be an explicit nil +func (o *PaymentRequestParameters) SetInitiatorNil() { + o.Initiator.Set(nil) +} + +// UnsetInitiator ensures that no value is present for Initiator, not even an explicit nil +func (o *PaymentRequestParameters) UnsetInitiator() { + o.Initiator.Unset() +} + +// GetPaymentMethodId returns the PaymentMethodId field value if set, zero value otherwise. +func (o *PaymentRequestParameters) GetPaymentMethodId() string { + if o == nil || utils.IsNil(o.PaymentMethodId) { + var ret string + return ret + } + return *o.PaymentMethodId +} + +// GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetPaymentMethodIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentMethodId) { + return nil, false + } + return o.PaymentMethodId, true +} + +// HasPaymentMethodId returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasPaymentMethodId() bool { + if o != nil && !utils.IsNil(o.PaymentMethodId) { + return true + } + + return false +} + +// SetPaymentMethodId gets a reference to the given string and assigns it to the PaymentMethodId field. +func (o *PaymentRequestParameters) SetPaymentMethodId(v string) { + o.PaymentMethodId = &v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *PaymentRequestParameters) GetChannelProperties() PaymentRequestParametersChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret PaymentRequestParametersChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParameters) GetChannelPropertiesOk() (*PaymentRequestParametersChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given PaymentRequestParametersChannelProperties and assigns it to the ChannelProperties field. +func (o *PaymentRequestParameters) SetChannelProperties(v PaymentRequestParametersChannelProperties) { + o.ChannelProperties = &v +} + +// GetShippingInformation returns the ShippingInformation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetShippingInformation() PaymentRequestShippingInformation { + if o == nil || utils.IsNil(o.ShippingInformation.Get()) { + var ret PaymentRequestShippingInformation + return ret + } + return *o.ShippingInformation.Get() +} + +// GetShippingInformationOk returns a tuple with the ShippingInformation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetShippingInformationOk() (*PaymentRequestShippingInformation, bool) { + if o == nil { + return nil, false + } + return o.ShippingInformation.Get(), o.ShippingInformation.IsSet() +} + +// HasShippingInformation returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasShippingInformation() bool { + if o != nil && o.ShippingInformation.IsSet() { + return true + } + + return false +} + +// SetShippingInformation gets a reference to the given NullablePaymentRequestShippingInformation and assigns it to the ShippingInformation field. +func (o *PaymentRequestParameters) SetShippingInformation(v PaymentRequestShippingInformation) { + o.ShippingInformation.Set(&v) +} +// SetShippingInformationNil sets the value for ShippingInformation to be an explicit nil +func (o *PaymentRequestParameters) SetShippingInformationNil() { + o.ShippingInformation.Set(nil) +} + +// UnsetShippingInformation ensures that no value is present for ShippingInformation, not even an explicit nil +func (o *PaymentRequestParameters) UnsetShippingInformation() { + o.ShippingInformation.Unset() +} + +// GetItems returns the Items field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetItems() []PaymentRequestBasketItem { + if o == nil { + var ret []PaymentRequestBasketItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetItemsOk() ([]PaymentRequestBasketItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasItems() bool { + if o != nil && utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []PaymentRequestBasketItem and assigns it to the Items field. +func (o *PaymentRequestParameters) SetItems(v []PaymentRequestBasketItem) { + o.Items = v +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *PaymentRequestParameters) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *PaymentRequestParameters) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *PaymentRequestParameters) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetCustomer returns the Customer field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetCustomer() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetCustomerOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Customer) { + return map[string]interface{}{}, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasCustomer() bool { + if o != nil && utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given map[string]interface{} and assigns it to the Customer field. +func (o *PaymentRequestParameters) SetCustomer(v map[string]interface{}) { + o.Customer = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParameters) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParameters) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentRequestParameters) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentRequestParameters) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o PaymentRequestParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + toSerialize["currency"] = o.Currency + if !utils.IsNil(o.PaymentMethod) { + toSerialize["payment_method"] = o.PaymentMethod + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.CaptureMethod.IsSet() { + toSerialize["capture_method"] = o.CaptureMethod.Get() + } + if o.Initiator.IsSet() { + toSerialize["initiator"] = o.Initiator.Get() + } + if !utils.IsNil(o.PaymentMethodId) { + toSerialize["payment_method_id"] = o.PaymentMethodId + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + if o.ShippingInformation.IsSet() { + toSerialize["shipping_information"] = o.ShippingInformation.Get() + } + if o.Items != nil { + toSerialize["items"] = o.Items + } + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + if o.Customer != nil { + toSerialize["customer"] = o.Customer + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullablePaymentRequestParameters struct { + value *PaymentRequestParameters + isSet bool +} + +func (v NullablePaymentRequestParameters) Get() *PaymentRequestParameters { + return v.value +} + +func (v *NullablePaymentRequestParameters) Set(val *PaymentRequestParameters) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestParameters) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestParameters(val *PaymentRequestParameters) *NullablePaymentRequestParameters { + return &NullablePaymentRequestParameters{value: val, isSet: true} +} + +func (v NullablePaymentRequestParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_parameters_channel_properties.go b/payment_request/model_payment_request_parameters_channel_properties.go new file mode 100644 index 00000000..c1d4621a --- /dev/null +++ b/payment_request/model_payment_request_parameters_channel_properties.go @@ -0,0 +1,400 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestParametersChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestParametersChannelProperties{} + +// PaymentRequestParametersChannelProperties struct for PaymentRequestParametersChannelProperties +type PaymentRequestParametersChannelProperties struct { + // URL where the end-customer is redirected if the authorization is successful + SuccessReturnUrl *string `json:"success_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization failed + FailureReturnUrl *string `json:"failure_return_url,omitempty"` + // URL where the end-customer is redirected if the authorization cancelled + CancelReturnUrl *string `json:"cancel_return_url,omitempty"` + // REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. + RedeemPoints *string `json:"redeem_points,omitempty"` + // Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. + RequireAuth *bool `json:"require_auth,omitempty"` + // Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use + MerchantIdTag *string `json:"merchant_id_tag,omitempty"` + // Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. + CardonfileType NullableString `json:"cardonfile_type,omitempty"` + // Three digit code written on the back of the card (usually called CVV/CVN). + Cvv *string `json:"cvv,omitempty"` +} + +// NewPaymentRequestParametersChannelProperties instantiates a new PaymentRequestParametersChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestParametersChannelProperties() *PaymentRequestParametersChannelProperties { + this := PaymentRequestParametersChannelProperties{} + return &this +} + +// NewPaymentRequestParametersChannelPropertiesWithDefaults instantiates a new PaymentRequestParametersChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestParametersChannelPropertiesWithDefaults() *PaymentRequestParametersChannelProperties { + this := PaymentRequestParametersChannelProperties{} + return &this +} + +// GetSuccessReturnUrl returns the SuccessReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetSuccessReturnUrl() string { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + var ret string + return ret + } + return *o.SuccessReturnUrl +} + +// GetSuccessReturnUrlOk returns a tuple with the SuccessReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetSuccessReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessReturnUrl) { + return nil, false + } + return o.SuccessReturnUrl, true +} + +// HasSuccessReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasSuccessReturnUrl() bool { + if o != nil && !utils.IsNil(o.SuccessReturnUrl) { + return true + } + + return false +} + +// SetSuccessReturnUrl gets a reference to the given string and assigns it to the SuccessReturnUrl field. +func (o *PaymentRequestParametersChannelProperties) SetSuccessReturnUrl(v string) { + o.SuccessReturnUrl = &v +} + +// GetFailureReturnUrl returns the FailureReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetFailureReturnUrl() string { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + var ret string + return ret + } + return *o.FailureReturnUrl +} + +// GetFailureReturnUrlOk returns a tuple with the FailureReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetFailureReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureReturnUrl) { + return nil, false + } + return o.FailureReturnUrl, true +} + +// HasFailureReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasFailureReturnUrl() bool { + if o != nil && !utils.IsNil(o.FailureReturnUrl) { + return true + } + + return false +} + +// SetFailureReturnUrl gets a reference to the given string and assigns it to the FailureReturnUrl field. +func (o *PaymentRequestParametersChannelProperties) SetFailureReturnUrl(v string) { + o.FailureReturnUrl = &v +} + +// GetCancelReturnUrl returns the CancelReturnUrl field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetCancelReturnUrl() string { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + var ret string + return ret + } + return *o.CancelReturnUrl +} + +// GetCancelReturnUrlOk returns a tuple with the CancelReturnUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetCancelReturnUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.CancelReturnUrl) { + return nil, false + } + return o.CancelReturnUrl, true +} + +// HasCancelReturnUrl returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasCancelReturnUrl() bool { + if o != nil && !utils.IsNil(o.CancelReturnUrl) { + return true + } + + return false +} + +// SetCancelReturnUrl gets a reference to the given string and assigns it to the CancelReturnUrl field. +func (o *PaymentRequestParametersChannelProperties) SetCancelReturnUrl(v string) { + o.CancelReturnUrl = &v +} + +// GetRedeemPoints returns the RedeemPoints field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetRedeemPoints() string { + if o == nil || utils.IsNil(o.RedeemPoints) { + var ret string + return ret + } + return *o.RedeemPoints +} + +// GetRedeemPointsOk returns a tuple with the RedeemPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetRedeemPointsOk() (*string, bool) { + if o == nil || utils.IsNil(o.RedeemPoints) { + return nil, false + } + return o.RedeemPoints, true +} + +// HasRedeemPoints returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasRedeemPoints() bool { + if o != nil && !utils.IsNil(o.RedeemPoints) { + return true + } + + return false +} + +// SetRedeemPoints gets a reference to the given string and assigns it to the RedeemPoints field. +func (o *PaymentRequestParametersChannelProperties) SetRedeemPoints(v string) { + o.RedeemPoints = &v +} + +// GetRequireAuth returns the RequireAuth field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetRequireAuth() bool { + if o == nil || utils.IsNil(o.RequireAuth) { + var ret bool + return ret + } + return *o.RequireAuth +} + +// GetRequireAuthOk returns a tuple with the RequireAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetRequireAuthOk() (*bool, bool) { + if o == nil || utils.IsNil(o.RequireAuth) { + return nil, false + } + return o.RequireAuth, true +} + +// HasRequireAuth returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasRequireAuth() bool { + if o != nil && !utils.IsNil(o.RequireAuth) { + return true + } + + return false +} + +// SetRequireAuth gets a reference to the given bool and assigns it to the RequireAuth field. +func (o *PaymentRequestParametersChannelProperties) SetRequireAuth(v bool) { + o.RequireAuth = &v +} + +// GetMerchantIdTag returns the MerchantIdTag field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetMerchantIdTag() string { + if o == nil || utils.IsNil(o.MerchantIdTag) { + var ret string + return ret + } + return *o.MerchantIdTag +} + +// GetMerchantIdTagOk returns a tuple with the MerchantIdTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetMerchantIdTagOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantIdTag) { + return nil, false + } + return o.MerchantIdTag, true +} + +// HasMerchantIdTag returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasMerchantIdTag() bool { + if o != nil && !utils.IsNil(o.MerchantIdTag) { + return true + } + + return false +} + +// SetMerchantIdTag gets a reference to the given string and assigns it to the MerchantIdTag field. +func (o *PaymentRequestParametersChannelProperties) SetMerchantIdTag(v string) { + o.MerchantIdTag = &v +} + +// GetCardonfileType returns the CardonfileType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentRequestParametersChannelProperties) GetCardonfileType() string { + if o == nil || utils.IsNil(o.CardonfileType.Get()) { + var ret string + return ret + } + return *o.CardonfileType.Get() +} + +// GetCardonfileTypeOk returns a tuple with the CardonfileType field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentRequestParametersChannelProperties) GetCardonfileTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CardonfileType.Get(), o.CardonfileType.IsSet() +} + +// HasCardonfileType returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasCardonfileType() bool { + if o != nil && o.CardonfileType.IsSet() { + return true + } + + return false +} + +// SetCardonfileType gets a reference to the given NullableString and assigns it to the CardonfileType field. +func (o *PaymentRequestParametersChannelProperties) SetCardonfileType(v string) { + o.CardonfileType.Set(&v) +} +// SetCardonfileTypeNil sets the value for CardonfileType to be an explicit nil +func (o *PaymentRequestParametersChannelProperties) SetCardonfileTypeNil() { + o.CardonfileType.Set(nil) +} + +// UnsetCardonfileType ensures that no value is present for CardonfileType, not even an explicit nil +func (o *PaymentRequestParametersChannelProperties) UnsetCardonfileType() { + o.CardonfileType.Unset() +} + +// GetCvv returns the Cvv field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelProperties) GetCvv() string { + if o == nil || utils.IsNil(o.Cvv) { + var ret string + return ret + } + return *o.Cvv +} + +// GetCvvOk returns a tuple with the Cvv field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelProperties) GetCvvOk() (*string, bool) { + if o == nil || utils.IsNil(o.Cvv) { + return nil, false + } + return o.Cvv, true +} + +// HasCvv returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelProperties) HasCvv() bool { + if o != nil && !utils.IsNil(o.Cvv) { + return true + } + + return false +} + +// SetCvv gets a reference to the given string and assigns it to the Cvv field. +func (o *PaymentRequestParametersChannelProperties) SetCvv(v string) { + o.Cvv = &v +} + +func (o PaymentRequestParametersChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestParametersChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SuccessReturnUrl) { + toSerialize["success_return_url"] = o.SuccessReturnUrl + } + if !utils.IsNil(o.FailureReturnUrl) { + toSerialize["failure_return_url"] = o.FailureReturnUrl + } + if !utils.IsNil(o.CancelReturnUrl) { + toSerialize["cancel_return_url"] = o.CancelReturnUrl + } + if !utils.IsNil(o.RedeemPoints) { + toSerialize["redeem_points"] = o.RedeemPoints + } + if !utils.IsNil(o.RequireAuth) { + toSerialize["require_auth"] = o.RequireAuth + } + if !utils.IsNil(o.MerchantIdTag) { + toSerialize["merchant_id_tag"] = o.MerchantIdTag + } + if o.CardonfileType.IsSet() { + toSerialize["cardonfile_type"] = o.CardonfileType.Get() + } + if !utils.IsNil(o.Cvv) { + toSerialize["cvv"] = o.Cvv + } + return toSerialize, nil +} + +type NullablePaymentRequestParametersChannelProperties struct { + value *PaymentRequestParametersChannelProperties + isSet bool +} + +func (v NullablePaymentRequestParametersChannelProperties) Get() *PaymentRequestParametersChannelProperties { + return v.value +} + +func (v *NullablePaymentRequestParametersChannelProperties) Set(val *PaymentRequestParametersChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestParametersChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestParametersChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestParametersChannelProperties(val *PaymentRequestParametersChannelProperties) *NullablePaymentRequestParametersChannelProperties { + return &NullablePaymentRequestParametersChannelProperties{value: val, isSet: true} +} + +func (v NullablePaymentRequestParametersChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestParametersChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_parameters_channel_properties_all_of.go b/payment_request/model_payment_request_parameters_channel_properties_all_of.go new file mode 100644 index 00000000..626eb355 --- /dev/null +++ b/payment_request/model_payment_request_parameters_channel_properties_all_of.go @@ -0,0 +1,131 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestParametersChannelPropertiesAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestParametersChannelPropertiesAllOf{} + +// PaymentRequestParametersChannelPropertiesAllOf struct for PaymentRequestParametersChannelPropertiesAllOf +type PaymentRequestParametersChannelPropertiesAllOf struct { + // Three digit code written on the back of the card (usually called CVV/CVN). + Cvv *string `json:"cvv,omitempty"` +} + +// NewPaymentRequestParametersChannelPropertiesAllOf instantiates a new PaymentRequestParametersChannelPropertiesAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestParametersChannelPropertiesAllOf() *PaymentRequestParametersChannelPropertiesAllOf { + this := PaymentRequestParametersChannelPropertiesAllOf{} + return &this +} + +// NewPaymentRequestParametersChannelPropertiesAllOfWithDefaults instantiates a new PaymentRequestParametersChannelPropertiesAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestParametersChannelPropertiesAllOfWithDefaults() *PaymentRequestParametersChannelPropertiesAllOf { + this := PaymentRequestParametersChannelPropertiesAllOf{} + return &this +} + +// GetCvv returns the Cvv field value if set, zero value otherwise. +func (o *PaymentRequestParametersChannelPropertiesAllOf) GetCvv() string { + if o == nil || utils.IsNil(o.Cvv) { + var ret string + return ret + } + return *o.Cvv +} + +// GetCvvOk returns a tuple with the Cvv field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestParametersChannelPropertiesAllOf) GetCvvOk() (*string, bool) { + if o == nil || utils.IsNil(o.Cvv) { + return nil, false + } + return o.Cvv, true +} + +// HasCvv returns a boolean if a field has been set. +func (o *PaymentRequestParametersChannelPropertiesAllOf) HasCvv() bool { + if o != nil && !utils.IsNil(o.Cvv) { + return true + } + + return false +} + +// SetCvv gets a reference to the given string and assigns it to the Cvv field. +func (o *PaymentRequestParametersChannelPropertiesAllOf) SetCvv(v string) { + o.Cvv = &v +} + +func (o PaymentRequestParametersChannelPropertiesAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestParametersChannelPropertiesAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Cvv) { + toSerialize["cvv"] = o.Cvv + } + return toSerialize, nil +} + +type NullablePaymentRequestParametersChannelPropertiesAllOf struct { + value *PaymentRequestParametersChannelPropertiesAllOf + isSet bool +} + +func (v NullablePaymentRequestParametersChannelPropertiesAllOf) Get() *PaymentRequestParametersChannelPropertiesAllOf { + return v.value +} + +func (v *NullablePaymentRequestParametersChannelPropertiesAllOf) Set(val *PaymentRequestParametersChannelPropertiesAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestParametersChannelPropertiesAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestParametersChannelPropertiesAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestParametersChannelPropertiesAllOf(val *PaymentRequestParametersChannelPropertiesAllOf) *NullablePaymentRequestParametersChannelPropertiesAllOf { + return &NullablePaymentRequestParametersChannelPropertiesAllOf{value: val, isSet: true} +} + +func (v NullablePaymentRequestParametersChannelPropertiesAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestParametersChannelPropertiesAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_shipping_information.go b/payment_request/model_payment_request_shipping_information.go new file mode 100644 index 00000000..0fa53b13 --- /dev/null +++ b/payment_request/model_payment_request_shipping_information.go @@ -0,0 +1,301 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the PaymentRequestShippingInformation type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentRequestShippingInformation{} + +// PaymentRequestShippingInformation struct for PaymentRequestShippingInformation +type PaymentRequestShippingInformation struct { + Country string `json:"country"` + StreetLine1 *string `json:"street_line1,omitempty"` + StreetLine2 *string `json:"street_line2,omitempty"` + City *string `json:"city,omitempty"` + ProvinceState *string `json:"province_state,omitempty"` + PostalCode *string `json:"postal_code,omitempty"` +} + +// NewPaymentRequestShippingInformation instantiates a new PaymentRequestShippingInformation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentRequestShippingInformation(country string) *PaymentRequestShippingInformation { + this := PaymentRequestShippingInformation{} + this.Country = country + return &this +} + +// NewPaymentRequestShippingInformationWithDefaults instantiates a new PaymentRequestShippingInformation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentRequestShippingInformationWithDefaults() *PaymentRequestShippingInformation { + this := PaymentRequestShippingInformation{} + return &this +} + +// GetCountry returns the Country field value +func (o *PaymentRequestShippingInformation) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *PaymentRequestShippingInformation) SetCountry(v string) { + o.Country = v +} + +// GetStreetLine1 returns the StreetLine1 field value if set, zero value otherwise. +func (o *PaymentRequestShippingInformation) GetStreetLine1() string { + if o == nil || utils.IsNil(o.StreetLine1) { + var ret string + return ret + } + return *o.StreetLine1 +} + +// GetStreetLine1Ok returns a tuple with the StreetLine1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetStreetLine1Ok() (*string, bool) { + if o == nil || utils.IsNil(o.StreetLine1) { + return nil, false + } + return o.StreetLine1, true +} + +// HasStreetLine1 returns a boolean if a field has been set. +func (o *PaymentRequestShippingInformation) HasStreetLine1() bool { + if o != nil && !utils.IsNil(o.StreetLine1) { + return true + } + + return false +} + +// SetStreetLine1 gets a reference to the given string and assigns it to the StreetLine1 field. +func (o *PaymentRequestShippingInformation) SetStreetLine1(v string) { + o.StreetLine1 = &v +} + +// GetStreetLine2 returns the StreetLine2 field value if set, zero value otherwise. +func (o *PaymentRequestShippingInformation) GetStreetLine2() string { + if o == nil || utils.IsNil(o.StreetLine2) { + var ret string + return ret + } + return *o.StreetLine2 +} + +// GetStreetLine2Ok returns a tuple with the StreetLine2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetStreetLine2Ok() (*string, bool) { + if o == nil || utils.IsNil(o.StreetLine2) { + return nil, false + } + return o.StreetLine2, true +} + +// HasStreetLine2 returns a boolean if a field has been set. +func (o *PaymentRequestShippingInformation) HasStreetLine2() bool { + if o != nil && !utils.IsNil(o.StreetLine2) { + return true + } + + return false +} + +// SetStreetLine2 gets a reference to the given string and assigns it to the StreetLine2 field. +func (o *PaymentRequestShippingInformation) SetStreetLine2(v string) { + o.StreetLine2 = &v +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *PaymentRequestShippingInformation) GetCity() string { + if o == nil || utils.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetCityOk() (*string, bool) { + if o == nil || utils.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *PaymentRequestShippingInformation) HasCity() bool { + if o != nil && !utils.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *PaymentRequestShippingInformation) SetCity(v string) { + o.City = &v +} + +// GetProvinceState returns the ProvinceState field value if set, zero value otherwise. +func (o *PaymentRequestShippingInformation) GetProvinceState() string { + if o == nil || utils.IsNil(o.ProvinceState) { + var ret string + return ret + } + return *o.ProvinceState +} + +// GetProvinceStateOk returns a tuple with the ProvinceState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetProvinceStateOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProvinceState) { + return nil, false + } + return o.ProvinceState, true +} + +// HasProvinceState returns a boolean if a field has been set. +func (o *PaymentRequestShippingInformation) HasProvinceState() bool { + if o != nil && !utils.IsNil(o.ProvinceState) { + return true + } + + return false +} + +// SetProvinceState gets a reference to the given string and assigns it to the ProvinceState field. +func (o *PaymentRequestShippingInformation) SetProvinceState(v string) { + o.ProvinceState = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *PaymentRequestShippingInformation) GetPostalCode() string { + if o == nil || utils.IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentRequestShippingInformation) GetPostalCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *PaymentRequestShippingInformation) HasPostalCode() bool { + if o != nil && !utils.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *PaymentRequestShippingInformation) SetPostalCode(v string) { + o.PostalCode = &v +} + +func (o PaymentRequestShippingInformation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentRequestShippingInformation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["country"] = o.Country + if !utils.IsNil(o.StreetLine1) { + toSerialize["street_line1"] = o.StreetLine1 + } + if !utils.IsNil(o.StreetLine2) { + toSerialize["street_line2"] = o.StreetLine2 + } + if !utils.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !utils.IsNil(o.ProvinceState) { + toSerialize["province_state"] = o.ProvinceState + } + if !utils.IsNil(o.PostalCode) { + toSerialize["postal_code"] = o.PostalCode + } + return toSerialize, nil +} + +type NullablePaymentRequestShippingInformation struct { + value *PaymentRequestShippingInformation + isSet bool +} + +func (v NullablePaymentRequestShippingInformation) Get() *PaymentRequestShippingInformation { + return v.value +} + +func (v *NullablePaymentRequestShippingInformation) Set(val *PaymentRequestShippingInformation) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestShippingInformation) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestShippingInformation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestShippingInformation(val *PaymentRequestShippingInformation) *NullablePaymentRequestShippingInformation { + return &NullablePaymentRequestShippingInformation{value: val, isSet: true} +} + +func (v NullablePaymentRequestShippingInformation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestShippingInformation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_request_status.go b/payment_request/model_payment_request_status.go new file mode 100644 index 00000000..2526682c --- /dev/null +++ b/payment_request/model_payment_request_status.go @@ -0,0 +1,127 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// PaymentRequestStatus the model 'PaymentRequestStatus' +type PaymentRequestStatus string + +// List of PaymentRequestStatus +const ( + PAYMENTREQUESTSTATUS_PENDING PaymentRequestStatus = "PENDING" + PAYMENTREQUESTSTATUS_REQUIRES_ACTION PaymentRequestStatus = "REQUIRES_ACTION" + PAYMENTREQUESTSTATUS_CANCELED PaymentRequestStatus = "CANCELED" + PAYMENTREQUESTSTATUS_SUCCEEDED PaymentRequestStatus = "SUCCEEDED" + PAYMENTREQUESTSTATUS_FAILED PaymentRequestStatus = "FAILED" + PAYMENTREQUESTSTATUS_VOIDED PaymentRequestStatus = "VOIDED" + PAYMENTREQUESTSTATUS_UNKNOWN PaymentRequestStatus = "UNKNOWN" + PAYMENTREQUESTSTATUS_AWAITING_CAPTURE PaymentRequestStatus = "AWAITING_CAPTURE" +) + +// All allowed values of PaymentRequestStatus enum +var AllowedPaymentRequestStatusEnumValues = []PaymentRequestStatus{ + "PENDING", + "REQUIRES_ACTION", + "CANCELED", + "SUCCEEDED", + "FAILED", + "VOIDED", + "UNKNOWN", + "AWAITING_CAPTURE", +} + +func (v *PaymentRequestStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PaymentRequestStatus(value) + for _, existing := range AllowedPaymentRequestStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PaymentRequestStatus", value) +} + +// NewPaymentRequestStatusFromValue returns a pointer to a valid PaymentRequestStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPaymentRequestStatusFromValue(v string) (*PaymentRequestStatus, error) { + ev := PaymentRequestStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PaymentRequestStatus: valid values are %v", v, AllowedPaymentRequestStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PaymentRequestStatus) IsValid() bool { + for _, existing := range AllowedPaymentRequestStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v PaymentRequestStatus) String() string { + return string(v) +} + +// Ptr returns reference to PaymentRequestStatus value +func (v PaymentRequestStatus) Ptr() *PaymentRequestStatus { + return &v +} + +type NullablePaymentRequestStatus struct { + value *PaymentRequestStatus + isSet bool +} + +func (v NullablePaymentRequestStatus) Get() *PaymentRequestStatus { + return v.value +} + +func (v *NullablePaymentRequestStatus) Set(val *PaymentRequestStatus) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentRequestStatus) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentRequestStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentRequestStatus(val *PaymentRequestStatus) *NullablePaymentRequestStatus { + return &NullablePaymentRequestStatus{value: val, isSet: true} +} + +func (v NullablePaymentRequestStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentRequestStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_qr_code.go b/payment_request/model_qr_code.go new file mode 100644 index 00000000..86149ec7 --- /dev/null +++ b/payment_request/model_qr_code.go @@ -0,0 +1,176 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the QRCode type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCode{} + +// QRCode QRCode Payment Method Details +type QRCode struct { + ChannelCode NullableQRCodeChannelCode `json:"channel_code,omitempty"` + ChannelProperties *QRCodeChannelProperties `json:"channel_properties,omitempty"` +} + +// NewQRCode instantiates a new QRCode object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCode() *QRCode { + this := QRCode{} + return &this +} + +// NewQRCodeWithDefaults instantiates a new QRCode object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeWithDefaults() *QRCode { + this := QRCode{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCode) GetChannelCode() QRCodeChannelCode { + if o == nil || utils.IsNil(o.ChannelCode.Get()) { + var ret QRCodeChannelCode + return ret + } + return *o.ChannelCode.Get() +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCode) GetChannelCodeOk() (*QRCodeChannelCode, bool) { + if o == nil { + return nil, false + } + return o.ChannelCode.Get(), o.ChannelCode.IsSet() +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *QRCode) HasChannelCode() bool { + if o != nil && o.ChannelCode.IsSet() { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given NullableQRCodeChannelCode and assigns it to the ChannelCode field. +func (o *QRCode) SetChannelCode(v QRCodeChannelCode) { + o.ChannelCode.Set(&v) +} +// SetChannelCodeNil sets the value for ChannelCode to be an explicit nil +func (o *QRCode) SetChannelCodeNil() { + o.ChannelCode.Set(nil) +} + +// UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +func (o *QRCode) UnsetChannelCode() { + o.ChannelCode.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *QRCode) GetChannelProperties() QRCodeChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret QRCodeChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCode) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *QRCode) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given QRCodeChannelProperties and assigns it to the ChannelProperties field. +func (o *QRCode) SetChannelProperties(v QRCodeChannelProperties) { + o.ChannelProperties = &v +} + +func (o QRCode) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCode) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ChannelCode.IsSet() { + toSerialize["channel_code"] = o.ChannelCode.Get() + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + return toSerialize, nil +} + +type NullableQRCode struct { + value *QRCode + isSet bool +} + +func (v NullableQRCode) Get() *QRCode { + return v.value +} + +func (v *NullableQRCode) Set(val *QRCode) { + v.value = val + v.isSet = true +} + +func (v NullableQRCode) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCode(val *QRCode) *NullableQRCode { + return &NullableQRCode{value: val, isSet: true} +} + +func (v NullableQRCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_qr_code_channel_code.go b/payment_request/model_qr_code_channel_code.go new file mode 100644 index 00000000..3b437f75 --- /dev/null +++ b/payment_request/model_qr_code_channel_code.go @@ -0,0 +1,119 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// QRCodeChannelCode QR Code Channel Code +type QRCodeChannelCode string + +// List of QRCodeChannelCode +const ( + QRCODECHANNELCODE_DANA QRCodeChannelCode = "DANA" + QRCODECHANNELCODE_RCBC QRCodeChannelCode = "RCBC" + QRCODECHANNELCODE_LINKAJA QRCodeChannelCode = "LINKAJA" + QRCODECHANNELCODE_PROMPTPAY QRCodeChannelCode = "PROMPTPAY" +) + +// All allowed values of QRCodeChannelCode enum +var AllowedQRCodeChannelCodeEnumValues = []QRCodeChannelCode{ + "DANA", + "RCBC", + "LINKAJA", + "PROMPTPAY", +} + +func (v *QRCodeChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := QRCodeChannelCode(value) + for _, existing := range AllowedQRCodeChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid QRCodeChannelCode", value) +} + +// NewQRCodeChannelCodeFromValue returns a pointer to a valid QRCodeChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewQRCodeChannelCodeFromValue(v string) (*QRCodeChannelCode, error) { + ev := QRCodeChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for QRCodeChannelCode: valid values are %v", v, AllowedQRCodeChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v QRCodeChannelCode) IsValid() bool { + for _, existing := range AllowedQRCodeChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v QRCodeChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to QRCodeChannelCode value +func (v QRCodeChannelCode) Ptr() *QRCodeChannelCode { + return &v +} + +type NullableQRCodeChannelCode struct { + value *QRCodeChannelCode + isSet bool +} + +func (v NullableQRCodeChannelCode) Get() *QRCodeChannelCode { + return v.value +} + +func (v *NullableQRCodeChannelCode) Set(val *QRCodeChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeChannelCode(val *QRCodeChannelCode) *NullableQRCodeChannelCode { + return &NullableQRCodeChannelCode{value: val, isSet: true} +} + +func (v NullableQRCodeChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_qr_code_channel_properties.go b/payment_request/model_qr_code_channel_properties.go new file mode 100644 index 00000000..bd989dc1 --- /dev/null +++ b/payment_request/model_qr_code_channel_properties.go @@ -0,0 +1,167 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the QRCodeChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCodeChannelProperties{} + +// QRCodeChannelProperties QR Code Channel Properties +type QRCodeChannelProperties struct { + QrString *string `json:"qr_string,omitempty"` + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +// NewQRCodeChannelProperties instantiates a new QRCodeChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCodeChannelProperties() *QRCodeChannelProperties { + this := QRCodeChannelProperties{} + return &this +} + +// NewQRCodeChannelPropertiesWithDefaults instantiates a new QRCodeChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeChannelPropertiesWithDefaults() *QRCodeChannelProperties { + this := QRCodeChannelProperties{} + return &this +} + +// GetQrString returns the QrString field value if set, zero value otherwise. +func (o *QRCodeChannelProperties) GetQrString() string { + if o == nil || utils.IsNil(o.QrString) { + var ret string + return ret + } + return *o.QrString +} + +// GetQrStringOk returns a tuple with the QrString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeChannelProperties) GetQrStringOk() (*string, bool) { + if o == nil || utils.IsNil(o.QrString) { + return nil, false + } + return o.QrString, true +} + +// HasQrString returns a boolean if a field has been set. +func (o *QRCodeChannelProperties) HasQrString() bool { + if o != nil && !utils.IsNil(o.QrString) { + return true + } + + return false +} + +// SetQrString gets a reference to the given string and assigns it to the QrString field. +func (o *QRCodeChannelProperties) SetQrString(v string) { + o.QrString = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *QRCodeChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *QRCodeChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *QRCodeChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +func (o QRCodeChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCodeChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.QrString) { + toSerialize["qr_string"] = o.QrString + } + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + return toSerialize, nil +} + +type NullableQRCodeChannelProperties struct { + value *QRCodeChannelProperties + isSet bool +} + +func (v NullableQRCodeChannelProperties) Get() *QRCodeChannelProperties { + return v.value +} + +func (v *NullableQRCodeChannelProperties) Set(val *QRCodeChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeChannelProperties(val *QRCodeChannelProperties) *NullableQRCodeChannelProperties { + return &NullableQRCodeChannelProperties{value: val, isSet: true} +} + +func (v NullableQRCodeChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_qr_code_parameters.go b/payment_request/model_qr_code_parameters.go new file mode 100644 index 00000000..cde0d667 --- /dev/null +++ b/payment_request/model_qr_code_parameters.go @@ -0,0 +1,176 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the QRCodeParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &QRCodeParameters{} + +// QRCodeParameters struct for QRCodeParameters +type QRCodeParameters struct { + ChannelCode NullableQRCodeChannelCode `json:"channel_code,omitempty"` + ChannelProperties *QRCodeChannelProperties `json:"channel_properties,omitempty"` +} + +// NewQRCodeParameters instantiates a new QRCodeParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQRCodeParameters() *QRCodeParameters { + this := QRCodeParameters{} + return &this +} + +// NewQRCodeParametersWithDefaults instantiates a new QRCodeParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQRCodeParametersWithDefaults() *QRCodeParameters { + this := QRCodeParameters{} + return &this +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *QRCodeParameters) GetChannelCode() QRCodeChannelCode { + if o == nil || utils.IsNil(o.ChannelCode.Get()) { + var ret QRCodeChannelCode + return ret + } + return *o.ChannelCode.Get() +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *QRCodeParameters) GetChannelCodeOk() (*QRCodeChannelCode, bool) { + if o == nil { + return nil, false + } + return o.ChannelCode.Get(), o.ChannelCode.IsSet() +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *QRCodeParameters) HasChannelCode() bool { + if o != nil && o.ChannelCode.IsSet() { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given NullableQRCodeChannelCode and assigns it to the ChannelCode field. +func (o *QRCodeParameters) SetChannelCode(v QRCodeChannelCode) { + o.ChannelCode.Set(&v) +} +// SetChannelCodeNil sets the value for ChannelCode to be an explicit nil +func (o *QRCodeParameters) SetChannelCodeNil() { + o.ChannelCode.Set(nil) +} + +// UnsetChannelCode ensures that no value is present for ChannelCode, not even an explicit nil +func (o *QRCodeParameters) UnsetChannelCode() { + o.ChannelCode.Unset() +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise. +func (o *QRCodeParameters) GetChannelProperties() QRCodeChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties) { + var ret QRCodeChannelProperties + return ret + } + return *o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QRCodeParameters) GetChannelPropertiesOk() (*QRCodeChannelProperties, bool) { + if o == nil || utils.IsNil(o.ChannelProperties) { + return nil, false + } + return o.ChannelProperties, true +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *QRCodeParameters) HasChannelProperties() bool { + if o != nil && !utils.IsNil(o.ChannelProperties) { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given QRCodeChannelProperties and assigns it to the ChannelProperties field. +func (o *QRCodeParameters) SetChannelProperties(v QRCodeChannelProperties) { + o.ChannelProperties = &v +} + +func (o QRCodeParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QRCodeParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ChannelCode.IsSet() { + toSerialize["channel_code"] = o.ChannelCode.Get() + } + if !utils.IsNil(o.ChannelProperties) { + toSerialize["channel_properties"] = o.ChannelProperties + } + return toSerialize, nil +} + +type NullableQRCodeParameters struct { + value *QRCodeParameters + isSet bool +} + +func (v NullableQRCodeParameters) Get() *QRCodeParameters { + return v.value +} + +func (v *NullableQRCodeParameters) Set(val *QRCodeParameters) { + v.value = val + v.isSet = true +} + +func (v NullableQRCodeParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableQRCodeParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQRCodeParameters(val *QRCodeParameters) *NullableQRCodeParameters { + return &NullableQRCodeParameters{value: val, isSet: true} +} + +func (v NullableQRCodeParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQRCodeParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_virtual_account.go b/payment_request/model_virtual_account.go new file mode 100644 index 00000000..38dc4eda --- /dev/null +++ b/payment_request/model_virtual_account.go @@ -0,0 +1,395 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccount type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccount{} + +// VirtualAccount Virtual Account Payment Method Details +type VirtualAccount struct { + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *PaymentRequestCurrency `json:"currency,omitempty"` + ChannelCode VirtualAccountChannelCode `json:"channel_code"` + ChannelProperties VirtualAccountChannelProperties `json:"channel_properties"` + // Alternative display requested for the virtual account + AlternativeDisplayTypes []string `json:"alternative_display_types,omitempty"` + AlternativeDisplays []VirtualAccountAlternativeDisplay `json:"alternative_displays,omitempty"` +} + +// NewVirtualAccount instantiates a new VirtualAccount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccount(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties) *VirtualAccount { + this := VirtualAccount{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewVirtualAccountWithDefaults instantiates a new VirtualAccount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountWithDefaults() *VirtualAccount { + this := VirtualAccount{} + return &this +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *VirtualAccount) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *VirtualAccount) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *VirtualAccount) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *VirtualAccount) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *VirtualAccount) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *VirtualAccount) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccount) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccount) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *VirtualAccount) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *VirtualAccount) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *VirtualAccount) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *VirtualAccount) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *VirtualAccount) GetCurrency() PaymentRequestCurrency { + if o == nil || utils.IsNil(o.Currency) { + var ret PaymentRequestCurrency + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *VirtualAccount) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given PaymentRequestCurrency and assigns it to the Currency field. +func (o *VirtualAccount) SetCurrency(v PaymentRequestCurrency) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *VirtualAccount) GetChannelCode() VirtualAccountChannelCode { + if o == nil { + var ret VirtualAccountChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetChannelCodeOk() (*VirtualAccountChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *VirtualAccount) SetChannelCode(v VirtualAccountChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *VirtualAccount) GetChannelProperties() VirtualAccountChannelProperties { + if o == nil { + var ret VirtualAccountChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *VirtualAccount) SetChannelProperties(v VirtualAccountChannelProperties) { + o.ChannelProperties = v +} + +// GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field value if set, zero value otherwise. +func (o *VirtualAccount) GetAlternativeDisplayTypes() []string { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + var ret []string + return ret + } + return o.AlternativeDisplayTypes +} + +// GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetAlternativeDisplayTypesOk() ([]string, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + return nil, false + } + return o.AlternativeDisplayTypes, true +} + +// HasAlternativeDisplayTypes returns a boolean if a field has been set. +func (o *VirtualAccount) HasAlternativeDisplayTypes() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplayTypes) { + return true + } + + return false +} + +// SetAlternativeDisplayTypes gets a reference to the given []string and assigns it to the AlternativeDisplayTypes field. +func (o *VirtualAccount) SetAlternativeDisplayTypes(v []string) { + o.AlternativeDisplayTypes = v +} + +// GetAlternativeDisplays returns the AlternativeDisplays field value if set, zero value otherwise. +func (o *VirtualAccount) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + var ret []VirtualAccountAlternativeDisplay + return ret + } + return o.AlternativeDisplays +} + +// GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccount) GetAlternativeDisplaysOk() ([]VirtualAccountAlternativeDisplay, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + return nil, false + } + return o.AlternativeDisplays, true +} + +// HasAlternativeDisplays returns a boolean if a field has been set. +func (o *VirtualAccount) HasAlternativeDisplays() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplays) { + return true + } + + return false +} + +// SetAlternativeDisplays gets a reference to the given []VirtualAccountAlternativeDisplay and assigns it to the AlternativeDisplays field. +func (o *VirtualAccount) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay) { + o.AlternativeDisplays = v +} + +func (o VirtualAccount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + if !utils.IsNil(o.AlternativeDisplayTypes) { + toSerialize["alternative_display_types"] = o.AlternativeDisplayTypes + } + if !utils.IsNil(o.AlternativeDisplays) { + toSerialize["alternative_displays"] = o.AlternativeDisplays + } + return toSerialize, nil +} + +type NullableVirtualAccount struct { + value *VirtualAccount + isSet bool +} + +func (v NullableVirtualAccount) Get() *VirtualAccount { + return v.value +} + +func (v *NullableVirtualAccount) Set(val *VirtualAccount) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccount) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccount(val *VirtualAccount) *NullableVirtualAccount { + return &NullableVirtualAccount{value: val, isSet: true} +} + +func (v NullableVirtualAccount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_virtual_account_all_of.go b/payment_request/model_virtual_account_all_of.go new file mode 100644 index 00000000..93a638e4 --- /dev/null +++ b/payment_request/model_virtual_account_all_of.go @@ -0,0 +1,130 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountAllOf{} + +// VirtualAccountAllOf struct for VirtualAccountAllOf +type VirtualAccountAllOf struct { + AlternativeDisplays []VirtualAccountAlternativeDisplay `json:"alternative_displays,omitempty"` +} + +// NewVirtualAccountAllOf instantiates a new VirtualAccountAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountAllOf() *VirtualAccountAllOf { + this := VirtualAccountAllOf{} + return &this +} + +// NewVirtualAccountAllOfWithDefaults instantiates a new VirtualAccountAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountAllOfWithDefaults() *VirtualAccountAllOf { + this := VirtualAccountAllOf{} + return &this +} + +// GetAlternativeDisplays returns the AlternativeDisplays field value if set, zero value otherwise. +func (o *VirtualAccountAllOf) GetAlternativeDisplays() []VirtualAccountAlternativeDisplay { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + var ret []VirtualAccountAlternativeDisplay + return ret + } + return o.AlternativeDisplays +} + +// GetAlternativeDisplaysOk returns a tuple with the AlternativeDisplays field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAllOf) GetAlternativeDisplaysOk() ([]VirtualAccountAlternativeDisplay, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplays) { + return nil, false + } + return o.AlternativeDisplays, true +} + +// HasAlternativeDisplays returns a boolean if a field has been set. +func (o *VirtualAccountAllOf) HasAlternativeDisplays() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplays) { + return true + } + + return false +} + +// SetAlternativeDisplays gets a reference to the given []VirtualAccountAlternativeDisplay and assigns it to the AlternativeDisplays field. +func (o *VirtualAccountAllOf) SetAlternativeDisplays(v []VirtualAccountAlternativeDisplay) { + o.AlternativeDisplays = v +} + +func (o VirtualAccountAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.AlternativeDisplays) { + toSerialize["alternative_displays"] = o.AlternativeDisplays + } + return toSerialize, nil +} + +type NullableVirtualAccountAllOf struct { + value *VirtualAccountAllOf + isSet bool +} + +func (v NullableVirtualAccountAllOf) Get() *VirtualAccountAllOf { + return v.value +} + +func (v *NullableVirtualAccountAllOf) Set(val *VirtualAccountAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountAllOf(val *VirtualAccountAllOf) *NullableVirtualAccountAllOf { + return &NullableVirtualAccountAllOf{value: val, isSet: true} +} + +func (v NullableVirtualAccountAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_virtual_account_alternative_display.go b/payment_request/model_virtual_account_alternative_display.go new file mode 100644 index 00000000..b575d1f8 --- /dev/null +++ b/payment_request/model_virtual_account_alternative_display.go @@ -0,0 +1,168 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountAlternativeDisplay type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountAlternativeDisplay{} + +// VirtualAccountAlternativeDisplay Alternative Display Object +type VirtualAccountAlternativeDisplay struct { + // Type of the alternative display + Type *string `json:"type,omitempty"` + // Data payload of the given alternative display + Data *string `json:"data,omitempty"` +} + +// NewVirtualAccountAlternativeDisplay instantiates a new VirtualAccountAlternativeDisplay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountAlternativeDisplay() *VirtualAccountAlternativeDisplay { + this := VirtualAccountAlternativeDisplay{} + return &this +} + +// NewVirtualAccountAlternativeDisplayWithDefaults instantiates a new VirtualAccountAlternativeDisplay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountAlternativeDisplayWithDefaults() *VirtualAccountAlternativeDisplay { + this := VirtualAccountAlternativeDisplay{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VirtualAccountAlternativeDisplay) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAlternativeDisplay) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VirtualAccountAlternativeDisplay) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *VirtualAccountAlternativeDisplay) SetType(v string) { + o.Type = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *VirtualAccountAlternativeDisplay) GetData() string { + if o == nil || utils.IsNil(o.Data) { + var ret string + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountAlternativeDisplay) GetDataOk() (*string, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *VirtualAccountAlternativeDisplay) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given string and assigns it to the Data field. +func (o *VirtualAccountAlternativeDisplay) SetData(v string) { + o.Data = &v +} + +func (o VirtualAccountAlternativeDisplay) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountAlternativeDisplay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableVirtualAccountAlternativeDisplay struct { + value *VirtualAccountAlternativeDisplay + isSet bool +} + +func (v NullableVirtualAccountAlternativeDisplay) Get() *VirtualAccountAlternativeDisplay { + return v.value +} + +func (v *NullableVirtualAccountAlternativeDisplay) Set(val *VirtualAccountAlternativeDisplay) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountAlternativeDisplay) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountAlternativeDisplay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountAlternativeDisplay(val *VirtualAccountAlternativeDisplay) *NullableVirtualAccountAlternativeDisplay { + return &NullableVirtualAccountAlternativeDisplay{value: val, isSet: true} +} + +func (v NullableVirtualAccountAlternativeDisplay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountAlternativeDisplay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_virtual_account_channel_code.go b/payment_request/model_virtual_account_channel_code.go new file mode 100644 index 00000000..93643036 --- /dev/null +++ b/payment_request/model_virtual_account_channel_code.go @@ -0,0 +1,141 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + "fmt" +) + +// VirtualAccountChannelCode Virtual Account Channel Code +type VirtualAccountChannelCode string + +// List of VirtualAccountChannelCode +const ( + VIRTUALACCOUNTCHANNELCODE_BCA VirtualAccountChannelCode = "BCA" + VIRTUALACCOUNTCHANNELCODE_BJB VirtualAccountChannelCode = "BJB" + VIRTUALACCOUNTCHANNELCODE_BNI VirtualAccountChannelCode = "BNI" + VIRTUALACCOUNTCHANNELCODE_BRI VirtualAccountChannelCode = "BRI" + VIRTUALACCOUNTCHANNELCODE_MANDIRI VirtualAccountChannelCode = "MANDIRI" + VIRTUALACCOUNTCHANNELCODE_PERMATA VirtualAccountChannelCode = "PERMATA" + VIRTUALACCOUNTCHANNELCODE_BSI VirtualAccountChannelCode = "BSI" + VIRTUALACCOUNTCHANNELCODE_CIMB VirtualAccountChannelCode = "CIMB" + VIRTUALACCOUNTCHANNELCODE_SAHABAT_SAMPOERNA VirtualAccountChannelCode = "SAHABAT_SAMPOERNA" + VIRTUALACCOUNTCHANNELCODE_ARTAJASA VirtualAccountChannelCode = "ARTAJASA" + VIRTUALACCOUNTCHANNELCODE_PV VirtualAccountChannelCode = "PV" + VIRTUALACCOUNTCHANNELCODE_VIETCAPITAL VirtualAccountChannelCode = "VIETCAPITAL" + VIRTUALACCOUNTCHANNELCODE_WOORI VirtualAccountChannelCode = "WOORI" + VIRTUALACCOUNTCHANNELCODE_MSB VirtualAccountChannelCode = "MSB" + VIRTUALACCOUNTCHANNELCODE_STANDARD_CHARTERED VirtualAccountChannelCode = "STANDARD_CHARTERED" +) + +// All allowed values of VirtualAccountChannelCode enum +var AllowedVirtualAccountChannelCodeEnumValues = []VirtualAccountChannelCode{ + "BCA", + "BJB", + "BNI", + "BRI", + "MANDIRI", + "PERMATA", + "BSI", + "CIMB", + "SAHABAT_SAMPOERNA", + "ARTAJASA", + "PV", + "VIETCAPITAL", + "WOORI", + "MSB", + "STANDARD_CHARTERED", +} + +func (v *VirtualAccountChannelCode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VirtualAccountChannelCode(value) + for _, existing := range AllowedVirtualAccountChannelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VirtualAccountChannelCode", value) +} + +// NewVirtualAccountChannelCodeFromValue returns a pointer to a valid VirtualAccountChannelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVirtualAccountChannelCodeFromValue(v string) (*VirtualAccountChannelCode, error) { + ev := VirtualAccountChannelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VirtualAccountChannelCode: valid values are %v", v, AllowedVirtualAccountChannelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VirtualAccountChannelCode) IsValid() bool { + for _, existing := range AllowedVirtualAccountChannelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v VirtualAccountChannelCode) String() string { + return string(v) +} + +// Ptr returns reference to VirtualAccountChannelCode value +func (v VirtualAccountChannelCode) Ptr() *VirtualAccountChannelCode { + return &v +} + +type NullableVirtualAccountChannelCode struct { + value *VirtualAccountChannelCode + isSet bool +} + +func (v NullableVirtualAccountChannelCode) Get() *VirtualAccountChannelCode { + return v.value +} + +func (v *NullableVirtualAccountChannelCode) Set(val *VirtualAccountChannelCode) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountChannelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountChannelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountChannelCode(val *VirtualAccountChannelCode) *NullableVirtualAccountChannelCode { + return &NullableVirtualAccountChannelCode{value: val, isSet: true} +} + +func (v NullableVirtualAccountChannelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountChannelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payment_request/model_virtual_account_channel_properties.go b/payment_request/model_virtual_account_channel_properties.go new file mode 100644 index 00000000..aab69a48 --- /dev/null +++ b/payment_request/model_virtual_account_channel_properties.go @@ -0,0 +1,234 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the VirtualAccountChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountChannelProperties{} + +// VirtualAccountChannelProperties Virtual Account Channel Properties +type VirtualAccountChannelProperties struct { + // Name of customer. + CustomerName string `json:"customer_name"` + // You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range. + VirtualAccountNumber *string `json:"virtual_account_number,omitempty"` + // The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) + SuggestedAmount *float64 `json:"suggested_amount,omitempty"` +} + +// NewVirtualAccountChannelProperties instantiates a new VirtualAccountChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountChannelProperties(customerName string) *VirtualAccountChannelProperties { + this := VirtualAccountChannelProperties{} + this.CustomerName = customerName + return &this +} + +// NewVirtualAccountChannelPropertiesWithDefaults instantiates a new VirtualAccountChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountChannelPropertiesWithDefaults() *VirtualAccountChannelProperties { + this := VirtualAccountChannelProperties{} + return &this +} + +// GetCustomerName returns the CustomerName field value +func (o *VirtualAccountChannelProperties) GetCustomerName() string { + if o == nil { + var ret string + return ret + } + + return o.CustomerName +} + +// GetCustomerNameOk returns a tuple with the CustomerName field value +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetCustomerNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CustomerName, true +} + +// SetCustomerName sets field value +func (o *VirtualAccountChannelProperties) SetCustomerName(v string) { + o.CustomerName = v +} + +// GetVirtualAccountNumber returns the VirtualAccountNumber field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetVirtualAccountNumber() string { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + var ret string + return ret + } + return *o.VirtualAccountNumber +} + +// GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetVirtualAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + return nil, false + } + return o.VirtualAccountNumber, true +} + +// HasVirtualAccountNumber returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasVirtualAccountNumber() bool { + if o != nil && !utils.IsNil(o.VirtualAccountNumber) { + return true + } + + return false +} + +// SetVirtualAccountNumber gets a reference to the given string and assigns it to the VirtualAccountNumber field. +func (o *VirtualAccountChannelProperties) SetVirtualAccountNumber(v string) { + o.VirtualAccountNumber = &v +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetExpiresAt() time.Time { + if o == nil || utils.IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasExpiresAt() bool { + if o != nil && !utils.IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *VirtualAccountChannelProperties) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +// GetSuggestedAmount returns the SuggestedAmount field value if set, zero value otherwise. +func (o *VirtualAccountChannelProperties) GetSuggestedAmount() float64 { + if o == nil || utils.IsNil(o.SuggestedAmount) { + var ret float64 + return ret + } + return *o.SuggestedAmount +} + +// GetSuggestedAmountOk returns a tuple with the SuggestedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountChannelProperties) GetSuggestedAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.SuggestedAmount) { + return nil, false + } + return o.SuggestedAmount, true +} + +// HasSuggestedAmount returns a boolean if a field has been set. +func (o *VirtualAccountChannelProperties) HasSuggestedAmount() bool { + if o != nil && !utils.IsNil(o.SuggestedAmount) { + return true + } + + return false +} + +// SetSuggestedAmount gets a reference to the given float64 and assigns it to the SuggestedAmount field. +func (o *VirtualAccountChannelProperties) SetSuggestedAmount(v float64) { + o.SuggestedAmount = &v +} + +func (o VirtualAccountChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["customer_name"] = o.CustomerName + if !utils.IsNil(o.VirtualAccountNumber) { + toSerialize["virtual_account_number"] = o.VirtualAccountNumber + } + if !utils.IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + if !utils.IsNil(o.SuggestedAmount) { + toSerialize["suggested_amount"] = o.SuggestedAmount + } + return toSerialize, nil +} + +type NullableVirtualAccountChannelProperties struct { + value *VirtualAccountChannelProperties + isSet bool +} + +func (v NullableVirtualAccountChannelProperties) Get() *VirtualAccountChannelProperties { + return v.value +} + +func (v *NullableVirtualAccountChannelProperties) Set(val *VirtualAccountChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountChannelProperties(val *VirtualAccountChannelProperties) *NullableVirtualAccountChannelProperties { + return &NullableVirtualAccountChannelProperties{value: val, isSet: true} +} + +func (v NullableVirtualAccountChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_virtual_account_parameters.go b/payment_request/model_virtual_account_parameters.go new file mode 100644 index 00000000..b714e331 --- /dev/null +++ b/payment_request/model_virtual_account_parameters.go @@ -0,0 +1,359 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.42.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payment_request + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the VirtualAccountParameters type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &VirtualAccountParameters{} + +// VirtualAccountParameters struct for VirtualAccountParameters +type VirtualAccountParameters struct { + MinAmount NullableFloat64 `json:"min_amount,omitempty"` + MaxAmount NullableFloat64 `json:"max_amount,omitempty"` + Amount NullableFloat64 `json:"amount,omitempty"` + Currency *PaymentRequestCurrency `json:"currency,omitempty"` + ChannelCode VirtualAccountChannelCode `json:"channel_code"` + ChannelProperties VirtualAccountChannelProperties `json:"channel_properties"` + // Alternative display requested for the virtual account + AlternativeDisplayTypes []string `json:"alternative_display_types,omitempty"` +} + +// NewVirtualAccountParameters instantiates a new VirtualAccountParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualAccountParameters(channelCode VirtualAccountChannelCode, channelProperties VirtualAccountChannelProperties) *VirtualAccountParameters { + this := VirtualAccountParameters{} + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + return &this +} + +// NewVirtualAccountParametersWithDefaults instantiates a new VirtualAccountParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualAccountParametersWithDefaults() *VirtualAccountParameters { + this := VirtualAccountParameters{} + return &this +} + +// GetMinAmount returns the MinAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetMinAmount() float64 { + if o == nil || utils.IsNil(o.MinAmount.Get()) { + var ret float64 + return ret + } + return *o.MinAmount.Get() +} + +// GetMinAmountOk returns a tuple with the MinAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetMinAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MinAmount.Get(), o.MinAmount.IsSet() +} + +// HasMinAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasMinAmount() bool { + if o != nil && o.MinAmount.IsSet() { + return true + } + + return false +} + +// SetMinAmount gets a reference to the given NullableFloat64 and assigns it to the MinAmount field. +func (o *VirtualAccountParameters) SetMinAmount(v float64) { + o.MinAmount.Set(&v) +} +// SetMinAmountNil sets the value for MinAmount to be an explicit nil +func (o *VirtualAccountParameters) SetMinAmountNil() { + o.MinAmount.Set(nil) +} + +// UnsetMinAmount ensures that no value is present for MinAmount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetMinAmount() { + o.MinAmount.Unset() +} + +// GetMaxAmount returns the MaxAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetMaxAmount() float64 { + if o == nil || utils.IsNil(o.MaxAmount.Get()) { + var ret float64 + return ret + } + return *o.MaxAmount.Get() +} + +// GetMaxAmountOk returns a tuple with the MaxAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetMaxAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.MaxAmount.Get(), o.MaxAmount.IsSet() +} + +// HasMaxAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasMaxAmount() bool { + if o != nil && o.MaxAmount.IsSet() { + return true + } + + return false +} + +// SetMaxAmount gets a reference to the given NullableFloat64 and assigns it to the MaxAmount field. +func (o *VirtualAccountParameters) SetMaxAmount(v float64) { + o.MaxAmount.Set(&v) +} +// SetMaxAmountNil sets the value for MaxAmount to be an explicit nil +func (o *VirtualAccountParameters) SetMaxAmountNil() { + o.MaxAmount.Set(nil) +} + +// UnsetMaxAmount ensures that no value is present for MaxAmount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetMaxAmount() { + o.MaxAmount.Unset() +} + +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VirtualAccountParameters) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount.Get()) { + var ret float64 + return ret + } + return *o.Amount.Get() +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VirtualAccountParameters) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Amount.Get(), o.Amount.IsSet() +} + +// HasAmount returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasAmount() bool { + if o != nil && o.Amount.IsSet() { + return true + } + + return false +} + +// SetAmount gets a reference to the given NullableFloat64 and assigns it to the Amount field. +func (o *VirtualAccountParameters) SetAmount(v float64) { + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *VirtualAccountParameters) SetAmountNil() { + o.Amount.Set(nil) +} + +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *VirtualAccountParameters) UnsetAmount() { + o.Amount.Unset() +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *VirtualAccountParameters) GetCurrency() PaymentRequestCurrency { + if o == nil || utils.IsNil(o.Currency) { + var ret PaymentRequestCurrency + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetCurrencyOk() (*PaymentRequestCurrency, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given PaymentRequestCurrency and assigns it to the Currency field. +func (o *VirtualAccountParameters) SetCurrency(v PaymentRequestCurrency) { + o.Currency = &v +} + +// GetChannelCode returns the ChannelCode field value +func (o *VirtualAccountParameters) GetChannelCode() VirtualAccountChannelCode { + if o == nil { + var ret VirtualAccountChannelCode + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetChannelCodeOk() (*VirtualAccountChannelCode, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *VirtualAccountParameters) SetChannelCode(v VirtualAccountChannelCode) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *VirtualAccountParameters) GetChannelProperties() VirtualAccountChannelProperties { + if o == nil { + var ret VirtualAccountChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetChannelPropertiesOk() (*VirtualAccountChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *VirtualAccountParameters) SetChannelProperties(v VirtualAccountChannelProperties) { + o.ChannelProperties = v +} + +// GetAlternativeDisplayTypes returns the AlternativeDisplayTypes field value if set, zero value otherwise. +func (o *VirtualAccountParameters) GetAlternativeDisplayTypes() []string { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + var ret []string + return ret + } + return o.AlternativeDisplayTypes +} + +// GetAlternativeDisplayTypesOk returns a tuple with the AlternativeDisplayTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualAccountParameters) GetAlternativeDisplayTypesOk() ([]string, bool) { + if o == nil || utils.IsNil(o.AlternativeDisplayTypes) { + return nil, false + } + return o.AlternativeDisplayTypes, true +} + +// HasAlternativeDisplayTypes returns a boolean if a field has been set. +func (o *VirtualAccountParameters) HasAlternativeDisplayTypes() bool { + if o != nil && !utils.IsNil(o.AlternativeDisplayTypes) { + return true + } + + return false +} + +// SetAlternativeDisplayTypes gets a reference to the given []string and assigns it to the AlternativeDisplayTypes field. +func (o *VirtualAccountParameters) SetAlternativeDisplayTypes(v []string) { + o.AlternativeDisplayTypes = v +} + +func (o VirtualAccountParameters) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualAccountParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.MinAmount.IsSet() { + toSerialize["min_amount"] = o.MinAmount.Get() + } + if o.MaxAmount.IsSet() { + toSerialize["max_amount"] = o.MaxAmount.Get() + } + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + if !utils.IsNil(o.AlternativeDisplayTypes) { + toSerialize["alternative_display_types"] = o.AlternativeDisplayTypes + } + return toSerialize, nil +} + +type NullableVirtualAccountParameters struct { + value *VirtualAccountParameters + isSet bool +} + +func (v NullableVirtualAccountParameters) Get() *VirtualAccountParameters { + return v.value +} + +func (v *NullableVirtualAccountParameters) Set(val *VirtualAccountParameters) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountParameters(val *VirtualAccountParameters) *NullableVirtualAccountParameters { + return &NullableVirtualAccountParameters{value: val, isSet: true} +} + +func (v NullableVirtualAccountParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/nullable.go b/payment_request/nullable.go new file mode 100644 index 00000000..afd5b6ad --- /dev/null +++ b/payment_request/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package payment_request + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/payout.go b/payout.go deleted file mode 100644 index 41a02b3f..00000000 --- a/payout.go +++ /dev/null @@ -1,26 +0,0 @@ -package xendit - -import "time" - -// Payout contains data from Xendit's API response of invoice related request. -// For more details see https://xendit.github.io/apireference/?bash#payouts. -// For documentation of subpackage payout, checkout https://pkg.go.dev/github.com/xendit/xendit-go/payout -type Payout struct { - ID string `json:"id"` - ExternalID string `json:"external_id"` - Amount float64 `json:"amount"` - Status string `json:"status"` - Email string `json:"email,omitempty"` - PaymentID string `json:"payment_id,omitempty"` - BankCode string `json:"bank_code,omitempty"` - AccountHolderName string `json:"account_holder_name,omitempty"` - AccountNumber string `json:"account_number,omitempty"` - DisbursementID string `json:"disbursement_id,omitempty"` - FailureReason string `json:"failure_reason,omitempty"` - Created *time.Time `json:"created,omitempty"` - ExpirationTimestamp *time.Time `json:"expiration_timestamp,omitempty"` - ClaimedTimestamp *time.Time `json:"claimed_timestamp,omitempty"` - FailedTimestamp *time.Time `json:"failed_timestamp,omitempty"` - MerchantName string `json:"merchant_name,omitempty"` - PayoutURL string `json:"payout_url,omitempty"` -} diff --git a/payout/api_payout.go b/payout/api_payout.go new file mode 100644 index 00000000..8c79223f --- /dev/null +++ b/payout/api_payout.go @@ -0,0 +1,612 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package payout + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" +) + + +type PayoutApi interface { + + /* + CancelPayout API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payout id returned from the response of /v2/payouts + @return ApiCancelPayoutRequest + */ + CancelPayout(ctx context.Context, id string) ApiCancelPayoutRequest + + // CancelPayoutExecute executes the request + // @return GetPayouts200ResponseDataInner + CancelPayoutExecute(r ApiCancelPayoutRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) + + /* + CreatePayout API to send money at scale to bank accounts & eWallets + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePayoutRequest + */ + CreatePayout(ctx context.Context) ApiCreatePayoutRequest + + // CreatePayoutExecute executes the request + // @return GetPayouts200ResponseDataInner + CreatePayoutExecute(r ApiCreatePayoutRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) + + /* + GetPayoutById API to fetch the current status, or details of the payout + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payout id returned from the response of /v2/payouts + @return ApiGetPayoutByIdRequest + */ + GetPayoutById(ctx context.Context, id string) ApiGetPayoutByIdRequest + + // GetPayoutByIdExecute executes the request + // @return GetPayouts200ResponseDataInner + GetPayoutByIdExecute(r ApiGetPayoutByIdRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) + + /* + GetPayoutChannels API providing the current list of banks and e-wallets we support for payouts for both regions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPayoutChannelsRequest + */ + GetPayoutChannels(ctx context.Context) ApiGetPayoutChannelsRequest + + // GetPayoutChannelsExecute executes the request + // @return []Channel + GetPayoutChannelsExecute(r ApiGetPayoutChannelsRequest) ([]Channel, *http.Response, *common.XenditSdkError) + + /* + GetPayouts API to retrieve all matching payouts with reference ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPayoutsRequest + */ + GetPayouts(ctx context.Context) ApiGetPayoutsRequest + + // GetPayoutsExecute executes the request + // @return GetPayouts200Response + GetPayoutsExecute(r ApiGetPayoutsRequest) (*GetPayouts200Response, *http.Response, *common.XenditSdkError) +} + +// PayoutApiService PayoutApi service +type PayoutApiService struct { + client common.IClient +} + +// NewPayoutApi Create a new PayoutApi service +func NewPayoutApi (client common.IClient) PayoutApi { + return &PayoutApiService{ + client: client, + } +} + + +type ApiCancelPayoutRequest struct { + ctx context.Context + ApiService PayoutApi + id string +} + +func (r ApiCancelPayoutRequest) Execute() (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + return r.ApiService.CancelPayoutExecute(r) +} + +/* +CancelPayout API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payout id returned from the response of /v2/payouts + @return ApiCancelPayoutRequest +*/ +func (a *PayoutApiService) CancelPayout(ctx context.Context, id string) ApiCancelPayoutRequest { + return ApiCancelPayoutRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return GetPayouts200ResponseDataInner +func (a *PayoutApiService) CancelPayoutExecute(r ApiCancelPayoutRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *GetPayouts200ResponseDataInner + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PayoutApiService.CancelPayout") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.CancelPayoutExecute") + } + + localVarPath := localBasePath + "/v2/payouts/{id}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(utils.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.CancelPayoutExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreatePayoutRequest struct { + ctx context.Context + ApiService PayoutApi + idempotencyKey *string + forUserId *string + createPayoutRequest *CreatePayoutRequest +} + +// A unique key to prevent duplicate requests from pushing through our system. No expiration. +func (r ApiCreatePayoutRequest) IdempotencyKey(idempotencyKey string) ApiCreatePayoutRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +// The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. +func (r ApiCreatePayoutRequest) ForUserId(forUserId string) ApiCreatePayoutRequest { + r.forUserId = &forUserId + return r +} + +func (r ApiCreatePayoutRequest) CreatePayoutRequest(createPayoutRequest CreatePayoutRequest) ApiCreatePayoutRequest { + r.createPayoutRequest = &createPayoutRequest + return r +} + +func (r ApiCreatePayoutRequest) Execute() (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + return r.ApiService.CreatePayoutExecute(r) +} + +/* +CreatePayout API to send money at scale to bank accounts & eWallets + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePayoutRequest +*/ +func (a *PayoutApiService) CreatePayout(ctx context.Context) ApiCreatePayoutRequest { + return ApiCreatePayoutRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetPayouts200ResponseDataInner +func (a *PayoutApiService) CreatePayoutExecute(r ApiCreatePayoutRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *GetPayouts200ResponseDataInner + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PayoutApiService.CreatePayout") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.CreatePayoutExecute") + } + + localVarPath := localBasePath + "/v2/payouts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.idempotencyKey == nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "idempotencyKey is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") + if r.forUserId != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "for-user-id", r.forUserId, "") + } + // body params + localVarPostBody = r.createPayoutRequest + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.CreatePayoutExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPayoutByIdRequest struct { + ctx context.Context + ApiService PayoutApi + id string +} + +func (r ApiGetPayoutByIdRequest) Execute() (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPayoutByIdExecute(r) +} + +/* +GetPayoutById API to fetch the current status, or details of the payout + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payout id returned from the response of /v2/payouts + @return ApiGetPayoutByIdRequest +*/ +func (a *PayoutApiService) GetPayoutById(ctx context.Context, id string) ApiGetPayoutByIdRequest { + return ApiGetPayoutByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// @return GetPayouts200ResponseDataInner +func (a *PayoutApiService) GetPayoutByIdExecute(r ApiGetPayoutByIdRequest) (*GetPayouts200ResponseDataInner, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *GetPayouts200ResponseDataInner + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PayoutApiService.GetPayoutById") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutByIdExecute") + } + + localVarPath := localBasePath + "/v2/payouts/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(utils.ParameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPayoutChannelsRequest struct { + ctx context.Context + ApiService PayoutApi + currency *string + channelCategory *[]ChannelCategory + channelCode *string +} + +// Filter channels by currency from ISO-4217 values +func (r ApiGetPayoutChannelsRequest) Currency(currency string) ApiGetPayoutChannelsRequest { + r.currency = ¤cy + return r +} + +// Filter channels by category +func (r ApiGetPayoutChannelsRequest) ChannelCategory(channelCategory []ChannelCategory) ApiGetPayoutChannelsRequest { + r.channelCategory = &channelCategory + return r +} + +// Filter channels by channel code, prefixed by ISO-3166 country code +func (r ApiGetPayoutChannelsRequest) ChannelCode(channelCode string) ApiGetPayoutChannelsRequest { + r.channelCode = &channelCode + return r +} + +func (r ApiGetPayoutChannelsRequest) Execute() ([]Channel, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPayoutChannelsExecute(r) +} + +/* +GetPayoutChannels API providing the current list of banks and e-wallets we support for payouts for both regions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPayoutChannelsRequest +*/ +func (a *PayoutApiService) GetPayoutChannels(ctx context.Context) ApiGetPayoutChannelsRequest { + return ApiGetPayoutChannelsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []Channel +func (a *PayoutApiService) GetPayoutChannelsExecute(r ApiGetPayoutChannelsRequest) ([]Channel, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue []Channel + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PayoutApiService.GetPayoutChannels") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutChannelsExecute") + } + + localVarPath := localBasePath + "/payouts_channels" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.currency != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "currency", r.currency, "") + } + if r.channelCategory != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_category", r.channelCategory, "csv") + } + if r.channelCode != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "channel_code", r.channelCode, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutChannelsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPayoutsRequest struct { + ctx context.Context + ApiService PayoutApi + referenceId *string + limit *float32 + afterId *string + beforeId *string +} + +// Reference_id provided when creating the payout +func (r ApiGetPayoutsRequest) ReferenceId(referenceId string) ApiGetPayoutsRequest { + r.referenceId = &referenceId + return r +} + +// Number of records to fetch per API call +func (r ApiGetPayoutsRequest) Limit(limit float32) ApiGetPayoutsRequest { + r.limit = &limit + return r +} + +// Used to fetch record after this payout unique id +func (r ApiGetPayoutsRequest) AfterId(afterId string) ApiGetPayoutsRequest { + r.afterId = &afterId + return r +} + +// Used to fetch record before this payout unique id +func (r ApiGetPayoutsRequest) BeforeId(beforeId string) ApiGetPayoutsRequest { + r.beforeId = &beforeId + return r +} + +func (r ApiGetPayoutsRequest) Execute() (*GetPayouts200Response, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetPayoutsExecute(r) +} + +/* +GetPayouts API to retrieve all matching payouts with reference ID + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPayoutsRequest +*/ +func (a *PayoutApiService) GetPayouts(ctx context.Context) ApiGetPayoutsRequest { + return ApiGetPayoutsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetPayouts200Response +func (a *PayoutApiService) GetPayoutsExecute(r ApiGetPayoutsRequest) (*GetPayouts200Response, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *GetPayouts200Response + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "PayoutApiService.GetPayouts") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutsExecute") + } + + localVarPath := localBasePath + "/v2/payouts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.referenceId == nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "referenceId is required and must be specified") + } + + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "reference_id", r.referenceId, "") + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.afterId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "after_id", r.afterId, "") + } + if r.beforeId != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "before_id", r.beforeId, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: PayoutApiService.GetPayoutsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/payout/client.go b/payout/client.go deleted file mode 100644 index 68e10c5c..00000000 --- a/payout/client.go +++ /dev/null @@ -1,107 +0,0 @@ -package payout - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new payout -func (c *Client) Create(data *CreateParams) (*xendit.Payout, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new payout with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Payout{} - header := http.Header{} - if data.IdempotencyKey != "" { - header.Add("x-idempotency-key", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/payouts", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Get gets one payout -func (c *Client) Get(data *GetParams) (*xendit.Payout, *xendit.Error) { - return c.GetWithContext(context.Background(), data) -} - -// GetWithContext gets one payout with context -func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.Payout, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Payout{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/payouts/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Void voids the created payout -func (c *Client) Void(data *VoidParams) (*xendit.Payout, *xendit.Error) { - return c.VoidWithContext(context.Background(), data) -} - -// VoidWithContext voids the created payout with context -func (c *Client) VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Payout{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/payouts/%s/void", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/payout/example_test.go b/payout/example_test.go deleted file mode 100644 index cffb03a4..00000000 --- a/payout/example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package payout_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/payout" -) - -func ExampleCreate() { - xendit.Opt.SecretKey = "examplesecretkey" - - createData := payout.CreateParams{ - ExternalID: "payout-" + time.Now().String(), - Amount: 200000, - } - - resp, err := payout.Create(&createData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payout: %+v\n", resp) -} - -func ExampleGet() { - xendit.Opt.SecretKey = "examplesecretkey" - - resp, err := payout.Get(&payout.GetParams{ - ID: "123", - }) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved payout: %+v\n", resp) -} - -func ExampleVoid() { - xendit.Opt.SecretKey = "examplesecretkey" - - resp, err := payout.Void(&payout.VoidParams{ - ID: "123", - }) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("voided payout: %+v\n", resp) -} diff --git a/payout/model_channel.go b/payout/model_channel.go new file mode 100644 index 00000000..a015161a --- /dev/null +++ b/payout/model_channel.go @@ -0,0 +1,232 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Channel type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Channel{} + +// Channel Channel information where you can send the money to +type Channel struct { + // Destination channel to send the money to, prefixed by ISO-3166 country code + ChannelCode string `json:"channel_code"` + ChannelCategory ChannelCategory `json:"channel_category"` + // Currency of the destination channel using ISO-4217 currency code + Currency string `json:"currency"` + // Name of the destination channel + ChannelName string `json:"channel_name"` + AmountLimits ChannelAmountLimits `json:"amount_limits"` +} + +// NewChannel instantiates a new Channel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannel(channelCode string, channelCategory ChannelCategory, currency string, channelName string, amountLimits ChannelAmountLimits) *Channel { + this := Channel{} + this.ChannelCode = channelCode + this.ChannelCategory = channelCategory + this.Currency = currency + this.ChannelName = channelName + this.AmountLimits = amountLimits + return &this +} + +// NewChannelWithDefaults instantiates a new Channel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelWithDefaults() *Channel { + this := Channel{} + return &this +} + +// GetChannelCode returns the ChannelCode field value +func (o *Channel) GetChannelCode() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *Channel) GetChannelCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *Channel) SetChannelCode(v string) { + o.ChannelCode = v +} + +// GetChannelCategory returns the ChannelCategory field value +func (o *Channel) GetChannelCategory() ChannelCategory { + if o == nil { + var ret ChannelCategory + return ret + } + + return o.ChannelCategory +} + +// GetChannelCategoryOk returns a tuple with the ChannelCategory field value +// and a boolean to check if the value has been set. +func (o *Channel) GetChannelCategoryOk() (*ChannelCategory, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCategory, true +} + +// SetChannelCategory sets field value +func (o *Channel) SetChannelCategory(v ChannelCategory) { + o.ChannelCategory = v +} + +// GetCurrency returns the Currency field value +func (o *Channel) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Channel) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Channel) SetCurrency(v string) { + o.Currency = v +} + +// GetChannelName returns the ChannelName field value +func (o *Channel) GetChannelName() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelName +} + +// GetChannelNameOk returns a tuple with the ChannelName field value +// and a boolean to check if the value has been set. +func (o *Channel) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *Channel) SetChannelName(v string) { + o.ChannelName = v +} + +// GetAmountLimits returns the AmountLimits field value +func (o *Channel) GetAmountLimits() ChannelAmountLimits { + if o == nil { + var ret ChannelAmountLimits + return ret + } + + return o.AmountLimits +} + +// GetAmountLimitsOk returns a tuple with the AmountLimits field value +// and a boolean to check if the value has been set. +func (o *Channel) GetAmountLimitsOk() (*ChannelAmountLimits, bool) { + if o == nil { + return nil, false + } + return &o.AmountLimits, true +} + +// SetAmountLimits sets field value +func (o *Channel) SetAmountLimits(v ChannelAmountLimits) { + o.AmountLimits = v +} + +func (o Channel) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Channel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_category"] = o.ChannelCategory + toSerialize["currency"] = o.Currency + toSerialize["channel_name"] = o.ChannelName + toSerialize["amount_limits"] = o.AmountLimits + return toSerialize, nil +} + +type NullableChannel struct { + value *Channel + isSet bool +} + +func (v NullableChannel) Get() *Channel { + return v.value +} + +func (v *NullableChannel) Set(val *Channel) { + v.value = val + v.isSet = true +} + +func (v NullableChannel) IsSet() bool { + return v.isSet +} + +func (v *NullableChannel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannel(val *Channel) *NullableChannel { + return &NullableChannel{value: val, isSet: true} +} + +func (v NullableChannel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_channel_account_type.go b/payout/model_channel_account_type.go new file mode 100644 index 00000000..a68964fd --- /dev/null +++ b/payout/model_channel_account_type.go @@ -0,0 +1,121 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + "fmt" +) + +// ChannelAccountType Available account types (applicable for MY_DUITNOW) +type ChannelAccountType string + +// List of ChannelAccountType +const ( + CHANNELACCOUNTTYPE_NATIONAL_ID ChannelAccountType = "NATIONAL_ID" + CHANNELACCOUNTTYPE_MOBILE_NO ChannelAccountType = "MOBILE_NO" + CHANNELACCOUNTTYPE_PASSPORT ChannelAccountType = "PASSPORT" + CHANNELACCOUNTTYPE_BUSINESS_REGISTRATION ChannelAccountType = "BUSINESS_REGISTRATION" + CHANNELACCOUNTTYPE_BANK_ACCOUNT ChannelAccountType = "BANK_ACCOUNT" +) + +// All allowed values of ChannelAccountType enum +var AllowedChannelAccountTypeEnumValues = []ChannelAccountType{ + "NATIONAL_ID", + "MOBILE_NO", + "PASSPORT", + "BUSINESS_REGISTRATION", + "BANK_ACCOUNT", +} + +func (v *ChannelAccountType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChannelAccountType(value) + for _, existing := range AllowedChannelAccountTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChannelAccountType", value) +} + +// NewChannelAccountTypeFromValue returns a pointer to a valid ChannelAccountType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChannelAccountTypeFromValue(v string) (*ChannelAccountType, error) { + ev := ChannelAccountType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChannelAccountType: valid values are %v", v, AllowedChannelAccountTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChannelAccountType) IsValid() bool { + for _, existing := range AllowedChannelAccountTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v ChannelAccountType) String() string { + return string(v) +} + +// Ptr returns reference to ChannelAccountType value +func (v ChannelAccountType) Ptr() *ChannelAccountType { + return &v +} + +type NullableChannelAccountType struct { + value *ChannelAccountType + isSet bool +} + +func (v NullableChannelAccountType) Get() *ChannelAccountType { + return v.value +} + +func (v *NullableChannelAccountType) Set(val *ChannelAccountType) { + v.value = val + v.isSet = true +} + +func (v NullableChannelAccountType) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelAccountType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelAccountType(val *ChannelAccountType) *NullableChannelAccountType { + return &NullableChannelAccountType{value: val, isSet: true} +} + +func (v NullableChannelAccountType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelAccountType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payout/model_channel_amount_limits.go b/payout/model_channel_amount_limits.go new file mode 100644 index 00000000..ad7ddfdc --- /dev/null +++ b/payout/model_channel_amount_limits.go @@ -0,0 +1,178 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ChannelAmountLimits type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ChannelAmountLimits{} + +// ChannelAmountLimits Supported amount ranges for payouts to this channel +type ChannelAmountLimits struct { + // Lowest amount supported for a payout to this channel + Minimum float32 `json:"minimum"` + // Highest amount supported for a payout to this channel + Maximum float32 `json:"maximum"` + // Supported increments + MinimumIncrement float32 `json:"minimum_increment"` +} + +// NewChannelAmountLimits instantiates a new ChannelAmountLimits object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewChannelAmountLimits(minimum float32, maximum float32, minimumIncrement float32) *ChannelAmountLimits { + this := ChannelAmountLimits{} + this.Minimum = minimum + this.Maximum = maximum + this.MinimumIncrement = minimumIncrement + return &this +} + +// NewChannelAmountLimitsWithDefaults instantiates a new ChannelAmountLimits object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewChannelAmountLimitsWithDefaults() *ChannelAmountLimits { + this := ChannelAmountLimits{} + return &this +} + +// GetMinimum returns the Minimum field value +func (o *ChannelAmountLimits) GetMinimum() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Minimum +} + +// GetMinimumOk returns a tuple with the Minimum field value +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetMinimumOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Minimum, true +} + +// SetMinimum sets field value +func (o *ChannelAmountLimits) SetMinimum(v float32) { + o.Minimum = v +} + +// GetMaximum returns the Maximum field value +func (o *ChannelAmountLimits) GetMaximum() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Maximum +} + +// GetMaximumOk returns a tuple with the Maximum field value +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetMaximumOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Maximum, true +} + +// SetMaximum sets field value +func (o *ChannelAmountLimits) SetMaximum(v float32) { + o.Maximum = v +} + +// GetMinimumIncrement returns the MinimumIncrement field value +func (o *ChannelAmountLimits) GetMinimumIncrement() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.MinimumIncrement +} + +// GetMinimumIncrementOk returns a tuple with the MinimumIncrement field value +// and a boolean to check if the value has been set. +func (o *ChannelAmountLimits) GetMinimumIncrementOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.MinimumIncrement, true +} + +// SetMinimumIncrement sets field value +func (o *ChannelAmountLimits) SetMinimumIncrement(v float32) { + o.MinimumIncrement = v +} + +func (o ChannelAmountLimits) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ChannelAmountLimits) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["minimum"] = o.Minimum + toSerialize["maximum"] = o.Maximum + toSerialize["minimum_increment"] = o.MinimumIncrement + return toSerialize, nil +} + +type NullableChannelAmountLimits struct { + value *ChannelAmountLimits + isSet bool +} + +func (v NullableChannelAmountLimits) Get() *ChannelAmountLimits { + return v.value +} + +func (v *NullableChannelAmountLimits) Set(val *ChannelAmountLimits) { + v.value = val + v.isSet = true +} + +func (v NullableChannelAmountLimits) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelAmountLimits) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelAmountLimits(val *ChannelAmountLimits) *NullableChannelAmountLimits { + return &NullableChannelAmountLimits{value: val, isSet: true} +} + +func (v NullableChannelAmountLimits) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelAmountLimits) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_channel_category.go b/payout/model_channel_category.go new file mode 100644 index 00000000..99d2496e --- /dev/null +++ b/payout/model_channel_category.go @@ -0,0 +1,117 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + "fmt" +) + +// ChannelCategory Category of channel code, as some channels might require more fields during processing +type ChannelCategory string + +// List of ChannelCategory +const ( + CHANNELCATEGORY_BANK ChannelCategory = "BANK" + CHANNELCATEGORY_EWALLET ChannelCategory = "EWALLET" + CHANNELCATEGORY_OTC ChannelCategory = "OTC" +) + +// All allowed values of ChannelCategory enum +var AllowedChannelCategoryEnumValues = []ChannelCategory{ + "BANK", + "EWALLET", + "OTC", +} + +func (v *ChannelCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ChannelCategory(value) + for _, existing := range AllowedChannelCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ChannelCategory", value) +} + +// NewChannelCategoryFromValue returns a pointer to a valid ChannelCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewChannelCategoryFromValue(v string) (*ChannelCategory, error) { + ev := ChannelCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ChannelCategory: valid values are %v", v, AllowedChannelCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ChannelCategory) IsValid() bool { + for _, existing := range AllowedChannelCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v ChannelCategory) String() string { + return string(v) +} + +// Ptr returns reference to ChannelCategory value +func (v ChannelCategory) Ptr() *ChannelCategory { + return &v +} + +type NullableChannelCategory struct { + value *ChannelCategory + isSet bool +} + +func (v NullableChannelCategory) Get() *ChannelCategory { + return v.value +} + +func (v *NullableChannelCategory) Set(val *ChannelCategory) { + v.value = val + v.isSet = true +} + +func (v NullableChannelCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableChannelCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChannelCategory(val *ChannelCategory) *NullableChannelCategory { + return &NullableChannelCategory{value: val, isSet: true} +} + +func (v NullableChannelCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChannelCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/payout/model_create_payout_request.go b/payout/model_create_payout_request.go new file mode 100644 index 00000000..1ccf9f81 --- /dev/null +++ b/payout/model_create_payout_request.go @@ -0,0 +1,343 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreatePayoutRequest type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreatePayoutRequest{} + +// CreatePayoutRequest Information needed by Xendit to send money to the destination channel provided +type CreatePayoutRequest struct { + // A client defined payout identifier + ReferenceId string `json:"reference_id"` + // Channel code of selected destination bank or e-wallet + ChannelCode string `json:"channel_code"` + ChannelProperties DigitalPayoutChannelProperties `json:"channel_properties"` + // Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + Amount float32 `json:"amount"` + // Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf + Description *string `json:"description,omitempty"` + // Currency of the destination channel using ISO-4217 currency code + Currency string `json:"currency"` + ReceiptNotification *ReceiptNotification `json:"receipt_notification,omitempty"` + // Object of additional information you may use + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewCreatePayoutRequest instantiates a new CreatePayoutRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePayoutRequest(referenceId string, channelCode string, channelProperties DigitalPayoutChannelProperties, amount float32, currency string) *CreatePayoutRequest { + this := CreatePayoutRequest{} + this.ReferenceId = referenceId + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + this.Amount = amount + this.Currency = currency + return &this +} + +// NewCreatePayoutRequestWithDefaults instantiates a new CreatePayoutRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePayoutRequestWithDefaults() *CreatePayoutRequest { + this := CreatePayoutRequest{} + return &this +} + +// GetReferenceId returns the ReferenceId field value +func (o *CreatePayoutRequest) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *CreatePayoutRequest) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetChannelCode returns the ChannelCode field value +func (o *CreatePayoutRequest) GetChannelCode() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetChannelCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *CreatePayoutRequest) SetChannelCode(v string) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *CreatePayoutRequest) GetChannelProperties() DigitalPayoutChannelProperties { + if o == nil { + var ret DigitalPayoutChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetChannelPropertiesOk() (*DigitalPayoutChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *CreatePayoutRequest) SetChannelProperties(v DigitalPayoutChannelProperties) { + o.ChannelProperties = v +} + +// GetAmount returns the Amount field value +func (o *CreatePayoutRequest) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *CreatePayoutRequest) SetAmount(v float32) { + o.Amount = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreatePayoutRequest) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreatePayoutRequest) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreatePayoutRequest) SetDescription(v string) { + o.Description = &v +} + +// GetCurrency returns the Currency field value +func (o *CreatePayoutRequest) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *CreatePayoutRequest) SetCurrency(v string) { + o.Currency = v +} + +// GetReceiptNotification returns the ReceiptNotification field value if set, zero value otherwise. +func (o *CreatePayoutRequest) GetReceiptNotification() ReceiptNotification { + if o == nil || utils.IsNil(o.ReceiptNotification) { + var ret ReceiptNotification + return ret + } + return *o.ReceiptNotification +} + +// GetReceiptNotificationOk returns a tuple with the ReceiptNotification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetReceiptNotificationOk() (*ReceiptNotification, bool) { + if o == nil || utils.IsNil(o.ReceiptNotification) { + return nil, false + } + return o.ReceiptNotification, true +} + +// HasReceiptNotification returns a boolean if a field has been set. +func (o *CreatePayoutRequest) HasReceiptNotification() bool { + if o != nil && !utils.IsNil(o.ReceiptNotification) { + return true + } + + return false +} + +// SetReceiptNotification gets a reference to the given ReceiptNotification and assigns it to the ReceiptNotification field. +func (o *CreatePayoutRequest) SetReceiptNotification(v ReceiptNotification) { + o.ReceiptNotification = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreatePayoutRequest) GetMetadata() map[string]interface{} { + if o == nil || utils.IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePayoutRequest) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreatePayoutRequest) HasMetadata() bool { + if o != nil && !utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreatePayoutRequest) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o CreatePayoutRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePayoutRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["reference_id"] = o.ReferenceId + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + toSerialize["amount"] = o.Amount + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["currency"] = o.Currency + if !utils.IsNil(o.ReceiptNotification) { + toSerialize["receipt_notification"] = o.ReceiptNotification + } + if !utils.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullableCreatePayoutRequest struct { + value *CreatePayoutRequest + isSet bool +} + +func (v NullableCreatePayoutRequest) Get() *CreatePayoutRequest { + return v.value +} + +func (v *NullableCreatePayoutRequest) Set(val *CreatePayoutRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePayoutRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePayoutRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePayoutRequest(val *CreatePayoutRequest) *NullableCreatePayoutRequest { + return &NullableCreatePayoutRequest{value: val, isSet: true} +} + +func (v NullableCreatePayoutRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePayoutRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_digital_payout_channel_properties.go b/payout/model_digital_payout_channel_properties.go new file mode 100644 index 00000000..5a48ac74 --- /dev/null +++ b/payout/model_digital_payout_channel_properties.go @@ -0,0 +1,205 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the DigitalPayoutChannelProperties type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &DigitalPayoutChannelProperties{} + +// DigitalPayoutChannelProperties Channel information for digital destinations (banks, e-wallets) +type DigitalPayoutChannelProperties struct { + // Registered account name + AccountHolderName NullableString `json:"account_holder_name,omitempty"` + // Registered account number + AccountNumber string `json:"account_number"` + AccountType *ChannelAccountType `json:"account_type,omitempty"` +} + +// NewDigitalPayoutChannelProperties instantiates a new DigitalPayoutChannelProperties object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDigitalPayoutChannelProperties(accountNumber string) *DigitalPayoutChannelProperties { + this := DigitalPayoutChannelProperties{} + this.AccountNumber = accountNumber + return &this +} + +// NewDigitalPayoutChannelPropertiesWithDefaults instantiates a new DigitalPayoutChannelProperties object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDigitalPayoutChannelPropertiesWithDefaults() *DigitalPayoutChannelProperties { + this := DigitalPayoutChannelProperties{} + return &this +} + +// GetAccountHolderName returns the AccountHolderName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DigitalPayoutChannelProperties) GetAccountHolderName() string { + if o == nil || utils.IsNil(o.AccountHolderName.Get()) { + var ret string + return ret + } + return *o.AccountHolderName.Get() +} + +// GetAccountHolderNameOk returns a tuple with the AccountHolderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DigitalPayoutChannelProperties) GetAccountHolderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccountHolderName.Get(), o.AccountHolderName.IsSet() +} + +// HasAccountHolderName returns a boolean if a field has been set. +func (o *DigitalPayoutChannelProperties) HasAccountHolderName() bool { + if o != nil && o.AccountHolderName.IsSet() { + return true + } + + return false +} + +// SetAccountHolderName gets a reference to the given NullableString and assigns it to the AccountHolderName field. +func (o *DigitalPayoutChannelProperties) SetAccountHolderName(v string) { + o.AccountHolderName.Set(&v) +} +// SetAccountHolderNameNil sets the value for AccountHolderName to be an explicit nil +func (o *DigitalPayoutChannelProperties) SetAccountHolderNameNil() { + o.AccountHolderName.Set(nil) +} + +// UnsetAccountHolderName ensures that no value is present for AccountHolderName, not even an explicit nil +func (o *DigitalPayoutChannelProperties) UnsetAccountHolderName() { + o.AccountHolderName.Unset() +} + +// GetAccountNumber returns the AccountNumber field value +func (o *DigitalPayoutChannelProperties) GetAccountNumber() string { + if o == nil { + var ret string + return ret + } + + return o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value +// and a boolean to check if the value has been set. +func (o *DigitalPayoutChannelProperties) GetAccountNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountNumber, true +} + +// SetAccountNumber sets field value +func (o *DigitalPayoutChannelProperties) SetAccountNumber(v string) { + o.AccountNumber = v +} + +// GetAccountType returns the AccountType field value if set, zero value otherwise. +func (o *DigitalPayoutChannelProperties) GetAccountType() ChannelAccountType { + if o == nil || utils.IsNil(o.AccountType) { + var ret ChannelAccountType + return ret + } + return *o.AccountType +} + +// GetAccountTypeOk returns a tuple with the AccountType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DigitalPayoutChannelProperties) GetAccountTypeOk() (*ChannelAccountType, bool) { + if o == nil || utils.IsNil(o.AccountType) { + return nil, false + } + return o.AccountType, true +} + +// HasAccountType returns a boolean if a field has been set. +func (o *DigitalPayoutChannelProperties) HasAccountType() bool { + if o != nil && !utils.IsNil(o.AccountType) { + return true + } + + return false +} + +// SetAccountType gets a reference to the given ChannelAccountType and assigns it to the AccountType field. +func (o *DigitalPayoutChannelProperties) SetAccountType(v ChannelAccountType) { + o.AccountType = &v +} + +func (o DigitalPayoutChannelProperties) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DigitalPayoutChannelProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.AccountHolderName.IsSet() { + toSerialize["account_holder_name"] = o.AccountHolderName.Get() + } + toSerialize["account_number"] = o.AccountNumber + if !utils.IsNil(o.AccountType) { + toSerialize["account_type"] = o.AccountType + } + return toSerialize, nil +} + +type NullableDigitalPayoutChannelProperties struct { + value *DigitalPayoutChannelProperties + isSet bool +} + +func (v NullableDigitalPayoutChannelProperties) Get() *DigitalPayoutChannelProperties { + return v.value +} + +func (v *NullableDigitalPayoutChannelProperties) Set(val *DigitalPayoutChannelProperties) { + v.value = val + v.isSet = true +} + +func (v NullableDigitalPayoutChannelProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableDigitalPayoutChannelProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDigitalPayoutChannelProperties(val *DigitalPayoutChannelProperties) *NullableDigitalPayoutChannelProperties { + return &NullableDigitalPayoutChannelProperties{value: val, isSet: true} +} + +func (v NullableDigitalPayoutChannelProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDigitalPayoutChannelProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_error.go b/payout/model_error.go new file mode 100644 index 00000000..1a3e575e --- /dev/null +++ b/payout/model_error.go @@ -0,0 +1,186 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + // Specific error encountered when processing the request, can refer to the API documentation on proper handling of each available error code https://developers.xendit.co/api-reference/#payouts + ErrorCode string `json:"error_code"` + // Human readable error message + Message string `json:"message"` + Errors []ErrorErrorsInner `json:"errors,omitempty"` +} + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(errorCode string, message string) *Error { + this := Error{} + this.ErrorCode = errorCode + this.Message = message + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetErrorCode returns the ErrorCode field value +func (o *Error) GetErrorCode() string { + if o == nil { + var ret string + return ret + } + + return o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value +// and a boolean to check if the value has been set. +func (o *Error) GetErrorCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ErrorCode, true +} + +// SetErrorCode sets field value +func (o *Error) SetErrorCode(v string) { + o.ErrorCode = v +} + +// GetMessage returns the Message field value +func (o *Error) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *Error) SetMessage(v string) { + o.Message = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Error) GetErrors() []ErrorErrorsInner { + if o == nil || utils.IsNil(o.Errors) { + var ret []ErrorErrorsInner + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetErrorsOk() ([]ErrorErrorsInner, bool) { + if o == nil || utils.IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Error) HasErrors() bool { + if o != nil && !utils.IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []ErrorErrorsInner and assigns it to the Errors field. +func (o *Error) SetErrors(v []ErrorErrorsInner) { + o.Errors = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_code"] = o.ErrorCode + toSerialize["message"] = o.Message + if !utils.IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + return toSerialize, nil +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_error_errors_inner.go b/payout/model_error_errors_inner.go new file mode 100644 index 00000000..e81ac982 --- /dev/null +++ b/payout/model_error_errors_inner.go @@ -0,0 +1,150 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ErrorErrorsInner type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ErrorErrorsInner{} + +// ErrorErrorsInner struct for ErrorErrorsInner +type ErrorErrorsInner struct { + // Precise location of the error + Path string `json:"path"` + // Specific description of the error + Message string `json:"message"` +} + +// NewErrorErrorsInner instantiates a new ErrorErrorsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorErrorsInner(path string, message string) *ErrorErrorsInner { + this := ErrorErrorsInner{} + this.Path = path + this.Message = message + return &this +} + +// NewErrorErrorsInnerWithDefaults instantiates a new ErrorErrorsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorErrorsInnerWithDefaults() *ErrorErrorsInner { + this := ErrorErrorsInner{} + return &this +} + +// GetPath returns the Path field value +func (o *ErrorErrorsInner) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *ErrorErrorsInner) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *ErrorErrorsInner) SetPath(v string) { + o.Path = v +} + +// GetMessage returns the Message field value +func (o *ErrorErrorsInner) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorErrorsInner) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorErrorsInner) SetMessage(v string) { + o.Message = v +} + +func (o ErrorErrorsInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorErrorsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["path"] = o.Path + toSerialize["message"] = o.Message + return toSerialize, nil +} + +type NullableErrorErrorsInner struct { + value *ErrorErrorsInner + isSet bool +} + +func (v NullableErrorErrorsInner) Get() *ErrorErrorsInner { + return v.value +} + +func (v *NullableErrorErrorsInner) Set(val *ErrorErrorsInner) { + v.value = val + v.isSet = true +} + +func (v NullableErrorErrorsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorErrorsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorErrorsInner(val *ErrorErrorsInner) *NullableErrorErrorsInner { + return &NullableErrorErrorsInner{value: val, isSet: true} +} + +func (v NullableErrorErrorsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorErrorsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_get_payouts_200_response.go b/payout/model_get_payouts_200_response.go new file mode 100644 index 00000000..5a48337c --- /dev/null +++ b/payout/model_get_payouts_200_response.go @@ -0,0 +1,202 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetPayouts200Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetPayouts200Response{} + +// GetPayouts200Response struct for GetPayouts200Response +type GetPayouts200Response struct { + Data []GetPayouts200ResponseDataInner `json:"data,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + Links *GetPayouts200ResponseLinks `json:"links,omitempty"` +} + +// NewGetPayouts200Response instantiates a new GetPayouts200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetPayouts200Response() *GetPayouts200Response { + this := GetPayouts200Response{} + return &this +} + +// NewGetPayouts200ResponseWithDefaults instantiates a new GetPayouts200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPayouts200ResponseWithDefaults() *GetPayouts200Response { + this := GetPayouts200Response{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetPayouts200Response) GetData() []GetPayouts200ResponseDataInner { + if o == nil || utils.IsNil(o.Data) { + var ret []GetPayouts200ResponseDataInner + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200Response) GetDataOk() ([]GetPayouts200ResponseDataInner, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetPayouts200Response) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []GetPayouts200ResponseDataInner and assigns it to the Data field. +func (o *GetPayouts200Response) SetData(v []GetPayouts200ResponseDataInner) { + o.Data = v +} + +// GetHasMore returns the HasMore field value if set, zero value otherwise. +func (o *GetPayouts200Response) GetHasMore() bool { + if o == nil || utils.IsNil(o.HasMore) { + var ret bool + return ret + } + return *o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200Response) GetHasMoreOk() (*bool, bool) { + if o == nil || utils.IsNil(o.HasMore) { + return nil, false + } + return o.HasMore, true +} + +// HasHasMore returns a boolean if a field has been set. +func (o *GetPayouts200Response) HasHasMore() bool { + if o != nil && !utils.IsNil(o.HasMore) { + return true + } + + return false +} + +// SetHasMore gets a reference to the given bool and assigns it to the HasMore field. +func (o *GetPayouts200Response) SetHasMore(v bool) { + o.HasMore = &v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *GetPayouts200Response) GetLinks() GetPayouts200ResponseLinks { + if o == nil || utils.IsNil(o.Links) { + var ret GetPayouts200ResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200Response) GetLinksOk() (*GetPayouts200ResponseLinks, bool) { + if o == nil || utils.IsNil(o.Links) { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *GetPayouts200Response) HasLinks() bool { + if o != nil && !utils.IsNil(o.Links) { + return true + } + + return false +} + +// SetLinks gets a reference to the given GetPayouts200ResponseLinks and assigns it to the Links field. +func (o *GetPayouts200Response) SetLinks(v GetPayouts200ResponseLinks) { + o.Links = &v +} + +func (o GetPayouts200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPayouts200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.HasMore) { + toSerialize["has_more"] = o.HasMore + } + if !utils.IsNil(o.Links) { + toSerialize["links"] = o.Links + } + return toSerialize, nil +} + +type NullableGetPayouts200Response struct { + value *GetPayouts200Response + isSet bool +} + +func (v NullableGetPayouts200Response) Get() *GetPayouts200Response { + return v.value +} + +func (v *NullableGetPayouts200Response) Set(val *GetPayouts200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetPayouts200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPayouts200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPayouts200Response(val *GetPayouts200Response) *NullableGetPayouts200Response { + return &NullableGetPayouts200Response{value: val, isSet: true} +} + +func (v NullableGetPayouts200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPayouts200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_get_payouts_200_response_data_inner.go b/payout/model_get_payouts_200_response_data_inner.go new file mode 100644 index 00000000..bcc0feea --- /dev/null +++ b/payout/model_get_payouts_200_response_data_inner.go @@ -0,0 +1,88 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + "fmt" +) + +// GetPayouts200ResponseDataInner struct for GetPayouts200ResponseDataInner +type GetPayouts200ResponseDataInner struct { + Payout *Payout +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *GetPayouts200ResponseDataInner) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into Payout + err = json.Unmarshal(data, &dst.Payout); + if err == nil { + jsonPayout, _ := json.Marshal(dst.Payout) + if string(jsonPayout) == "{}" { // empty struct + dst.Payout = nil + } else { + return nil // data stored in dst.Payout, return on the first match + } + } else { + dst.Payout = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(GetPayouts200ResponseDataInner)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *GetPayouts200ResponseDataInner) MarshalJSON() ([]byte, error) { + if src.Payout != nil { + return json.Marshal(&src.Payout) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableGetPayouts200ResponseDataInner struct { + value *GetPayouts200ResponseDataInner + isSet bool +} + +func (v NullableGetPayouts200ResponseDataInner) Get() *GetPayouts200ResponseDataInner { + return v.value +} + +func (v *NullableGetPayouts200ResponseDataInner) Set(val *GetPayouts200ResponseDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetPayouts200ResponseDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPayouts200ResponseDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPayouts200ResponseDataInner(val *GetPayouts200ResponseDataInner) *NullableGetPayouts200ResponseDataInner { + return &NullableGetPayouts200ResponseDataInner{value: val, isSet: true} +} + +func (v NullableGetPayouts200ResponseDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPayouts200ResponseDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_get_payouts_200_response_links.go b/payout/model_get_payouts_200_response_links.go new file mode 100644 index 00000000..46af3cb0 --- /dev/null +++ b/payout/model_get_payouts_200_response_links.go @@ -0,0 +1,202 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the GetPayouts200ResponseLinks type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &GetPayouts200ResponseLinks{} + +// GetPayouts200ResponseLinks struct for GetPayouts200ResponseLinks +type GetPayouts200ResponseLinks struct { + Href *string `json:"href,omitempty"` + Rel *string `json:"rel,omitempty"` + Method *string `json:"method,omitempty"` +} + +// NewGetPayouts200ResponseLinks instantiates a new GetPayouts200ResponseLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetPayouts200ResponseLinks() *GetPayouts200ResponseLinks { + this := GetPayouts200ResponseLinks{} + return &this +} + +// NewGetPayouts200ResponseLinksWithDefaults instantiates a new GetPayouts200ResponseLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetPayouts200ResponseLinksWithDefaults() *GetPayouts200ResponseLinks { + this := GetPayouts200ResponseLinks{} + return &this +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *GetPayouts200ResponseLinks) GetHref() string { + if o == nil || utils.IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200ResponseLinks) GetHrefOk() (*string, bool) { + if o == nil || utils.IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *GetPayouts200ResponseLinks) HasHref() bool { + if o != nil && !utils.IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *GetPayouts200ResponseLinks) SetHref(v string) { + o.Href = &v +} + +// GetRel returns the Rel field value if set, zero value otherwise. +func (o *GetPayouts200ResponseLinks) GetRel() string { + if o == nil || utils.IsNil(o.Rel) { + var ret string + return ret + } + return *o.Rel +} + +// GetRelOk returns a tuple with the Rel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200ResponseLinks) GetRelOk() (*string, bool) { + if o == nil || utils.IsNil(o.Rel) { + return nil, false + } + return o.Rel, true +} + +// HasRel returns a boolean if a field has been set. +func (o *GetPayouts200ResponseLinks) HasRel() bool { + if o != nil && !utils.IsNil(o.Rel) { + return true + } + + return false +} + +// SetRel gets a reference to the given string and assigns it to the Rel field. +func (o *GetPayouts200ResponseLinks) SetRel(v string) { + o.Rel = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *GetPayouts200ResponseLinks) GetMethod() string { + if o == nil || utils.IsNil(o.Method) { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetPayouts200ResponseLinks) GetMethodOk() (*string, bool) { + if o == nil || utils.IsNil(o.Method) { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *GetPayouts200ResponseLinks) HasMethod() bool { + if o != nil && !utils.IsNil(o.Method) { + return true + } + + return false +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *GetPayouts200ResponseLinks) SetMethod(v string) { + o.Method = &v +} + +func (o GetPayouts200ResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetPayouts200ResponseLinks) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !utils.IsNil(o.Rel) { + toSerialize["rel"] = o.Rel + } + if !utils.IsNil(o.Method) { + toSerialize["method"] = o.Method + } + return toSerialize, nil +} + +type NullableGetPayouts200ResponseLinks struct { + value *GetPayouts200ResponseLinks + isSet bool +} + +func (v NullableGetPayouts200ResponseLinks) Get() *GetPayouts200ResponseLinks { + return v.value +} + +func (v *NullableGetPayouts200ResponseLinks) Set(val *GetPayouts200ResponseLinks) { + v.value = val + v.isSet = true +} + +func (v NullableGetPayouts200ResponseLinks) IsSet() bool { + return v.isSet +} + +func (v *NullableGetPayouts200ResponseLinks) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetPayouts200ResponseLinks(val *GetPayouts200ResponseLinks) *NullableGetPayouts200ResponseLinks { + return &NullableGetPayouts200ResponseLinks{value: val, isSet: true} +} + +func (v NullableGetPayouts200ResponseLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetPayouts200ResponseLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_payout.go b/payout/model_payout.go new file mode 100644 index 00000000..087b392d --- /dev/null +++ b/payout/model_payout.go @@ -0,0 +1,558 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the Payout type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Payout{} + +// Payout struct for Payout +type Payout struct { + // A client defined payout identifier + ReferenceId string `json:"reference_id"` + // Channel code of selected destination bank or e-wallet + ChannelCode string `json:"channel_code"` + ChannelProperties DigitalPayoutChannelProperties `json:"channel_properties"` + // Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + Amount float32 `json:"amount"` + // Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf + Description *string `json:"description,omitempty"` + // Currency of the destination channel using ISO-4217 currency code + Currency string `json:"currency"` + ReceiptNotification *ReceiptNotification `json:"receipt_notification,omitempty"` + // Object of additional information you may use + Metadata map[string]interface{} `json:"metadata,omitempty"` + // Xendit-generated unique identifier for each payout + Id string `json:"id"` + // The time payout was created on Xendit's system, in ISO 8601 format + Created time.Time `json:"created"` + // The time payout was last updated on Xendit's system, in ISO 8601 format + Updated time.Time `json:"updated"` + // Xendit Business ID + BusinessId string `json:"business_id"` + // Status of payout + Status string `json:"status"` + // If the Payout failed, we include a failure code for more details on the failure. + FailureCode *string `json:"failure_code,omitempty"` + // Our estimated time on to when your payout is reflected to the destination account + EstimatedArrivalTime *time.Time `json:"estimated_arrival_time,omitempty"` +} + +// NewPayout instantiates a new Payout object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPayout(referenceId string, channelCode string, channelProperties DigitalPayoutChannelProperties, amount float32, currency string, id string, created time.Time, updated time.Time, businessId string, status string) *Payout { + this := Payout{} + this.ReferenceId = referenceId + this.ChannelCode = channelCode + this.ChannelProperties = channelProperties + this.Amount = amount + this.Currency = currency + this.Id = id + this.Created = created + this.Updated = updated + this.BusinessId = businessId + this.Status = status + return &this +} + +// NewPayoutWithDefaults instantiates a new Payout object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayoutWithDefaults() *Payout { + this := Payout{} + return &this +} + +// GetReferenceId returns the ReferenceId field value +func (o *Payout) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *Payout) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *Payout) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetChannelCode returns the ChannelCode field value +func (o *Payout) GetChannelCode() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *Payout) GetChannelCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *Payout) SetChannelCode(v string) { + o.ChannelCode = v +} + +// GetChannelProperties returns the ChannelProperties field value +func (o *Payout) GetChannelProperties() DigitalPayoutChannelProperties { + if o == nil { + var ret DigitalPayoutChannelProperties + return ret + } + + return o.ChannelProperties +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value +// and a boolean to check if the value has been set. +func (o *Payout) GetChannelPropertiesOk() (*DigitalPayoutChannelProperties, bool) { + if o == nil { + return nil, false + } + return &o.ChannelProperties, true +} + +// SetChannelProperties sets field value +func (o *Payout) SetChannelProperties(v DigitalPayoutChannelProperties) { + o.ChannelProperties = v +} + +// GetAmount returns the Amount field value +func (o *Payout) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *Payout) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *Payout) SetAmount(v float32) { + o.Amount = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Payout) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payout) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Payout) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Payout) SetDescription(v string) { + o.Description = &v +} + +// GetCurrency returns the Currency field value +func (o *Payout) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Payout) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Payout) SetCurrency(v string) { + o.Currency = v +} + +// GetReceiptNotification returns the ReceiptNotification field value if set, zero value otherwise. +func (o *Payout) GetReceiptNotification() ReceiptNotification { + if o == nil || utils.IsNil(o.ReceiptNotification) { + var ret ReceiptNotification + return ret + } + return *o.ReceiptNotification +} + +// GetReceiptNotificationOk returns a tuple with the ReceiptNotification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payout) GetReceiptNotificationOk() (*ReceiptNotification, bool) { + if o == nil || utils.IsNil(o.ReceiptNotification) { + return nil, false + } + return o.ReceiptNotification, true +} + +// HasReceiptNotification returns a boolean if a field has been set. +func (o *Payout) HasReceiptNotification() bool { + if o != nil && !utils.IsNil(o.ReceiptNotification) { + return true + } + + return false +} + +// SetReceiptNotification gets a reference to the given ReceiptNotification and assigns it to the ReceiptNotification field. +func (o *Payout) SetReceiptNotification(v ReceiptNotification) { + o.ReceiptNotification = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Payout) GetMetadata() map[string]interface{} { + if o == nil || utils.IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payout) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Payout) HasMetadata() bool { + if o != nil && !utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Payout) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetId returns the Id field value +func (o *Payout) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Payout) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Payout) SetId(v string) { + o.Id = v +} + +// GetCreated returns the Created field value +func (o *Payout) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Payout) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Payout) SetCreated(v time.Time) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *Payout) GetUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *Payout) GetUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *Payout) SetUpdated(v time.Time) { + o.Updated = v +} + +// GetBusinessId returns the BusinessId field value +func (o *Payout) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *Payout) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *Payout) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetStatus returns the Status field value +func (o *Payout) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Payout) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Payout) SetStatus(v string) { + o.Status = v +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise. +func (o *Payout) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode) { + var ret string + return ret + } + return *o.FailureCode +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payout) GetFailureCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureCode) { + return nil, false + } + return o.FailureCode, true +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *Payout) HasFailureCode() bool { + if o != nil && !utils.IsNil(o.FailureCode) { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given string and assigns it to the FailureCode field. +func (o *Payout) SetFailureCode(v string) { + o.FailureCode = &v +} + +// GetEstimatedArrivalTime returns the EstimatedArrivalTime field value if set, zero value otherwise. +func (o *Payout) GetEstimatedArrivalTime() time.Time { + if o == nil || utils.IsNil(o.EstimatedArrivalTime) { + var ret time.Time + return ret + } + return *o.EstimatedArrivalTime +} + +// GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Payout) GetEstimatedArrivalTimeOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.EstimatedArrivalTime) { + return nil, false + } + return o.EstimatedArrivalTime, true +} + +// HasEstimatedArrivalTime returns a boolean if a field has been set. +func (o *Payout) HasEstimatedArrivalTime() bool { + if o != nil && !utils.IsNil(o.EstimatedArrivalTime) { + return true + } + + return false +} + +// SetEstimatedArrivalTime gets a reference to the given time.Time and assigns it to the EstimatedArrivalTime field. +func (o *Payout) SetEstimatedArrivalTime(v time.Time) { + o.EstimatedArrivalTime = &v +} + +func (o Payout) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Payout) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["reference_id"] = o.ReferenceId + toSerialize["channel_code"] = o.ChannelCode + toSerialize["channel_properties"] = o.ChannelProperties + toSerialize["amount"] = o.Amount + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["currency"] = o.Currency + if !utils.IsNil(o.ReceiptNotification) { + toSerialize["receipt_notification"] = o.ReceiptNotification + } + if !utils.IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["id"] = o.Id + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + toSerialize["business_id"] = o.BusinessId + toSerialize["status"] = o.Status + if !utils.IsNil(o.FailureCode) { + toSerialize["failure_code"] = o.FailureCode + } + if !utils.IsNil(o.EstimatedArrivalTime) { + toSerialize["estimated_arrival_time"] = o.EstimatedArrivalTime + } + return toSerialize, nil +} + +type NullablePayout struct { + value *Payout + isSet bool +} + +func (v NullablePayout) Get() *Payout { + return v.value +} + +func (v *NullablePayout) Set(val *Payout) { + v.value = val + v.isSet = true +} + +func (v NullablePayout) IsSet() bool { + return v.isSet +} + +func (v *NullablePayout) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayout(val *Payout) *NullablePayout { + return &NullablePayout{value: val, isSet: true} +} + +func (v NullablePayout) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayout) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_payout_all_of.go b/payout/model_payout_all_of.go new file mode 100644 index 00000000..71523e26 --- /dev/null +++ b/payout/model_payout_all_of.go @@ -0,0 +1,309 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + + "time" +) + +// checks if the PayoutAllOf type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PayoutAllOf{} + +// PayoutAllOf struct for PayoutAllOf +type PayoutAllOf struct { + // Xendit-generated unique identifier for each payout + Id string `json:"id"` + // The time payout was created on Xendit's system, in ISO 8601 format + Created time.Time `json:"created"` + // The time payout was last updated on Xendit's system, in ISO 8601 format + Updated time.Time `json:"updated"` + // Xendit Business ID + BusinessId string `json:"business_id"` + // Status of payout + Status string `json:"status"` + // If the Payout failed, we include a failure code for more details on the failure. + FailureCode *string `json:"failure_code,omitempty"` + // Our estimated time on to when your payout is reflected to the destination account + EstimatedArrivalTime *time.Time `json:"estimated_arrival_time,omitempty"` +} + +// NewPayoutAllOf instantiates a new PayoutAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPayoutAllOf(id string, created time.Time, updated time.Time, businessId string, status string) *PayoutAllOf { + this := PayoutAllOf{} + this.Id = id + this.Created = created + this.Updated = updated + this.BusinessId = businessId + this.Status = status + return &this +} + +// NewPayoutAllOfWithDefaults instantiates a new PayoutAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPayoutAllOfWithDefaults() *PayoutAllOf { + this := PayoutAllOf{} + return &this +} + +// GetId returns the Id field value +func (o *PayoutAllOf) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PayoutAllOf) SetId(v string) { + o.Id = v +} + +// GetCreated returns the Created field value +func (o *PayoutAllOf) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *PayoutAllOf) SetCreated(v time.Time) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *PayoutAllOf) GetUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *PayoutAllOf) SetUpdated(v time.Time) { + o.Updated = v +} + +// GetBusinessId returns the BusinessId field value +func (o *PayoutAllOf) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *PayoutAllOf) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetStatus returns the Status field value +func (o *PayoutAllOf) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *PayoutAllOf) SetStatus(v string) { + o.Status = v +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise. +func (o *PayoutAllOf) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode) { + var ret string + return ret + } + return *o.FailureCode +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetFailureCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureCode) { + return nil, false + } + return o.FailureCode, true +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *PayoutAllOf) HasFailureCode() bool { + if o != nil && !utils.IsNil(o.FailureCode) { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given string and assigns it to the FailureCode field. +func (o *PayoutAllOf) SetFailureCode(v string) { + o.FailureCode = &v +} + +// GetEstimatedArrivalTime returns the EstimatedArrivalTime field value if set, zero value otherwise. +func (o *PayoutAllOf) GetEstimatedArrivalTime() time.Time { + if o == nil || utils.IsNil(o.EstimatedArrivalTime) { + var ret time.Time + return ret + } + return *o.EstimatedArrivalTime +} + +// GetEstimatedArrivalTimeOk returns a tuple with the EstimatedArrivalTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PayoutAllOf) GetEstimatedArrivalTimeOk() (*time.Time, bool) { + if o == nil || utils.IsNil(o.EstimatedArrivalTime) { + return nil, false + } + return o.EstimatedArrivalTime, true +} + +// HasEstimatedArrivalTime returns a boolean if a field has been set. +func (o *PayoutAllOf) HasEstimatedArrivalTime() bool { + if o != nil && !utils.IsNil(o.EstimatedArrivalTime) { + return true + } + + return false +} + +// SetEstimatedArrivalTime gets a reference to the given time.Time and assigns it to the EstimatedArrivalTime field. +func (o *PayoutAllOf) SetEstimatedArrivalTime(v time.Time) { + o.EstimatedArrivalTime = &v +} + +func (o PayoutAllOf) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PayoutAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + toSerialize["business_id"] = o.BusinessId + toSerialize["status"] = o.Status + if !utils.IsNil(o.FailureCode) { + toSerialize["failure_code"] = o.FailureCode + } + if !utils.IsNil(o.EstimatedArrivalTime) { + toSerialize["estimated_arrival_time"] = o.EstimatedArrivalTime + } + return toSerialize, nil +} + +type NullablePayoutAllOf struct { + value *PayoutAllOf + isSet bool +} + +func (v NullablePayoutAllOf) Get() *PayoutAllOf { + return v.value +} + +func (v *NullablePayoutAllOf) Set(val *PayoutAllOf) { + v.value = val + v.isSet = true +} + +func (v NullablePayoutAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullablePayoutAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePayoutAllOf(val *PayoutAllOf) *NullablePayoutAllOf { + return &NullablePayoutAllOf{value: val, isSet: true} +} + +func (v NullablePayoutAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePayoutAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/model_receipt_notification.go b/payout/model_receipt_notification.go new file mode 100644 index 00000000..382e52fb --- /dev/null +++ b/payout/model_receipt_notification.go @@ -0,0 +1,208 @@ +/* +Payout Service + +This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package payout + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the ReceiptNotification type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &ReceiptNotification{} + +// ReceiptNotification Additional notification for completed payout +type ReceiptNotification struct { + // Valid email address to send the payout receipt + EmailTo []string `json:"email_to,omitempty"` + // Valid email address to cc the payout receipt + EmailCc []string `json:"email_cc,omitempty"` + // Valid email address to bcc the payout receipt + EmailBcc []string `json:"email_bcc,omitempty"` +} + +// NewReceiptNotification instantiates a new ReceiptNotification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiptNotification() *ReceiptNotification { + this := ReceiptNotification{} + return &this +} + +// NewReceiptNotificationWithDefaults instantiates a new ReceiptNotification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiptNotificationWithDefaults() *ReceiptNotification { + this := ReceiptNotification{} + return &this +} + +// GetEmailTo returns the EmailTo field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ReceiptNotification) GetEmailTo() []string { + if o == nil { + var ret []string + return ret + } + return o.EmailTo +} + +// GetEmailToOk returns a tuple with the EmailTo field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ReceiptNotification) GetEmailToOk() ([]string, bool) { + if o == nil || utils.IsNil(o.EmailTo) { + return nil, false + } + return o.EmailTo, true +} + +// HasEmailTo returns a boolean if a field has been set. +func (o *ReceiptNotification) HasEmailTo() bool { + if o != nil && utils.IsNil(o.EmailTo) { + return true + } + + return false +} + +// SetEmailTo gets a reference to the given []string and assigns it to the EmailTo field. +func (o *ReceiptNotification) SetEmailTo(v []string) { + o.EmailTo = v +} + +// GetEmailCc returns the EmailCc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ReceiptNotification) GetEmailCc() []string { + if o == nil { + var ret []string + return ret + } + return o.EmailCc +} + +// GetEmailCcOk returns a tuple with the EmailCc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ReceiptNotification) GetEmailCcOk() ([]string, bool) { + if o == nil || utils.IsNil(o.EmailCc) { + return nil, false + } + return o.EmailCc, true +} + +// HasEmailCc returns a boolean if a field has been set. +func (o *ReceiptNotification) HasEmailCc() bool { + if o != nil && utils.IsNil(o.EmailCc) { + return true + } + + return false +} + +// SetEmailCc gets a reference to the given []string and assigns it to the EmailCc field. +func (o *ReceiptNotification) SetEmailCc(v []string) { + o.EmailCc = v +} + +// GetEmailBcc returns the EmailBcc field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ReceiptNotification) GetEmailBcc() []string { + if o == nil { + var ret []string + return ret + } + return o.EmailBcc +} + +// GetEmailBccOk returns a tuple with the EmailBcc field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ReceiptNotification) GetEmailBccOk() ([]string, bool) { + if o == nil || utils.IsNil(o.EmailBcc) { + return nil, false + } + return o.EmailBcc, true +} + +// HasEmailBcc returns a boolean if a field has been set. +func (o *ReceiptNotification) HasEmailBcc() bool { + if o != nil && utils.IsNil(o.EmailBcc) { + return true + } + + return false +} + +// SetEmailBcc gets a reference to the given []string and assigns it to the EmailBcc field. +func (o *ReceiptNotification) SetEmailBcc(v []string) { + o.EmailBcc = v +} + +func (o ReceiptNotification) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReceiptNotification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.EmailTo != nil { + toSerialize["email_to"] = o.EmailTo + } + if o.EmailCc != nil { + toSerialize["email_cc"] = o.EmailCc + } + if o.EmailBcc != nil { + toSerialize["email_bcc"] = o.EmailBcc + } + return toSerialize, nil +} + +type NullableReceiptNotification struct { + value *ReceiptNotification + isSet bool +} + +func (v NullableReceiptNotification) Get() *ReceiptNotification { + return v.value +} + +func (v *NullableReceiptNotification) Set(val *ReceiptNotification) { + v.value = val + v.isSet = true +} + +func (v NullableReceiptNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiptNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiptNotification(val *ReceiptNotification) *NullableReceiptNotification { + return &NullableReceiptNotification{value: val, isSet: true} +} + +func (v NullableReceiptNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiptNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payout/nullable.go b/payout/nullable.go new file mode 100644 index 00000000..2513ea84 --- /dev/null +++ b/payout/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package payout + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/payout/params.go b/payout/params.go deleted file mode 100644 index bfedbd99..00000000 --- a/payout/params.go +++ /dev/null @@ -1,19 +0,0 @@ -package payout - -// CreateParams contains parameters for Create -type CreateParams struct { - IdempotencyKey string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - Email string `json:"email" validate:"required"` -} - -// GetParams contains parameters for Get -type GetParams struct { - ID string `json:"id" validate:"required"` -} - -// VoidParams contains parameters for Get -type VoidParams struct { - ID string `json:"id" validate:"required"` -} diff --git a/payout/payout.go b/payout/payout.go deleted file mode 100644 index 001be66f..00000000 --- a/payout/payout.go +++ /dev/null @@ -1,59 +0,0 @@ -package payout - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new payout -func Create(data *CreateParams) (*xendit.Payout, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new payout with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.Payout, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// Get gets one payout -func Get(data *GetParams) (*xendit.Payout, *xendit.Error) { - return GetWithContext(context.Background(), data) -} - -// GetWithContext gets one payout with context -func GetWithContext(ctx context.Context, data *GetParams) (*xendit.Payout, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetWithContext(ctx, data) -} - -// Void voids the created payout -func Void(data *VoidParams) (*xendit.Payout, *xendit.Error) { - return VoidWithContext(context.Background(), data) -} - -// VoidWithContext voids the created payout with context -func VoidWithContext(ctx context.Context, data *VoidParams) (*xendit.Payout, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.VoidWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/payout/payout_test.go b/payout/payout_test.go deleted file mode 100644 index c63ddf83..00000000 --- a/payout/payout_test.go +++ /dev/null @@ -1,220 +0,0 @@ -package payout_test - -import ( - "context" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/payout" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - result.(*xendit.Payout).ID = "123" - result.(*xendit.Payout).ExternalID = "payout-external-id" - result.(*xendit.Payout).Amount = 200000 - result.(*xendit.Payout).Status = "ISSUED" - result.(*xendit.Payout).Created = &date - result.(*xendit.Payout).ExpirationTimestamp = &date - result.(*xendit.Payout).MerchantName = "Business Name" - result.(*xendit.Payout).PayoutURL = "https://payout-url.com/123" - - return nil -} - -func TestCreatePayout(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *payout.CreateParams - expectedRes *xendit.Payout - expectedErr *xendit.Error - }{ - { - desc: "should create an payout", - data: &payout.CreateParams{ - IdempotencyKey: "unique-idempotency-key", - ExternalID: "payout-external-id", - Amount: 200000, - Email: "customer@customer.com", - }, - expectedRes: &xendit.Payout{ - ID: "123", - ExternalID: "payout-external-id", - Amount: 200000, - Status: "ISSUED", - Created: &date, - ExpirationTimestamp: &date, - MerchantName: "Business Name", - PayoutURL: "https://payout-url.com/123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &payout.CreateParams{ - ExternalID: "payout-external-id", - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Amount', 'Email'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/payouts", - xendit.Opt.SecretKey, - mock.Anything, - tC.data, - &xendit.Payout{}, - ).Return(nil) - - resp, err := payout.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetPayout(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *payout.GetParams - expectedRes *xendit.Payout - expectedErr *xendit.Error - }{ - { - desc: "should get an payout", - data: &payout.GetParams{ - ID: "123", - }, - expectedRes: &xendit.Payout{ - ID: "123", - ExternalID: "payout-external-id", - Amount: 200000, - Status: "ISSUED", - Created: &date, - ExpirationTimestamp: &date, - MerchantName: "Business Name", - PayoutURL: "https://payout-url.com/123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &payout.GetParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/payouts/123", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.Payout{}, - ).Return(nil) - - resp, err := payout.Get(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestVoidPayout(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *payout.VoidParams - expectedRes *xendit.Payout - expectedErr *xendit.Error - }{ - { - desc: "should void an payout", - data: &payout.VoidParams{ - ID: "123", - }, - expectedRes: &xendit.Payout{ - ID: "123", - ExternalID: "payout-external-id", - Amount: 200000, - Status: "ISSUED", - Created: &date, - ExpirationTimestamp: &date, - MerchantName: "Business Name", - PayoutURL: "https://payout-url.com/123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &payout.VoidParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/payouts/"+tC.data.ID+"/void", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.Payout{}, - ).Return(nil) - - resp, err := payout.Void(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/pmsv2/card/params.go b/pmsv2/card/params.go deleted file mode 100644 index 9721e376..00000000 --- a/pmsv2/card/params.go +++ /dev/null @@ -1,42 +0,0 @@ -package card - -type CardOnFileType string - -const ( - CustomerUnscheduledCOF CardOnFileType = "CUSTOMER_UNSCHEDULED" - MerchantUnscheduledCOF CardOnFileType = "MERCHANT_UNSCHEDULED" - RecurringCOF CardOnFileType = "RECURRING" -) - -type CreateMethod struct { - Currency *string `json:"currency"` - ChannelProperties *CardChannelProperties `json:"channel_properties"` - CardInformation *CardInformation `json:"card_information"` -} - -type Method CreateMethod - -type CardChannelProperties struct { - SkipThreeDSecure *bool `json:"skip_three_d_secure"` - SuccessReturnURL *string `json:"success_return_url"` - FailureReturnURL *string `json:"failure_return_url"` - CardOnFileType *string `json:"cardonfile_type"` -} - -type CardInformation struct { - CardNumber string `json:"card_number"` - ExpiryMonth string `json:"expiry_month"` - ExpiryYear string `json:"expiry_year"` - CardCVN *string `json:"cvv"` - CardholderName *string `json:"cardholder_name"` -} - -type BillingInformation struct { - Country string `json:"country"` - StreetLine1 *string `json:"street_line1"` - StreetLine2 *string `json:"street_line2"` - City *string `json:"city"` - ProvinceState *string `json:"province_state"` - Province *string `json:"province"` - PostalCode *string `json:"postal_code"` -} diff --git a/pmsv2/client.go b/pmsv2/client.go deleted file mode 100644 index 91338e7d..00000000 --- a/pmsv2/client.go +++ /dev/null @@ -1,300 +0,0 @@ -package pmsv2 - -import ( - "context" - "fmt" - "net/http" - "net/url" - "strconv" - "time" - - "github.com/xendit/xendit-go" -) - -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -func (c *Client) CreatePaymentMethod(data *CreatePaymentMethodParams) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.CreatePaymentMethodWithContext(context.Background(), data) -} - -func (c *Client) CreatePaymentMethodWithContext(ctx context.Context, data *CreatePaymentMethodParams) (*xendit.PaymentMethodResponse, *xendit.Error) { - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - if data.IdempotencyKey != "" { - header.Add("idempotency-key", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/v2/payment_methods", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) AuthPaymentMethod(data *ValidateOTPRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.AuthPaymentMethodWithContext(context.Background(), data) -} - -func (c *Client) AuthPaymentMethodWithContext(ctx context.Context, data *ValidateOTPRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - if data.IdempotencyKey != "" { - header.Add("idempotency-key", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/v2/payment_methods/%s/auth", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) ExpirePaymentMethod(data *ExpireRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.ExpirePaymentMethodWithContext(context.Background(), data) -} - -func (c *Client) ExpirePaymentMethodWithContext(ctx context.Context, data *ExpireRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - if data.IdempotencyKey != "" { - header.Add("idempotency-key", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/v2/payment_methods/%s/expire", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) RetrievePaymentMethod(data *RetrievePaymentMethodRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.RetrievePaymentMethodWithContext(context.Background(), data) -} - -func (c *Client) RetrievePaymentMethodWithContext(ctx context.Context, data *RetrievePaymentMethodRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/payment_methods/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) RetrieveAllPaymentMethods(data *RetrieveAllPaymentMethodsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.RetrieveAllPaymentMethodsWithContext(context.Background(), data) -} - -func (c *Client) RetrieveAllPaymentMethodsWithContext(ctx context.Context, data *RetrieveAllPaymentMethodsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - urlValues := &url.Values{} - for _, item := range data.ID { - urlValues.Add("id", string(item)) - } - for _, item := range data.Status { - urlValues.Add("status", string(item)) - } - addUrlValue(urlValues, "type", string(data.Type)) - addUrlValue(urlValues, "reusability", string(data.Reusability)) - addUrlValue(urlValues, "customer_id", data.CustomerID) - addUrlValue(urlValues, "business_id", data.BusinessID) - addUrlValue(urlValues, "after_id", data.AfterID) - addUrlValue(urlValues, "before_id", data.BeforeID) - if data.Limit != 0 { - addUrlValue(urlValues, "limit", strconv.Itoa(data.Limit)) - } - queryString := urlValues.Encode() - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/payment_methods?%s", c.Opt.XenditURL, queryString), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) UpdatePaymentMethod(data *UpdateRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.UpdatePaymentMethodWithContext(context.Background(), data) -} - -func (c *Client) UpdatePaymentMethodWithContext(ctx context.Context, data *UpdateRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - if data.IdempotencyKey != "" { - header.Add("idempotency-key", data.IdempotencyKey) - } - - err := c.APIRequester.Call( - ctx, - "PATCH", - fmt.Sprintf("%s/v2/payment_methods/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func (c *Client) RetrievePayments(data *RetrievePaymentsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return c.RetrievePaymentsWithContext(context.Background(), data) -} - -func (c *Client) RetrievePaymentsWithContext(ctx context.Context, data *RetrievePaymentsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - - response := &xendit.PaymentMethodResponse{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - urlValues := &url.Values{} - if !data.CreatedGTE.IsZero() { - addUrlValue(urlValues, "created[gte]", data.CreatedGTE.Format(time.RFC3339)) - } - if !data.CreatedLTE.IsZero() { - addUrlValue(urlValues, "created[lte]", data.CreatedLTE.Format(time.RFC3339)) - } - if !data.UpdatedGTE.IsZero() { - addUrlValue(urlValues, "created[lte]", data.UpdatedGTE.Format(time.RFC3339)) - } - if !data.UpdatedLTE.IsZero() { - addUrlValue(urlValues, "created[lte]", data.UpdatedLTE.Format(time.RFC3339)) - } - - for _, item := range data.PaymentMethodType { - urlValues.Add("payment_method_type", string(item)) - } - for _, item := range data.PaymentMethodID { - urlValues.Add("payment_method_id", string(item)) - } - for _, item := range data.PaymentRequestID { - urlValues.Add("payment_request_id", string(item)) - } - for _, item := range data.ChannelCode { - urlValues.Add("channel_code", string(item)) - } - for _, item := range data.Status { - urlValues.Add("status", string(item)) - } - for _, item := range data.Currency { - urlValues.Add("currency", string(item)) - } - for _, item := range data.ReferenceID { - urlValues.Add("reference_id", string(item)) - } - addUrlValue(urlValues, "after_id", data.AfterID) - addUrlValue(urlValues, "before_id", data.BeforeID) - if data.Limit != 0 { - addUrlValue(urlValues, "limit", strconv.Itoa(data.Limit)) - } - - queryString := urlValues.Encode() - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/v2/payment_methods/%s/payments?%s", c.Opt.XenditURL, data.ID, queryString), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -func addUrlValue(urlValues *url.Values, key string, data string) { - if data != "" { - urlValues.Add(key, string(data)) - } -} diff --git a/pmsv2/constant/params.go b/pmsv2/constant/params.go deleted file mode 100644 index 9d06d8ee..00000000 --- a/pmsv2/constant/params.go +++ /dev/null @@ -1,41 +0,0 @@ -package constant - -type PaymentMethodTypeEnum string -type ReusabilityEnum string -type CountryEnum string -type CurrencyEnum string -type TokenStatus string - -// This consists the values that PaymentMethodTypeEnum can take -const ( - PaymentMethodTypeEwallet PaymentMethodTypeEnum = "EWALLET" - PaymentMethodTypeDirectDebit PaymentMethodTypeEnum = "DIRECT_DEBIT" - PaymentMethodTypeOverTheCounter PaymentMethodTypeEnum = "OVER_THE_COUNTER" - PaymentMethodTypeQRCode PaymentMethodTypeEnum = "QR_CODE" - PaymentMethodTypeVirtualAccount PaymentMethodTypeEnum = "VIRTUAL_ACCOUNT" - PaymentMethodTypeCard PaymentMethodTypeEnum = "CARD" - - ReusabilityOneTimeUse ReusabilityEnum = "ONE_TIME_USE" - ReusabilityMultipleUse ReusabilityEnum = "MULTIPLE_USE" - - CountryPH CountryEnum = "PH" - CountryID CountryEnum = "ID" - CountryVN CountryEnum = "VN" - CountryTH CountryEnum = "TH" - - CurrencyPH CurrencyEnum = "PHP" - CurrencyIDR CurrencyEnum = "IDR" - CurrencyVND CurrencyEnum = "VND" - CurrencyTHB CurrencyEnum = "THB" -) - -type PaymentMethodStatusEnum string - -const ( - Active PaymentMethodStatusEnum = "ACTIVE" - Expired PaymentMethodStatusEnum = "EXPIRED" - Inactive PaymentMethodStatusEnum = "INACTIVE" - Pending PaymentMethodStatusEnum = "PENDING" - RequiresAction PaymentMethodStatusEnum = "REQUIRES_ACTION" - Failed PaymentMethodStatusEnum = "FAILED" -) diff --git a/pmsv2/directdebit/params.go b/pmsv2/directdebit/params.go deleted file mode 100644 index 368a31fb..00000000 --- a/pmsv2/directdebit/params.go +++ /dev/null @@ -1,46 +0,0 @@ -package directdebit - -type ChannelCode string -type ChannelProperties map[string]interface{} -type Type string - -const ( - // debit card - BRI ChannelCode = "BRI" - CIMBNIAGA ChannelCode = "CIMBNIAGA" - - // bank account - BPI ChannelCode = "BPI" - Unionbank ChannelCode = "UBP" - RCBC ChannelCode = "RCBC" - CHINABANK ChannelCode = "CHINABANK" - Mandiri ChannelCode = "MANDIRI" - - BBL ChannelCode = "BBL" - SCB ChannelCode = "SCB" - KTB ChannelCode = "KTB" - BAY ChannelCode = "BAY" -) - -const ( - BankAccountType Type = "BANK_ACCOUNT" - DebitCardType Type = "DEBIT_CARD" - BankRedirectType Type = "BANK_REDIRECT" -) - -type CreateMethod struct { - ChannelCode ChannelCode `json:"channel_code"` - ChannelProperties ChannelProperties `json:"channel_properties"` -} - -type BankAccount struct { - AccountNumber *string `json:"masked_bank_account_number"` - AccountHash *string `json:"bank_account_hash"` -} - -type DebitCard struct { - MobileNumber *string `json:"mobile_number"` - CardLastFour *string `json:"card_last_four"` - CardExpiry *string `json:"card_expiry"` - Email *string `json:"email"` -} diff --git a/pmsv2/ewallet/params.go b/pmsv2/ewallet/params.go deleted file mode 100644 index 9d824baf..00000000 --- a/pmsv2/ewallet/params.go +++ /dev/null @@ -1,31 +0,0 @@ -package ewallet - -type ChannelCode string - -type ChannelProperties map[string]interface{} - -const ( - Grabpay ChannelCode = "GRABPAY" - Paymaya ChannelCode = "PAYMAYA" - Gcash ChannelCode = "GCASH" - OVO ChannelCode = "OVO" - DANA ChannelCode = "DANA" - LinkAja ChannelCode = "LINKAJA" - Shopeepay ChannelCode = "SHOPEEPAY" - Sakuku ChannelCode = "SAKUKU" - Nexcash ChannelCode = "NEXCASH" - Astrapay ChannelCode = "ASTRAPAY" - Jeniuspay ChannelCode = "JENIUSPAY" -) - -type CreateMethod struct { - ChannelCode ChannelCode `json:"channel_code"` - ChannelProperties ChannelProperties `json:"channel_properties"` -} - -type Account struct { - Name *string `json:"name"` - AccountDetails *string `json:"account_details"` - Balance float64 `json:"balance"` - PointBalance float64 `json:"point_balance"` -} diff --git a/pmsv2/example_test.go b/pmsv2/example_test.go deleted file mode 100644 index c24af3c2..00000000 --- a/pmsv2/example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -package pmsv2_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/pmsv2" -) - -func ExampleCreatePaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.CreatePaymentMethodParams{} - - resp, err := pmsv2.CreatePaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleAuthPaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.ValidateOTPRequest{} - - resp, err := pmsv2.AuthPaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleExpirePaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.ExpireRequest{} - - resp, err := pmsv2.ExpirePaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleRetrievePaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.RetrievePaymentMethodRequest{} - - resp, err := pmsv2.RetrievePaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleRetrieveAllPaymentMethods() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.RetrieveAllPaymentMethodsRequest{} - - resp, err := pmsv2.RetrieveAllPaymentMethods(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleUpdatePaymentMethod() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.UpdateRequest{} - - resp, err := pmsv2.UpdatePaymentMethod(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} - -func ExampleRetrievePayments() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := pmsv2.RetrievePaymentsRequest{} - - resp, err := pmsv2.RetrievePayments(&data) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created payment: %+v\n", resp) -} diff --git a/pmsv2/overthecounter/params.go b/pmsv2/overthecounter/params.go deleted file mode 100644 index 8b400609..00000000 --- a/pmsv2/overthecounter/params.go +++ /dev/null @@ -1,55 +0,0 @@ -package overthecounter - -import ( - "time" - - "github.com/xendit/xendit-go/pmsv2/constant" -) - -type ChannelCode string - -const ( - // PH - SevenEleven ChannelCode = "7ELEVEN" - SevenElevenCliqq ChannelCode = "7ELEVEN_CLIQQ" - Cebuana ChannelCode = "CEBUANA" - ECPay ChannelCode = "ECPAY" - - // PH DragonPay - Palawan ChannelCode = "PALAWAN" - MLhuiller ChannelCode = "MLHUILLIER" - ECPayDragonLoan ChannelCode = "ECPAY_DRAGONLOAN" - LBC ChannelCode = "LBC" - RDPawnshop ChannelCode = "RD_PAWNSHOP" - CVM ChannelCode = "CVM" - ECPaySchool ChannelCode = "ECPAY_SCHOOL" - USSC ChannelCode = "USSC" - - // ID - Alfamart ChannelCode = "ALFAMART" - Indomaret ChannelCode = "INDOMARET" -) - -type ChannelProperties struct { - CustomerName string `json:"customer_name"` - PaymentCode *string `json:"payment_code,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` -} - -type CreateMethod struct { - Amount *float64 `json:"amount,omitempty"` - Currency *constant.CurrencyEnum `json:"currency,omitempty"` - ChannelCode ChannelCode `json:"channel_code"` - ChannelProperties ChannelProperties `json:"channel_properties"` -} - -type MutableMethod struct { - Amount *float64 `json:"amount,omitempty"` - Currency *string `json:"currency,omitempty"` - ChannelProperties *MutableChannelProperties `json:"channel_properties,omitempty"` -} - -type MutableChannelProperties struct { - CustomerName *string `json:"customer_name,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` -} diff --git a/pmsv2/params.go b/pmsv2/params.go deleted file mode 100644 index b7fc4a60..00000000 --- a/pmsv2/params.go +++ /dev/null @@ -1,108 +0,0 @@ -package pmsv2 - -import ( - "time" - - "github.com/xendit/xendit-go/pmsv2/card" - "github.com/xendit/xendit-go/pmsv2/constant" - "github.com/xendit/xendit-go/pmsv2/directdebit" - "github.com/xendit/xendit-go/pmsv2/ewallet" - "github.com/xendit/xendit-go/pmsv2/overthecounter" - "github.com/xendit/xendit-go/pmsv2/qrcode" - "github.com/xendit/xendit-go/pmsv2/virtualaccount" -) - -type CreatePaymentMethodParams struct { - Type constant.PaymentMethodTypeEnum `json:"type"` - Country constant.CountryEnum `json:"country,omitempty"` - CustomerID *string `json:"customer_id,omitempty"` - ReferenceID *string `json:"reference_id,omitempty"` - Reusability constant.ReusabilityEnum `json:"reusability"` - Description *string `json:"description,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - BillingInformation *card.BillingInformation `json:"billing_information,omitempty"` - - Card *card.CreateMethod `json:"card,omitempty"` - DirectDebit *directdebit.CreateMethod `json:"direct_debit,omitempty"` - Ewallet *ewallet.CreateMethod `json:"ewallet,omitempty"` - OverTheCounter *overthecounter.CreateMethod `json:"over_the_counter,omitempty"` - VirtualAccount *virtualaccount.CreateMethod `json:"virtual_account,omitempty"` - QRCode *qrcode.CreateMethod `json:"qr_code,omitempty"` - - ForUserID string `json:"-"` - IdempotencyKey string `json:"-"` -} - -type ValidateOTPRequest struct { - ID string `param:"id"` - Code string `json:"auth_code"` - - ForUserID string `json:"-"` - IdempotencyKey string `json:"-"` -} - -type ExpireRequest struct { - ID string `json:"-"` - - ForUserID string `json:"-"` - IdempotencyKey string `json:"-"` -} - -type RetrievePaymentMethodRequest struct { - ID string `json:"-"` - - ForUserID string `json:"-"` -} - -type RetrieveAllPaymentMethodsRequest struct { - ID []string `query:"id"` - Type constant.PaymentMethodTypeEnum `query:"type"` - Status []constant.PaymentMethodStatusEnum `query:"status"` - Reusability constant.ReusabilityEnum `query:"reusability"` - CustomerID string `query:"customer_id"` - BusinessID string `query:"business_id"` - ReferenceID string `query:"reference_id"` - AfterID string `query:"after_id"` - BeforeID string `query:"before_id"` - Limit int `query:"limit"` - - ForUserID string `json:"-"` -} - -type UpdateRequest struct { - ReferenceID *string `json:"reference_id,omitempty"` - Description *string `json:"description,omitempty"` - Status *constant.PaymentMethodStatusEnum `json:"status,omitempty"` - Reusability *constant.ReusabilityEnum `json:"reusability,omitempty"` - OverTheCounter *overthecounter.MutableMethod `json:"over_the_counter,omitempty"` - VirtualAccount *virtualaccount.MutableMethod `json:"virtual_account,omitempty"` - - ID string `json:"-"` - - ForUserID string `json:"-"` - IdempotencyKey string `json:"-"` -} - -type RetrievePaymentsRequest struct { - ID string `json:"-"` - CreatedGTE time.Time `query:"created[gte]" url:"created[gte],omitempty"` - CreatedLTE time.Time `query:"created[lte]" url:"created[lte],omitempty"` - UpdatedGTE time.Time `query:"updated[gte]" url:"updated[gte],omitempty"` - UpdatedLTE time.Time `query:"updated[lte]" url:"updated[lte],omitempty"` - PaymentMethodType []string `query:"payment_method_type" url:"payment_method_type,omitempty"` - PaymentMethodID []string `query:"payment_method_id" url:"payment_method_id,omitempty"` - PaymentRequestID []string `query:"payment_request_id" url:"payment_request_id,omitempty"` - ChannelCode []string `query:"channel_code" url:"channel_code,omitempty"` - Status []string `query:"status" url:"status,omitempty"` - Currency []string `query:"currency" url:"currency,omitempty"` - ReferenceID []string `query:"reference_id" url:"reference_id,omitempty"` - PaginationFilters - - ForUserID string `json:"-"` -} - -type PaginationFilters struct { - BeforeID string `query:"before_id" url:"before_id,omitempty"` - AfterID string `query:"after_id" url:"after_id,omitempty"` - Limit int `query:"limit" url:"limit,omitempty"` -} diff --git a/pmsv2/payment_method.go b/pmsv2/payment_method.go deleted file mode 100644 index d7eb0df6..00000000 --- a/pmsv2/payment_method.go +++ /dev/null @@ -1,105 +0,0 @@ -package pmsv2 - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -func CreatePaymentMethod(data *CreatePaymentMethodParams) (*xendit.PaymentMethodResponse, *xendit.Error) { - return CreatePaymentMethodWithContext(context.Background(), data) -} - -func CreatePaymentMethodWithContext(ctx context.Context, data *CreatePaymentMethodParams) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreatePaymentMethodWithContext(ctx, data) -} - -func AuthPaymentMethod(data *ValidateOTPRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return AuthPaymentMethodWithContext(context.Background(), data) -} - -func AuthPaymentMethodWithContext(ctx context.Context, data *ValidateOTPRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.AuthPaymentMethodWithContext(ctx, data) -} - -func ExpirePaymentMethod(data *ExpireRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return ExpirePaymentMethodWithContext(context.Background(), data) -} - -func ExpirePaymentMethodWithContext(ctx context.Context, data *ExpireRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ExpirePaymentMethodWithContext(ctx, data) -} - -func RetrievePaymentMethod(data *RetrievePaymentMethodRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return RetrievePaymentMethodWithContext(context.Background(), data) -} - -func RetrievePaymentMethodWithContext(ctx context.Context, data *RetrievePaymentMethodRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.RetrievePaymentMethodWithContext(ctx, data) -} - -func RetrieveAllPaymentMethods(data *RetrieveAllPaymentMethodsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return RetrieveAllPaymentMethodsWithContext(context.Background(), data) -} - -func RetrieveAllPaymentMethodsWithContext(ctx context.Context, data *RetrieveAllPaymentMethodsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.RetrieveAllPaymentMethodsWithContext(ctx, data) -} - -func UpdatePaymentMethod(data *UpdateRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return UpdatePaymentMethodWithContext(context.Background(), data) -} - -func UpdatePaymentMethodWithContext(ctx context.Context, data *UpdateRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.UpdatePaymentMethodWithContext(ctx, data) -} - -func RetrievePayments(data *RetrievePaymentsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - return RetrievePaymentsWithContext(context.Background(), data) -} - -func RetrievePaymentsWithContext(ctx context.Context, data *RetrievePaymentsRequest) (*xendit.PaymentMethodResponse, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.RetrievePaymentsWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/pmsv2/payment_method_test.go b/pmsv2/payment_method_test.go deleted file mode 100644 index a917e39f..00000000 --- a/pmsv2/payment_method_test.go +++ /dev/null @@ -1,443 +0,0 @@ -package pmsv2 - -import ( - "context" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/pmsv2/constant" - "github.com/xendit/xendit-go/pmsv2/ewallet" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, header, params, result) - - result.(*xendit.PaymentMethodResponse).Type = constant.PaymentMethodTypeEwallet - result.(*xendit.PaymentMethodResponse).Country = constant.CountryPH - result.(*xendit.PaymentMethodResponse).ReferenceID = "reference_id" - result.(*xendit.PaymentMethodResponse).Reusability = constant.ReusabilityMultipleUse - - ewallet := &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - } - - result.(*xendit.PaymentMethodResponse).Ewallet = ewallet - - return nil -} - -func TestCreatePaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - referenceID := "reference_id" - - testCases := []struct { - desc string - data *CreatePaymentMethodParams - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should create a payment", - data: &CreatePaymentMethodParams{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: &referenceID, - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &ewallet.CreateMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - }, - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/v2/payment_methods", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := CreatePaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestAuthPaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *ValidateOTPRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should auth", - data: &ValidateOTPRequest{ - ID: "id", - Code: "auth", - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/v2/payment_methods/id/auth", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := AuthPaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestExpirePaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *ExpireRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should auth", - data: &ExpireRequest{ - ID: "id", - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/v2/payment_methods/id/expire", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := ExpirePaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetPaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *RetrievePaymentMethodRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should get a payment method", - data: &RetrievePaymentMethodRequest{ - ID: "id", - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/payment_methods/id", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - nil, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := RetrievePaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetPaymentMethods(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *RetrieveAllPaymentMethodsRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should get payment methods", - data: &RetrieveAllPaymentMethodsRequest{}, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/payment_methods?", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - nil, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := RetrieveAllPaymentMethods(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestUpdatePaymentMethod(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - status := constant.Active - testCases := []struct { - desc string - data *UpdateRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should update", - data: &UpdateRequest{ - ID: "id", - Status: &status, - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "PATCH", - xendit.Opt.XenditURL+"/v2/payment_methods/id", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - tC.data, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := UpdatePaymentMethod(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestRetrievePayments(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *RetrievePaymentsRequest - expectedRes *xendit.PaymentMethodResponse - expectedErr *xendit.Error - }{ - { - desc: "should get a payment method", - data: &RetrievePaymentsRequest{ - ID: "id", - PaginationFilters: PaginationFilters{ - Limit: 5, - }, - }, - expectedRes: &xendit.PaymentMethodResponse{ - Type: constant.PaymentMethodTypeEwallet, - Country: constant.CountryPH, - CustomerID: nil, - ReferenceID: "reference_id", - Reusability: constant.ReusabilityMultipleUse, - Description: nil, - Metadata: nil, - - Ewallet: &xendit.EwalletMethod{ - ChannelCode: ewallet.Astrapay, - ChannelProperties: ewallet.ChannelProperties{}, - Account: ewallet.Account{}, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/v2/payment_methods/id/payments?limit=5", - xendit.Opt.SecretKey, - mock.AnythingOfType("http.Header"), - nil, - &xendit.PaymentMethodResponse{}, - ).Return(nil) - - resp, err := RetrievePayments(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/pmsv2/qrcode/params.go b/pmsv2/qrcode/params.go deleted file mode 100644 index 7318f061..00000000 --- a/pmsv2/qrcode/params.go +++ /dev/null @@ -1,33 +0,0 @@ -package qrcode - -import ( - "time" - - "github.com/xendit/xendit-go/pmsv2/constant" -) - -type ChannelCode string - -const ( - QRIS ChannelCode = "QRIS" - DANA ChannelCode = "DANA" - RCBC ChannelCode = "RCBC" - PromptPay ChannelCode = "PROMPTPAY" -) - -const ( - EMPTY ChannelCode = "" - LinkAja ChannelCode = "LINKAJA" -) - -type ChannelProperties struct { - QRString string `json:"qr_string"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` -} - -type CreateMethod struct { - Amount *float64 `json:"amount,omitempty"` - Currency *constant.CurrencyEnum `json:"currency,omitempty"` - ChannelCode ChannelCode `json:"channel_code"` - ChannelProperties ChannelProperties `json:"channel_properties"` -} diff --git a/pmsv2/virtualaccount/params.go b/pmsv2/virtualaccount/params.go deleted file mode 100644 index fd8c7b78..00000000 --- a/pmsv2/virtualaccount/params.go +++ /dev/null @@ -1,49 +0,0 @@ -package virtualaccount - -import ( - "time" - - "github.com/xendit/xendit-go/pmsv2/constant" -) - -type ChannelCode string - -const ( - BCA ChannelCode = "BCA" - BJB ChannelCode = "BJB" - BNI ChannelCode = "BNI" - BRI ChannelCode = "BRI" - MANDIRI ChannelCode = "MANDIRI" - PERMATA ChannelCode = "PERMATA" - BSI ChannelCode = "BSI" - CIMB ChannelCode = "CIMB" - SAHABAT_SAMPOERNA ChannelCode = "SAHABAT_SAMPOERNA" -) - -type ChannelProperties struct { - CustomerName string `json:"customer_name"` - VirtualAccountNumber *string `json:"virtual_account_number,omitempty"` - ExpiresAt *time.Time `json:"expires_at,omitempty"` - SuggestedAmount *float64 `json:"suggested_amount,omitempty"` -} - -type CreateMethod struct { - Amount *float64 `json:"amount,omitempty"` - MinimumAmount *float64 `json:"min_amount,omitempty"` - MaximumAmount *float64 `json:"max_amount,omitempty"` - Currency *constant.CurrencyEnum `json:"currency,omitempty"` - ChannelCode ChannelCode `json:"channel_code"` - ChannelProperties ChannelProperties `json:"channel_properties"` -} - -type MutableMethod struct { - Amount *float64 `json:"amount,omitempty"` - MinimumAmount *float64 `json:"min_amount,omitempty"` - MaximumAmount *float64 `json:"max_amount,omitempty"` - ChannelProperties *MutableChannelProperties `json:"channel_properties,omitempty"` -} - -type MutableChannelProperties struct { - ExpiresAt *time.Time `json:"expires_at,omitempty"` - SuggestedAmount *int64 `json:"suggested_amount,omitempty"` -} diff --git a/promotion.go b/promotion.go deleted file mode 100644 index c1b1e4e1..00000000 --- a/promotion.go +++ /dev/null @@ -1,30 +0,0 @@ -package xendit - -import "time" - -// Promotion contains data from Xendit's API response of promotion-related request. -// For more details see https://xendit.github.io/apireference/?bash#create-promotion. -type Promotion struct { - ID string `json:"id"` - BusinessID string `json:"business_id"` - Status string `json:"status"` - ReferenceID string `json:"reference_id"` - Description string `json:"description"` - PromoCode string `json:"promo_code"` - BinList []string `json:"bin_list"` - ChannelCode string `json:"channel_code"` - DiscountPercent float64 `json:"discount_percent"` - DiscountAmount float64 `json:"discount_amount"` - Currency string `json:"currency"` - StartTime *time.Time `json:"start_time"` - EndTime *time.Time `json:"end_time"` - MinOriginalAmount float64 `json:"min_original_amount"` - MaxDiscountAmount float64 `json:"max_discount_amount"` -} - -// PromotionDeletion contains data from Xendit's API response of delete promotion request. -// For more details see https://xendit.github.io/apireference/?bash#create-promotion. -type PromotionDeletion struct { - ID string `json:"id"` - IsDeleted bool `json:"is_deleted"` -} diff --git a/promotion/client.go b/promotion/client.go deleted file mode 100644 index 10d5b5de..00000000 --- a/promotion/client.go +++ /dev/null @@ -1,131 +0,0 @@ -package promotion - -import ( - "context" - "fmt" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke ewallet API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreatePromotion creates new promotion. -func (c *Client) CreatePromotion(data *CreatePromotionParams) (*xendit.Promotion, *xendit.Error) { - return c.CreatePromotionWithContext(context.Background(), data) -} - -// CreatePromotionWithContext creates new promotion with context. -func (c *Client) CreatePromotionWithContext(ctx context.Context, data *CreatePromotionParams) (*xendit.Promotion, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Promotion{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/promotions", c.Opt.XenditURL), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetPromotions gets promotions. -func (c *Client) GetPromotions(data *GetPromotionsParams) ([]xendit.Promotion, *xendit.Error) { - return c.GetPromotionsWithContext(context.Background(), data) -} - -// GetPromotionsWithContext gets promotions with context. -func (c *Client) GetPromotionsWithContext(ctx context.Context, data *GetPromotionsParams) ([]xendit.Promotion, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.Promotion{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/promotions?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// UpdatePromotion updates a promotion. -func (c *Client) UpdatePromotion(data *UpdatePromotionParams) (*xendit.Promotion, *xendit.Error) { - return c.UpdatePromotionWithContext(context.Background(), data) -} - -// UpdatePromotionWithContext updates a promotion with context. -func (c *Client) UpdatePromotionWithContext(ctx context.Context, data *UpdatePromotionParams) (*xendit.Promotion, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Promotion{} - - err := c.APIRequester.Call( - ctx, - "PATCH", - fmt.Sprintf("%s/promotions/%s", c.Opt.XenditURL, data.PromotionID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// DeletePromotion deletes a promotion. -func (c *Client) DeletePromotion(data *DeletePromotionParams) (*xendit.PromotionDeletion, *xendit.Error) { - return c.DeletePromotionWithContext(context.Background(), data) -} - -// DeletePromotionWithContext deletes a promotion with context. -func (c *Client) DeletePromotionWithContext(ctx context.Context, data *DeletePromotionParams) (*xendit.PromotionDeletion, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.PromotionDeletion{} - - err := c.APIRequester.Call( - ctx, - "DELETE", - fmt.Sprintf("%s/promotions/%s", c.Opt.XenditURL, data.PromotionID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/promotion/example_test.go b/promotion/example_test.go deleted file mode 100644 index 35d3e51e..00000000 --- a/promotion/example_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package promotion_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/promotion" -) - -func ExampleCreatePromotion() { - xendit.Opt.SecretKey = "examplesecretkey" - - startTime := time.Now().Add(time.Hour) - endTime := startTime.Add(time.Hour) - - createPromotionData := promotion.CreatePromotionParams{ - ReferenceID: "BRI_20_JAN", - Description: "20% discount applied for all BRI cards", - BinList: []string{ - "400000", - "460000", - }, - DiscountPercent: 20, - Currency: "IDR", - StartTime: &startTime, - EndTime: &endTime, - ChannelCode: "BRI", - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - } - - promotionResp, err := promotion.CreatePromotion(&createPromotionData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created promotion: %+v\n", promotionResp) -} - -func ExampleGetPromotions() { - xendit.Opt.SecretKey = "examplesecretkey" - - promotions, err := promotion.GetPromotions(&promotion.GetPromotionsParams{ - ReferenceID: "BRI_20_JAN", - }) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved promotions: %+v\n", promotions) -} - -func ExampleUpdatePromotion() { - xendit.Opt.SecretKey = "examplesecretkey" - - updatePromotionData := promotion.UpdatePromotionParams{ - PromotionID: "36ab1517-208a-4f22-b155-96fb101cb378", - Description: "20% discount applied for all BCA cards", - BinList: []string{ - "123123", - "456456", - }, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BCA", - } - - promotionResp, err := promotion.UpdatePromotion(&updatePromotionData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("updated promotion: %+v\n", promotionResp) -} - -func ExampleDeletePromotion() { - xendit.Opt.SecretKey = "examplesecretkey" - - deletePromotionData := promotion.DeletePromotionParams{ - PromotionID: "36ab1517-208a-4f22-b155-96fb101cb378", - } - - promotionResp, err := promotion.DeletePromotion(&deletePromotionData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("deleted promotion: %+v\n", promotionResp) -} diff --git a/promotion/params.go b/promotion/params.go deleted file mode 100644 index d65222a2..00000000 --- a/promotion/params.go +++ /dev/null @@ -1,75 +0,0 @@ -package promotion - -import ( - "net/url" - "time" -) - -// CreatePromotionParams contains parameters for CreatePromotion. -type CreatePromotionParams struct { - ReferenceID string `json:"reference_id" validate:"required"` - Description string `json:"description" validate:"required"` - PromoCode string `json:"promo_code,omitempty"` - BinList []string `json:"bin_list,omitempty"` - ChannelCode string `json:"channel_code,omitempty"` - DiscountPercent float64 `json:"discount_percent,omitempty"` - DiscountAmount float64 `json:"discount_amount,omitempty"` - Currency string `json:"currency" validate:"required"` - StartTime *time.Time `json:"start_time" validate:"required"` - EndTime *time.Time `json:"end_time" validate:"required"` - MinOriginalAmount float64 `json:"min_original_amount,omitempty"` - MaxDiscountAmount float64 `json:"max_discount_amount,omitempty"` -} - -// GetPromotionsParams contains parameters for GetPromotions. -type GetPromotionsParams struct { - ReferenceID string - Status string - Bin string - ChannelCode string - Currency string -} - -// QueryString creates query string from GetPromotionsParams, ignores nil values. -func (p *GetPromotionsParams) QueryString() string { - urlValues := &url.Values{} - - if p.ReferenceID != "" { - urlValues.Add("reference_id", p.ReferenceID) - } - if p.Status != "" { - urlValues.Add("status", p.Status) - } - if p.Bin != "" { - urlValues.Add("bin", p.Bin) - } - if p.ChannelCode != "" { - urlValues.Add("channel_code", p.ChannelCode) - } - if p.Currency != "" { - urlValues.Add("currency", p.Currency) - } - - return urlValues.Encode() -} - -// UpdatePromotionParams contains parameters for UpdatePromotion. -type UpdatePromotionParams struct { - PromotionID string `json:"-" validate:"required"` - Description string `json:"description,omitempty"` - PromoCode string `json:"promo_code,omitempty"` - BinList []string `json:"bin_list,omitempty"` - ChannelCode string `json:"channel_code,omitempty"` - DiscountPercent float64 `json:"discount_percent,omitempty"` - DiscountAmount float64 `json:"discount_amount,omitempty"` - Currency string `json:"currency,omitempty"` - StartTime *time.Time `json:"start_time,omitempty"` - EndTime *time.Time `json:"end_time,omitempty"` - MinOriginalAmount float64 `json:"min_original_amount,omitempty"` - MaxDiscountAmount float64 `json:"max_discount_amount,omitempty"` -} - -// DeletePromotionParams contains parameters for DeletePromotion. -type DeletePromotionParams struct { - PromotionID string `validate:"required"` -} diff --git a/promotion/promotion.go b/promotion/promotion.go deleted file mode 100644 index a73ab5f9..00000000 --- a/promotion/promotion.go +++ /dev/null @@ -1,74 +0,0 @@ -package promotion - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreatePromotion creates new promotion. -func CreatePromotion(data *CreatePromotionParams) (*xendit.Promotion, *xendit.Error) { - return CreatePromotionWithContext(context.Background(), data) -} - -// CreatePromotionWithContext creates new promotion with context. -func CreatePromotionWithContext(ctx context.Context, data *CreatePromotionParams) (*xendit.Promotion, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreatePromotionWithContext(ctx, data) -} - -// GetPromotions gets promotions. -func GetPromotions(data *GetPromotionsParams) ([]xendit.Promotion, *xendit.Error) { - return GetPromotionsWithContext(context.Background(), data) -} - -// GetPromotionsWithContext gets promotions with context. -func GetPromotionsWithContext(ctx context.Context, data *GetPromotionsParams) ([]xendit.Promotion, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetPromotionsWithContext(ctx, data) -} - -// UpdatePromotion updates a promotion. -func UpdatePromotion(data *UpdatePromotionParams) (*xendit.Promotion, *xendit.Error) { - return UpdatePromotionWithContext(context.Background(), data) -} - -// UpdatePromotionWithContext updates a promotion with context. -func UpdatePromotionWithContext(ctx context.Context, data *UpdatePromotionParams) (*xendit.Promotion, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.UpdatePromotionWithContext(ctx, data) -} - -// DeletePromotion deletes a promotion. -func DeletePromotion(data *DeletePromotionParams) (*xendit.PromotionDeletion, *xendit.Error) { - return DeletePromotionWithContext(context.Background(), data) -} - -// DeletePromotionWithContext deletes a promotion with context. -func DeletePromotionWithContext(ctx context.Context, data *DeletePromotionParams) (*xendit.PromotionDeletion, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.DeletePromotionWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/promotion/promotion_test.go b/promotion/promotion_test.go deleted file mode 100644 index c324b4fc..00000000 --- a/promotion/promotion_test.go +++ /dev/null @@ -1,401 +0,0 @@ -package promotion_test - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/promotion" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterPromotionMock struct { - mock.Mock -} - -func (m *apiRequesterPromotionMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - result.(*xendit.Promotion).ID = "36ab1517-208a-4f22-b155-96fb101cb378" - result.(*xendit.Promotion).BusinessID = "5e61664b3dba955c203d232e" - result.(*xendit.Promotion).ReferenceID = "BRI_20_JAN" - result.(*xendit.Promotion).Description = "20% discount applied for all BRI cards" - result.(*xendit.Promotion).Status = "ACTIVE" - result.(*xendit.Promotion).BinList = []string{"400000", "460000"} - result.(*xendit.Promotion).DiscountPercent = 20 - result.(*xendit.Promotion).Currency = "IDR" - result.(*xendit.Promotion).ChannelCode = "BRI" - result.(*xendit.Promotion).StartTime = &mockTime - result.(*xendit.Promotion).EndTime = &mockTime - result.(*xendit.Promotion).MinOriginalAmount = 25000 - result.(*xendit.Promotion).MaxDiscountAmount = 5000 - - return nil -} - -func TestCreatePromotion(t *testing.T) { - apiRequesterMockObj := new(apiRequesterPromotionMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *promotion.CreatePromotionParams - expectedRes *xendit.Promotion - expectedErr *xendit.Error - }{ - { - desc: "should create a promotion", - data: &promotion.CreatePromotionParams{ - ReferenceID: "BRI_20_JAN", - Description: "20% discount applied for all BRI cards", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedRes: &xendit.Promotion{ - ID: "36ab1517-208a-4f22-b155-96fb101cb378", - BusinessID: "5e61664b3dba955c203d232e", - ReferenceID: "BRI_20_JAN", - Description: "20% discount applied for all BRI cards", - Status: "ACTIVE", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &promotion.CreatePromotionParams{ - Description: "20% discount applied for all BRI cards", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReferenceID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/promotions", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.Promotion{}, - ).Return(nil) - - resp, err := promotion.CreatePromotion(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetPromotionsMock struct { - mock.Mock -} - -func (m *apiRequesterGetPromotionsMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "id": "36ab1517-208a-4f22-b155-96fb101cb378", - "business_id": "5e61664b3dba955c203d232e", - "reference_id": "BRI_20_JAN", - "status": "ACTIVE", - "description": "20% discount applied for all BRI cards", - "bin_list": [ - "400000", - "460000" - ], - "channel_code": "BRI", - "discount_percent": 20, - "currency": "IDR", - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2020-01-01T00:00:00.000Z", - "min_original_amount": 25000, - "max_discount_amount": 5000 - }, - { - "id": "36ab1517-208a-4f22-b155-96fb101cb377", - "business_id": "5e61664b3dba955c203d232e", - "reference_id": "BRI_20_FEB", - "status": "ACTIVE", - "description": "20% discount applied for all BRI cards", - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2020-01-01T00:00:00.000Z", - "bin_list": [ - "400000", - "460000" - ], - "discount_percent": 20, - "channel_code": "BRI", - "currency": "IDR", - "min_original_amount": 25000, - "max_discount_amount": 5000 - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetPromotions(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetPromotionsMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *promotion.GetPromotionsParams - expectedRes []xendit.Promotion - expectedErr *xendit.Error - }{ - { - desc: "should get promotions", - data: &promotion.GetPromotionsParams{ - Currency: "IDR", - ChannelCode: "BRI", - }, - expectedRes: []xendit.Promotion{ - { - ID: "36ab1517-208a-4f22-b155-96fb101cb378", - BusinessID: "5e61664b3dba955c203d232e", - ReferenceID: "BRI_20_JAN", - Description: "20% discount applied for all BRI cards", - Status: "ACTIVE", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - { - ID: "36ab1517-208a-4f22-b155-96fb101cb377", - BusinessID: "5e61664b3dba955c203d232e", - ReferenceID: "BRI_20_FEB", - Description: "20% discount applied for all BRI cards", - Status: "ACTIVE", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - fmt.Sprintf("%s/promotions?%s", xendit.Opt.XenditURL, tC.data.QueryString()), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.Promotion{}, - ).Return(nil) - - resp, err := promotion.GetPromotions(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestUpdatePromotion(t *testing.T) { - apiRequesterMockObj := new(apiRequesterPromotionMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *promotion.UpdatePromotionParams - expectedRes *xendit.Promotion - expectedErr *xendit.Error - }{ - { - desc: "should update a promotion", - data: &promotion.UpdatePromotionParams{ - PromotionID: "36ab1517-208a-4f22-b155-96fb101cb378", - Description: "20% discount applied for all BRI cards", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedRes: &xendit.Promotion{ - ID: "36ab1517-208a-4f22-b155-96fb101cb378", - BusinessID: "5e61664b3dba955c203d232e", - ReferenceID: "BRI_20_JAN", - Description: "20% discount applied for all BRI cards", - Status: "ACTIVE", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &promotion.UpdatePromotionParams{ - Description: "20% discount applied for all BRI cards", - BinList: []string{"400000", "460000"}, - DiscountPercent: 20, - Currency: "IDR", - ChannelCode: "BRI", - StartTime: &mockTime, - EndTime: &mockTime, - MinOriginalAmount: 25000, - MaxDiscountAmount: 5000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'PromotionID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "PATCH", - xendit.Opt.XenditURL+"/promotions/"+tC.data.PromotionID, - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.Promotion{}, - ).Return(nil) - - resp, err := promotion.UpdatePromotion(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterDeletePromotionMock struct { - mock.Mock -} - -func (m *apiRequesterDeletePromotionMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - result.(*xendit.PromotionDeletion).ID = "36ab1517-208a-4f22-b155-96fb101cb378" - result.(*xendit.PromotionDeletion).IsDeleted = true - - return nil -} - -func TestDeletePromotion(t *testing.T) { - apiRequesterMockObj := new(apiRequesterDeletePromotionMock) - initTesting(apiRequesterMockObj) - - testCases := []struct { - desc string - data *promotion.DeletePromotionParams - expectedRes *xendit.PromotionDeletion - expectedErr *xendit.Error - }{ - { - desc: "should delete a promotion", - data: &promotion.DeletePromotionParams{ - PromotionID: "36ab1517-208a-4f22-b155-96fb101cb378", - }, - expectedRes: &xendit.PromotionDeletion{ - ID: "36ab1517-208a-4f22-b155-96fb101cb378", - IsDeleted: true, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &promotion.DeletePromotionParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'PromotionID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "DELETE", - xendit.Opt.XenditURL+"/promotions/"+tC.data.PromotionID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.PromotionDeletion{}, - ).Return(nil) - - resp, err := promotion.DeletePromotion(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/qrcode.go b/qrcode.go deleted file mode 100644 index f93dab88..00000000 --- a/qrcode.go +++ /dev/null @@ -1,45 +0,0 @@ -package xendit - -import "time" - -// QRCodeType constants are the available QR Code type -type QRCodeType string - -// This consists the values that QRCodeType can have -const ( - DynamicQRCode QRCodeType = "DYNAMIC" - StaticQRCode QRCodeType = "STATIC" -) - -// QRCode contains data from Xendit's API response of QR code related request. -// For more details see https://developers.xendit.co/api-reference/#create-qr-code -type QRCode struct { - ID string `json:"id"` - ExternalID string `json:"external_id"` - Amount float64 `json:"amount"` - QRString string `json:"qr_string"` - CallbackURL string `json:"callback_url"` - Type QRCodeType `json:"type"` - Status string `json:"status"` - Created *time.Time `json:"created"` - Updated *time.Time `json:"updated"` -} - -// QRDetail contains data from qr field from Xendit's API response of QRCode payments related request -// For more details see https://developers.xendit.co/api-reference/#get-payments-by-external-id -type QRDetail struct { - ID string `json:"id"` - ExternalID string `json:"external_id"` - QRString string `json:"qr_string"` - Type QRCodeType `json:"type"` -} - -// QRCodePayments contains data from Xendit's API response of QRCode payments related request. -// For more details see https://developers.xendit.co/api-reference/#get-payments-by-external-id -type QRCodePayments struct { - ID string `json:"id"` - Amount float64 `json:"amount"` - Created *time.Time `json:"created"` - Status string `json:"status"` - QRCode QRDetail `json:"qr_code"` -} diff --git a/qrcode/client.go b/qrcode/client.go deleted file mode 100644 index 2b954e50..00000000 --- a/qrcode/client.go +++ /dev/null @@ -1,113 +0,0 @@ -package qrcode - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke QRCode API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreateQRCode creates new QR Code -func (c *Client) CreateQRCode(data *CreateQRCodeParams) (*xendit.QRCode, *xendit.Error) { - return c.CreateQRCodeWithContext(context.Background(), data) -} - -// CreateQRCodeWithContext creates new QR Code with context -func (c *Client) CreateQRCodeWithContext(ctx context.Context, data *CreateQRCodeParams) (*xendit.QRCode, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.QRCode{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/qr_codes", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetQRCode gets a single QRCode -func (c *Client) GetQRCode(data *GetQRCodeParams) (*xendit.QRCode, *xendit.Error) { - return c.GetQRCodeWithContext(context.Background(), data) -} - -// GetQRCodeWithContext gets a single QRCode with context -func (c *Client) GetQRCodeWithContext(ctx context.Context, data *GetQRCodeParams) (*xendit.QRCode, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.QRCode{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/qr_codes/%s", c.Opt.XenditURL, data.ExternalID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetQRCodePayments gets a list of QR Code payments -func (c *Client) GetQRCodePayments(data *GetQRCodePaymentsParams) ([]xendit.QRCodePayments, *xendit.Error) { - return c.GetQRCodePaymentsWithContext(context.Background(), data) -} - -// GetQRCodePaymentsWithContext gets a list of QR Code payments with context -func (c *Client) GetQRCodePaymentsWithContext(ctx context.Context, data *GetQRCodePaymentsParams) ([]xendit.QRCodePayments, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := []xendit.QRCodePayments{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/qr_codes/payments?%s", c.Opt.XenditURL, data.QueryString()), - c.Opt.SecretKey, - nil, - nil, - &response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/qrcode/example_test.go b/qrcode/example_test.go deleted file mode 100644 index 70084cd7..00000000 --- a/qrcode/example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package qrcode_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/qrcode" -) - -func ExampleCreateQRCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - createQRCodeData := qrcode.CreateQRCodeParams{ - ExternalID: "external_id", - CallbackURL: "http://webhook-site", - Type: xendit.DynamicQRCode, - Amount: 10000, - } - - qrCodeResponse, err := qrcode.CreateQRCode(&createQRCodeData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created QR code: %+v\n", qrCodeResponse) -} - -func ExampleGetQRCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - qrCodeResponse, err := qrcode.GetQRCode(&qrcode.GetQRCodeParams{ - ExternalID: "external_id", - }) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved qr code: %v\n", qrCodeResponse) -} - -func ExampleGetQRCodePayments() { - xendit.Opt.SecretKey = "examplesecretkey" - - getQRCodePaymentsdata := qrcode.GetQRCodePaymentsParams{ - ExternalID: "external_id", - Limit: 20, - } - - getQRCodePaymentsRes, err := qrcode.GetQRCodePayments(&getQRCodePaymentsdata) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved QR Code payments: %v\n", getQRCodePaymentsRes) -} diff --git a/qrcode/params.go b/qrcode/params.go deleted file mode 100644 index 8816e71b..00000000 --- a/qrcode/params.go +++ /dev/null @@ -1,51 +0,0 @@ -package qrcode - -import ( - "net/url" - "strconv" - - "github.com/xendit/xendit-go" -) - -// CreateQRCodeParams contains parameters for CreateQRCode -type CreateQRCodeParams struct { - ForUserID string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` - Type xendit.QRCodeType `json:"type" validate:"required"` - CallbackURL string `json:"callback_url" validate:"required"` - Amount float64 `json:"amount,omitempty"` -} - -// GetQRCodeParams contains parameters for GetQRCode -type GetQRCodeParams struct { - ForUserID string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` -} - -// GetQRCodePaymentsParams contains parameters for GetQRCodePayments -type GetQRCodePaymentsParams struct { - ExternalID string `json:"external_id" validate:"required"` - Limit int `json:"limit,omitempty"` - From string `json:"from,omitempty"` - To string `json:"to,omitempty"` -} - -// QueryString creates query string from GetQRCodePaymentsParams, ignores nil values -func (p *GetQRCodePaymentsParams) QueryString() string { - urlValues := &url.Values{} - - urlValues.Add("external_id", p.ExternalID) - if p.Limit > 0 { - urlValues.Add("limit", strconv.Itoa(p.Limit)) - } - - if p.From != "" { - urlValues.Add("from", p.From) - } - - if p.To != "" { - urlValues.Add("to", p.To) - } - - return urlValues.Encode() -} diff --git a/qrcode/qrcode.go b/qrcode/qrcode.go deleted file mode 100644 index 929df439..00000000 --- a/qrcode/qrcode.go +++ /dev/null @@ -1,59 +0,0 @@ -package qrcode - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreateQRCode creates new QR Code. -func CreateQRCode(data *CreateQRCodeParams) (*xendit.QRCode, *xendit.Error) { - return CreateQRCodeWithContext(context.Background(), data) -} - -// CreateQRCodeWithContext creates new QR Code with context. -func CreateQRCodeWithContext(ctx context.Context, data *CreateQRCodeParams) (*xendit.QRCode, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateQRCodeWithContext(ctx, data) -} - -// GetQRCode gets a single QR Code. -func GetQRCode(data *GetQRCodeParams) (*xendit.QRCode, *xendit.Error) { - return GetQRCodeWithContext(context.Background(), data) -} - -// GetQRCodeWithContext gets a single QR Code with context. -func GetQRCodeWithContext(ctx context.Context, data *GetQRCodeParams) (*xendit.QRCode, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetQRCodeWithContext(ctx, data) -} - -// GetQRCodePayments gets a list of QR Code payments. -func GetQRCodePayments(data *GetQRCodePaymentsParams) ([]xendit.QRCodePayments, *xendit.Error) { - return GetQRCodePaymentsWithContext(context.Background(), data) -} - -// GetQRCodePaymentsWithContext gets a list of QR Code payments with context. -func GetQRCodePaymentsWithContext(ctx context.Context, data *GetQRCodePaymentsParams) ([]xendit.QRCodePayments, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetQRCodePaymentsWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/qrcode/qrcode_test.go b/qrcode/qrcode_test.go deleted file mode 100644 index d98b8768..00000000 --- a/qrcode/qrcode_test.go +++ /dev/null @@ -1,251 +0,0 @@ -package qrcode_test - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/qrcode" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterQRCodeMock struct { - mock.Mock -} - -func (m *apiRequesterQRCodeMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - result.(*xendit.QRCode).ID = "qr_8182837te-87st-49ing-8696-1239bd4d759c" - result.(*xendit.QRCode).ExternalID = "testing_id_123" - result.(*xendit.QRCode).CallbackURL = "https://webhook-site" - result.(*xendit.QRCode).Amount = 50000 - result.(*xendit.QRCode).Type = xendit.StaticQRCode - result.(*xendit.QRCode).QRString = "0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB" - result.(*xendit.QRCode).Status = "ACTIVE" - result.(*xendit.QRCode).Created = &mockTime - result.(*xendit.QRCode).Updated = &mockTime - - return nil -} - -func TestCreateQRCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterQRCodeMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *qrcode.CreateQRCodeParams - expectedRes *xendit.QRCode - expectedErr *xendit.Error - }{ - { - desc: "should create a QR Code", - data: &qrcode.CreateQRCodeParams{ - ExternalID: "testing_id_123", - CallbackURL: "https://webhook-site", - Type: xendit.StaticQRCode, - Amount: 50000, - }, - expectedRes: &xendit.QRCode{ - ID: "qr_8182837te-87st-49ing-8696-1239bd4d759c", - CallbackURL: "https://webhook-site", - Amount: 50000, - Type: xendit.StaticQRCode, - ExternalID: "testing_id_123", - QRString: "0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB", - Status: "ACTIVE", - Created: &mockTime, - Updated: &mockTime, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &qrcode.CreateQRCodeParams{ - Amount: 10000, - CallbackURL: "https://webhook-site", - Type: xendit.DynamicQRCode, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ExternalID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/qr_codes", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.QRCode{}, - ).Return(nil) - - resp, err := qrcode.CreateQRCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetQRCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterQRCodeMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-02-02T00:00:00.000Z") - - testCases := []struct { - desc string - data *qrcode.GetQRCodeParams - expectedRes *xendit.QRCode - expectedErr *xendit.Error - }{ - { - desc: "should get a QR Code", - data: &qrcode.GetQRCodeParams{ - ExternalID: "testing_id_123", - }, - expectedRes: &xendit.QRCode{ - ID: "qr_8182837te-87st-49ing-8696-1239bd4d759c", - CallbackURL: "https://webhook-site", - Amount: 50000, - Type: xendit.StaticQRCode, - ExternalID: "testing_id_123", - QRString: "0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52 045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB", - Status: "ACTIVE", - Created: &mockTime, - Updated: &mockTime, - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &qrcode.GetQRCodeParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ExternalID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - fmt.Sprintf("%s/qr_codes/%s", xendit.Opt.XenditURL, tC.data.ExternalID), - xendit.Opt.SecretKey, - nil, - nil, - &xendit.QRCode{}, - ).Return(nil) - - resp, err := qrcode.GetQRCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetQRCodePaymentsMock struct { - mock.Mock -} - -func (m *apiRequesterGetQRCodePaymentsMock) Call(ctx context.Context, method string, path string, secretKey string, headers http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `[ - { - "id": "qrpy_8182837te-87st-49ing-8696-1239bd4d759c", - "amount": 1500, - "created": "2020-01-08T18:18:18.857Z", - "qr_code": { - "id": "qr_8182837te-87st-49ing-8696-1239bd4d759c", - "external_id": "testing_id_123", - "qr_string": "0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB", - "type": "DYNAMIC" - }, - "status": "COMPLETED" - } - ]` - - _ = json.Unmarshal([]byte(resultString), &result) - return nil -} - -func TestGetQRPayments(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetQRCodePaymentsMock) - initTesting(apiRequesterMockObj) - - mockTime, _ := time.Parse(time.RFC3339, "2020-01-08T18:18:18.857Z") - - testCases := []struct { - desc string - data *qrcode.GetQRCodePaymentsParams - expectedRes []xendit.QRCodePayments - expectedErr *xendit.Error - }{ - { - desc: "should get QR code payments", - data: &qrcode.GetQRCodePaymentsParams{ - ExternalID: "testing_id_123", - }, - expectedRes: []xendit.QRCodePayments{ - { - ID: "qrpy_8182837te-87st-49ing-8696-1239bd4d759c", - Amount: 1500, - Created: &mockTime, - Status: "COMPLETED", - QRCode: xendit.QRDetail{ - ID: "qr_8182837te-87st-49ing-8696-1239bd4d759c", - ExternalID: "testing_id_123", - QRString: "0002010102##########CO.XENDIT.WWW011893600#######14220002152#####414220010303TTT####015CO.XENDIT.WWW02180000000000000000000TTT52045######ID5911XenditQRIS6007Jakarta6105121606##########3k1mOnF73h11111111#3k1mOnF73h6v53033605401163040BDB", - Type: xendit.DynamicQRCode, - }, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - fmt.Sprintf("%s/qr_codes/payments?%s", xendit.Opt.XenditURL, tC.data.QueryString()), - xendit.Opt.SecretKey, - nil, - nil, - &[]xendit.QRCodePayments{}, - ).Return(nil) - - resp, err := qrcode.GetQRCodePayments(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/recurringpayment.go b/recurringpayment.go deleted file mode 100644 index 0814dfcc..00000000 --- a/recurringpayment.go +++ /dev/null @@ -1,91 +0,0 @@ -package xendit - -import "time" - -// MissedPaymentActionEnum constants are the available recurring payment missed payment actions -type MissedPaymentActionEnum string - -// This consists the values that MissedPaymentActionEnum can take -const ( - MissedPaymentActionIgnore MissedPaymentActionEnum = "IGNORE" - MissedPaymentActionStop MissedPaymentActionEnum = "STOP" -) - -// RecurringPaymentIntervalEnum constants are the available recurring payment intervals -type RecurringPaymentIntervalEnum string - -// This consists the values that RecurringPaymentIntervalEnum can take -const ( - RecurringPaymentIntervalDay RecurringPaymentIntervalEnum = "DAY" - RecurringPaymentIntervalWeek RecurringPaymentIntervalEnum = "WEEK" - RecurringPaymentIntervalMonth RecurringPaymentIntervalEnum = "MONTH" -) - -// RecurringPayment contains data from Xendit's API response of recurring payment related requests. -// For more details see https://xendit.github.io/apireference/?bash#recurring-payments. -// For documentation of subpackage recurringpayment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/recurringpayment -type RecurringPayment struct { - ID string `json:"id"` - ExternalID string `json:"external_id"` - UserID string `json:"user_id"` - PayerEmail string `json:"payer_email"` - Description string `json:"description"` - Status string `json:"status"` - Amount float64 `json:"amount"` - ShouldSendEmail bool `json:"should_send_email"` - Customer RecurringPaymentCustomer `json:"customer,omitempty"` - CustomerNotificationPreference CustomerNotificationPreference `json:"customer_notification_preference,omitempty"` - Interval RecurringPaymentIntervalEnum `json:"interval"` - IntervalCount int `json:"interval_count"` - MissedPaymentAction MissedPaymentActionEnum `json:"missed_payment_action"` - Created *time.Time `json:"created"` - Updated *time.Time `json:"updated"` - InvoiceDuration int `json:"invoice_duration,omitempty"` - StartDate *time.Time `json:"start_date,omitempty"` - LastCreatedInvoiceURL string `json:"last_created_invoice_url,omitempty"` - CreditCardToken string `json:"credit_card_token,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - TotalRecurrence int `json:"total_recurrence,omitempty"` - RecurrenceProgress int `json:"recurrence_progress,omitempty"` - Recharge bool `json:"recharge,omitempty"` - ChargeImmediately bool `json:"charge_immediately,omitempty"` - Currency string `json:"currency,omitempty"` -} - -// RecurringPaymentCustomer is data that contained in `RecurringPayment` at Customer -type RecurringPaymentCustomer struct { - GivenNames string `json:"given_names,omitempty"` - Email string `json:"email,omitempty"` - MobileNumber string `json:"mobile_number,omitempty"` - Address []RecurringPaymenCustomerAddress `json:"address,omitempty"` -} - -// RecurringPaymenCustomerAddress is data that contained in `RecurringPaymentCustomer` at Address -type RecurringPaymenCustomerAddress struct { - City string `json:"city,omitempty"` - Country string `json:"country,omitempty"` - PostalCode string `json:"postal_code,omitempty"` - State string `json:"state,omitempty"` - StreetLine1 string `json:"street_line1,omitempty"` - StreetLine2 string `json:"street_line2,omitempty"` -} - -// CustomerNotificationChannelEnum constants are the available customer notification channels -type CustomerNotificationChannelEnum string - -// This consists the values that CustomerNotificationChannelEnum can take -const ( - CustomerNotificationChannelWhatsApp CustomerNotificationChannelEnum = "whatsapp" - CustomerNotificationChannelSMS CustomerNotificationChannelEnum = "sms" - CustomerNotificationChannelEmail CustomerNotificationChannelEnum = "email" - CustomerNotificationChannelViber CustomerNotificationChannelEnum = "viber" -) - -// CustomerNotificationPreference is data that contained in `RecurringPayment` at CustomerNotificationPreference -type CustomerNotificationPreference struct { - InvoiceCreated []CustomerNotificationChannelEnum `json:"invoice_created,omitempty"` - InvoiceReminder []CustomerNotificationChannelEnum `json:"invoice_reminder,omitempty"` - InvoicePaid []CustomerNotificationChannelEnum `json:"invoice_paid,omitempty"` - InvoiceExpired []CustomerNotificationChannelEnum `json:"invoice_expired,omitempty"` -} diff --git a/recurringpayment/client.go b/recurringpayment/client.go deleted file mode 100644 index 05ca7386..00000000 --- a/recurringpayment/client.go +++ /dev/null @@ -1,195 +0,0 @@ -package recurringpayment - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// Create creates new recurring payment -func (c *Client) Create(data *CreateParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new recurring payment with context -func (c *Client) CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/recurring_payments", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Get gets one recurring payment -func (c *Client) Get(data *GetParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.GetWithContext(context.Background(), data) -} - -// GetWithContext gets one recurring payment with context -func (c *Client) GetWithContext(ctx context.Context, data *GetParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/recurring_payments/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Edit edits a recurring payment -func (c *Client) Edit(data *EditParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.EditWithContext(context.Background(), data) -} - -// EditWithContext edits a recurring payment with context -func (c *Client) EditWithContext(ctx context.Context, data *EditParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - - err := c.APIRequester.Call( - ctx, - "PATCH", - fmt.Sprintf("%s/recurring_payments/%s", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Stop stops one recurring payment -func (c *Client) Stop(data *StopParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.StopWithContext(context.Background(), data) -} - -// StopWithContext stops one recurring payment with context -func (c *Client) StopWithContext(ctx context.Context, data *StopParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/recurring_payments/%s/stop!", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Pause pauses one recurring payment -func (c *Client) Pause(data *PauseParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.PauseWithContext(context.Background(), data) -} - -// PauseWithContext pauses one recurring payment with context -func (c *Client) PauseWithContext(ctx context.Context, data *PauseParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/recurring_payments/%s/pause!", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// Resume resumes one recurring payment -func (c *Client) Resume(data *ResumeParams) (*xendit.RecurringPayment, *xendit.Error) { - return c.ResumeWithContext(context.Background(), data) -} - -// ResumeWithContext resumes one recurring payment with context -func (c *Client) ResumeWithContext(ctx context.Context, data *ResumeParams) (*xendit.RecurringPayment, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RecurringPayment{} - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/recurring_payments/%s/resume!", c.Opt.XenditURL, data.ID), - c.Opt.SecretKey, - nil, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/recurringpayment/example_test.go b/recurringpayment/example_test.go deleted file mode 100644 index df5939c9..00000000 --- a/recurringpayment/example_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package recurringpayment_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/recurringpayment" -) - -func ExampleCreate() { - xendit.Opt.SecretKey = "examplesecretkey" - - createData := recurringpayment.CreateParams{ - ExternalID: "recurringpayment-" + time.Now().String(), - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurringpayment #1", - Interval: xendit.RecurringPaymentIntervalDay, - IntervalCount: 3, - } - - resp, err := recurringpayment.Create(&createData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("created recurring payment: %+v\n", resp) -} - -func ExampleGet() { - xendit.Opt.SecretKey = "examplesecretkey" - - getData := recurringpayment.GetParams{ - ID: "123", - } - - resp, err := recurringpayment.Get(&getData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("retrieved recurring payment: %+v\n", resp) -} - -func ExampleEdit() { - xendit.Opt.SecretKey = "examplesecretkey" - - editData := recurringpayment.EditParams{ - ID: "123", - Amount: 500000, - Interval: xendit.RecurringPaymentIntervalMonth, - IntervalCount: 3, - } - - resp, err := recurringpayment.Edit(&editData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("edited recurring payment: %+v\n", resp) -} - -func ExampleStop() { - xendit.Opt.SecretKey = "examplesecretkey" - - stopData := recurringpayment.StopParams{ - ID: "123", - } - - resp, err := recurringpayment.Stop(&stopData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("stopped recurring payment: %+v\n", resp) -} - -func ExamplePause() { - xendit.Opt.SecretKey = "examplesecretkey" - - pauseData := recurringpayment.PauseParams{ - ID: "123", - } - - resp, err := recurringpayment.Pause(&pauseData) - if err != nil { - log.Fatal(err) - } - - fmt.Printf("paused recurring payment: %+v\n", resp) -} - -func ExampleResume() { - xendit.Opt.SecretKey = "examplesecretkey" - - resumeData := recurringpayment.ResumeParams{ - ID: "123", - } - - resp, err := recurringpayment.Resume(&resumeData) - if err != nil { - log.Fatal(err) - } - fmt.Printf("resumed recurring payment: %+v\n", resp) -} diff --git a/recurringpayment/params.go b/recurringpayment/params.go deleted file mode 100644 index af8b7365..00000000 --- a/recurringpayment/params.go +++ /dev/null @@ -1,63 +0,0 @@ -package recurringpayment - -import ( - "time" - - "github.com/xendit/xendit-go" -) - -// CreateParams contains parameters for Create -type CreateParams struct { - ForUserID string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` - PayerEmail string `json:"payer_email" validate:"required"` - Description string `json:"description" validate:"required"` - Amount float64 `json:"amount" validate:"required"` - Interval xendit.RecurringPaymentIntervalEnum `json:"interval" validate:"required"` - IntervalCount int `json:"interval_count" validate:"required"` - TotalRecurrence int `json:"total_recurrence,omitempty"` - InvoiceDuration int `json:"invoice_duration,omitempty"` - ShouldSendEmail *bool `json:"should_send_email,omitempty"` - Customer xendit.RecurringPaymentCustomer `json:"customer,omitempty"` - CustomerNotificationPreference xendit.CustomerNotificationPreference `json:"customer_notification_preference,omitempty"` - MissedPaymentAction xendit.MissedPaymentActionEnum `json:"missed_payment_action,omitempty"` - CreditCardToken string `json:"credit_card_token,omitempty"` - StartDate *time.Time `json:"start_date,omitempty"` - SuccessRedirectURL string `json:"success_redirect_url,omitempty"` - FailureRedirectURL string `json:"failure_redirect_url,omitempty"` - Recharge *bool `json:"recharge,omitempty"` - ChargeImmediately *bool `json:"charge_immediately,omitempty"` - Currency string `json:"currency,omitempty"` -} - -// GetParams contains parameters for Get -type GetParams struct { - ID string `json:"id" validate:"required"` -} - -// EditParams contains parameters for Edit -type EditParams struct { - ID string `json:"-" validate:"required"` - Amount float64 `json:"amount,omitempty"` - Interval xendit.RecurringPaymentIntervalEnum `json:"interval,omitempty"` - IntervalCount int `json:"interval_count,omitempty"` - InvoiceDuration int `json:"invoice_duration,omitempty"` - ShouldSendEmail *bool `json:"should_send_email,omitempty"` - MissedPaymentAction xendit.MissedPaymentActionEnum `json:"missed_payment_action,omitempty"` - CreditCardToken string `json:"credit_card_token,omitempty"` -} - -// StopParams contains parameters for Stop -type StopParams struct { - ID string `json:"id" validate:"required"` -} - -// PauseParams contains parameters for Pause -type PauseParams struct { - ID string `json:"id" validate:"required"` -} - -// ResumeParams contains parameters for Resume -type ResumeParams struct { - ID string `json:"id" validate:"required"` -} diff --git a/recurringpayment/recurringpayment.go b/recurringpayment/recurringpayment.go deleted file mode 100644 index 200dfb16..00000000 --- a/recurringpayment/recurringpayment.go +++ /dev/null @@ -1,104 +0,0 @@ -package recurringpayment - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// Create creates new recurring payment -func Create(data *CreateParams) (*xendit.RecurringPayment, *xendit.Error) { - return CreateWithContext(context.Background(), data) -} - -// CreateWithContext creates new recurring payment with context -func CreateWithContext(ctx context.Context, data *CreateParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateWithContext(ctx, data) -} - -// Get gets a recurring payment -func Get(data *GetParams) (*xendit.RecurringPayment, *xendit.Error) { - return GetWithContext(context.Background(), data) -} - -// GetWithContext gets a recurring payment with context -func GetWithContext(ctx context.Context, data *GetParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetWithContext(ctx, data) -} - -// Edit gets a recurring payment -func Edit(data *EditParams) (*xendit.RecurringPayment, *xendit.Error) { - return EditWithContext(context.Background(), data) -} - -// EditWithContext gets a recurring payment with context -func EditWithContext(ctx context.Context, data *EditParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.EditWithContext(ctx, data) -} - -// Stop gets a recurring payment -func Stop(data *StopParams) (*xendit.RecurringPayment, *xendit.Error) { - return StopWithContext(context.Background(), data) -} - -// StopWithContext gets a recurring payment with context -func StopWithContext(ctx context.Context, data *StopParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.StopWithContext(ctx, data) -} - -// Pause gets a recurring payment -func Pause(data *PauseParams) (*xendit.RecurringPayment, *xendit.Error) { - return PauseWithContext(context.Background(), data) -} - -// PauseWithContext gets a recurring payment with context -func PauseWithContext(ctx context.Context, data *PauseParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.PauseWithContext(ctx, data) -} - -// Resume gets a recurring payment -func Resume(data *ResumeParams) (*xendit.RecurringPayment, *xendit.Error) { - return ResumeWithContext(context.Background(), data) -} - -// ResumeWithContext gets a recurring payment with context -func ResumeWithContext(ctx context.Context, data *ResumeParams) (*xendit.RecurringPayment, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.ResumeWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/recurringpayment/recurringpayment_test.go b/recurringpayment/recurringpayment_test.go deleted file mode 100644 index 93bef2d5..00000000 --- a/recurringpayment/recurringpayment_test.go +++ /dev/null @@ -1,475 +0,0 @@ -package recurringpayment_test - -import ( - "context" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/recurringpayment" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - result.(*xendit.RecurringPayment).ID = "123" - result.(*xendit.RecurringPayment).UserID = "someone-id" - result.(*xendit.RecurringPayment).ExternalID = "recurring-external-id" - result.(*xendit.RecurringPayment).Status = "ACTIVE" - result.(*xendit.RecurringPayment).Amount = 200000 - result.(*xendit.RecurringPayment).PayerEmail = "customer@customer.com" - result.(*xendit.RecurringPayment).Description = "recurring test" - result.(*xendit.RecurringPayment).Interval = "DAY" - result.(*xendit.RecurringPayment).IntervalCount = 3 - result.(*xendit.RecurringPayment).RecurrenceProgress = 1 - result.(*xendit.RecurringPayment).ShouldSendEmail = false - result.(*xendit.RecurringPayment).MissedPaymentAction = "IGNORE" - result.(*xendit.RecurringPayment).LastCreatedInvoiceURL = "https://invoice-url.com" - result.(*xendit.RecurringPayment).Created = &date - result.(*xendit.RecurringPayment).Updated = &date - result.(*xendit.RecurringPayment).StartDate = &date - result.(*xendit.RecurringPayment).Recharge = false - result.(*xendit.RecurringPayment).Currency = "IDR" - - return nil -} - -func TestCreateRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.CreateParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should create a recurring payment", - data: &recurringpayment.CreateParams{ - ExternalID: "recurring-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: xendit.RecurringPaymentIntervalDay, - IntervalCount: 3, - Recharge: new(bool), - Currency: "IDR", - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.CreateParams{ - ExternalID: "recurring-external-id", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: xendit.RecurringPaymentIntervalDay, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'IntervalCount'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/recurring_payments", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Create(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.GetParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should get a recurring payment", - data: &recurringpayment.GetParams{ - ID: "123", - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.GetParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/recurring_payments/"+tC.data.ID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Get(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestEditRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.EditParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should edit a recurring payment", - data: &recurringpayment.EditParams{ - ID: "123", - Amount: 200000, - Interval: xendit.RecurringPaymentIntervalDay, - IntervalCount: 3, - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.EditParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "PATCH", - xendit.Opt.XenditURL+"/recurring_payments/"+tC.data.ID, - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Edit(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestStopRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.StopParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should stop a recurring payment", - data: &recurringpayment.StopParams{ - ID: "123", - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.StopParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/recurring_payments/"+tC.data.ID+"/stop!", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Stop(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestPauseRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.PauseParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should pause a recurring payment", - data: &recurringpayment.PauseParams{ - ID: "123", - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.PauseParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/recurring_payments/"+tC.data.ID+"/pause!", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Pause(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestResumeRecurringPayment(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - date, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *recurringpayment.ResumeParams - expectedRes *xendit.RecurringPayment - expectedErr *xendit.Error - }{ - { - desc: "should resume a recurring payment", - data: &recurringpayment.ResumeParams{ - ID: "123", - }, - expectedRes: &xendit.RecurringPayment{ - ID: "123", - UserID: "someone-id", - ExternalID: "recurring-external-id", - Status: "ACTIVE", - Amount: 200000, - PayerEmail: "customer@customer.com", - Description: "recurring test", - Interval: "DAY", - IntervalCount: 3, - RecurrenceProgress: 1, - ShouldSendEmail: false, - MissedPaymentAction: "IGNORE", - LastCreatedInvoiceURL: "https://invoice-url.com", - Created: &date, - Updated: &date, - StartDate: &date, - Recharge: false, - Currency: "IDR", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &recurringpayment.ResumeParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/recurring_payments/"+tC.data.ID+"/resume!", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RecurringPayment{}, - ).Return(nil) - - resp, err := recurringpayment.Resume(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/refund/api_refund.go b/refund/api_refund.go new file mode 100644 index 00000000..84818946 --- /dev/null +++ b/refund/api_refund.go @@ -0,0 +1,453 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package refund + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + common "github.com/xendit/xendit-go/v3/common" + utils "github.com/xendit/xendit-go/v3/utils" + "strings" +) + + +type RefundApi interface { + + /* + CancelRefund Method for CancelRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param refundID + @return ApiCancelRefundRequest + */ + CancelRefund(ctx context.Context, refundID string) ApiCancelRefundRequest + + // CancelRefundExecute executes the request + // @return Refund + CancelRefundExecute(r ApiCancelRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) + + /* + CreateRefund Method for CreateRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRefundRequest + */ + CreateRefund(ctx context.Context) ApiCreateRefundRequest + + // CreateRefundExecute executes the request + // @return Refund + CreateRefundExecute(r ApiCreateRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) + + /* + GetAllRefunds Method for GetAllRefunds + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllRefundsRequest + */ + GetAllRefunds(ctx context.Context) ApiGetAllRefundsRequest + + // GetAllRefundsExecute executes the request + // @return RefundList + GetAllRefundsExecute(r ApiGetAllRefundsRequest) (*RefundList, *http.Response, *common.XenditSdkError) + + /* + GetRefund Method for GetRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param refundID + @return ApiGetRefundRequest + */ + GetRefund(ctx context.Context, refundID string) ApiGetRefundRequest + + // GetRefundExecute executes the request + // @return Refund + GetRefundExecute(r ApiGetRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) +} + +// RefundApiService RefundApi service +type RefundApiService struct { + client common.IClient +} + +// NewRefundApi Create a new RefundApi service +func NewRefundApi (client common.IClient) RefundApi { + return &RefundApiService{ + client: client, + } +} + + +type ApiCancelRefundRequest struct { + ctx context.Context + ApiService RefundApi + refundID string + idempotencyKey *string +} + +func (r ApiCancelRefundRequest) IdempotencyKey(idempotencyKey string) ApiCancelRefundRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiCancelRefundRequest) Execute() (*Refund, *http.Response, *common.XenditSdkError) { + return r.ApiService.CancelRefundExecute(r) +} + +/* +CancelRefund Method for CancelRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param refundID + @return ApiCancelRefundRequest +*/ +func (a *RefundApiService) CancelRefund(ctx context.Context, refundID string) ApiCancelRefundRequest { + return ApiCancelRefundRequest{ + ApiService: a, + ctx: ctx, + refundID: refundID, + } +} + +// Execute executes the request +// @return Refund +func (a *RefundApiService) CancelRefundExecute(r ApiCancelRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Refund + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "RefundApiService.CancelRefund") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.CancelRefundExecute") + } + + localVarPath := localBasePath + "/refunds/{refundID}/cancel" + localVarPath = strings.Replace(localVarPath, "{"+"refundID"+"}", url.PathEscape(utils.ParameterValueToString(r.refundID, "refundID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.CancelRefundExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateRefundRequest struct { + ctx context.Context + ApiService RefundApi + idempotencyKey *string + createRefund *CreateRefund +} + +func (r ApiCreateRefundRequest) IdempotencyKey(idempotencyKey string) ApiCreateRefundRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiCreateRefundRequest) CreateRefund(createRefund CreateRefund) ApiCreateRefundRequest { + r.createRefund = &createRefund + return r +} + +func (r ApiCreateRefundRequest) Execute() (*Refund, *http.Response, *common.XenditSdkError) { + return r.ApiService.CreateRefundExecute(r) +} + +/* +CreateRefund Method for CreateRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateRefundRequest +*/ +func (a *RefundApiService) CreateRefund(ctx context.Context) ApiCreateRefundRequest { + return ApiCreateRefundRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Refund +func (a *RefundApiService) CreateRefundExecute(r ApiCreateRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Refund + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "RefundApiService.CreateRefund") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.CreateRefundExecute") + } + + localVarPath := localBasePath + "/refunds" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") + } + // body params + localVarPostBody = r.createRefund + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.CreateRefundExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetAllRefundsRequest struct { + ctx context.Context + ApiService RefundApi +} + +func (r ApiGetAllRefundsRequest) Execute() (*RefundList, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetAllRefundsExecute(r) +} + +/* +GetAllRefunds Method for GetAllRefunds + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAllRefundsRequest +*/ +func (a *RefundApiService) GetAllRefunds(ctx context.Context) ApiGetAllRefundsRequest { + return ApiGetAllRefundsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RefundList +func (a *RefundApiService) GetAllRefundsExecute(r ApiGetAllRefundsRequest) (*RefundList, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *RefundList + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "RefundApiService.GetAllRefunds") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.GetAllRefundsExecute") + } + + localVarPath := localBasePath + "/refunds/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.GetAllRefundsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRefundRequest struct { + ctx context.Context + ApiService RefundApi + refundID string + idempotencyKey *string +} + +func (r ApiGetRefundRequest) IdempotencyKey(idempotencyKey string) ApiGetRefundRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiGetRefundRequest) Execute() (*Refund, *http.Response, *common.XenditSdkError) { + return r.ApiService.GetRefundExecute(r) +} + +/* +GetRefund Method for GetRefund + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param refundID + @return ApiGetRefundRequest +*/ +func (a *RefundApiService) GetRefund(ctx context.Context, refundID string) ApiGetRefundRequest { + return ApiGetRefundRequest{ + ApiService: a, + ctx: ctx, + refundID: refundID, + } +} + +// Execute executes the request +// @return Refund +func (a *RefundApiService) GetRefundExecute(r ApiGetRefundRequest) (*Refund, *http.Response, *common.XenditSdkError) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *Refund + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "RefundApiService.GetRefund") + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.GetRefundExecute") + } + + localVarPath := localBasePath + "/refunds/{refundID}" + localVarPath = strings.Replace(localVarPath, "{"+"refundID"+"}", url.PathEscape(utils.ParameterValueToString(r.refundID, "refundID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + utils.ParameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "") + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewXenditSdkError(nil, "", "Error creating HTTP request: RefundApiService.GetRefundExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + xenditSdkError := common.NewXenditSdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, xenditSdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/refund/model_create_refund.go b/refund/model_create_refund.go new file mode 100644 index 00000000..10cb819c --- /dev/null +++ b/refund/model_create_refund.go @@ -0,0 +1,347 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund{} + +// CreateRefund struct for CreateRefund +type CreateRefund struct { + PaymentRequestId *string `json:"payment_request_id,omitempty"` + InvoiceId *string `json:"invoice_id,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + Amount *float64 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + Reason *string `json:"reason,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewCreateRefund instantiates a new CreateRefund object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund() *CreateRefund { + this := CreateRefund{} + return &this +} + +// NewCreateRefundWithDefaults instantiates a new CreateRefund object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefundWithDefaults() *CreateRefund { + this := CreateRefund{} + return &this +} + +// GetPaymentRequestId returns the PaymentRequestId field value if set, zero value otherwise. +func (o *CreateRefund) GetPaymentRequestId() string { + if o == nil || utils.IsNil(o.PaymentRequestId) { + var ret string + return ret + } + return *o.PaymentRequestId +} + +// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetPaymentRequestIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentRequestId) { + return nil, false + } + return o.PaymentRequestId, true +} + +// HasPaymentRequestId returns a boolean if a field has been set. +func (o *CreateRefund) HasPaymentRequestId() bool { + if o != nil && !utils.IsNil(o.PaymentRequestId) { + return true + } + + return false +} + +// SetPaymentRequestId gets a reference to the given string and assigns it to the PaymentRequestId field. +func (o *CreateRefund) SetPaymentRequestId(v string) { + o.PaymentRequestId = &v +} + +// GetInvoiceId returns the InvoiceId field value if set, zero value otherwise. +func (o *CreateRefund) GetInvoiceId() string { + if o == nil || utils.IsNil(o.InvoiceId) { + var ret string + return ret + } + return *o.InvoiceId +} + +// GetInvoiceIdOk returns a tuple with the InvoiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetInvoiceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.InvoiceId) { + return nil, false + } + return o.InvoiceId, true +} + +// HasInvoiceId returns a boolean if a field has been set. +func (o *CreateRefund) HasInvoiceId() bool { + if o != nil && !utils.IsNil(o.InvoiceId) { + return true + } + + return false +} + +// SetInvoiceId gets a reference to the given string and assigns it to the InvoiceId field. +func (o *CreateRefund) SetInvoiceId(v string) { + o.InvoiceId = &v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *CreateRefund) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *CreateRefund) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *CreateRefund) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *CreateRefund) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount) { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *CreateRefund) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *CreateRefund) SetAmount(v float64) { + o.Amount = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *CreateRefund) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *CreateRefund) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *CreateRefund) SetCurrency(v string) { + o.Currency = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *CreateRefund) GetReason() string { + if o == nil || utils.IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund) GetReasonOk() (*string, bool) { + if o == nil || utils.IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *CreateRefund) HasReason() bool { + if o != nil && !utils.IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *CreateRefund) SetReason(v string) { + o.Reason = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateRefund) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateRefund) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateRefund) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateRefund) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o CreateRefund) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.PaymentRequestId) { + toSerialize["payment_request_id"] = o.PaymentRequestId + } + if !utils.IsNil(o.InvoiceId) { + toSerialize["invoice_id"] = o.InvoiceId + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullableCreateRefund struct { + value *CreateRefund + isSet bool +} + +func (v NullableCreateRefund) Get() *CreateRefund { + return v.value +} + +func (v *NullableCreateRefund) Set(val *CreateRefund) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund(val *CreateRefund) *NullableCreateRefund { + return &NullableCreateRefund{value: val, isSet: true} +} + +func (v NullableCreateRefund) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_400_response.go b/refund/model_create_refund_400_response.go new file mode 100644 index 00000000..e316d3c7 --- /dev/null +++ b/refund/model_create_refund_400_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund400Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund400Response{} + +// CreateRefund400Response struct for CreateRefund400Response +type CreateRefund400Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefund400Response instantiates a new CreateRefund400Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund400Response() *CreateRefund400Response { + this := CreateRefund400Response{} + return &this +} + +// NewCreateRefund400ResponseWithDefaults instantiates a new CreateRefund400Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefund400ResponseWithDefaults() *CreateRefund400Response { + this := CreateRefund400Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefund400Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund400Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefund400Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefund400Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefund400Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund400Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefund400Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefund400Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefund400Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund400Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefund400Response struct { + value *CreateRefund400Response + isSet bool +} + +func (v NullableCreateRefund400Response) Get() *CreateRefund400Response { + return v.value +} + +func (v *NullableCreateRefund400Response) Set(val *CreateRefund400Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund400Response(val *CreateRefund400Response) *NullableCreateRefund400Response { + return &NullableCreateRefund400Response{value: val, isSet: true} +} + +func (v NullableCreateRefund400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_403_response.go b/refund/model_create_refund_403_response.go new file mode 100644 index 00000000..3135ae7c --- /dev/null +++ b/refund/model_create_refund_403_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund403Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund403Response{} + +// CreateRefund403Response struct for CreateRefund403Response +type CreateRefund403Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefund403Response instantiates a new CreateRefund403Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund403Response() *CreateRefund403Response { + this := CreateRefund403Response{} + return &this +} + +// NewCreateRefund403ResponseWithDefaults instantiates a new CreateRefund403Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefund403ResponseWithDefaults() *CreateRefund403Response { + this := CreateRefund403Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefund403Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund403Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefund403Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefund403Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefund403Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund403Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefund403Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefund403Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefund403Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund403Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefund403Response struct { + value *CreateRefund403Response + isSet bool +} + +func (v NullableCreateRefund403Response) Get() *CreateRefund403Response { + return v.value +} + +func (v *NullableCreateRefund403Response) Set(val *CreateRefund403Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund403Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund403Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund403Response(val *CreateRefund403Response) *NullableCreateRefund403Response { + return &NullableCreateRefund403Response{value: val, isSet: true} +} + +func (v NullableCreateRefund403Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund403Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_404_response.go b/refund/model_create_refund_404_response.go new file mode 100644 index 00000000..0337ea64 --- /dev/null +++ b/refund/model_create_refund_404_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund404Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund404Response{} + +// CreateRefund404Response struct for CreateRefund404Response +type CreateRefund404Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefund404Response instantiates a new CreateRefund404Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund404Response() *CreateRefund404Response { + this := CreateRefund404Response{} + return &this +} + +// NewCreateRefund404ResponseWithDefaults instantiates a new CreateRefund404Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefund404ResponseWithDefaults() *CreateRefund404Response { + this := CreateRefund404Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefund404Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund404Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefund404Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefund404Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefund404Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund404Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefund404Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefund404Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefund404Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund404Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefund404Response struct { + value *CreateRefund404Response + isSet bool +} + +func (v NullableCreateRefund404Response) Get() *CreateRefund404Response { + return v.value +} + +func (v *NullableCreateRefund404Response) Set(val *CreateRefund404Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund404Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund404Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund404Response(val *CreateRefund404Response) *NullableCreateRefund404Response { + return &NullableCreateRefund404Response{value: val, isSet: true} +} + +func (v NullableCreateRefund404Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund404Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_409_response.go b/refund/model_create_refund_409_response.go new file mode 100644 index 00000000..58691ab2 --- /dev/null +++ b/refund/model_create_refund_409_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund409Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund409Response{} + +// CreateRefund409Response struct for CreateRefund409Response +type CreateRefund409Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefund409Response instantiates a new CreateRefund409Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund409Response() *CreateRefund409Response { + this := CreateRefund409Response{} + return &this +} + +// NewCreateRefund409ResponseWithDefaults instantiates a new CreateRefund409Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefund409ResponseWithDefaults() *CreateRefund409Response { + this := CreateRefund409Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefund409Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund409Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefund409Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefund409Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefund409Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund409Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefund409Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefund409Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefund409Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund409Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefund409Response struct { + value *CreateRefund409Response + isSet bool +} + +func (v NullableCreateRefund409Response) Get() *CreateRefund409Response { + return v.value +} + +func (v *NullableCreateRefund409Response) Set(val *CreateRefund409Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund409Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund409Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund409Response(val *CreateRefund409Response) *NullableCreateRefund409Response { + return &NullableCreateRefund409Response{value: val, isSet: true} +} + +func (v NullableCreateRefund409Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund409Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_503_response.go b/refund/model_create_refund_503_response.go new file mode 100644 index 00000000..c6701198 --- /dev/null +++ b/refund/model_create_refund_503_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefund503Response type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefund503Response{} + +// CreateRefund503Response struct for CreateRefund503Response +type CreateRefund503Response struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefund503Response instantiates a new CreateRefund503Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefund503Response() *CreateRefund503Response { + this := CreateRefund503Response{} + return &this +} + +// NewCreateRefund503ResponseWithDefaults instantiates a new CreateRefund503Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefund503ResponseWithDefaults() *CreateRefund503Response { + this := CreateRefund503Response{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefund503Response) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund503Response) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefund503Response) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefund503Response) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefund503Response) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefund503Response) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefund503Response) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefund503Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefund503Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefund503Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefund503Response struct { + value *CreateRefund503Response + isSet bool +} + +func (v NullableCreateRefund503Response) Get() *CreateRefund503Response { + return v.value +} + +func (v *NullableCreateRefund503Response) Set(val *CreateRefund503Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefund503Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefund503Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefund503Response(val *CreateRefund503Response) *NullableCreateRefund503Response { + return &NullableCreateRefund503Response{value: val, isSet: true} +} + +func (v NullableCreateRefund503Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefund503Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_create_refund_default_response.go b/refund/model_create_refund_default_response.go new file mode 100644 index 00000000..408e32bd --- /dev/null +++ b/refund/model_create_refund_default_response.go @@ -0,0 +1,166 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the CreateRefundDefaultResponse type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &CreateRefundDefaultResponse{} + +// CreateRefundDefaultResponse struct for CreateRefundDefaultResponse +type CreateRefundDefaultResponse struct { + ErrorCode *string `json:"error_code,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateRefundDefaultResponse instantiates a new CreateRefundDefaultResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRefundDefaultResponse() *CreateRefundDefaultResponse { + this := CreateRefundDefaultResponse{} + return &this +} + +// NewCreateRefundDefaultResponseWithDefaults instantiates a new CreateRefundDefaultResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRefundDefaultResponseWithDefaults() *CreateRefundDefaultResponse { + this := CreateRefundDefaultResponse{} + return &this +} + +// GetErrorCode returns the ErrorCode field value if set, zero value otherwise. +func (o *CreateRefundDefaultResponse) GetErrorCode() string { + if o == nil || utils.IsNil(o.ErrorCode) { + var ret string + return ret + } + return *o.ErrorCode +} + +// GetErrorCodeOk returns a tuple with the ErrorCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefundDefaultResponse) GetErrorCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ErrorCode) { + return nil, false + } + return o.ErrorCode, true +} + +// HasErrorCode returns a boolean if a field has been set. +func (o *CreateRefundDefaultResponse) HasErrorCode() bool { + if o != nil && !utils.IsNil(o.ErrorCode) { + return true + } + + return false +} + +// SetErrorCode gets a reference to the given string and assigns it to the ErrorCode field. +func (o *CreateRefundDefaultResponse) SetErrorCode(v string) { + o.ErrorCode = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateRefundDefaultResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateRefundDefaultResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateRefundDefaultResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateRefundDefaultResponse) SetMessage(v string) { + o.Message = &v +} + +func (o CreateRefundDefaultResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRefundDefaultResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ErrorCode) { + toSerialize["error_code"] = o.ErrorCode + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateRefundDefaultResponse struct { + value *CreateRefundDefaultResponse + isSet bool +} + +func (v NullableCreateRefundDefaultResponse) Get() *CreateRefundDefaultResponse { + return v.value +} + +func (v *NullableCreateRefundDefaultResponse) Set(val *CreateRefundDefaultResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRefundDefaultResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRefundDefaultResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRefundDefaultResponse(val *CreateRefundDefaultResponse) *NullableCreateRefundDefaultResponse { + return &NullableCreateRefundDefaultResponse{value: val, isSet: true} +} + +func (v NullableCreateRefundDefaultResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRefundDefaultResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_refund.go b/refund/model_refund.go new file mode 100644 index 00000000..9591bf17 --- /dev/null +++ b/refund/model_refund.go @@ -0,0 +1,557 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the Refund type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &Refund{} + +// Refund struct for Refund +type Refund struct { + Id *string `json:"id,omitempty"` + PaymentRequestId *string `json:"payment_request_id,omitempty"` + Amount *float64 `json:"amount,omitempty"` + ChannelCode *string `json:"channel_code,omitempty"` + Country *string `json:"country,omitempty"` + Currency *string `json:"currency,omitempty"` + ReferenceId NullableString `json:"reference_id,omitempty"` + FailureCode NullableString `json:"failure_code,omitempty"` + RefundFeeAmount NullableFloat64 `json:"refund_fee_amount,omitempty"` + Created *string `json:"created,omitempty"` + Updated *string `json:"updated,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewRefund instantiates a new Refund object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefund() *Refund { + this := Refund{} + return &this +} + +// NewRefundWithDefaults instantiates a new Refund object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundWithDefaults() *Refund { + this := Refund{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Refund) GetId() string { + if o == nil || utils.IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Refund) HasId() bool { + if o != nil && !utils.IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Refund) SetId(v string) { + o.Id = &v +} + +// GetPaymentRequestId returns the PaymentRequestId field value if set, zero value otherwise. +func (o *Refund) GetPaymentRequestId() string { + if o == nil || utils.IsNil(o.PaymentRequestId) { + var ret string + return ret + } + return *o.PaymentRequestId +} + +// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetPaymentRequestIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentRequestId) { + return nil, false + } + return o.PaymentRequestId, true +} + +// HasPaymentRequestId returns a boolean if a field has been set. +func (o *Refund) HasPaymentRequestId() bool { + if o != nil && !utils.IsNil(o.PaymentRequestId) { + return true + } + + return false +} + +// SetPaymentRequestId gets a reference to the given string and assigns it to the PaymentRequestId field. +func (o *Refund) SetPaymentRequestId(v string) { + o.PaymentRequestId = &v +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *Refund) GetAmount() float64 { + if o == nil || utils.IsNil(o.Amount) { + var ret float64 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetAmountOk() (*float64, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Refund) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float64 and assigns it to the Amount field. +func (o *Refund) SetAmount(v float64) { + o.Amount = &v +} + +// GetChannelCode returns the ChannelCode field value if set, zero value otherwise. +func (o *Refund) GetChannelCode() string { + if o == nil || utils.IsNil(o.ChannelCode) { + var ret string + return ret + } + return *o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetChannelCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ChannelCode) { + return nil, false + } + return o.ChannelCode, true +} + +// HasChannelCode returns a boolean if a field has been set. +func (o *Refund) HasChannelCode() bool { + if o != nil && !utils.IsNil(o.ChannelCode) { + return true + } + + return false +} + +// SetChannelCode gets a reference to the given string and assigns it to the ChannelCode field. +func (o *Refund) SetChannelCode(v string) { + o.ChannelCode = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *Refund) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *Refund) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *Refund) SetCountry(v string) { + o.Country = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *Refund) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *Refund) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *Refund) SetCurrency(v string) { + o.Currency = &v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Refund) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId.Get()) { + var ret string + return ret + } + return *o.ReferenceId.Get() +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Refund) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ReferenceId.Get(), o.ReferenceId.IsSet() +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *Refund) HasReferenceId() bool { + if o != nil && o.ReferenceId.IsSet() { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given NullableString and assigns it to the ReferenceId field. +func (o *Refund) SetReferenceId(v string) { + o.ReferenceId.Set(&v) +} +// SetReferenceIdNil sets the value for ReferenceId to be an explicit nil +func (o *Refund) SetReferenceIdNil() { + o.ReferenceId.Set(nil) +} + +// UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +func (o *Refund) UnsetReferenceId() { + o.ReferenceId.Unset() +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Refund) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode.Get()) { + var ret string + return ret + } + return *o.FailureCode.Get() +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Refund) GetFailureCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureCode.Get(), o.FailureCode.IsSet() +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *Refund) HasFailureCode() bool { + if o != nil && o.FailureCode.IsSet() { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given NullableString and assigns it to the FailureCode field. +func (o *Refund) SetFailureCode(v string) { + o.FailureCode.Set(&v) +} +// SetFailureCodeNil sets the value for FailureCode to be an explicit nil +func (o *Refund) SetFailureCodeNil() { + o.FailureCode.Set(nil) +} + +// UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +func (o *Refund) UnsetFailureCode() { + o.FailureCode.Unset() +} + +// GetRefundFeeAmount returns the RefundFeeAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Refund) GetRefundFeeAmount() float64 { + if o == nil || utils.IsNil(o.RefundFeeAmount.Get()) { + var ret float64 + return ret + } + return *o.RefundFeeAmount.Get() +} + +// GetRefundFeeAmountOk returns a tuple with the RefundFeeAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Refund) GetRefundFeeAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RefundFeeAmount.Get(), o.RefundFeeAmount.IsSet() +} + +// HasRefundFeeAmount returns a boolean if a field has been set. +func (o *Refund) HasRefundFeeAmount() bool { + if o != nil && o.RefundFeeAmount.IsSet() { + return true + } + + return false +} + +// SetRefundFeeAmount gets a reference to the given NullableFloat64 and assigns it to the RefundFeeAmount field. +func (o *Refund) SetRefundFeeAmount(v float64) { + o.RefundFeeAmount.Set(&v) +} +// SetRefundFeeAmountNil sets the value for RefundFeeAmount to be an explicit nil +func (o *Refund) SetRefundFeeAmountNil() { + o.RefundFeeAmount.Set(nil) +} + +// UnsetRefundFeeAmount ensures that no value is present for RefundFeeAmount, not even an explicit nil +func (o *Refund) UnsetRefundFeeAmount() { + o.RefundFeeAmount.Unset() +} + +// GetCreated returns the Created field value if set, zero value otherwise. +func (o *Refund) GetCreated() string { + if o == nil || utils.IsNil(o.Created) { + var ret string + return ret + } + return *o.Created +} + +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetCreatedOk() (*string, bool) { + if o == nil || utils.IsNil(o.Created) { + return nil, false + } + return o.Created, true +} + +// HasCreated returns a boolean if a field has been set. +func (o *Refund) HasCreated() bool { + if o != nil && !utils.IsNil(o.Created) { + return true + } + + return false +} + +// SetCreated gets a reference to the given string and assigns it to the Created field. +func (o *Refund) SetCreated(v string) { + o.Created = &v +} + +// GetUpdated returns the Updated field value if set, zero value otherwise. +func (o *Refund) GetUpdated() string { + if o == nil || utils.IsNil(o.Updated) { + var ret string + return ret + } + return *o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Refund) GetUpdatedOk() (*string, bool) { + if o == nil || utils.IsNil(o.Updated) { + return nil, false + } + return o.Updated, true +} + +// HasUpdated returns a boolean if a field has been set. +func (o *Refund) HasUpdated() bool { + if o != nil && !utils.IsNil(o.Updated) { + return true + } + + return false +} + +// SetUpdated gets a reference to the given string and assigns it to the Updated field. +func (o *Refund) SetUpdated(v string) { + o.Updated = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Refund) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Refund) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Refund) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Refund) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o Refund) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Refund) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !utils.IsNil(o.PaymentRequestId) { + toSerialize["payment_request_id"] = o.PaymentRequestId + } + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.ChannelCode) { + toSerialize["channel_code"] = o.ChannelCode + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if o.ReferenceId.IsSet() { + toSerialize["reference_id"] = o.ReferenceId.Get() + } + if o.FailureCode.IsSet() { + toSerialize["failure_code"] = o.FailureCode.Get() + } + if o.RefundFeeAmount.IsSet() { + toSerialize["refund_fee_amount"] = o.RefundFeeAmount.Get() + } + if !utils.IsNil(o.Created) { + toSerialize["created"] = o.Created + } + if !utils.IsNil(o.Updated) { + toSerialize["updated"] = o.Updated + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullableRefund struct { + value *Refund + isSet bool +} + +func (v NullableRefund) Get() *Refund { + return v.value +} + +func (v *NullableRefund) Set(val *Refund) { + v.value = val + v.isSet = true +} + +func (v NullableRefund) IsSet() bool { + return v.isSet +} + +func (v *NullableRefund) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefund(val *Refund) *NullableRefund { + return &NullableRefund{value: val, isSet: true} +} + +func (v NullableRefund) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefund) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_refund_list.go b/refund/model_refund_list.go new file mode 100644 index 00000000..64d77a76 --- /dev/null +++ b/refund/model_refund_list.go @@ -0,0 +1,157 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.2.3 +*/ + +// Code generated by OpenAPI Generator; DO NOT EDIT. + +package refund + +import ( + "encoding/json" + + + utils "github.com/xendit/xendit-go/v3/utils" + +) + +// checks if the RefundList type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &RefundList{} + +// RefundList struct for RefundList +type RefundList struct { + Data []Refund `json:"data"` + HasMore *bool `json:"has_more,omitempty"` +} + +// NewRefundList instantiates a new RefundList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefundList(data []Refund) *RefundList { + this := RefundList{} + this.Data = data + return &this +} + +// NewRefundListWithDefaults instantiates a new RefundList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundListWithDefaults() *RefundList { + this := RefundList{} + return &this +} + +// GetData returns the Data field value +func (o *RefundList) GetData() []Refund { + if o == nil { + var ret []Refund + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *RefundList) GetDataOk() ([]Refund, bool) { + if o == nil { + return nil, false + } + return o.Data, true +} + +// SetData sets field value +func (o *RefundList) SetData(v []Refund) { + o.Data = v +} + +// GetHasMore returns the HasMore field value if set, zero value otherwise. +func (o *RefundList) GetHasMore() bool { + if o == nil || utils.IsNil(o.HasMore) { + var ret bool + return ret + } + return *o.HasMore +} + +// GetHasMoreOk returns a tuple with the HasMore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundList) GetHasMoreOk() (*bool, bool) { + if o == nil || utils.IsNil(o.HasMore) { + return nil, false + } + return o.HasMore, true +} + +// HasHasMore returns a boolean if a field has been set. +func (o *RefundList) HasHasMore() bool { + if o != nil && !utils.IsNil(o.HasMore) { + return true + } + + return false +} + +// SetHasMore gets a reference to the given bool and assigns it to the HasMore field. +func (o *RefundList) SetHasMore(v bool) { + o.HasMore = &v +} + +func (o RefundList) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + if !utils.IsNil(o.HasMore) { + toSerialize["has_more"] = o.HasMore + } + return toSerialize, nil +} + +type NullableRefundList struct { + value *RefundList + isSet bool +} + +func (v NullableRefundList) Get() *RefundList { + return v.value +} + +func (v *NullableRefundList) Set(val *RefundList) { + v.value = val + v.isSet = true +} + +func (v NullableRefundList) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundList(val *RefundList) *NullableRefundList { + return &NullableRefundList{value: val, isSet: true} +} + +func (v NullableRefundList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/nullable.go b/refund/nullable.go new file mode 100644 index 00000000..8e0f5aa9 --- /dev/null +++ b/refund/nullable.go @@ -0,0 +1,301 @@ +// Code generated by Xendit OpenAPI Generator; DO NOT EDIT. +package refund + +import ( + "encoding/json" + "time" +) + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} \ No newline at end of file diff --git a/report.go b/report.go deleted file mode 100644 index 1256c198..00000000 --- a/report.go +++ /dev/null @@ -1,21 +0,0 @@ -package xendit - -import "time" - -type Report struct { - ID string `json:"id"` - Type string `json:"type"` - Filter Filter `json:"filter"` - Format string `json:"format"` - Status string `json:"status"` - Url string `json:"url,omitempty"` - Currency string `json:"currency"` - BusinessID string `json:"business_id"` - Created time.Time `json:"created"` - Updated time.Time `json:"updated"` -} - -type Filter struct { - From string `json:"from"` - To string `json:"to"` -} diff --git a/report/client.go b/report/client.go deleted file mode 100644 index df18d64a..00000000 --- a/report/client.go +++ /dev/null @@ -1,82 +0,0 @@ -package report - -import ( - "context" - "fmt" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" - "net/http" -) - -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// GenerateReport creates a report -func (c *Client) GenerateReport(data *GenerateReportParams) (*xendit.Report, *xendit.Error) { - return c.GenerateReportWithContext(context.Background(), data) -} - -// GenerateReportWithContext creates a report with context -func (c *Client) GenerateReportWithContext(ctx context.Context, data *GenerateReportParams) (*xendit.Report, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Report{} - - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/reports", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetReport gets a report -func (c *Client) GetReport(data *GetReportParams) (*xendit.Report, *xendit.Error) { - return c.GetReportWithContext(context.Background(), data) -} - -// GetReportWithContext gets a report with context -func (c *Client) GetReportWithContext(ctx context.Context, data *GetReportParams) (*xendit.Report, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Report{} - - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/reports/%s", c.Opt.XenditURL, data.ReportID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/report/example_test.go b/report/example_test.go deleted file mode 100644 index 5e46a9d6..00000000 --- a/report/example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package report - -import ( - "github.com/xendit/xendit-go" - "log" -) - -func ExampleGenerateReport() { - xendit.Opt.SecretKey = "examplesecretkey" - - generateReport := GenerateReportParams{ - Type: "BALANCE_HISTORY", // "BALANCE_HISTORY", "TRANSACTIONS", "UPCOMING_TRANSACTIONS" - Filter: Filter{ - From: "2020-01-01T00:00:00.000Z", - To: "2020-12-31T23:59:59.999Z", - }, - } - - resp, err := GenerateReport(&generateReport) - if err != nil { - log.Fatal(err.ErrorCode) - } - - log.Printf("generated report: %+v\n", resp) -} - -func ExampleGetReport() { - xendit.Opt.SecretKey = "examplesecretkey" - - getReport := GetReportParams{ - ReportID: "report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28", - } - - resp, err := GetReport(&getReport) - if err != nil { - log.Fatal(err.ErrorCode) - } - - log.Printf("retrieved report: %+v\n", resp) -} diff --git a/report/params.go b/report/params.go deleted file mode 100644 index bd5595ba..00000000 --- a/report/params.go +++ /dev/null @@ -1,20 +0,0 @@ -package report - -type Filter struct { - From string `json:"from"` - To string `json:"to"` -} - -type GenerateReportParams struct { - ForUserID string `json:"-"` - Type string `json:"type" validate:"required"` - Filter Filter `json:"filter" validate:"required"` - Format string `json:"format"` - Currency string `json:"currency"` - ReportVersion string `json:"report_version"` -} - -type GetReportParams struct { - ForUserID string `json:"-"` - ReportID string `json:"report_id" validate:"required"` -} diff --git a/report/report.go b/report/report.go deleted file mode 100644 index 725e7ce1..00000000 --- a/report/report.go +++ /dev/null @@ -1,43 +0,0 @@ -package report - -import ( - "context" - "github.com/xendit/xendit-go" -) - -// GenerateReport generates a report -func GenerateReport(data *GenerateReportParams) (*xendit.Report, *xendit.Error) { - return GenerateReportWithContext(context.Background(), data) -} - -// GenerateReportWithContext generates a report with context -func GenerateReportWithContext(ctx context.Context, data *GenerateReportParams) (*xendit.Report, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GenerateReportWithContext(ctx, data) -} - -// GetReport gets a report -func GetReport(data *GetReportParams) (*xendit.Report, *xendit.Error) { - return GetReportWithContext(context.Background(), data) -} - -// GetReportWithContext gets a report with context -func GetReportWithContext(ctx context.Context, data *GetReportParams) (*xendit.Report, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetReportWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/report/report_test.go b/report/report_test.go deleted file mode 100644 index 2e98c8f8..00000000 --- a/report/report_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package report - -import ( - "context" - "encoding/json" - "errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" - "net/http" - "testing" - "time" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, url string, secretKey string, header http.Header, body interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, url, secretKey, header, body, result) - - resultString := `{ - "id": "report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28", - "type": "BALANCE_HISTORY", - "status": "COMPLETED", - "filter": { - "from": "2021-06-23T04:01:55.574Z", - "to": "2021-06-24T04:01:55.574Z" - }, - "format": "CSV", - "url": "https://transaction-report-files.s3-us-west-2.amazonaws.com/{report_name}", - "currency": "IDR", - "business_id": "5f34f60535ba7c1c0eed846a", - "created": "2021-06-24T04:01:55.570Z", - "updated": "2021-06-24T04:01:55.570Z" - }` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGenerateReport(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - created := time.Date(2021, 6, 24, 04, 01, 55, 570000000, time.UTC) - updated := time.Date(2021, 6, 24, 04, 01, 55, 570000000, time.UTC) - - testCases := []struct { - desc string - data *GenerateReportParams - expectedRes *xendit.Report - expectedErr *xendit.Error - }{ - { - desc: "should generate report", - data: &GenerateReportParams{ - Type: "BALANCE_HISTORY", // "BALANCE_HISTORY", "TRANSACTIONS", "UPCOMING_TRANSACTIONS" - Filter: Filter{ - From: "2021-06-23T04:01:55.574Z", - To: "2021-06-24T04:01:55.574Z", - }, - }, - expectedRes: &xendit.Report{ - ID: "report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28", - Type: "BALANCE_HISTORY", - Status: "COMPLETED", - Filter: xendit.Filter{ - From: "2021-06-23T04:01:55.574Z", - To: "2021-06-24T04:01:55.574Z", - }, - Format: "CSV", - Url: "https://transaction-report-files.s3-us-west-2.amazonaws.com/{report_name}", - Currency: "IDR", - BusinessID: "5f34f60535ba7c1c0eed846a", - Created: created, - Updated: updated, - }, - }, - { - desc: "should report error", - data: &GenerateReportParams{}, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Type'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On("Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/reports", - xendit.Opt.SecretKey, - mock.Anything, - mock.Anything, - &xendit.Report{}, - ).Return(nil) - - resp, err := GenerateReport(tC.data) - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetReport(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - created := time.Date(2021, 6, 24, 04, 01, 55, 570000000, time.UTC) - updated := time.Date(2021, 6, 24, 04, 01, 55, 570000000, time.UTC) - - testCases := []struct { - desc string - data *GetReportParams - expectedRes *xendit.Report - expectedErr *xendit.Error - }{ - { - desc: "should generate report", - data: &GetReportParams{ - ReportID: "report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28", - }, - expectedRes: &xendit.Report{ - ID: "report_5c1b34a2-6ceb-4c24-aba9-c836bac82b28", - Type: "BALANCE_HISTORY", - Status: "COMPLETED", - Filter: xendit.Filter{ - From: "2021-06-23T04:01:55.574Z", - To: "2021-06-24T04:01:55.574Z", - }, - Format: "CSV", - Url: "https://transaction-report-files.s3-us-west-2.amazonaws.com/{report_name}", - Currency: "IDR", - BusinessID: "5f34f60535ba7c1c0eed846a", - Created: created, - Updated: updated, - }, - }, - { - desc: "should report error", - data: &GetReportParams{}, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'ReportID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On("Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/reports/"+tC.data.ReportID, - xendit.Opt.SecretKey, - mock.Anything, - mock.Anything, - &xendit.Report{}, - ).Return(nil) - - resp, err := GetReport(tC.data) - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/response.go b/response.go new file mode 100644 index 00000000..d3cd8858 --- /dev/null +++ b/response.go @@ -0,0 +1,38 @@ +// Code generated by OpenAPI Generator; DO NOT EDIT. +package xendit + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/retailoutlet.go b/retailoutlet.go deleted file mode 100644 index 1d0654d2..00000000 --- a/retailoutlet.go +++ /dev/null @@ -1,66 +0,0 @@ -package xendit - -import "time" - -// RetailOutletNameEnum constants are the available retail outlet names -type RetailOutletNameEnum string - -// This consists the values that RetailOutletNameEnum can take -const ( - RetailOutletNameAlfamart RetailOutletNameEnum = "ALFAMART" - RetailOutletNameIndomaret RetailOutletNameEnum = "INDOMARET" -) - -// RetailOutlet contains data from Xendit's API response of retail outlet related requests. -// For more details see https://xendit.github.io/apireference/?bash#retail-outlets. -// For documentation of subpackage retailoutlet, checkout https://pkg.go.dev/github.com/xendit/xendit-go/retailoutlet -type RetailOutlet struct { - IsSingleUse bool `json:"is_single_use"` - Status string `json:"status"` - OwnerID string `json:"owner_id"` - ExternalID string `json:"external_id"` - RetailOutletName RetailOutletNameEnum `json:"retail_outlet_name"` - Prefix string `json:"prefix"` - Name string `json:"name"` - PaymentCode string `json:"payment_code"` - Type string `json:"type"` - ExpectedAmount float64 `json:"expected_amount"` - ExpirationDate *time.Time `json:"expiration_date"` - ID string `json:"id"` -} - -// RetailOutletPayments contains data from Xendit's API response of Retail Outlet Get Payments By Fixed Payment Code ID requests. -// For more details see https://developers.xendit.co/api-reference/#get-payments-by-fixed-payment-code-id. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/retailoutlet/ -type RetailOutletPayments struct { - Data []RetailOutletPayment `json:"data"` - HasMore bool `json:"has_more"` - Links RetailOutletPaymentsLinks `json:"links"` -} - -// RetailOutletPaymentsLinks is data that contained in `RetailOutletPayments` at Links field. -type RetailOutletPaymentsLinks struct { - Href string `json:"href"` - Rel string `json:"rel"` - Method string `json:"method"` -} - -// RetailOutletPayments contains data from Xendit's API response of Retail Outlet Get Payments By Fixed Payment Code ID requests. -// For more details see https://developers.xendit.co/api-reference/#get-payments-by-fixed-payment-code-id. -// For documentation of subpackage direct debit payment, checkout https://pkg.go.dev/github.com/xendit/xendit-go/retailoutlet/ - -type RetailOutletPayment struct { - ID string `json:"id"` - FixedPaymentCodeID string `json:"fixed_payment_code_id"` - FixedPaymentCodePaymentID string `json:"fixed_payment_code_payment_id"` - PaymentCode string `json:"payment_code"` - RetailOutletName RetailOutletNameEnum `json:"retail_outlet_name"` - Amount float64 `json:"amount"` - Status string `json:"status"` - OwnerID string `json:"owner_id"` - Name string `json:"name"` - Prefix string `json:"prefix"` - PaymentID string `json:"payment_id"` - ExternalID string `json:"external_id"` - TransactionTimestamp *time.Time `json:"transaction_timestamp"` -} diff --git a/retailoutlet/client.go b/retailoutlet/client.go deleted file mode 100644 index c0e0e097..00000000 --- a/retailoutlet/client.go +++ /dev/null @@ -1,148 +0,0 @@ -package retailoutlet - -import ( - "context" - "fmt" - "net/http" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke invoice API. -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// CreateFixedPaymentCode creates new retail outlet fixed payment code -func (c *Client) CreateFixedPaymentCode(data *CreateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return c.CreateFixedPaymentCodeWithContext(context.Background(), data) -} - -// CreateFixedPaymentCodeWithContext creates new retail outlet fixed payment code with context -func (c *Client) CreateFixedPaymentCodeWithContext(ctx context.Context, data *CreateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RetailOutlet{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "POST", - fmt.Sprintf("%s/fixed_payment_code", c.Opt.XenditURL), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetFixedPaymentCode gets one retail outlet fixed payment code -func (c *Client) GetFixedPaymentCode(data *GetFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return c.GetFixedPaymentCodeWithContext(context.Background(), data) -} - -// GetFixedPaymentCodeWithContext gets one retail outlet fixed payment code with context -func (c *Client) GetFixedPaymentCodeWithContext(ctx context.Context, data *GetFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RetailOutlet{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/fixed_payment_code/%s", c.Opt.XenditURL, data.FixedPaymentCodeID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetPaymentByFixedPaymentCode gets list retail outlet fixed payment code -func (c *Client) GetPaymentByFixedPaymentCode(data *GetPaymentByFixedPaymentCodeParams) (*xendit.RetailOutletPayments, *xendit.Error) { - return c.GetPaymentByFixedPaymentCodeWithContext(context.Background(), data) -} - -// GetPaymentByFixedPaymentCodeWithContext gets list retail outlet fixed payment code with context -func (c *Client) GetPaymentByFixedPaymentCodeWithContext(ctx context.Context, data *GetPaymentByFixedPaymentCodeParams) (*xendit.RetailOutletPayments, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RetailOutletPayments{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/fixed_payment_code/%s/payments", c.Opt.XenditURL, data.FixedPaymentCodeID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// UpdateFixedPaymentCode updates a retail outlet fixed payment code -func (c *Client) UpdateFixedPaymentCode(data *UpdateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return c.UpdateFixedPaymentCodeWithContext(context.Background(), data) -} - -// UpdateFixedPaymentCodeWithContext updates a retail outlet fixed payment code with context -func (c *Client) UpdateFixedPaymentCodeWithContext(ctx context.Context, data *UpdateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.RetailOutlet{} - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "PATCH", - fmt.Sprintf("%s/fixed_payment_code/%s", c.Opt.XenditURL, data.FixedPaymentCodeID), - c.Opt.SecretKey, - header, - data, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/retailoutlet/example_test.go b/retailoutlet/example_test.go deleted file mode 100644 index d5dd42bc..00000000 --- a/retailoutlet/example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package retailoutlet_test - -import ( - "fmt" - "log" - "time" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/retailoutlet" -) - -func ExampleCreateFixedPaymentCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - data := retailoutlet.CreateFixedPaymentCodeParams{ - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - Name: "Michael Jackson", - ExpectedAmount: 200000, - } - - resp, err := retailoutlet.CreateFixedPaymentCode(&data) - if err != nil { - log.Fatal(err.ErrorCode) - } - - fmt.Printf("created retail outlet fixed payment code: %+v\n", resp) -} - -func ExampleGetFixedPaymentCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - getFixedPaymentCodeData := retailoutlet.GetFixedPaymentCodeParams{ - FixedPaymentCodeID: "123", - } - - resp, err := retailoutlet.GetFixedPaymentCode(&getFixedPaymentCodeData) - if err != nil { - log.Fatal(err.ErrorCode) - } - - fmt.Printf("retrieved retail outlet fixed payment code: %+v\n", resp) -} - -func ExampleGetPaymentByFixedPaymentCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - getPaymentByFixedPaymentCodeData := retailoutlet.GetPaymentByFixedPaymentCodeParams{ - FixedPaymentCodeID: "123", - } - - resp, err := retailoutlet.GetPaymentByFixedPaymentCode(&getPaymentByFixedPaymentCodeData) - if err != nil { - log.Fatal(err.ErrorCode) - } - - fmt.Printf("retrieved retail outlet list payment by fixed payment code %+v\n", resp) -} - -func ExampleUpdateFixedPaymentCode() { - xendit.Opt.SecretKey = "examplesecretkey" - - expirationDate := time.Now().AddDate(0, 0, 1) - - updateFixedPaymentCodeData := retailoutlet.UpdateFixedPaymentCodeParams{ - FixedPaymentCodeID: "123", - Name: "Billy Jackson", - ExpectedAmount: 2000000, - ExpirationDate: &expirationDate, - } - - resp, err := retailoutlet.UpdateFixedPaymentCode(&updateFixedPaymentCodeData) - if err != nil { - log.Fatal(err.ErrorCode) - } - fmt.Printf("updated retail outlet fixed payment code: %+v\n", resp) -} diff --git a/retailoutlet/params.go b/retailoutlet/params.go deleted file mode 100644 index a590e941..00000000 --- a/retailoutlet/params.go +++ /dev/null @@ -1,40 +0,0 @@ -package retailoutlet - -import ( - "time" - - "github.com/xendit/xendit-go" -) - -// CreateFixedPaymentCodeParams contains parameters for CreateFixedPaymentCode -type CreateFixedPaymentCodeParams struct { - ForUserID string `json:"-"` - ExternalID string `json:"external_id" validate:"required"` - RetailOutletName xendit.RetailOutletNameEnum `json:"retail_outlet_name" validate:"required"` - Name string `json:"name" validate:"required"` - ExpectedAmount float64 `json:"expected_amount" validate:"required"` - PaymentCode string `json:"payment_code,omitempty"` - ExpirationDate *time.Time `json:"expiration_date,omitempty"` - IsSingleUse *bool `json:"is_single_use,omitempty"` -} - -// GetFixedPaymentCodeParams contains parameters for GetFixedPaymentCode -type GetFixedPaymentCodeParams struct { - ForUserID string `json:"-"` - FixedPaymentCodeID string `json:"fixed_payment_code_id" validate:"required"` -} - -// GetPaymentByFixedPaymentCodeParams contains parameters for GetFixedPaymentCode -type GetPaymentByFixedPaymentCodeParams struct { - ForUserID string `json:"-"` - FixedPaymentCodeID string `json:"fixed_payment_code_id" validate:"required"` -} - -// UpdateFixedPaymentCodeParams contains parameters for UpdateFixedPaymentCode -type UpdateFixedPaymentCodeParams struct { - ForUserID string `json:"-"` - FixedPaymentCodeID string `json:"-" validate:"required"` - Name string `json:"name,omitempty"` - ExpectedAmount float64 `json:"expected_amount,omitempty"` - ExpirationDate *time.Time `json:"expiration_date,omitempty"` -} diff --git a/retailoutlet/retailoutlet.go b/retailoutlet/retailoutlet.go deleted file mode 100644 index e2497435..00000000 --- a/retailoutlet/retailoutlet.go +++ /dev/null @@ -1,74 +0,0 @@ -package retailoutlet - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// CreateFixedPaymentCode creates new retail outlet fixed payment code -func CreateFixedPaymentCode(data *CreateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return CreateFixedPaymentCodeWithContext(context.Background(), data) -} - -// CreateFixedPaymentCodeWithContext creates new retail outlet fixed payment code with context -func CreateFixedPaymentCodeWithContext(ctx context.Context, data *CreateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.CreateFixedPaymentCodeWithContext(ctx, data) -} - -// GetFixedPaymentCode gets one retail outlet fixed payment code -func GetFixedPaymentCode(data *GetFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return GetFixedPaymentCodeWithContext(context.Background(), data) -} - -// GetFixedPaymentCodeWithContext gets one retail outlet fixed payment code with context -func GetFixedPaymentCodeWithContext(ctx context.Context, data *GetFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetFixedPaymentCodeWithContext(ctx, data) -} - -// GetPaymentByFixedPaymentCode gets one retail outlet fixed payment code -func GetPaymentByFixedPaymentCode(data *GetPaymentByFixedPaymentCodeParams) (*xendit.RetailOutletPayments, *xendit.Error) { - return GetPaymentByFixedPaymentCodeWithContext(context.Background(), data) -} - -// GetPaymentByFixedPaymentCodeWithContext gets one retail outlet fixed payment code with context -func GetPaymentByFixedPaymentCodeWithContext(ctx context.Context, data *GetPaymentByFixedPaymentCodeParams) (*xendit.RetailOutletPayments, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetPaymentByFixedPaymentCodeWithContext(ctx, data) -} - -// UpdateFixedPaymentCode updates a retail outlet fixed payment code -func UpdateFixedPaymentCode(data *UpdateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - return UpdateFixedPaymentCodeWithContext(context.Background(), data) -} - -// UpdateFixedPaymentCodeWithContext updates a retail outlet fixed payment code with context -func UpdateFixedPaymentCodeWithContext(ctx context.Context, data *UpdateFixedPaymentCodeParams) (*xendit.RetailOutlet, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.UpdateFixedPaymentCodeWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/retailoutlet/retailoutlet_test.go b/retailoutlet/retailoutlet_test.go deleted file mode 100644 index 4ddb3c1f..00000000 --- a/retailoutlet/retailoutlet_test.go +++ /dev/null @@ -1,351 +0,0 @@ -package retailoutlet_test - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/retailoutlet" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - expirationDate, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - result.(*xendit.RetailOutlet).IsSingleUse = false - result.(*xendit.RetailOutlet).Status = "ACTIVE" - result.(*xendit.RetailOutlet).OwnerID = "someone-owner-id" - result.(*xendit.RetailOutlet).ExternalID = "retailoutlet-external-id" - result.(*xendit.RetailOutlet).RetailOutletName = xendit.RetailOutletNameAlfamart - result.(*xendit.RetailOutlet).Prefix = "TEST" - result.(*xendit.RetailOutlet).Name = "Michael Jackson" - result.(*xendit.RetailOutlet).PaymentCode = "TEST123" - result.(*xendit.RetailOutlet).Type = "USER" - result.(*xendit.RetailOutlet).ExpectedAmount = 200000 - result.(*xendit.RetailOutlet).ExpirationDate = &expirationDate - result.(*xendit.RetailOutlet).ID = "123" - - return nil -} - -func TestCreateFixedPaymentCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - expirationDate, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *retailoutlet.CreateFixedPaymentCodeParams - expectedRes *xendit.RetailOutlet - expectedErr *xendit.Error - }{ - { - desc: "should create a retail outlet fixed payment code", - data: &retailoutlet.CreateFixedPaymentCodeParams{ - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - Name: "Michael Jackson", - ExpectedAmount: 200000, - }, - expectedRes: &xendit.RetailOutlet{ - IsSingleUse: false, - Status: "ACTIVE", - OwnerID: "someone-owner-id", - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - Prefix: "TEST", - Name: "Michael Jackson", - PaymentCode: "TEST123", - Type: "USER", - ExpectedAmount: 200000, - ExpirationDate: &expirationDate, - ID: "123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &retailoutlet.CreateFixedPaymentCodeParams{ - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - ExpectedAmount: 200000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'Name'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "POST", - xendit.Opt.XenditURL+"/fixed_payment_code", - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.RetailOutlet{}, - ).Return(nil) - - resp, err := retailoutlet.CreateFixedPaymentCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestGetFixedPaymentCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - expirationDate, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *retailoutlet.GetFixedPaymentCodeParams - expectedRes *xendit.RetailOutlet - expectedErr *xendit.Error - }{ - { - desc: "should gets a retail outlet fixed payment code", - data: &retailoutlet.GetFixedPaymentCodeParams{ - FixedPaymentCodeID: "123", - }, - expectedRes: &xendit.RetailOutlet{ - IsSingleUse: false, - Status: "ACTIVE", - OwnerID: "someone-owner-id", - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - Prefix: "TEST", - Name: "Michael Jackson", - PaymentCode: "TEST123", - Type: "USER", - ExpectedAmount: 200000, - ExpirationDate: &expirationDate, - ID: "123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &retailoutlet.GetFixedPaymentCodeParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'FixedPaymentCodeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/fixed_payment_code/"+tC.data.FixedPaymentCodeID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RetailOutlet{}, - ).Return(nil) - - resp, err := retailoutlet.GetFixedPaymentCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -func TestUpdateFixedPaymentCode(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - expirationDate, _ := time.Parse(time.RFC3339, "2050-01-01T00:00:00.000Z") - - testCases := []struct { - desc string - data *retailoutlet.UpdateFixedPaymentCodeParams - expectedRes *xendit.RetailOutlet - expectedErr *xendit.Error - }{ - { - desc: "should update a retail outlet fixed payment code", - data: &retailoutlet.UpdateFixedPaymentCodeParams{ - FixedPaymentCodeID: "123", - ExpirationDate: &expirationDate, - Name: "Michael Jackson", - ExpectedAmount: 200000, - }, - expectedRes: &xendit.RetailOutlet{ - IsSingleUse: false, - Status: "ACTIVE", - OwnerID: "someone-owner-id", - ExternalID: "retailoutlet-external-id", - RetailOutletName: xendit.RetailOutletNameAlfamart, - Prefix: "TEST", - Name: "Michael Jackson", - PaymentCode: "TEST123", - Type: "USER", - ExpectedAmount: 200000, - ExpirationDate: &expirationDate, - ID: "123", - }, - expectedErr: nil, - }, - { - desc: "should report missing required fields", - data: &retailoutlet.UpdateFixedPaymentCodeParams{ - ExpectedAmount: 200000, - }, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'FixedPaymentCodeID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "PATCH", - xendit.Opt.XenditURL+"/fixed_payment_code/"+tC.data.FixedPaymentCodeID, - xendit.Opt.SecretKey, - nil, - tC.data, - &xendit.RetailOutlet{}, - ).Return(nil) - - resp, err := retailoutlet.UpdateFixedPaymentCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetPaymentByFixedPaymentCodeMock struct { - mock.Mock -} - -func (m *apiRequesterGetPaymentByFixedPaymentCodeMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `{ - "data": [ - { - "status": "COMPLETED", - "fixed_payment_code_payment_id": "61c53c4fdc1b825d9a58ff54", - "fixed_payment_code_id": "61c53c3727c7a679826dd90a", - "amount": 2500000, - "name": "JOHN DOE", - "prefix": "TEST", - "payment_code": "TEST892185", - "payment_id": "1640315983260", - "external_id": "FPC-1640315959", - "retail_outlet_name": "ALFAMART", - "transaction_timestamp": "2021-12-24T03:19:43.260Z", - "id": "61c53c4f6cc577e4038ab099", - "owner_id": "60ca10b83ffd534ece8aa856" - } - ], - "has_more": true, - "links": { - "href": "https://api.xendit.co/fixed_payment_code/61c53c3727c7a679826dd90a/payments?limit=1&after_id=61c53c4f6cc577e4038ab099", - "rel": "next", - "method": "GET" - } - }` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetListTransaction(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetPaymentByFixedPaymentCodeMock) - initTesting(apiRequesterMockObj) - - transactionTimestamp := time.Date(2021, 12, 24, 3, 19, 43, 260000000, time.UTC) - - testCases := []struct { - desc string - data *retailoutlet.GetPaymentByFixedPaymentCodeParams - expectedRes *xendit.RetailOutletPayments - expectedErr *xendit.Error - }{ - { - desc: "should get a list of transaction", - data: &retailoutlet.GetPaymentByFixedPaymentCodeParams{ - FixedPaymentCodeID: "61c53c4fdc1b825d9a58ff54", - }, - expectedRes: &xendit.RetailOutletPayments{ - Data: []xendit.RetailOutletPayment{ - { - Status: "COMPLETED", - FixedPaymentCodePaymentID: "61c53c4fdc1b825d9a58ff54", - FixedPaymentCodeID: "61c53c3727c7a679826dd90a", - Amount: 2500000, - Name: "JOHN DOE", - Prefix: "TEST", - PaymentCode: "TEST892185", - PaymentID: "1640315983260", - ExternalID: "FPC-1640315959", - RetailOutletName: "ALFAMART", - TransactionTimestamp: &transactionTimestamp, - ID: "61c53c4f6cc577e4038ab099", - OwnerID: "60ca10b83ffd534ece8aa856", - }, - }, - HasMore: true, - Links: xendit.RetailOutletPaymentsLinks{ - Href: "https://api.xendit.co/fixed_payment_code/61c53c3727c7a679826dd90a/payments?limit=1&after_id=61c53c4f6cc577e4038ab099", - Rel: "next", - Method: "GET", - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - - t.Run(tC.desc, func(t *testing.T) { - - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/fixed_payment_code/"+tC.data.FixedPaymentCodeID+"/payments", - xendit.Opt.SecretKey, - nil, - nil, - &xendit.RetailOutletPayments{}, - ).Return(nil) - - resp, err := retailoutlet.GetPaymentByFixedPaymentCode(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/test/api_balance_test.go b/test/api_balance_test.go new file mode 100644 index 00000000..7f217d33 --- /dev/null +++ b/test/api_balance_test.go @@ -0,0 +1,42 @@ +/* +Transaction Service V4 API_test + +Testing BalanceApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_BalanceApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test BalanceApiService GetBalance", func(t *testing.T) { + + resp, httpRes, err := apiClient.BalanceApi.GetBalance(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_invoice_test.go b/test/api_invoice_test.go new file mode 100644 index 00000000..a9c7a7e0 --- /dev/null +++ b/test/api_invoice_test.go @@ -0,0 +1,76 @@ +/* +xendit-invoice-service_test + +Testing InvoiceApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_InvoiceApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test InvoiceApiService CreateInvoice", func(t *testing.T) { + + resp, httpRes, err := apiClient.InvoiceApi.CreateInvoice(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService ExpireInvoice", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceApi.ExpireInvoice(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService GetInvoiceById", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceApi.GetInvoiceById(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService GetInvoices", func(t *testing.T) { + + resp, httpRes, err := apiClient.InvoiceApi.GetInvoices(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_payment_method_test.go b/test/api_payment_method_test.go new file mode 100644 index 00000000..3feb5d99 --- /dev/null +++ b/test/api_payment_method_test.go @@ -0,0 +1,133 @@ +/* +Payment Method Service v2_test + +Testing PaymentMethodApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_PaymentMethodApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test PaymentMethodApiService AuthPaymentMethod", func(t *testing.T) { + + var paymentMethodId string + + resp, httpRes, err := apiClient.PaymentMethodApi.AuthPaymentMethod(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService CreatePaymentMethod", func(t *testing.T) { + + resp, httpRes, err := apiClient.PaymentMethodApi.CreatePaymentMethod(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService ExpirePaymentMethod", func(t *testing.T) { + + var paymentMethodId string + + resp, httpRes, err := apiClient.PaymentMethodApi.ExpirePaymentMethod(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService GetAllPaymentChannels", func(t *testing.T) { + + resp, httpRes, err := apiClient.PaymentMethodApi.GetAllPaymentChannels(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService GetAllPaymentMethods", func(t *testing.T) { + + resp, httpRes, err := apiClient.PaymentMethodApi.GetAllPaymentMethods(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService GetPaymentMethodByID", func(t *testing.T) { + + var paymentMethodId string + + resp, httpRes, err := apiClient.PaymentMethodApi.GetPaymentMethodByID(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService GetPaymentsByPaymentMethodId", func(t *testing.T) { + + var paymentMethodId string + + resp, httpRes, err := apiClient.PaymentMethodApi.GetPaymentsByPaymentMethodId(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService PatchPaymentMethod", func(t *testing.T) { + + var paymentMethodId string + + resp, httpRes, err := apiClient.PaymentMethodApi.PatchPaymentMethod(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentMethodApiService SimulatePayment", func(t *testing.T) { + + var paymentMethodId string + + httpRes, err := apiClient.PaymentMethodApi.SimulatePayment(context.Background(), paymentMethodId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_payment_request_test.go b/test/api_payment_request_test.go new file mode 100644 index 00000000..6779a5fc --- /dev/null +++ b/test/api_payment_request_test.go @@ -0,0 +1,112 @@ +/* +Payment Requests_test + +Testing PaymentRequestApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_PaymentRequestApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test PaymentRequestApiService AuthorizePaymentRequest", func(t *testing.T) { + + var paymentRequestId string + + resp, httpRes, err := apiClient.PaymentRequestApi.AuthorizePaymentRequest(context.Background(), paymentRequestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService CapturePaymentRequest", func(t *testing.T) { + + var paymentRequestId string + + resp, httpRes, err := apiClient.PaymentRequestApi.CapturePaymentRequest(context.Background(), paymentRequestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService CreatePaymentRequest", func(t *testing.T) { + + resp, httpRes, err := apiClient.PaymentRequestApi.CreatePaymentRequest(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService GetAllPaymentRequests", func(t *testing.T) { + + resp, httpRes, err := apiClient.PaymentRequestApi.GetAllPaymentRequests(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService GetPaymentRequestByID", func(t *testing.T) { + + var paymentRequestId string + + resp, httpRes, err := apiClient.PaymentRequestApi.GetPaymentRequestByID(context.Background(), paymentRequestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService GetPaymentRequestCaptures", func(t *testing.T) { + + var paymentRequestId string + + resp, httpRes, err := apiClient.PaymentRequestApi.GetPaymentRequestCaptures(context.Background(), paymentRequestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PaymentRequestApiService ResendPaymentRequestAuth", func(t *testing.T) { + + var paymentRequestId string + + resp, httpRes, err := apiClient.PaymentRequestApi.ResendPaymentRequestAuth(context.Background(), paymentRequestId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_payout_test.go b/test/api_payout_test.go new file mode 100644 index 00000000..b9f4b91d --- /dev/null +++ b/test/api_payout_test.go @@ -0,0 +1,86 @@ +/* +Payout Service_test + +Testing PayoutApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_PayoutApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test PayoutApiService CancelPayout", func(t *testing.T) { + + var id string + + resp, httpRes, err := apiClient.PayoutApi.CancelPayout(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PayoutApiService CreatePayout", func(t *testing.T) { + + resp, httpRes, err := apiClient.PayoutApi.CreatePayout(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PayoutApiService GetPayoutById", func(t *testing.T) { + + var id string + + resp, httpRes, err := apiClient.PayoutApi.GetPayoutById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PayoutApiService GetPayoutChannels", func(t *testing.T) { + + resp, httpRes, err := apiClient.PayoutApi.GetPayoutChannels(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PayoutApiService GetPayouts", func(t *testing.T) { + + resp, httpRes, err := apiClient.PayoutApi.GetPayouts(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_refund_test.go b/test/api_refund_test.go new file mode 100644 index 00000000..222dfdd6 --- /dev/null +++ b/test/api_refund_test.go @@ -0,0 +1,76 @@ +/* +Refund Service_test + +Testing RefundApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_RefundApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test RefundApiService CancelRefund", func(t *testing.T) { + + var refundID string + + resp, httpRes, err := apiClient.RefundApi.CancelRefund(context.Background(), refundID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RefundApiService CreateRefund", func(t *testing.T) { + + resp, httpRes, err := apiClient.RefundApi.CreateRefund(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RefundApiService GetAllRefunds", func(t *testing.T) { + + resp, httpRes, err := apiClient.RefundApi.GetAllRefunds(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RefundApiService GetRefund", func(t *testing.T) { + + var refundID string + + resp, httpRes, err := apiClient.RefundApi.GetRefund(context.Background(), refundID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_transaction_test.go b/test/api_transaction_test.go new file mode 100644 index 00000000..c8040e3e --- /dev/null +++ b/test/api_transaction_test.go @@ -0,0 +1,54 @@ +/* +Transaction Service V4 API_test + +Testing TransactionApiService + +*/ + +// Code generated by OpenAPI Generator + +package xendit + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + xendit "github.com/xendit/xendit-go/v3" +) + +func Test_xendit_TransactionApiService(t *testing.T) { + + apiKey := os.Getenv("XND_APIKEY") + if apiKey == "" { + t.Skip("XND_APIKEY not set") + } + + apiClient := xendit.NewClient(apiKey) + + t.Run("Test TransactionApiService GetAllTransactions", func(t *testing.T) { + + resp, httpRes, err := apiClient.TransactionApi.GetAllTransactions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TransactionApiService GetTransactionByID", func(t *testing.T) { + + var id string + + resp, httpRes, err := apiClient.TransactionApi.GetTransactionByID(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/transaction.go b/transaction.go deleted file mode 100644 index 9ad42dd2..00000000 --- a/transaction.go +++ /dev/null @@ -1,48 +0,0 @@ -package xendit - -import "time" - -// Transaction contains data from Xendit's API response of invoice related request. -// For more details see https://developers.xendit.co/api-reference/#transactions. -// For documentation of subpackage payout, checkout https://pkg.go.dev/github.com/xendit/xendit-go/transaction -type Transaction struct { - ID string `json:"id"` - ProductID string `json:"product_id"` - Type string `json:"type"` - ChannelCode string `json:"channel_code,omitempty"` - ReferenceID string `json:"reference_id"` - AccountIdentifier string `json:"account_identifier,omitempty"` - Currency string `json:"currency,omitempty"` - Amount float64 `json:"amount"` - NetAmount float64 `json:"net_amount"` - Cashflow string `json:"cashflow"` - Status string `json:"status"` - ChannelCategory string `json:"channel_category"` - BusinessID string `json:"business_id"` - SettlementStatus string `json:"settlement_status,omitempty"` - EstimatedSettlementTime *time.Time `json:"estimated_settlement_time,omitempty"` - Created *time.Time `json:"created"` - Updated *time.Time `json:"updated"` - Fee TransactionFee `json:"fee"` -} - -type TransactionFee struct { - XenditFee float64 `json:"xendit_fee,omitempty"` - ValueAddedTax float64 `json:"value_added_tax,omitempty"` - XenditWithholdingTax float64 `json:"xendit_withholding_tax,omitempty"` - ThirdPartyWithholdingTax float64 `json:"third_party_withholding_tax,omitempty"` - Status string `json:"status,omitempty"` -} - -type ListTransactions struct { - Data []Transaction `json:"data"` - HasMore bool `json:"has_more"` - Links []ListTransactionsLinks `json:"links"` -} - -// ListTransactionsLinks is data that contained in `ListTransactions` at Links field. -type ListTransactionsLinks struct { - Href string `json:"href"` - Rel string `json:"rel"` - Method string `json:"method"` -} diff --git a/transaction/client.go b/transaction/client.go deleted file mode 100644 index 7c017a55..00000000 --- a/transaction/client.go +++ /dev/null @@ -1,89 +0,0 @@ -package transaction - -import ( - "context" - "fmt" - "net/http" - - "github.com/google/go-querystring/query" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/utils/validator" -) - -// Client is the client used to invoke transaction API -type Client struct { - Opt *xendit.Option - APIRequester xendit.APIRequester -} - -// GetTransaction gets one transaction -func (c *Client) GetTransaction(data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) { - return c.GetTransactionnWithContext(context.Background(), data) -} - -// GetTransactionnWithContext gets one transaction with context -func (c *Client) GetTransactionnWithContext(ctx context.Context, data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.Transaction{} - - header := http.Header{} - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/transactions/%s", c.Opt.XenditURL, data.TransactionID), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} - -// GetListTransaction gets list transactions -func (c *Client) GetListTransaction(data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { - return c.GetListTransactionWithContext(context.Background(), data) -} - -// GetListTransactionWithContext gets list transactions with context -func (c *Client) GetListTransactionWithContext(ctx context.Context, data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { - if err := validator.ValidateRequired(ctx, data); err != nil { - return nil, validator.APIValidatorErr(err) - } - - response := &xendit.ListTransactions{} - header := http.Header{} - - if data.ForUserID != "" { - header.Add("for-user-id", data.ForUserID) - } - - qs, errParseQuery := query.Values(data) - if errParseQuery != nil { - return nil, xendit.FromGoErr(errParseQuery) - } - err := c.APIRequester.Call( - ctx, - "GET", - fmt.Sprintf("%s/transactions?%s", c.Opt.XenditURL, qs.Encode()), - c.Opt.SecretKey, - header, - nil, - response, - ) - if err != nil { - return nil, err - } - - return response, nil -} diff --git a/transaction/example_test.go b/transaction/example_test.go deleted file mode 100644 index d0605e3e..00000000 --- a/transaction/example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package transaction_test - -import ( - "fmt" - "log" - - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/transaction" -) - -func ExampleGetTransaction() { - xendit.Opt.SecretKey = "examplesecretkey" - - getTransaction := transaction.GetTransactionParams{ - TransactionID: "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - } - - resp, err := transaction.GetTransaction(&getTransaction) - if err != nil { - log.Fatal(err.ErrorCode) - } - - fmt.Printf("retrieved transaction %+v\n", resp) -} - -func ExampleGetListTransaction() { - xendit.Opt.SecretKey = "examplesecretkey" - - getListTransaction := transaction.GetListTransactionParams{ - Limit: 10, - } - - resp, err := transaction.GetListTransaction(&getListTransaction) - if err != nil { - log.Fatal(err.ErrorCode) - } - - fmt.Printf("retrieved list transaction %+v\n", resp) -} diff --git a/transaction/params.go b/transaction/params.go deleted file mode 100644 index 87b82b2f..00000000 --- a/transaction/params.go +++ /dev/null @@ -1,27 +0,0 @@ -package transaction - -// GetTransactionParams contains parameters for GetTransaction -type GetTransactionParams struct { - ForUserID string `json:"-"` - TransactionID string `json:"transaction_id" validate:"required"` -} - -// GetListTransactionParams contains parameters for GetListTransaction -type GetListTransactionParams struct { - ForUserID string `url:"-"` - Types []string `url:"types,omitempty"` - Statuses []string `url:"statuses,omitempty"` - ChannelCategories []string `url:"channel_categories,omitempty"` - ReferenceID string `url:"reference_id,omitempty"` - ProductID string `url:"product_id,omitempty"` - AccountIdentifier string `url:"account_identifier,omitempty"` - Currency string `url:"currency,omitempty"` - Amount float64 `url:"Amount,omitempty"` - CreatedGte string `url:"created[gte],omitempty"` - CreatedLte string `url:"created[lte],omitempty"` - UpdatedGte string `url:"updated[gte],omitempty"` - UpdatedLte string `url:"updated[lte],omitempty"` - Limit int `url:"limit,omitempty"` - AfterID string `url:"after_id,omitempty"` - BeforeID string `url:"before_id,omitempty"` -} diff --git a/transaction/transaction.go b/transaction/transaction.go deleted file mode 100644 index e037596a..00000000 --- a/transaction/transaction.go +++ /dev/null @@ -1,44 +0,0 @@ -package transaction - -import ( - "context" - - "github.com/xendit/xendit-go" -) - -// GetTransaction gets one retail outlet fixed payment code -func GetTransaction(data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) { - return GetTransactionnWithContext(context.Background(), data) -} - -// GetTransactionnWithContext gets one retail outlet fixed payment code with context -func GetTransactionnWithContext(ctx context.Context, data *GetTransactionParams) (*xendit.Transaction, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetTransactionnWithContext(ctx, data) -} - -// GetListTransaction gets one retail outlet fixed payment code -func GetListTransaction(data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { - return GetListTransactionnWithContext(context.Background(), data) -} - -// GetListTransactionnWithContext gets one retail outlet fixed payment code with context -func GetListTransactionnWithContext(ctx context.Context, data *GetListTransactionParams) (*xendit.ListTransactions, *xendit.Error) { - client, err := getClient() - if err != nil { - return nil, err - } - - return client.GetListTransactionWithContext(ctx, data) -} - -func getClient() (*Client, *xendit.Error) { - return &Client{ - Opt: &xendit.Opt, - APIRequester: xendit.GetAPIRequester(), - }, nil -} diff --git a/transaction/transaction_test.go b/transaction/transaction_test.go deleted file mode 100644 index 5a8ebd2e..00000000 --- a/transaction/transaction_test.go +++ /dev/null @@ -1,285 +0,0 @@ -package transaction_test - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "testing" - "time" - - "github.com/google/go-querystring/query" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/xendit/xendit-go" - "github.com/xendit/xendit-go/transaction" - "github.com/xendit/xendit-go/utils/validator" -) - -func initTesting(apiRequesterMockObj xendit.APIRequester) { - xendit.Opt.SecretKey = "examplesecretkey" - xendit.SetAPIRequester(apiRequesterMockObj) -} - -type apiRequesterMock struct { - mock.Mock -} - -func (m *apiRequesterMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `{ - "id": "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - "product_id": "d290f1ee-6c54-4b01-90e6-d701748f0701", - "type": "PAYMENT", - "channel_category": "RETAIL_OUTLET", - "channel_code": "ALFAMART", - "reference_id": "ref23232", - "account_identifier": null, - "currency": "IDR", - "amount": 500000, - "cashflow": "MONEY_IN", - "status": "SUCCESS", - "business_id": "5fc9f5b246f820517e38c84d", - "created": "2021-06-23T02:42:15.601Z", - "updated": "2021-06-23T02:42:15.601Z", - "fee":{ - "xendit_fee": 1500, - "value_added_tax": 500, - "xendit_withholding_tax": 0, - "third_party_withholding_tax": 0, - "status": "COMPLETED" - } - }` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetTransaction(t *testing.T) { - apiRequesterMockObj := new(apiRequesterMock) - initTesting(apiRequesterMockObj) - - created := time.Date(2021, 6, 23, 2, 42, 15, 601000000, time.UTC) - updated := time.Date(2021, 6, 23, 2, 42, 15, 601000000, time.UTC) - - testCases := []struct { - desc string - data *transaction.GetTransactionParams - expectedRes *xendit.Transaction - expectedErr *xendit.Error - }{ - { - desc: "should gets a single transaction", - data: &transaction.GetTransactionParams{ - TransactionID: "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - }, - expectedRes: &xendit.Transaction{ - ID: "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - ProductID: "d290f1ee-6c54-4b01-90e6-d701748f0701", - Type: "PAYMENT", - ChannelCategory: "RETAIL_OUTLET", - ChannelCode: "ALFAMART", - ReferenceID: "ref23232", - AccountIdentifier: "", - Currency: "IDR", - Amount: 500000, - Cashflow: "MONEY_IN", - Status: "SUCCESS", - BusinessID: "5fc9f5b246f820517e38c84d", - Created: &created, - Updated: &updated, - Fee: xendit.TransactionFee{ - XenditFee: 1500, - ValueAddedTax: 500, - XenditWithholdingTax: 0, - ThirdPartyWithholdingTax: 0, - Status: "COMPLETED", - }}, - expectedErr: nil, - }, - - { - desc: "should report missing required fields", - data: &transaction.GetTransactionParams{}, - expectedRes: nil, - expectedErr: validator.APIValidatorErr(errors.New("Missing required fields: 'TransactionID'")), - }, - } - - for _, tC := range testCases { - t.Run(tC.desc, func(t *testing.T) { - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/transactions/"+tC.data.TransactionID, - xendit.Opt.SecretKey, - nil, - nil, - &xendit.Transaction{}, - ).Return(nil) - - resp, err := transaction.GetTransaction(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} - -type apiRequesterGetListMock struct { - mock.Mock -} - -func (m *apiRequesterGetListMock) Call(ctx context.Context, method string, path string, secretKey string, header http.Header, params interface{}, result interface{}) *xendit.Error { - m.Called(ctx, method, path, secretKey, nil, params, result) - - resultString := `{ - "has_more": true, - "data": [ - { - "id": "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - "product_id": "d290f1ee-6c54-4b01-90e6-d701748f0701", - "type": "PAYMENT", - "status": "SUCCESS", - "channel_category": "RETAIL_OUTLET", - "channel_code": "ALFAMART", - "reference_id": "ref23244", - "account_identifier": null, - "currency": "IDR", - "amount": 1, - "cashflow": "MONEY_IN", - "settlement_status" : "PENDING", - "estimated_settlement_time" : "2021-06-26T04:03:02.123Z", - "business_id": "5fc9f5b246f820517e38c84d", - "created": "2021-06-23T02:42:15.601Z", - "updated": "2021-06-23T02:42:15.601Z" - }, - { - "id": "txn_a765a3f0-34c0-41ee-8686-bca11835ebdc", - "product_id": "d290f1ee-6c54-4b01-90e6-d701748f0700", - "type": "PAYMENT", - "status": "SUCCESS", - "channel_category": "RETAIL_OUTLET", - "channel_code": "ALFAMART", - "reference_id": "ref242424", - "account_identifier": null, - "currency": "IDR", - "amount": 1, - "cashflow": "MONEY_IN", - "business_id": "5fc9f5b246f820517e38c84d", - "created": "2021-06-23T02:39:23.176Z", - "updated": "2021-06-23T02:39:23.176Z" - } - ], - "links": [ - { - "href": "/transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc", - "method": "GET", - "rel": "next" - } - ] - }` - - _ = json.Unmarshal([]byte(resultString), &result) - - return nil -} - -func TestGetListTransaction(t *testing.T) { - apiRequesterMockObj := new(apiRequesterGetListMock) - initTesting(apiRequesterMockObj) - - created := time.Date(2021, 6, 23, 2, 42, 15, 601000000, time.UTC) - updated := time.Date(2021, 6, 23, 2, 42, 15, 601000000, time.UTC) - - created2 := time.Date(2021, 6, 23, 2, 39, 23, 176000000, time.UTC) - updated2 := time.Date(2021, 6, 23, 2, 39, 23, 176000000, time.UTC) - - estimatedSettlement := time.Date(2021, 6, 26, 4, 3, 2, 123000000, time.UTC) - - testCases := []struct { - desc string - data *transaction.GetListTransactionParams - expectedRes *xendit.ListTransactions - expectedErr *xendit.Error - }{ - { - desc: "should get a list of transaction", - data: &transaction.GetListTransactionParams{}, - expectedRes: &xendit.ListTransactions{ - HasMore: true, - Data: []xendit.Transaction{ - { - ID: "txn_13dd178d-41fa-40b7-8fd3-f83675d6f413", - ProductID: "d290f1ee-6c54-4b01-90e6-d701748f0701", - Type: "PAYMENT", - Status: "SUCCESS", - ChannelCategory: "RETAIL_OUTLET", - ChannelCode: "ALFAMART", - ReferenceID: "ref23244", - AccountIdentifier: "", - Currency: "IDR", - Amount: 1, - Cashflow: "MONEY_IN", - BusinessID: "5fc9f5b246f820517e38c84d", - SettlementStatus: "PENDING", - EstimatedSettlementTime: &estimatedSettlement, - Created: &created, - Updated: &updated, - }, - { - ID: "txn_a765a3f0-34c0-41ee-8686-bca11835ebdc", - ProductID: "d290f1ee-6c54-4b01-90e6-d701748f0700", - Type: "PAYMENT", - Status: "SUCCESS", - ChannelCategory: "RETAIL_OUTLET", - ChannelCode: "ALFAMART", - ReferenceID: "ref242424", - AccountIdentifier: "", - Currency: "IDR", - Amount: 1, - Cashflow: "MONEY_IN", - BusinessID: "5fc9f5b246f820517e38c84d", - Created: &created2, - Updated: &updated2, - }, - }, - Links: []xendit.ListTransactionsLinks{ - { - Href: "/transactions?types=PAYMENT&statuses=SUCCESS&channel_categories=EWALLET&channel_categories=RETAIL_OUTLET&limit=2&after_id=txn_a765a3f0-34c0-41ee-8686-bca11835ebdc", - Method: "GET", - Rel: "next", - }, - }, - }, - expectedErr: nil, - }, - } - - for _, tC := range testCases { - - qs, _ := query.Values(tC.data) - - t.Run(tC.desc, func(t *testing.T) { - - apiRequesterMockObj.On( - "Call", - context.Background(), - "GET", - xendit.Opt.XenditURL+"/transactions?"+qs.Encode(), - xendit.Opt.SecretKey, - nil, - nil, - &xendit.ListTransactions{}, - ).Return(nil) - - resp, err := transaction.GetListTransaction(tC.data) - - assert.Equal(t, tC.expectedRes, resp) - assert.Equal(t, tC.expectedErr, err) - }) - } -} diff --git a/utils/helpers.go b/utils/helpers.go new file mode 100644 index 00000000..53a96de4 --- /dev/null +++ b/utils/helpers.go @@ -0,0 +1,184 @@ +package utils + +import ( + "strconv" + "strings" + "fmt" + "reflect" + "time" + "net/url" +) + +type FormFile struct { + FileBytes []byte + FileName string + FormFileName string +} + +func Atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// SelectHeaderAccept join all accept types and return +func SelectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if Contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// Contains is a case insensitive match, finding needle in a haystack +func Contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// SelectHeaderContentType select a content type from the available list. +func SelectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if Contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// ParameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func ParameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + + if v.CanInterface() { + if t, ok := v.Interface().(fmt.Stringer); ok { + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.String(), collectionType) + return + } + } + + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i