diff --git a/.github/workflows/generate-release-tag.yml b/.github/workflows/generate-release-tag.yml index af91f10a..df9a5caf 100644 --- a/.github/workflows/generate-release-tag.yml +++ b/.github/workflows/generate-release-tag.yml @@ -4,16 +4,67 @@ on: types: [create-release-tag] jobs: - build: + testing: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10","3.11","3.12"] steps: - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Print python version + run: python --version + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run test + run: DEVELOPMENT_API_KEY=${{ secrets.DEVELOPMENT_API_KEY }} pytest -s --log-cli-level=DEBUG + + send-test-result: + name: Slack Notification + needs: [testing] + if: always() && (needs.testing.result == 'success' || needs.testing.result == 'failure') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set Slack Color + id: set_color + run: | + if [ "${{ needs.testing.result }}" == "success" ]; then + echo "color=good" >> $GITHUB_ENV + else + echo "color=danger" >> $GITHUB_ENV + fi + + - name: Send Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_TITLE: "[xendi-python] CI pipeline for ${{ github.event.client_payload.version }}" + SLACK_MESSAGE: 'Test Result: ${{ needs.testing.result }}' + SLACK_COLOR: ${{ steps.set_color.outputs.color }} + + publish-release-tag: + runs-on: ubuntu-latest + needs: [testing] + 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 }}" | sed -e 's/%0A/\n/g' >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" + - name: Create Release id: create-release uses: actions/create-release@latest @@ -27,7 +78,7 @@ jobs: prerelease: false publish-pypi: - needs: [build] + needs: [publish-release-tag] runs-on: ubuntu-latest environment: name: pypi @@ -36,16 +87,20 @@ jobs: id-token: write steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Install Poetry uses: abatilo/actions-poetry@v2 with: poetry-version: '1.6.1' + - name: Build Package run: | poetry install poetry build + - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 62c9ac8e..df9425bf 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,4 @@ target/ .ipynb_checkpoints .vscode/ -test.py - -# virtual environment -xendit-python +test.py \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d5c60bc2..eb270e41 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -3,6 +3,7 @@ .gitignore LICENSE README.md +docs/Configuration.md docs/PaymentRequestApi.md docs/payment_request/Capture.md docs/payment_request/CaptureList.md @@ -31,10 +32,13 @@ docs/payment_request/EWalletChannelCode.md docs/payment_request/EWalletChannelProperties.md docs/payment_request/EWalletParameters.md docs/payment_request/Error.md +docs/payment_request/InvoicePartnerMetadata.md docs/payment_request/OverTheCounter.md docs/payment_request/OverTheCounterChannelCode.md docs/payment_request/OverTheCounterChannelProperties.md docs/payment_request/OverTheCounterParameters.md +docs/payment_request/PaymentCallback.md +docs/payment_request/PaymentCallbackData.md docs/payment_request/PaymentMethod.md docs/payment_request/PaymentMethodParameters.md docs/payment_request/PaymentMethodReusability.md @@ -84,6 +88,9 @@ test/test_direct_debit_channel_properties_bank_account.py test/test_direct_debit_channel_properties_bank_redirect.py test/test_direct_debit_channel_properties_debit_card.py test/test_e_wallet_all_of.py +test/test_invoice_partner_metadata.py +test/test_payment_callback.py +test/test_payment_callback_data.py test/test_payment_request.py test/test_payment_request_action.py test/test_payment_request_api.py @@ -142,10 +149,13 @@ xendit/payment_request/model/e_wallet_channel_code.py xendit/payment_request/model/e_wallet_channel_properties.py xendit/payment_request/model/e_wallet_parameters.py xendit/payment_request/model/error.py +xendit/payment_request/model/invoice_partner_metadata.py xendit/payment_request/model/over_the_counter.py xendit/payment_request/model/over_the_counter_channel_code.py xendit/payment_request/model/over_the_counter_channel_properties.py xendit/payment_request/model/over_the_counter_parameters.py +xendit/payment_request/model/payment_callback.py +xendit/payment_request/model/payment_callback_data.py xendit/payment_request/model/payment_method.py xendit/payment_request/model/payment_method_parameters.py xendit/payment_request/model/payment_method_reusability.py diff --git a/README.md b/README.md index bb957f2b..a1c60b06 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The official Xendit Python SDK provides a simple and convenient way to call Xendit's REST API in applications written in Python. -* Package version: 3.6.0 +* Package version: 3.7.0 ## Requirements @@ -48,7 +48,7 @@ You can sign up for a free Dashboard account [here](https://dashboard.xendit.co/ ```python import xendit -from xendit.apis import BalancesApi +from xendit.apis import BalanceApi from pprint import pprint xendit.set_api_key('XENDIT_API_KEY') @@ -56,10 +56,10 @@ xendit.set_api_key('XENDIT_API_KEY') client = xendit.ApiClient() try: - response = BalancesApi(client).get_balance('CASH') + response = BalanceApi(client).get_balance('CASH') pprint(response) except xendit.XenditSdkException as e: - print("Exception when calling BalancesApi->get_balance: %s\n" % e) + print("Exception when calling BalanceApi->get_balance: %s\n" % e) ``` # Documentation @@ -80,4 +80,4 @@ All URIs are relative to *https://api.xendit.co*. For more information about ou Further Reading * [Xendit Docs](https://docs.xendit.co/) -* [Xendit API Reference](https://developers.xendit.co/) +* [Xendit API Reference](https://developers.xendit.co/) \ No newline at end of file diff --git a/docs/BalanceApi.md b/docs/BalanceApi.md index 7cc9d67c..d32c363b 100644 --- a/docs/BalanceApi.md +++ b/docs/BalanceApi.md @@ -77,4 +77,5 @@ except xendit.XenditSdkException as e: print("Exception when calling BalanceApi->get_balance: %s\n" % e) ``` + [[Back to README]](../README.md) diff --git a/docs/Configuration.md b/docs/Configuration.md new file mode 100644 index 00000000..ceea5222 --- /dev/null +++ b/docs/Configuration.md @@ -0,0 +1,46 @@ +# Configuration + +To start using the API, you need to configure the secret key and initiate the client instance. +You can use all the configurable parameters in the `configuration.py` file to customize your client (e.g. setting up proxy) + +## Configuration Parameters + +Here are the parameters you can set: + +| Name | Type | Description | Default | Example | +|-------------|:----------:|:---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|--------------------------------------------------------------------------| +| **host** | **str** | Base URL | https://api.xendit.co | https://www.example.com | +| **api_key** | **str** | Xendit API Key | None | `xnd_development_abcdefghijke9112015j1nuq808912tr` | +| **proxy** | **str** | Proxy URL | None | https://www.proxy.example.com | +| **ssl_ca_cert** | **str** | Specifies the path to a PEM format CA certificate files, which can be used to verify the backend server certificates | None | `/path/to/your/example_cert.crt` | +| **logger** | **map** | Logging Settings (e.g. `package_logger`, `urllib3_logger`) | `{"package_logger": "xendit", "urllib3_logger": "urllib3"}` | `{"package_logger": "your_logger_package", "urllib3_logger": "urllib3"}` | +| **logger_format** | **str** | Log format | `%(asctime)s %(levelname)s %(message)s` | `%(asctime)s %(levelname)s %(message)s` | +| **logger_file** | **str** | Debug file location | None | `/path/to/your/debug_file.txt` | +| **debug** | **bool** | Debug Switch | `False` | `True` | +| **connection_pool_maxsize** | **number** | urllib3 connection pool's maximum number of connections saved per pool. | `multiprocessing.cpu_count() * 5` | 5 | + +## Sample Usage + +Some parameters are able to set during initialization, e.g. `host`, `api_key` +Some are set after initialization, e.g. `proxy` + +```python +import xendit + +configuration = xendit.Configuration( + host='https://www.example.com', + api_key='xnd_development_abcdefghijke9112015j1nuq808912tr' +) +configuration.proxy = 'https://www.proxy.example.com' +configuration.ssl_ca_cert = '/path/to/your/example_cert.crt' +configuration.logger["package_logger"] = 'your_logger_package' +configuration.logger["urllib3_logger"] = 'urllib3_logger' +configuration.logger_format = '%(asctime)s %(levelname)s %(message)s`' +configuration.logger_file = 'path/to/your/debug_file.txt' +configuration.connection_pool_maxsize = 10 + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient(configuration) +``` + + diff --git a/docs/CustomerApi.md b/docs/CustomerApi.md index a27cd107..b681c996 100644 --- a/docs/CustomerApi.md +++ b/docs/CustomerApi.md @@ -396,4 +396,5 @@ except xendit.XenditSdkException as e: print("Exception when calling CustomerApi->update_customer: %s\n" % e) ``` + [[Back to README]](../README.md) diff --git a/docs/InvoiceApi.md b/docs/InvoiceApi.md index 13bf297b..c947c295 100644 --- a/docs/InvoiceApi.md +++ b/docs/InvoiceApi.md @@ -146,7 +146,7 @@ create_invoice_request = CreateInvoiceRequest( ), ], ) # CreateInvoiceRequest -for_user_id = "62efe4c33e45694d63f585f8" # str | Business ID of the sub-account merchant (XP feature) +for_user_id = "62efe4c33e45694d63f585f0" # str | Business ID of the sub-account merchant (XP feature) # example passing only required values which don't have defaults set try: @@ -204,7 +204,7 @@ api_client = xendit.ApiClient() # Create an instance of the API class api_instance = InvoiceApi(api_client) invoice_id = "62efe4c33e45294d63f585f2" # str | Invoice ID -for_user_id = "62efe4c33e45694d63f585f8" # str | Business ID of the sub-account merchant (XP feature) +for_user_id = "62efe4c33e45694d63f585f0" # str | Business ID of the sub-account merchant (XP feature) # example passing only required values which don't have defaults set try: @@ -275,7 +275,7 @@ xendit.set_api_key('XENDIT API KEY') api_client = xendit.ApiClient() # Create an instance of the API class api_instance = InvoiceApi(api_client) -for_user_id = "62efe4c33e45694d63f585f8" # str | Business ID of the sub-account merchant (XP feature) +for_user_id = "62efe4c33e45694d63f585f0" # str | Business ID of the sub-account merchant (XP feature) external_id = "test-external" # str statuses = [ InvoiceStatus("["PENDING","SETTLED"]"), @@ -342,7 +342,7 @@ api_client = xendit.ApiClient() # Create an instance of the API class api_instance = InvoiceApi(api_client) invoice_id = "5f4708b7bd394b0400b96276" # str | Invoice ID to be expired -for_user_id = "62efe4c33e45694d63f585f8" # str | Business ID of the sub-account merchant (XP feature) +for_user_id = "62efe4c33e45694d63f585f0" # str | Business ID of the sub-account merchant (XP feature) # example passing only required values which don't have defaults set try: @@ -362,4 +362,47 @@ except xendit.XenditSdkException as e: print("Exception when calling InvoiceApi->expire_invoice: %s\n" % e) ``` + +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### InvoiceCallback Object +>Invoice Callback Object + +Model Documentation: [InvoiceCallback](/InvoiceCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```python +import xendit +from xendit.invoice.model import InvoiceCallback +import json +from pprint import pprint + +invoice_callback_obj = { + "id" : "593f4ed1c3d3bb7f39733d83", + "external_id" : "testing-invoice", + "user_id" : "5848fdf860053555135587e7", + "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 webhook test", + "created" : "2020-01-13T02:32:49.827Z", + "updated" : "2020-01-13T02:32:50.912Z", + "currency" : "IDR", + "payment_channel" : "ALFAMART", + "payment_destination" : "TEST815" +} +invoice_callback_json = json.dumps(invoice_callback_obj) +``` + +You may then use the callback object in your webhook or callback handler like so, +```python +def SimulateInvoiceCallback(invoice_callback_json) { + callback_obj = InvoiceCallback(**json.loads(invoice_callback_json)) + // do things here with the callback +} +``` [[Back to README]](../README.md) diff --git a/docs/PaymentMethodApi.md b/docs/PaymentMethodApi.md index 0a2d9d68..a34ced45 100644 --- a/docs/PaymentMethodApi.md +++ b/docs/PaymentMethodApi.md @@ -677,4 +677,68 @@ except xendit.XenditSdkException as e: print("Exception when calling PaymentMethodApi->simulate_payment: %s\n" % e) ``` + +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### PaymentMethodCallback Object +>Callback for active or expired E-Wallet or Direct Debit account linking, Virtual Accounts or QR strings + +Model Documentation: [PaymentMethodCallback](/PaymentMethodCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```python +import xendit +from xendit.payment_method.model import PaymentMethodCallback +import json +from pprint import pprint + +payment_method_callback_obj = { + "event" : "payment_method.activated", + "data" : { + "id" : "pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a", + "card" : null, + "type" : "DIRECT_DEBIT", + "status" : "ACTIVE", + "country" : "PH", + "created" : "2022-08-12T13:30:26.579048Z", + "ewallet" : null, + "qr_code" : null, + "updated" : "2022-08-12T13:30:58.908220358Z", + "metadata" : null, + "customer_id" : "e2878b4c-d57e-4a2c-922d-c0313c2800a3", + "description" : null, + "reusability" : "MULTIPLE_USE", + "direct_debit" : { + "type" : "BANK_ACCOUNT", + "debit_card" : null, + "bank_account" : { + "bank_account_hash" : "b4dfa99c9b60c77f2e3962b73c098945", + "masked_bank_account_number" : "XXXXXX1234" + }, + "channel_code" : "BPI", + "channel_properties" : { + "failure_return_url" : "https://your-redirect-website.com/failure", + "success_return_url" : "https://your-redirect-website.com/success" + } + }, + "failure_code" : null, + "reference_id" : "620b9df4-fe69-4bfd-b9d4-5cba6861db8a", + "virtual_account" : null, + "over_the_counter" : null, + "billing_information" : null, + "direct_bank_transfer" : null + }, + "created" : "2022-08-12T13:30:59.074277334Z", + "business_id" : "5f27a14a9bf05c73dd040bc8" +} +payment_method_callback_json = json.dumps(payment_method_callback_obj) +``` + +You may then use the callback object in your webhook or callback handler like so, +```python +def SimulatePaymentMethodCallback(payment_method_callback_json) { + callback_obj = PaymentMethodCallback(**json.loads(payment_method_callback_json)) + // do things here with the callback +} +``` [[Back to README]](../README.md) diff --git a/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md index b6fc8230..7941e4fa 100644 --- a/docs/PaymentRequestApi.md +++ b/docs/PaymentRequestApi.md @@ -635,4 +635,86 @@ except xendit.XenditSdkException as e: print("Exception when calling PaymentRequestApi->resend_payment_request_auth: %s\n" % e) ``` + +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### PaymentCallback Object +>Callback for successful or failed payments made via the Payments API + +Model Documentation: [PaymentCallback](/PaymentCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```python +import xendit +from xendit.payment_request.model import PaymentCallback +import json +from pprint import pprint + +payment_callback_obj = { + "event" : "payment.succeeded", + "data" : { + "id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f", + "amount" : 1000, + "status" : "SUCCEEDED", + "country" : "PH", + "created" : "2022-08-12T13:30:40.9209Z", + "updated" : "2022-08-12T13:30:58.729373Z", + "currency" : "PHP", + "metadata" : { + "sku" : "ABCDEFGH" + }, + "customer_id" : "c832697e-a62d-46fa-a383-24930b155e81", + "reference_id" : "25cfd0f9-baee-44ca-9a12-6debe03f3c22", + "payment_method" : { + "id" : "pm-951b1ad9-1fbb-4724-a744-8956ab6ed17f", + "card" : null, + "type" : "DIRECT_DEBIT", + "status" : "ACTIVE", + "created" : "2022-08-12T13:30:26.579048Z", + "ewallet" : null, + "qr_code" : null, + "updated" : "2022-08-12T13:30:40.221525Z", + "metadata" : { + "sku" : "ABCDEFGH" + }, + "description" : null, + "reusability" : "MULTIPLE_USE", + "direct_debit" : { + "type" : "BANK_ACCOUNT", + "debit_card" : null, + "bank_account" : { + "bank_account_hash" : "b4dfa99c9b60c77f2e3962b73c098945", + "masked_bank_account_number" : "XXXXXX1234" + }, + "channel_code" : "BPI", + "channel_properties" : { + "failure_return_url" : "https://your-redirect-website.com/failure", + "success_return_url" : "https://your-redirect-website.com/success" + } + }, + "reference_id" : "620b9df4-fe69-4bfd-b9d4-5cba6861db8a", + "virtual_account" : null, + "over_the_counter" : null, + "direct_bank_transfer" : null + }, + "description" : null, + "failure_code" : null, + "payment_detail" : null, + "channel_properties" : null, + "payment_request_id" : "pr-5b26cae1-545b-49e9-855e-f85128f3e705" + }, + "created" : "2022-08-12T13:30:58.986Z", + "business_id" : "5f27a14a9bf05c73dd040bc8", + "api_version" : null +} +payment_callback_json = json.dumps(payment_callback_obj) +``` + +You may then use the callback object in your webhook or callback handler like so, +```python +def SimulatePaymentCallback(payment_callback_json) { + callback_obj = PaymentCallback(**json.loads(payment_callback_json)) + // do things here with the callback +} +``` [[Back to README]](../README.md) diff --git a/docs/PayoutApi.md b/docs/PayoutApi.md index 49545c88..cfd07e05 100644 --- a/docs/PayoutApi.md +++ b/docs/PayoutApi.md @@ -331,4 +331,5 @@ except xendit.XenditSdkException as e: print("Exception when calling PayoutApi->cancel_payout: %s\n" % e) ``` + [[Back to README]](../README.md) diff --git a/docs/RefundApi.md b/docs/RefundApi.md index 6ee3ccf6..975c5f44 100644 --- a/docs/RefundApi.md +++ b/docs/RefundApi.md @@ -266,4 +266,51 @@ except xendit.XenditSdkException as e: print("Exception when calling RefundApi->cancel_refund: %s\n" % e) ``` + +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### RefundCallback Object +>Callback for successful or failed Refunds made via the Payments API + +Model Documentation: [RefundCallback](/RefundCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```python +import xendit +from xendit.refund.model import RefundCallback +import json +from pprint import pprint + +refund_callback_obj = { + "event" : "refund.succeeded", + "business_id" : "5f27a14a9bf05c73dd040bc8", + "created" : "2020-08-29T09:12:33.001Z", + "data" : { + "id" : "rfd-6f4a377d-a201-437f-9119-f8b00cbbe857", + "payment_id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f", + "invoice_id" : null, + "amount" : 10000, + "payment_method_type" : "DIRECT_DEBIT", + "channel_code" : "BPI", + "currency" : "PHP", + "status" : "SUCCEEDED", + "reason" : "CANCELLATION", + "reference_id" : "b2756a1e-e6cd-4352-9a68-0483aa2b6a2", + "failure_code" : null, + "refund_fee_amount" : null, + "created" : "2020-08-30T09:12:33.001Z", + "updated" : "2020-08-30T09:12:33.001Z", + "metadata" : null + } +} +refund_callback_json = json.dumps(refund_callback_obj) +``` + +You may then use the callback object in your webhook or callback handler like so, +```python +def SimulateRefundCallback(refund_callback_json) { + callback_obj = RefundCallback(**json.loads(refund_callback_json)) + // do things here with the callback +} +``` [[Back to README]](../README.md) diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index 3bb3afe2..da502f5a 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -174,4 +174,5 @@ except xendit.XenditSdkException as e: print("Exception when calling TransactionApi->get_all_transactions: %s\n" % e) ``` + [[Back to README]](../README.md) diff --git a/docs/invoice/InvoiceCallback.md b/docs/invoice/InvoiceCallback.md new file mode 100644 index 00000000..f4f12dba --- /dev/null +++ b/docs/invoice/InvoiceCallback.md @@ -0,0 +1,41 @@ +# InvoiceCallback +> xendit.invoice.model.InvoiceCallback + +Invoice Callback Object + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **id** | **str** | ☑️ | An invoice ID generated by Xendit | | | +| **external_id** | **str** | ☑️ | ID of your choice (typically the unique identifier of an invoice in your system) | | | +| **user_id** | **str** | ☑️ | Xendit Business ID | | | +| **status** | **str** | ☑️ | The status of the invoice. | | | +| **merchant_name** | **str** | ☑️ | The name of company or website | | | +| **amount** | **float** | ☑️ | Nominal amount for the invoice | | | +| **created** | **str** | ☑️ | The date and time when the invoice was created. | | | +| **updated** | **str** | ☑️ | The date and time when the invoice was last updated. | | | +| **currency** | **str** | ☑️ | The currency of the invoice. | | | +| **payer_email** | **str** | | Email of the payer | | +| **description** | **str** | | Description for the invoice | | +| **paid_amount** | **float** | | Total amount paid for the invoice | | +| **paid_at** | **str** | | The date and time when the invoice was paid. | | +| **payment_method** | **str** | | The payment method used for the invoice. | | +| **payment_channel** | **str** | | The payment channel. | | +| **payment_destination** | **str** | | The payment destination. | | +| **payment_details** | [**PaymentDetails**](PaymentDetails.md) | | | | +| **payment_id** | **str** | | The ID of the payment. | | +| **success_redirect_url** | **str** | | The URL to redirect to on successful payment. | | +| **failure_redirect_url** | **str** | | The URL to redirect to on payment failure. | | +| **credit_card_charge_id** | **str** | | The ID associated with a credit card charge (if applicable). | | +| **items** | [**[InvoiceCallbackItem]**](InvoiceCallbackItem.md) | | | | +| **fees** | [**[InvoiceFee]**](InvoiceFee.md) | | An array of fees associated with the invoice. | | +| **should_authenticate_credit_card** | **bool** | | Indicates whether credit card authentication is required. | | +| **bank_code** | **str** | | The bank code for the bank details. | | +| **ewallet_type** | **str** | | The type of eWallet. | | +| **on_demand_link** | **str** | | The on-demand link. | | +| **recurring_payment_id** | **str** | | The ID of the recurring payment. | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceCallbackItem.md b/docs/invoice/InvoiceCallbackItem.md new file mode 100644 index 00000000..1bb5d695 --- /dev/null +++ b/docs/invoice/InvoiceCallbackItem.md @@ -0,0 +1,18 @@ +# InvoiceCallbackItem +> xendit.invoice.model.InvoiceCallbackItem + +An object representing an item within an invoice. + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **name** | **str** | ☑️ | The name of the item. | | | +| **price** | **float** | ☑️ | The price of the item. | | | +| **quantity** | **float** | ☑️ | The quantity of the item. Must be greater than or equal to 0. | | | +| **url** | **str** | | The URL associated with the item. | | +| **category** | **str** | | The category of the item. | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/PaymentDetails.md b/docs/invoice/PaymentDetails.md new file mode 100644 index 00000000..3f800ae1 --- /dev/null +++ b/docs/invoice/PaymentDetails.md @@ -0,0 +1,15 @@ +# PaymentDetails +> xendit.invoice.model.PaymentDetails + +An object representing payment details. + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **receipt_id** | **str** | | The unique identifier or reference ID associated with the payment receipt. | | +| **source** | **str** | | The source or method of payment. | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodCallback.md b/docs/payment_method/PaymentMethodCallback.md new file mode 100644 index 00000000..c571c6c4 --- /dev/null +++ b/docs/payment_method/PaymentMethodCallback.md @@ -0,0 +1,17 @@ +# PaymentMethodCallback +> xendit.payment_method.model.PaymentMethodCallback + +Callback for active or expired E-Wallet or Direct Debit account linking, Virtual Accounts or QR strings + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **event** | **str** | ☑️ | Identifies the event that triggered a notification to the merchant | | | +| **business_id** | **str** | ☑️ | business_id | | | +| **created** | **str** | ☑️ | | | | +| **data** | [**PaymentMethod**](PaymentMethod.md) | | | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/InvoicePartnerMetadata.md b/docs/payment_request/InvoicePartnerMetadata.md new file mode 100644 index 00000000..8e81b0dd --- /dev/null +++ b/docs/payment_request/InvoicePartnerMetadata.md @@ -0,0 +1,13 @@ +# InvoicePartnerMetadata +> xendit.payment_request.model.InvoicePartnerMetadata + + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **notes** | **str** | | | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentCallback.md b/docs/payment_request/PaymentCallback.md new file mode 100644 index 00000000..5c9a486e --- /dev/null +++ b/docs/payment_request/PaymentCallback.md @@ -0,0 +1,17 @@ +# PaymentCallback +> xendit.payment_request.model.PaymentCallback + +Callback for successful or failed payments made via the Payments API + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **event** | **str** | ☑️ | Identifies the event that triggered a notification to the merchant | | | +| **business_id** | **str** | ☑️ | business_id | | | +| **created** | **str** | ☑️ | | | | +| **data** | [**PaymentCallbackData**](PaymentCallbackData.md) | | | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentCallbackData.md b/docs/payment_request/PaymentCallbackData.md new file mode 100644 index 00000000..cf2599a2 --- /dev/null +++ b/docs/payment_request/PaymentCallbackData.md @@ -0,0 +1,28 @@ +# PaymentCallbackData +> xendit.payment_request.model.PaymentCallbackData + +Represents the actual funds transaction/attempt made to a payment method + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **id** | **str** | ☑️ | | | | +| **reference_id** | **str** | ☑️ | | | | +| **currency** | **str** | ☑️ | | | | +| **amount** | **float** | ☑️ | | | | +| **country** | **str** | ☑️ | | | | +| **status** | **str** | ☑️ | | | | +| **payment_method** | [**PaymentMethod**](PaymentMethod.md) | ☑️ | | | | +| **created** | **str** | ☑️ | | | | +| **updated** | **str** | ☑️ | | | | +| **payment_request_id** | **str, none_type** | | | | +| **customer_id** | **str, none_type** | | | | +| **channel_properties** | [**PaymentRequestChannelProperties**](PaymentRequestChannelProperties.md) | | | | +| **payment_detail** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | | | +| **failure_code** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | | | +| **metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/RefundCallback.md b/docs/refund/RefundCallback.md new file mode 100644 index 00000000..c8984909 --- /dev/null +++ b/docs/refund/RefundCallback.md @@ -0,0 +1,17 @@ +# RefundCallback +> xendit.refund.model.RefundCallback + +Callback for successful or failed Refunds made via the Payments API + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **event** | **str** | ☑️ | Identifies the event that triggered a notification to the merchant | | | +| **business_id** | **str** | ☑️ | business_id | | | +| **created** | **str** | ☑️ | | | | +| **data** | [**RefundCallbackData**](RefundCallbackData.md) | | | | + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/RefundCallbackData.md b/docs/refund/RefundCallbackData.md new file mode 100644 index 00000000..11b4beb6 --- /dev/null +++ b/docs/refund/RefundCallbackData.md @@ -0,0 +1,28 @@ +# RefundCallbackData +> xendit.refund.model.RefundCallbackData + + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **id** | **str** | ☑️ | | | | +| **payment_request_id** | **str** | ☑️ | | | | +| **payment_method_type** | **str** | ☑️ | | | | +| **amount** | **float** | ☑️ | | | | +| **channel_code** | **str** | ☑️ | | | | +| **status** | **str** | ☑️ | | | | +| **reason** | **str** | ☑️ | | | | +| **country** | **str** | ☑️ | | | | +| **currency** | **str** | ☑️ | | | | +| **created** | **str** | ☑️ | | | | +| **updated** | **str** | ☑️ | | | | +| **invoice_id** | **str, none_type** | | | | +| **reference_id** | **str, none_type** | | | | +| **failure_code** | **str, none_type** | | | | +| **refund_fee_amount** | **float, none_type** | | | | +| **metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | | | + + +[[Back to README]](../../README.md) + + diff --git a/pyproject.toml b/pyproject.toml index 9caec711..2cf20a96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "xendit-python" -version = "3.6.0" +version = "3.7.0" description = "Xendit REST API Client for Python - Invoice, Payment Request, Payment Method, Refund, Balance, Transaction, Customer, and Payout Services https://xendit.github.io/apireference/" authors = ["DevX Team "] license = "MIT" diff --git a/setup.py b/setup.py index e050ceca..7e9556aa 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ from setuptools import setup, find_packages # noqa: H301 NAME = "xendit" -VERSION = "3.6.0" +VERSION = "3.7.0" # To install the library, run the following # # python setup.py install diff --git a/xendit/__init__.py b/xendit/__init__.py index c4e3ad63..9111d003 100644 --- a/xendit/__init__.py +++ b/xendit/__init__.py @@ -1,11 +1,11 @@ # flake8: noqa """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ -__version__ = "3.6.0" +__version__ = "3.7.0" # import ApiClient from xendit.api_client import ApiClient diff --git a/xendit/api_client.py b/xendit/api_client.py index 7246bd92..9956f136 100644 --- a/xendit/api_client.py +++ b/xendit/api_client.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ @@ -74,11 +74,11 @@ def __init__(self, configuration=None, header_name=None, header_value=None, # XENDIT headers self.default_headers['xendit-lib'] = 'python' - self.default_headers['xendit-lib-ver'] = '3.6.0' + self.default_headers['xendit-lib-ver'] = '3.7.0' self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/3.6.0/python' + self.user_agent = 'OpenAPI-Generator/3.7.0/python' def __enter__(self): return self diff --git a/xendit/balance_and_transaction/balance_api.py b/xendit/balance_and_transaction/balance_api.py index 57ba6d20..81ebd4bf 100644 --- a/xendit/balance_and_transaction/balance_api.py +++ b/xendit/balance_and_transaction/balance_api.py @@ -3,7 +3,7 @@ # 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 # noqa: E501 - The version of the OpenAPI document: 3.5.0 + The version of the OpenAPI document: 3.5.2 """ import re # noqa: F401 diff --git a/xendit/balance_and_transaction/model/balance.py b/xendit/balance_and_transaction/model/balance.py index dac356c5..b0b4808a 100644 --- a/xendit/balance_and_transaction/model/balance.py +++ b/xendit/balance_and_transaction/model/balance.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/channels_categories.py b/xendit/balance_and_transaction/model/channels_categories.py index 9c494d53..102eab72 100644 --- a/xendit/balance_and_transaction/model/channels_categories.py +++ b/xendit/balance_and_transaction/model/channels_categories.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/currency.py b/xendit/balance_and_transaction/model/currency.py index f1581fb3..57a0d727 100644 --- a/xendit/balance_and_transaction/model/currency.py +++ b/xendit/balance_and_transaction/model/currency.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/date_range_filter.py b/xendit/balance_and_transaction/model/date_range_filter.py index 1f10e099..8f9a9a48 100644 --- a/xendit/balance_and_transaction/model/date_range_filter.py +++ b/xendit/balance_and_transaction/model/date_range_filter.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/fee_response.py b/xendit/balance_and_transaction/model/fee_response.py index 1f2bc11f..07480a6e 100644 --- a/xendit/balance_and_transaction/model/fee_response.py +++ b/xendit/balance_and_transaction/model/fee_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/link_item.py b/xendit/balance_and_transaction/model/link_item.py index 857d9a23..8d0b380f 100644 --- a/xendit/balance_and_transaction/model/link_item.py +++ b/xendit/balance_and_transaction/model/link_item.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/server_error.py b/xendit/balance_and_transaction/model/server_error.py index f75a1005..6dfc0e85 100644 --- a/xendit/balance_and_transaction/model/server_error.py +++ b/xendit/balance_and_transaction/model/server_error.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transaction_id.py b/xendit/balance_and_transaction/model/transaction_id.py index eccae1d7..c7b4c613 100644 --- a/xendit/balance_and_transaction/model/transaction_id.py +++ b/xendit/balance_and_transaction/model/transaction_id.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transaction_response.py b/xendit/balance_and_transaction/model/transaction_response.py index 35a7d220..cc9f86e9 100644 --- a/xendit/balance_and_transaction/model/transaction_response.py +++ b/xendit/balance_and_transaction/model/transaction_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transaction_response_type.py b/xendit/balance_and_transaction/model/transaction_response_type.py index a3564cfd..57a57f19 100644 --- a/xendit/balance_and_transaction/model/transaction_response_type.py +++ b/xendit/balance_and_transaction/model/transaction_response_type.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transaction_statuses.py b/xendit/balance_and_transaction/model/transaction_statuses.py index 9337c005..e9ef7416 100644 --- a/xendit/balance_and_transaction/model/transaction_statuses.py +++ b/xendit/balance_and_transaction/model/transaction_statuses.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transaction_types.py b/xendit/balance_and_transaction/model/transaction_types.py index e9e1d22c..23363f71 100644 --- a/xendit/balance_and_transaction/model/transaction_types.py +++ b/xendit/balance_and_transaction/model/transaction_types.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/transactions_response.py b/xendit/balance_and_transaction/model/transactions_response.py index fce8e7e8..f6435050 100644 --- a/xendit/balance_and_transaction/model/transactions_response.py +++ b/xendit/balance_and_transaction/model/transactions_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/model/validation_error.py b/xendit/balance_and_transaction/model/validation_error.py index 0eb435c5..92660cd4 100644 --- a/xendit/balance_and_transaction/model/validation_error.py +++ b/xendit/balance_and_transaction/model/validation_error.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 3.5.0 + The version of the XENDIT API: 3.5.2 """ diff --git a/xendit/balance_and_transaction/transaction_api.py b/xendit/balance_and_transaction/transaction_api.py index 25e8bb25..091116e3 100644 --- a/xendit/balance_and_transaction/transaction_api.py +++ b/xendit/balance_and_transaction/transaction_api.py @@ -3,7 +3,7 @@ # 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 # noqa: E501 - The version of the OpenAPI document: 3.5.0 + The version of the OpenAPI document: 3.5.2 """ import re # noqa: F401 diff --git a/xendit/configuration.py b/xendit/configuration.py index 40cafca0..fe7facf1 100644 --- a/xendit/configuration.py +++ b/xendit/configuration.py @@ -364,8 +364,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.45.1\n"\ - "SDK Package Version: 3.6.0".\ + "Version of the API: 1.45.2\n"\ + "SDK Package Version: 3.7.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/xendit/exceptions.py b/xendit/exceptions.py index 7c4b0772..74058333 100644 --- a/xendit/exceptions.py +++ b/xendit/exceptions.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ import json diff --git a/xendit/invoice/model/__init__.py b/xendit/invoice/model/__init__.py index 20e7005a..7beac30d 100644 --- a/xendit/invoice/model/__init__.py +++ b/xendit/invoice/model/__init__.py @@ -22,6 +22,8 @@ from xendit.invoice.model.ewallet_type import EwalletType from xendit.invoice.model.forbidden_error import ForbiddenError from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.invoice_callback import InvoiceCallback +from xendit.invoice.model.invoice_callback_item import InvoiceCallbackItem from xendit.invoice.model.invoice_client_type import InvoiceClientType from xendit.invoice.model.invoice_currency import InvoiceCurrency from xendit.invoice.model.invoice_error404_response_definition import InvoiceError404ResponseDefinition @@ -34,6 +36,7 @@ from xendit.invoice.model.notification_preference import NotificationPreference from xendit.invoice.model.paylater import Paylater from xendit.invoice.model.paylater_type import PaylaterType +from xendit.invoice.model.payment_details import PaymentDetails from xendit.invoice.model.qr_code import QrCode from xendit.invoice.model.qr_code_type import QrCodeType from xendit.invoice.model.retail_outlet import RetailOutlet diff --git a/xendit/invoice/model/invoice_callback.py b/xendit/invoice/model/invoice_callback.py new file mode 100644 index 00000000..a751357d --- /dev/null +++ b/xendit/invoice/model/invoice_callback.py @@ -0,0 +1,472 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + +from xendit.invoice.model.invoice_callback_item import InvoiceCallbackItem +from xendit.invoice.model.invoice_fee import InvoiceFee +from xendit.invoice.model.payment_details import PaymentDetails +globals()['InvoiceCallbackItem'] = InvoiceCallbackItem +globals()['InvoiceFee'] = InvoiceFee +globals()['PaymentDetails'] = PaymentDetails + +def lazy_import(): + pass + +class InvoiceCallback(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'external_id': (str,), # noqa: E501 + 'user_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'merchant_name': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'payer_email': (str, none_type), # noqa: E501 + 'description': (str, none_type), # noqa: E501 + 'paid_amount': (float, none_type), # noqa: E501 + 'paid_at': (str, none_type), # noqa: E501 + 'payment_method': (str, none_type), # noqa: E501 + 'payment_channel': (str, none_type), # noqa: E501 + 'payment_destination': (str, none_type), # noqa: E501 + 'payment_details': (PaymentDetails, none_type), # noqa: E501 + 'payment_id': (str, none_type), # noqa: E501 + 'success_redirect_url': (str, none_type), # noqa: E501 + 'failure_redirect_url': (str, none_type), # noqa: E501 + 'credit_card_charge_id': (str, none_type), # noqa: E501 + 'items': ([InvoiceCallbackItem], none_type), # noqa: E501 + 'fees': ([InvoiceFee], none_type), # noqa: E501 + 'should_authenticate_credit_card': (bool, none_type), # noqa: E501 + 'bank_code': (str, none_type), # noqa: E501 + 'ewallet_type': (str, none_type), # noqa: E501 + 'on_demand_link': (str, none_type), # noqa: E501 + 'recurring_payment_id': (str, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'external_id': 'external_id', # noqa: E501 + 'user_id': 'user_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'merchant_name': 'merchant_name', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'payer_email': 'payer_email', # noqa: E501 + 'description': 'description', # noqa: E501 + 'paid_amount': 'paid_amount', # noqa: E501 + 'paid_at': 'paid_at', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'payment_channel': 'payment_channel', # noqa: E501 + 'payment_destination': 'payment_destination', # noqa: E501 + 'payment_details': 'payment_details', # noqa: E501 + 'payment_id': 'payment_id', # noqa: E501 + 'success_redirect_url': 'success_redirect_url', # noqa: E501 + 'failure_redirect_url': 'failure_redirect_url', # noqa: E501 + 'credit_card_charge_id': 'credit_card_charge_id', # noqa: E501 + 'items': 'items', # noqa: E501 + 'fees': 'fees', # noqa: E501 + 'should_authenticate_credit_card': 'should_authenticate_credit_card', # noqa: E501 + 'bank_code': 'bank_code', # noqa: E501 + 'ewallet_type': 'ewallet_type', # noqa: E501 + 'on_demand_link': 'on_demand_link', # noqa: E501 + 'recurring_payment_id': 'recurring_payment_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, external_id, user_id, status, merchant_name, amount, created, updated, currency, *args, **kwargs): # noqa: E501 + """InvoiceCallback - a model defined in OpenAPI + + Args: + id (str): An invoice ID generated by Xendit + external_id (str): ID of your choice (typically the unique identifier of an invoice in your system) + user_id (str): Xendit Business ID + status (str): The status of the invoice. + merchant_name (str): The name of company or website + amount (float): Nominal amount for the invoice + created (str): The date and time when the invoice was created. + updated (str): The date and time when the invoice was last updated. + currency (str): The currency of the invoice. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payer_email (str): Email of the payer. [optional] # noqa: E501 + description (str): Description for the invoice. [optional] # noqa: E501 + paid_amount (float): Total amount paid for the invoice. [optional] # noqa: E501 + paid_at (str): The date and time when the invoice was paid.. [optional] # noqa: E501 + payment_method (str): The payment method used for the invoice.. [optional] # noqa: E501 + payment_channel (str): The payment channel.. [optional] # noqa: E501 + payment_destination (str): The payment destination.. [optional] # noqa: E501 + payment_details (PaymentDetails): [optional] # noqa: E501 + payment_id (str): The ID of the payment.. [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + credit_card_charge_id (str): The ID associated with a credit card charge (if applicable).. [optional] # noqa: E501 + items ([InvoiceCallbackItem]): [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + bank_code (str): The bank code for the bank details.. [optional] # noqa: E501 + ewallet_type (str): The type of eWallet.. [optional] # noqa: E501 + on_demand_link (str): The on-demand link.. [optional] # noqa: E501 + recurring_payment_id (str): The ID of the recurring payment.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.external_id = external_id + self.user_id = user_id + self.status = status + self.merchant_name = merchant_name + self.amount = amount + self.created = created + self.updated = updated + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + id: str, + external_id: str, + user_id: str, + status: str, + merchant_name: str, + amount: float, + created: str, + updated: str, + currency: str, + payer_email: str | None = None, + description: str | None = None, + paid_amount: float | None = None, + paid_at: str | None = None, + payment_method: str | None = None, + payment_channel: str | None = None, + payment_destination: str | None = None, + payment_details: PaymentDetails | None = None, + payment_id: str | None = None, + success_redirect_url: str | None = None, + failure_redirect_url: str | None = None, + credit_card_charge_id: str | None = None, + items: list | None = None, + fees: list | None = None, + should_authenticate_credit_card: bool | None = None, + bank_code: str | None = None, + ewallet_type: str | None = None, + on_demand_link: str | None = None, + recurring_payment_id: str | None = None, + *args, **kwargs + ): # noqa: E501 + """InvoiceCallback - a model defined in OpenAPI + + Args: + id (str): An invoice ID generated by Xendit + external_id (str): ID of your choice (typically the unique identifier of an invoice in your system) + user_id (str): Xendit Business ID + status (str): The status of the invoice. + merchant_name (str): The name of company or website + amount (float): Nominal amount for the invoice + created (str): The date and time when the invoice was created. + updated (str): The date and time when the invoice was last updated. + currency (str): The currency of the invoice. + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payer_email (str): Email of the payer. [optional] # noqa: E501 + description (str): Description for the invoice. [optional] # noqa: E501 + paid_amount (float): Total amount paid for the invoice. [optional] # noqa: E501 + paid_at (str): The date and time when the invoice was paid.. [optional] # noqa: E501 + payment_method (str): The payment method used for the invoice.. [optional] # noqa: E501 + payment_channel (str): The payment channel.. [optional] # noqa: E501 + payment_destination (str): The payment destination.. [optional] # noqa: E501 + payment_details (PaymentDetails): [optional] # noqa: E501 + payment_id (str): The ID of the payment.. [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + credit_card_charge_id (str): The ID associated with a credit card charge (if applicable).. [optional] # noqa: E501 + items ([InvoiceCallbackItem]): [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + bank_code (str): The bank code for the bank details.. [optional] # noqa: E501 + ewallet_type (str): The type of eWallet.. [optional] # noqa: E501 + on_demand_link (str): The on-demand link.. [optional] # noqa: E501 + recurring_payment_id (str): The ID of the recurring payment.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.external_id = external_id + self.user_id = user_id + self.status = status + self.merchant_name = merchant_name + self.amount = amount + self.created = created + self.updated = updated + self.currency = currency + if payer_email is not None: + self.payer_email = payer_email + if description is not None: + self.description = description + if paid_amount is not None: + self.paid_amount = paid_amount + if paid_at is not None: + self.paid_at = paid_at + if payment_method is not None: + self.payment_method = payment_method + if payment_channel is not None: + self.payment_channel = payment_channel + if payment_destination is not None: + self.payment_destination = payment_destination + if payment_details is not None: + self.payment_details = payment_details + if payment_id is not None: + self.payment_id = payment_id + if success_redirect_url is not None: + self.success_redirect_url = success_redirect_url + if failure_redirect_url is not None: + self.failure_redirect_url = failure_redirect_url + if credit_card_charge_id is not None: + self.credit_card_charge_id = credit_card_charge_id + if items is not None: + self.items = items + if fees is not None: + self.fees = fees + if should_authenticate_credit_card is not None: + self.should_authenticate_credit_card = should_authenticate_credit_card + if bank_code is not None: + self.bank_code = bank_code + if ewallet_type is not None: + self.ewallet_type = ewallet_type + if on_demand_link is not None: + self.on_demand_link = on_demand_link + if recurring_payment_id is not None: + self.recurring_payment_id = recurring_payment_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_callback_item.py b/xendit/invoice/model/invoice_callback_item.py new file mode 100644 index 00000000..59df7b42 --- /dev/null +++ b/xendit/invoice/model/invoice_callback_item.py @@ -0,0 +1,306 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + pass + +class InvoiceCallbackItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('quantity',): { + 'exclusive_minimum''inclusive_minimum': 0, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'price': (float,), # noqa: E501 + 'quantity': (float,), # noqa: E501 + 'url': (str, none_type), # noqa: E501 + 'category': (str, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'price': 'price', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'url': 'url', # noqa: E501 + 'category': 'category', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, price, quantity, *args, **kwargs): # noqa: E501 + """InvoiceCallbackItem - a model defined in OpenAPI + + Args: + name (str): The name of the item. + price (float): The price of the item. + quantity (float): The quantity of the item. Must be greater than or equal to 0. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + url (str): The URL associated with the item.. [optional] # noqa: E501 + category (str): The category of the item.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.price = price + self.quantity = quantity + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + name: str, + price: float, + quantity: float, + url: str | None = None, + category: str | None = None, + *args, **kwargs + ): # noqa: E501 + """InvoiceCallbackItem - a model defined in OpenAPI + + Args: + name (str): The name of the item. + price (float): The price of the item. + quantity (float): The quantity of the item. Must be greater than or equal to 0. + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + url (str): The URL associated with the item.. [optional] # noqa: E501 + category (str): The category of the item.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.price = price + self.quantity = quantity + if url is not None: + self.url = url + if category is not None: + self.category = category + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/payment_details.py b/xendit/invoice/model/payment_details.py new file mode 100644 index 00000000..282a3427 --- /dev/null +++ b/xendit/invoice/model/payment_details.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + pass + +class PaymentDetails(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'receipt_id': (str, none_type), # noqa: E501 + 'source': (str, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'receipt_id': 'receipt_id', # noqa: E501 + 'source': 'source', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentDetails - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + receipt_id (str): The unique identifier or reference ID associated with the payment receipt.. [optional] # noqa: E501 + source (str): The source or method of payment.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + receipt_id: str | None = None, + source: str | None = None, + *args, **kwargs + ): # noqa: E501 + """PaymentDetails - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + receipt_id (str): The unique identifier or reference ID associated with the payment receipt.. [optional] # noqa: E501 + source (str): The source or method of payment.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + if receipt_id is not None: + self.receipt_id = receipt_id + if source is not None: + self.source = source + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/model_utils.py b/xendit/model_utils.py index 0aafa35c..5eb38c65 100644 --- a/xendit/model_utils.py +++ b/xendit/model_utils.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_method/model/__init__.py b/xendit/payment_method/model/__init__.py index 96ddd968..92de685c 100644 --- a/xendit/payment_method/model/__init__.py +++ b/xendit/payment_method/model/__init__.py @@ -44,6 +44,7 @@ from xendit.payment_method.model.payment_method import PaymentMethod from xendit.payment_method.model.payment_method_action import PaymentMethodAction from xendit.payment_method.model.payment_method_auth_parameters import PaymentMethodAuthParameters +from xendit.payment_method.model.payment_method_callback import PaymentMethodCallback from xendit.payment_method.model.payment_method_country import PaymentMethodCountry from xendit.payment_method.model.payment_method_expire_parameters import PaymentMethodExpireParameters from xendit.payment_method.model.payment_method_list import PaymentMethodList diff --git a/xendit/payment_method/model/payment_method_callback.py b/xendit/payment_method/model/payment_method_callback.py new file mode 100644 index 00000000..abbd6111 --- /dev/null +++ b/xendit/payment_method/model/payment_method_callback.py @@ -0,0 +1,300 @@ +""" + The version of the XENDIT API: 2.91.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + +from xendit.payment_method.model.payment_method import PaymentMethod +globals()['PaymentMethod'] = PaymentMethod + +def lazy_import(): + pass + +class PaymentMethodCallback(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'event': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'data': (PaymentMethod, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'event': 'event', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, event, business_id, created, *args, **kwargs): # noqa: E501 + """PaymentMethodCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PaymentMethod): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + event: str, + business_id: str, + created: str, + data: PaymentMethod | None = None, + *args, **kwargs + ): # noqa: E501 + """PaymentMethodCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PaymentMethod): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + if data is not None: + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/__init__.py b/xendit/payment_request/model/__init__.py index 58d3982b..e87b11fc 100644 --- a/xendit/payment_request/model/__init__.py +++ b/xendit/payment_request/model/__init__.py @@ -36,10 +36,13 @@ from xendit.payment_request.model.e_wallet_channel_properties import EWalletChannelProperties from xendit.payment_request.model.e_wallet_parameters import EWalletParameters from xendit.payment_request.model.error import Error +from xendit.payment_request.model.invoice_partner_metadata import InvoicePartnerMetadata from xendit.payment_request.model.over_the_counter import OverTheCounter from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters +from xendit.payment_request.model.payment_callback import PaymentCallback +from xendit.payment_request.model.payment_callback_data import PaymentCallbackData from xendit.payment_request.model.payment_method import PaymentMethod from xendit.payment_request.model.payment_method_parameters import PaymentMethodParameters from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability diff --git a/xendit/payment_request/model/capture.py b/xendit/payment_request/model/capture.py index 40243a39..2f4663b8 100644 --- a/xendit/payment_request/model/capture.py +++ b/xendit/payment_request/model/capture.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/capture_list.py b/xendit/payment_request/model/capture_list.py index 1ee1e9fb..263be193 100644 --- a/xendit/payment_request/model/capture_list.py +++ b/xendit/payment_request/model/capture_list.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/capture_list_response.py b/xendit/payment_request/model/capture_list_response.py index 25e41165..03bd614b 100644 --- a/xendit/payment_request/model/capture_list_response.py +++ b/xendit/payment_request/model/capture_list_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/capture_parameters.py b/xendit/payment_request/model/capture_parameters.py index 15c66135..0cfb83fc 100644 --- a/xendit/payment_request/model/capture_parameters.py +++ b/xendit/payment_request/model/capture_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/card.py b/xendit/payment_request/model/card.py index d24230b8..ddee3529 100644 --- a/xendit/payment_request/model/card.py +++ b/xendit/payment_request/model/card.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/card_channel_properties.py b/xendit/payment_request/model/card_channel_properties.py index d37f687a..3eca56b1 100644 --- a/xendit/payment_request/model/card_channel_properties.py +++ b/xendit/payment_request/model/card_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/card_information.py b/xendit/payment_request/model/card_information.py index a73de543..5c93ff49 100644 --- a/xendit/payment_request/model/card_information.py +++ b/xendit/payment_request/model/card_information.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/card_verification_results.py b/xendit/payment_request/model/card_verification_results.py index 88c505d2..47cfc8b7 100644 --- a/xendit/payment_request/model/card_verification_results.py +++ b/xendit/payment_request/model/card_verification_results.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/card_verification_results_three_d_secure.py b/xendit/payment_request/model/card_verification_results_three_d_secure.py index cf23bba2..5be30010 100644 --- a/xendit/payment_request/model/card_verification_results_three_d_secure.py +++ b/xendit/payment_request/model/card_verification_results_three_d_secure.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit.py b/xendit/payment_request/model/direct_debit.py index ecb033dc..41dd766c 100644 --- a/xendit/payment_request/model/direct_debit.py +++ b/xendit/payment_request/model/direct_debit.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_all_of.py b/xendit/payment_request/model/direct_debit_all_of.py index 800bdc97..580cfb56 100644 --- a/xendit/payment_request/model/direct_debit_all_of.py +++ b/xendit/payment_request/model/direct_debit_all_of.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_bank_account.py b/xendit/payment_request/model/direct_debit_bank_account.py index 4ff1a680..dfb8c87e 100644 --- a/xendit/payment_request/model/direct_debit_bank_account.py +++ b/xendit/payment_request/model/direct_debit_bank_account.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_channel_code.py b/xendit/payment_request/model/direct_debit_channel_code.py index 101867ba..c0696561 100644 --- a/xendit/payment_request/model/direct_debit_channel_code.py +++ b/xendit/payment_request/model/direct_debit_channel_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_channel_properties.py b/xendit/payment_request/model/direct_debit_channel_properties.py index a7d70ecb..224e28e0 100644 --- a/xendit/payment_request/model/direct_debit_channel_properties.py +++ b/xendit/payment_request/model/direct_debit_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py b/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py index 14977cb3..4385adbe 100644 --- a/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py +++ b/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py b/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py index 675f82db..75a587df 100644 --- a/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py +++ b/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py b/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py index 3b1db848..76fd8ec1 100644 --- a/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py +++ b/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_debit_card.py b/xendit/payment_request/model/direct_debit_debit_card.py index 3507f46c..fc37265b 100644 --- a/xendit/payment_request/model/direct_debit_debit_card.py +++ b/xendit/payment_request/model/direct_debit_debit_card.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_parameters.py b/xendit/payment_request/model/direct_debit_parameters.py index 1fc4331e..382619d4 100644 --- a/xendit/payment_request/model/direct_debit_parameters.py +++ b/xendit/payment_request/model/direct_debit_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/direct_debit_type.py b/xendit/payment_request/model/direct_debit_type.py index 45f82f76..2858c5cf 100644 --- a/xendit/payment_request/model/direct_debit_type.py +++ b/xendit/payment_request/model/direct_debit_type.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet.py b/xendit/payment_request/model/e_wallet.py index 536122d3..914e233e 100644 --- a/xendit/payment_request/model/e_wallet.py +++ b/xendit/payment_request/model/e_wallet.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet_account.py b/xendit/payment_request/model/e_wallet_account.py index e7a68b7f..5a71453e 100644 --- a/xendit/payment_request/model/e_wallet_account.py +++ b/xendit/payment_request/model/e_wallet_account.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet_all_of.py b/xendit/payment_request/model/e_wallet_all_of.py index 012fdad0..8e598612 100644 --- a/xendit/payment_request/model/e_wallet_all_of.py +++ b/xendit/payment_request/model/e_wallet_all_of.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet_channel_code.py b/xendit/payment_request/model/e_wallet_channel_code.py index 373ac732..a461e0e9 100644 --- a/xendit/payment_request/model/e_wallet_channel_code.py +++ b/xendit/payment_request/model/e_wallet_channel_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet_channel_properties.py b/xendit/payment_request/model/e_wallet_channel_properties.py index 6c51213b..a7533192 100644 --- a/xendit/payment_request/model/e_wallet_channel_properties.py +++ b/xendit/payment_request/model/e_wallet_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/e_wallet_parameters.py b/xendit/payment_request/model/e_wallet_parameters.py index 21ce1062..876eee3f 100644 --- a/xendit/payment_request/model/e_wallet_parameters.py +++ b/xendit/payment_request/model/e_wallet_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/error.py b/xendit/payment_request/model/error.py index 11195a0f..ba4fbaed 100644 --- a/xendit/payment_request/model/error.py +++ b/xendit/payment_request/model/error.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/invoice_partner_metadata.py b/xendit/payment_request/model/invoice_partner_metadata.py new file mode 100644 index 00000000..680d45a3 --- /dev/null +++ b/xendit/payment_request/model/invoice_partner_metadata.py @@ -0,0 +1,271 @@ +""" + The version of the XENDIT API: 1.45.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + pass + +class InvoicePartnerMetadata(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'notes': (str, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'notes': 'notes', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """InvoicePartnerMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + notes (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + notes: str | None = None, + *args, **kwargs + ): # noqa: E501 + """InvoicePartnerMetadata - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + notes (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + if notes is not None: + self.notes = notes + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/over_the_counter.py b/xendit/payment_request/model/over_the_counter.py index c319ab2a..e7ed4b1e 100644 --- a/xendit/payment_request/model/over_the_counter.py +++ b/xendit/payment_request/model/over_the_counter.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/over_the_counter_channel_code.py b/xendit/payment_request/model/over_the_counter_channel_code.py index 612fb5bd..7f7225cd 100644 --- a/xendit/payment_request/model/over_the_counter_channel_code.py +++ b/xendit/payment_request/model/over_the_counter_channel_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/over_the_counter_channel_properties.py b/xendit/payment_request/model/over_the_counter_channel_properties.py index 0b3c6bcd..4aa5c3ce 100644 --- a/xendit/payment_request/model/over_the_counter_channel_properties.py +++ b/xendit/payment_request/model/over_the_counter_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/over_the_counter_parameters.py b/xendit/payment_request/model/over_the_counter_parameters.py index a4dce611..f68844ea 100644 --- a/xendit/payment_request/model/over_the_counter_parameters.py +++ b/xendit/payment_request/model/over_the_counter_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_callback.py b/xendit/payment_request/model/payment_callback.py new file mode 100644 index 00000000..83f98e55 --- /dev/null +++ b/xendit/payment_request/model/payment_callback.py @@ -0,0 +1,300 @@ +""" + The version of the XENDIT API: 1.45.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + +from xendit.payment_request.model.payment_callback_data import PaymentCallbackData +globals()['PaymentCallbackData'] = PaymentCallbackData + +def lazy_import(): + pass + +class PaymentCallback(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'event': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'data': (PaymentCallbackData, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'event': 'event', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, event, business_id, created, *args, **kwargs): # noqa: E501 + """PaymentCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PaymentCallbackData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + event: str, + business_id: str, + created: str, + data: PaymentCallbackData | None = None, + *args, **kwargs + ): # noqa: E501 + """PaymentCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (PaymentCallbackData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + if data is not None: + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_callback_data.py b/xendit/payment_request/model/payment_callback_data.py new file mode 100644 index 00000000..f7c7d436 --- /dev/null +++ b/xendit/payment_request/model/payment_callback_data.py @@ -0,0 +1,379 @@ +""" + The version of the XENDIT API: 1.45.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + +from xendit.payment_request.model.payment_method import PaymentMethod +from xendit.payment_request.model.payment_request_channel_properties import PaymentRequestChannelProperties +globals()['PaymentMethod'] = PaymentMethod +globals()['PaymentRequestChannelProperties'] = PaymentRequestChannelProperties + +def lazy_import(): + pass + +class PaymentCallbackData(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'payment_method': (PaymentMethod,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'payment_request_id': (str, none_type, none_type), # noqa: E501 + 'customer_id': (str, none_type, none_type), # noqa: E501 + 'channel_properties': (PaymentRequestChannelProperties, none_type), # noqa: E501 + 'payment_detail': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, none_type), # noqa: E501 + 'failure_code': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, none_type), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'country': 'country', # noqa: E501 + 'status': 'status', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'payment_request_id': 'payment_request_id', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'payment_detail': 'payment_detail', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, reference_id, currency, amount, country, status, payment_method, created, updated, *args, **kwargs): # noqa: E501 + """PaymentCallbackData - a model defined in OpenAPI + + Args: + id (str): + reference_id (str): + currency (str): + amount (float): + country (str): + status (str): + payment_method (PaymentMethod): + created (str): + updated (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_request_id (str, none_type): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + channel_properties (PaymentRequestChannelProperties): [optional] # noqa: E501 + payment_detail ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + failure_code ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.reference_id = reference_id + self.currency = currency + self.amount = amount + self.country = country + self.status = status + self.payment_method = payment_method + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + id: str, + reference_id: str, + currency: str, + amount: float, + country: str, + status: str, + payment_method: PaymentMethod, + created: str, + updated: str, + payment_request_id: str | None = None, + customer_id: str | None = None, + channel_properties: PaymentRequestChannelProperties | None = None, + payment_detail: dict | None = None, + failure_code: dict | None = None, + metadata: dict | None = None, + *args, **kwargs + ): # noqa: E501 + """PaymentCallbackData - a model defined in OpenAPI + + Args: + id (str): + reference_id (str): + currency (str): + amount (float): + country (str): + status (str): + payment_method (PaymentMethod): + created (str): + updated (str): + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_request_id (str, none_type): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + channel_properties (PaymentRequestChannelProperties): [optional] # noqa: E501 + payment_detail ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + failure_code ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.reference_id = reference_id + self.currency = currency + self.amount = amount + self.country = country + self.status = status + self.payment_method = payment_method + self.created = created + self.updated = updated + if payment_request_id is not None: + self.payment_request_id = payment_request_id + if customer_id is not None: + self.customer_id = customer_id + if channel_properties is not None: + self.channel_properties = channel_properties + if payment_detail is not None: + self.payment_detail = payment_detail + if failure_code is not None: + self.failure_code = failure_code + if metadata is not None: + self.metadata = metadata + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_method.py b/xendit/payment_request/model/payment_method.py index 7eca5d9c..bbd01bbf 100644 --- a/xendit/payment_request/model/payment_method.py +++ b/xendit/payment_request/model/payment_method.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_method_parameters.py b/xendit/payment_request/model/payment_method_parameters.py index 43cfe1e8..fb0eed54 100644 --- a/xendit/payment_request/model/payment_method_parameters.py +++ b/xendit/payment_request/model/payment_method_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_method_reusability.py b/xendit/payment_request/model/payment_method_reusability.py index 6388c622..46852fa0 100644 --- a/xendit/payment_request/model/payment_method_reusability.py +++ b/xendit/payment_request/model/payment_method_reusability.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_method_status.py b/xendit/payment_request/model/payment_method_status.py index 0e5d36e0..39113ec5 100644 --- a/xendit/payment_request/model/payment_method_status.py +++ b/xendit/payment_request/model/payment_method_status.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_method_type.py b/xendit/payment_request/model/payment_method_type.py index 0da560ac..569ff54a 100644 --- a/xendit/payment_request/model/payment_method_type.py +++ b/xendit/payment_request/model/payment_method_type.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request.py b/xendit/payment_request/model/payment_request.py index 1bf7fc1d..2c924383 100644 --- a/xendit/payment_request/model/payment_request.py +++ b/xendit/payment_request/model/payment_request.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_action.py b/xendit/payment_request/model/payment_request_action.py index 8cf24562..39cfc958 100644 --- a/xendit/payment_request/model/payment_request_action.py +++ b/xendit/payment_request/model/payment_request_action.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_auth_parameters.py b/xendit/payment_request/model/payment_request_auth_parameters.py index c390269d..d558278b 100644 --- a/xendit/payment_request/model/payment_request_auth_parameters.py +++ b/xendit/payment_request/model/payment_request_auth_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_basket.py b/xendit/payment_request/model/payment_request_basket.py index c93048d8..a6fd90cd 100644 --- a/xendit/payment_request/model/payment_request_basket.py +++ b/xendit/payment_request/model/payment_request_basket.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_basket_item.py b/xendit/payment_request/model/payment_request_basket_item.py index f61f7534..862002fc 100644 --- a/xendit/payment_request/model/payment_request_basket_item.py +++ b/xendit/payment_request/model/payment_request_basket_item.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_capture_method.py b/xendit/payment_request/model/payment_request_capture_method.py index 2424639c..613aa1ad 100644 --- a/xendit/payment_request/model/payment_request_capture_method.py +++ b/xendit/payment_request/model/payment_request_capture_method.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_card_verification_results.py b/xendit/payment_request/model/payment_request_card_verification_results.py index a0870448..c345a8b0 100644 --- a/xendit/payment_request/model/payment_request_card_verification_results.py +++ b/xendit/payment_request/model/payment_request_card_verification_results.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py b/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py index f01e676e..492f9872 100644 --- a/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py +++ b/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_channel_properties.py b/xendit/payment_request/model/payment_request_channel_properties.py index 770d737d..3279d291 100644 --- a/xendit/payment_request/model/payment_request_channel_properties.py +++ b/xendit/payment_request/model/payment_request_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_country.py b/xendit/payment_request/model/payment_request_country.py index e3e56bb1..a51b562e 100644 --- a/xendit/payment_request/model/payment_request_country.py +++ b/xendit/payment_request/model/payment_request_country.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_currency.py b/xendit/payment_request/model/payment_request_currency.py index e2d73361..73274e62 100644 --- a/xendit/payment_request/model/payment_request_currency.py +++ b/xendit/payment_request/model/payment_request_currency.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_initiator.py b/xendit/payment_request/model/payment_request_initiator.py index b69d7446..58a74162 100644 --- a/xendit/payment_request/model/payment_request_initiator.py +++ b/xendit/payment_request/model/payment_request_initiator.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_list_response.py b/xendit/payment_request/model/payment_request_list_response.py index 520a7f03..b1b4d148 100644 --- a/xendit/payment_request/model/payment_request_list_response.py +++ b/xendit/payment_request/model/payment_request_list_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_parameters.py b/xendit/payment_request/model/payment_request_parameters.py index 8dbb5df7..13ed6e5b 100644 --- a/xendit/payment_request/model/payment_request_parameters.py +++ b/xendit/payment_request/model/payment_request_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_parameters_channel_properties.py b/xendit/payment_request/model/payment_request_parameters_channel_properties.py index a55cc1ee..79bb40e1 100644 --- a/xendit/payment_request/model/payment_request_parameters_channel_properties.py +++ b/xendit/payment_request/model/payment_request_parameters_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py b/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py index b6c4ff7c..a23fe6f2 100644 --- a/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py +++ b/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_shipping_information.py b/xendit/payment_request/model/payment_request_shipping_information.py index 2e8c442c..b5edb0fa 100644 --- a/xendit/payment_request/model/payment_request_shipping_information.py +++ b/xendit/payment_request/model/payment_request_shipping_information.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/payment_request_status.py b/xendit/payment_request/model/payment_request_status.py index b8ce60e9..6bf4d788 100644 --- a/xendit/payment_request/model/payment_request_status.py +++ b/xendit/payment_request/model/payment_request_status.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/qr_code.py b/xendit/payment_request/model/qr_code.py index 55937668..83e56914 100644 --- a/xendit/payment_request/model/qr_code.py +++ b/xendit/payment_request/model/qr_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/qr_code_channel_code.py b/xendit/payment_request/model/qr_code_channel_code.py index f5a996ce..1a3975e9 100644 --- a/xendit/payment_request/model/qr_code_channel_code.py +++ b/xendit/payment_request/model/qr_code_channel_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/qr_code_channel_properties.py b/xendit/payment_request/model/qr_code_channel_properties.py index 4de666b5..a1929cae 100644 --- a/xendit/payment_request/model/qr_code_channel_properties.py +++ b/xendit/payment_request/model/qr_code_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/qr_code_parameters.py b/xendit/payment_request/model/qr_code_parameters.py index 059c1fbc..beead358 100644 --- a/xendit/payment_request/model/qr_code_parameters.py +++ b/xendit/payment_request/model/qr_code_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account.py b/xendit/payment_request/model/virtual_account.py index 1f50bd74..a51a12ff 100644 --- a/xendit/payment_request/model/virtual_account.py +++ b/xendit/payment_request/model/virtual_account.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account_all_of.py b/xendit/payment_request/model/virtual_account_all_of.py index 77b0fb2e..106165fb 100644 --- a/xendit/payment_request/model/virtual_account_all_of.py +++ b/xendit/payment_request/model/virtual_account_all_of.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account_alternative_display.py b/xendit/payment_request/model/virtual_account_alternative_display.py index 5b039d5d..b554d0b3 100644 --- a/xendit/payment_request/model/virtual_account_alternative_display.py +++ b/xendit/payment_request/model/virtual_account_alternative_display.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account_channel_code.py b/xendit/payment_request/model/virtual_account_channel_code.py index 4f7aa1c6..ff30b6ea 100644 --- a/xendit/payment_request/model/virtual_account_channel_code.py +++ b/xendit/payment_request/model/virtual_account_channel_code.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account_channel_properties.py b/xendit/payment_request/model/virtual_account_channel_properties.py index 4ababa05..0fb36bd0 100644 --- a/xendit/payment_request/model/virtual_account_channel_properties.py +++ b/xendit/payment_request/model/virtual_account_channel_properties.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/model/virtual_account_parameters.py b/xendit/payment_request/model/virtual_account_parameters.py index 09bbedab..20c8dc9e 100644 --- a/xendit/payment_request/model/virtual_account_parameters.py +++ b/xendit/payment_request/model/virtual_account_parameters.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """ diff --git a/xendit/payment_request/payment_request_api.py b/xendit/payment_request/payment_request_api.py index ae78cd58..2ee10806 100644 --- a/xendit/payment_request/payment_request_api.py +++ b/xendit/payment_request/payment_request_api.py @@ -3,7 +3,7 @@ This API is used for Payment Requests # noqa: E501 - The version of the OpenAPI document: 1.45.1 + The version of the OpenAPI document: 1.45.2 """ import re # noqa: F401 diff --git a/xendit/refund/model/__init__.py b/xendit/refund/model/__init__.py index e5606ee0..7880b91e 100644 --- a/xendit/refund/model/__init__.py +++ b/xendit/refund/model/__init__.py @@ -17,4 +17,6 @@ from xendit.refund.model.create_refund503_response import CreateRefund503Response from xendit.refund.model.get_all_refunds_default_response import GetAllRefundsDefaultResponse from xendit.refund.model.refund import Refund +from xendit.refund.model.refund_callback import RefundCallback +from xendit.refund.model.refund_callback_data import RefundCallbackData from xendit.refund.model.refund_list import RefundList diff --git a/xendit/refund/model/create_refund.py b/xendit/refund/model/create_refund.py index 98f66297..03cdd45d 100644 --- a/xendit/refund/model/create_refund.py +++ b/xendit/refund/model/create_refund.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/create_refund400_response.py b/xendit/refund/model/create_refund400_response.py index 6847ab30..bc5add25 100644 --- a/xendit/refund/model/create_refund400_response.py +++ b/xendit/refund/model/create_refund400_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ @@ -61,6 +61,7 @@ class CreateRefund400Response(ModelNormal): 'PARTIAL_REFUND_NOT_SUPPORTED': "PARTIAL_REFUND_NOT_SUPPORTED", 'REFUND_NOT_SUPPORTED': "REFUND_NOT_SUPPORTED", 'TRANSACTION_NOT_FOUND': "TRANSACTION_NOT_FOUND", + 'REFUND_IN_PROGRESS': "REFUND_IN_PROGRESS", }, } diff --git a/xendit/refund/model/create_refund403_response.py b/xendit/refund/model/create_refund403_response.py index 10a14e92..e3d30106 100644 --- a/xendit/refund/model/create_refund403_response.py +++ b/xendit/refund/model/create_refund403_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/create_refund404_response.py b/xendit/refund/model/create_refund404_response.py index afe77778..cb061c1a 100644 --- a/xendit/refund/model/create_refund404_response.py +++ b/xendit/refund/model/create_refund404_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/create_refund409_response.py b/xendit/refund/model/create_refund409_response.py index 2dbdf873..97d0fa25 100644 --- a/xendit/refund/model/create_refund409_response.py +++ b/xendit/refund/model/create_refund409_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/create_refund503_response.py b/xendit/refund/model/create_refund503_response.py index 92940a5c..64002e22 100644 --- a/xendit/refund/model/create_refund503_response.py +++ b/xendit/refund/model/create_refund503_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/get_all_refunds_default_response.py b/xendit/refund/model/get_all_refunds_default_response.py index 89778f49..3627ede2 100644 --- a/xendit/refund/model/get_all_refunds_default_response.py +++ b/xendit/refund/model/get_all_refunds_default_response.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/refund.py b/xendit/refund/model/refund.py index 30a0d867..db7368ea 100644 --- a/xendit/refund/model/refund.py +++ b/xendit/refund/model/refund.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/model/refund_callback.py b/xendit/refund/model/refund_callback.py new file mode 100644 index 00000000..d39779f9 --- /dev/null +++ b/xendit/refund/model/refund_callback.py @@ -0,0 +1,300 @@ +""" + The version of the XENDIT API: 1.3.4 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + +from xendit.refund.model.refund_callback_data import RefundCallbackData +globals()['RefundCallbackData'] = RefundCallbackData + +def lazy_import(): + pass + +class RefundCallback(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'event': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'data': (RefundCallbackData, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'event': 'event', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, event, business_id, created, *args, **kwargs): # noqa: E501 + """RefundCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RefundCallbackData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + event: str, + business_id: str, + created: str, + data: RefundCallbackData | None = None, + *args, **kwargs + ): # noqa: E501 + """RefundCallback - a model defined in OpenAPI + + Args: + event (str): Identifies the event that triggered a notification to the merchant + business_id (str): business_id + created (str): + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RefundCallbackData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.event = event + self.business_id = business_id + self.created = created + if data is not None: + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/refund_callback_data.py b/xendit/refund/model/refund_callback_data.py new file mode 100644 index 00000000..7f329634 --- /dev/null +++ b/xendit/refund/model/refund_callback_data.py @@ -0,0 +1,380 @@ +""" + The version of the XENDIT API: 1.3.4 +""" + + +import re # noqa: F401 +import sys # noqa: F401 +from typing import List # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + pass + +class RefundCallbackData(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'payment_request_id': (str,), # noqa: E501 + 'payment_method_type': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'channel_code': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'reason': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'invoice_id': (str, none_type, none_type), # noqa: E501 + 'reference_id': (str, none_type, none_type), # noqa: E501 + 'failure_code': (str, none_type, none_type), # noqa: E501 + 'refund_fee_amount': (float, none_type, none_type), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type, none_type), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'payment_request_id': 'payment_request_id', # noqa: E501 + 'payment_method_type': 'payment_method_type', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'status': 'status', # noqa: E501 + 'reason': 'reason', # noqa: E501 + 'country': 'country', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'invoice_id': 'invoice_id', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'refund_fee_amount': 'refund_fee_amount', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, payment_request_id, payment_method_type, amount, channel_code, status, reason, country, currency, created, updated, *args, **kwargs): # noqa: E501 + """RefundCallbackData - a model defined in OpenAPI + + Args: + id (str): + payment_request_id (str): + payment_method_type (str): + amount (float): + channel_code (str): + status (str): + reason (str): + country (str): + currency (str): + created (str): + updated (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + invoice_id (str, none_type): [optional] # noqa: E501 + reference_id (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + refund_fee_amount (float, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.payment_request_id = payment_request_id + self.payment_method_type = payment_method_type + self.amount = amount + self.channel_code = channel_code + self.status = status + self.reason = reason + self.country = country + self.currency = currency + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, + id: str, + payment_request_id: str, + payment_method_type: str, + amount: float, + channel_code: str, + status: str, + reason: str, + country: str, + currency: str, + created: str, + updated: str, + invoice_id: str | None = None, + reference_id: str | None = None, + failure_code: str | None = None, + refund_fee_amount: float | None = None, + metadata: dict | None = None, + *args, **kwargs + ): # noqa: E501 + """RefundCallbackData - a model defined in OpenAPI + + Args: + id (str): + payment_request_id (str): + payment_method_type (str): + amount (float): + channel_code (str): + status (str): + reason (str): + country (str): + currency (str): + created (str): + updated (str): + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + invoice_id (str, none_type): [optional] # noqa: E501 + reference_id (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + refund_fee_amount (float, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.payment_request_id = payment_request_id + self.payment_method_type = payment_method_type + self.amount = amount + self.channel_code = channel_code + self.status = status + self.reason = reason + self.country = country + self.currency = currency + self.created = created + self.updated = updated + if invoice_id is not None: + self.invoice_id = invoice_id + if reference_id is not None: + self.reference_id = reference_id + if failure_code is not None: + self.failure_code = failure_code + if refund_fee_amount is not None: + self.refund_fee_amount = refund_fee_amount + if metadata is not None: + self.metadata = metadata + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/refund_list.py b/xendit/refund/model/refund_list.py index eb37df2b..8d57c945 100644 --- a/xendit/refund/model/refund_list.py +++ b/xendit/refund/model/refund_list.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.3.3 + The version of the XENDIT API: 1.3.4 """ diff --git a/xendit/refund/refund_api.py b/xendit/refund/refund_api.py index 27a19a9b..7cb919ca 100644 --- a/xendit/refund/refund_api.py +++ b/xendit/refund/refund_api.py @@ -3,7 +3,7 @@ This API is used for the unified refund service # noqa: E501 - The version of the OpenAPI document: 1.3.3 + The version of the OpenAPI document: 1.3.4 """ import re # noqa: F401 diff --git a/xendit/rest.py b/xendit/rest.py index 6c0647f5..55e5a466 100644 --- a/xendit/rest.py +++ b/xendit/rest.py @@ -1,5 +1,5 @@ """ - The version of the XENDIT API: 1.45.1 + The version of the XENDIT API: 1.45.2 """