Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .cursor/rules/general.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
description: General rules
globs:
---
- always use `uv` instead of `pip` directly
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Install uv and set Python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml uv.lock"

- name: Install dependencies
run: uv sync --all-groups

- name: Run tests with pytest
run: uv run pytest --cov=Monei --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false

- name: Minimize uv cache
run: uv cache prune --ci
26 changes: 18 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,26 @@ target/

##### MONEI Custom

build/node_modules/
build/openapi.json
node_modules/
openapi.json
test.py

.idea

# Yarn
/build/.yarn/*
!/build/.yarn/patches
!/build/.yarn/plugins
!/build/.yarn/releases
!/build/.yarn/sdks
!/build/.yarn/versions
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

##### UV specific
.uv/.cache/
.uv/.tmp/
.uv/links/
.uv/storage/
.uv/indexes/
.uv/network/
.uv/pythons/
.venv/
53 changes: 45 additions & 8 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.gitlab-ci.yml
.travis.yml
Monei/__init__.py
Monei/api/__init__.py
Monei/api/apple_pay_domain_api.py
Monei/api/bizum_api.py
Monei/api/payment_methods_api.py
Monei/api/payments_api.py
Monei/api/subscriptions_api.py
Monei/api_client.py
Expand All @@ -12,16 +12,22 @@ Monei/exceptions.py
Monei/model/__init__.py
Monei/model/activate_subscription_request.py
Monei/model/address.py
Monei/model/apple_pay_domain_register200_response.py
Monei/model/apple_pay_domain_register400_response.py
Monei/model/apple_pay_domain_register401_response.py
Monei/model/apple_pay_domain_register404_response.py
Monei/model/apple_pay_domain_register422_response.py
Monei/model/apple_pay_domain_register500_response.py
Monei/model/apple_pay_domain_register503_response.py
Monei/model/bizum_validate_phone200_response.py
Monei/model/cancel_payment_request.py
Monei/model/cancel_subscription_request.py
Monei/model/capture_payment_request.py
Monei/model/card.py
Monei/model/confirm_payment_request.py
Monei/model/confirm_payment_request_payment_method.py
Monei/model/confirm_payment_request_payment_method_card.py
Monei/model/create_payment_request.py
Monei/model/create_subscription_request.py
Monei/model/domain_register200_response.py
Monei/model/error.py
Monei/model/pause_subscription_request.py
Monei/model/payment.py
Expand All @@ -31,13 +37,41 @@ Monei/model/payment_customer.py
Monei/model/payment_last_refund_reason.py
Monei/model/payment_message_channel.py
Monei/model/payment_message_language.py
Monei/model/payment_methods.py
Monei/model/payment_methods_metadata.py
Monei/model/payment_methods_metadata_alipay.py
Monei/model/payment_methods_metadata_apple_pay.py
Monei/model/payment_methods_metadata_bancontact.py
Monei/model/payment_methods_metadata_bizum.py
Monei/model/payment_methods_metadata_blik.py
Monei/model/payment_methods_metadata_card.py
Monei/model/payment_methods_metadata_click_to_pay.py
Monei/model/payment_methods_metadata_click_to_pay_discover.py
Monei/model/payment_methods_metadata_click_to_pay_mastercard.py
Monei/model/payment_methods_metadata_click_to_pay_visa.py
Monei/model/payment_methods_metadata_eps.py
Monei/model/payment_methods_metadata_giropay.py
Monei/model/payment_methods_metadata_google_pay.py
Monei/model/payment_methods_metadata_i_deal.py
Monei/model/payment_methods_metadata_klarna.py
Monei/model/payment_methods_metadata_mbway.py
Monei/model/payment_methods_metadata_sepa.py
Monei/model/payment_methods_metadata_sofort.py
Monei/model/payment_methods_metadata_trustly.py
Monei/model/payment_methods_methods.py
Monei/model/payment_next_action.py
Monei/model/payment_payment_method.py
Monei/model/payment_payment_method_bizum.py
Monei/model/payment_payment_method_bizum_input.py
Monei/model/payment_payment_method_card.py
Monei/model/payment_payment_method_card_input.py
Monei/model/payment_payment_method_cofidis.py
Monei/model/payment_payment_method_input.py
Monei/model/payment_payment_method_klarna.py
Monei/model/payment_payment_method_mbway.py
Monei/model/payment_payment_method_paypal.py
Monei/model/payment_payment_method_sepa.py
Monei/model/payment_payment_method_trustly.py
Monei/model/payment_payment_methods.py
Monei/model/payment_refund_reason.py
Monei/model/payment_sequence.py
Expand All @@ -50,23 +84,26 @@ Monei/model/payment_trace_details.py
Monei/model/payment_transaction_type.py
Monei/model/recurring_payment_request.py
Monei/model/refund_payment_request.py
Monei/model/register_domain_request.py
Monei/model/register_apple_pay_domain_request.py
Monei/model/send_payment_link_request.py
Monei/model/send_payment_receipt_request.py
Monei/model/send_payment_request_request.py
Monei/model/send_subscription_link_request.py
Monei/model/send_subscription_status_request.py
Monei/model/subscription.py
Monei/model/subscription_interval.py
Monei/model/subscription_last_payment.py
Monei/model/subscription_payment_method.py
Monei/model/subscription_payment_method_card.py
Monei/model/subscription_retry_schedule.py
Monei/model/subscription_retry_schedule_inner.py
Monei/model/subscription_status.py
Monei/model/update_subscription_request.py
Monei/model/validate_bizum_phone_request.py
Monei/model_utils.py
Monei/models/__init__.py
Monei/rest.py
git_push.sh
requirements.txt
test-requirements.txt
test/__init__.py
test/test_domain_register200_response.py
test/test_payment_payment_methods.py
tox.ini
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1
6.0.1
14 changes: 14 additions & 0 deletions .uv/uv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[python]
python-version = "3.12"

[venv]
location = ".venv"
use-local-python = true

[install]
upgrade-strategy = "eager"

[sync]
dev-groups = ["test", "lint"]
no-deps = false
index-url = "https://pypi.org/simple"
File renamed without changes.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 MONEI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
78 changes: 7 additions & 71 deletions Monei/__init__.py
Original file line number Diff line number Diff line change
@@ -1,93 +1,29 @@
# coding: utf-8

# flake8: noqa

"""
MONEI API v1

<p>The MONEI API is organized around <a href=\"https://en.wikipedia.org/wiki/Representational_State_Transfer\">REST</a>. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.</p> <h4 id=\"base-url\">Base URL:</h4> <p><a href=\"https://api.monei.com/v1\">https://api.monei.com/v1</a></p> <h4 id=\"client-libraries\">Client libraries:</h4> <ul> <li><a href=\"https://github.com/MONEI/monei-php-sdk\">PHP SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-python-sdk\">Python SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-node-sdk\">Node.js SDK</a></li> <li><a href=\"https://postman.monei.com/\">Postman</a></li> </ul> <h4 id=\"important\">Important:</h4> <p><strong>If you are not using our official SDKs, you need to provide a valid <code>User-Agent</code> header in each request, otherwise your requests will be rejected.</strong></p> # noqa: E501
<p>The MONEI API is organized around <a href=\"https://en.wikipedia.org/wiki/Representational_State_Transfer\">REST</a> principles. Our API is designed to be intuitive and developer-friendly.</p> <h3>Base URL</h3> <p>All API requests should be made to:</p> <pre><code>https://api.monei.com/v1 </code></pre> <h3>Environment</h3> <p>MONEI provides two environments:</p> <ul> <li><strong>Test Environment</strong>: For development and testing without processing real payments</li> <li><strong>Live Environment</strong>: For processing real transactions in production</li> </ul> <h3>Client Libraries</h3> <p>We provide official SDKs to simplify integration:</p> <ul> <li><a href=\"https://github.com/MONEI/monei-php-sdk\">PHP SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-python-sdk\">Python SDK</a></li> <li><a href=\"https://github.com/MONEI/monei-node-sdk\">Node.js SDK</a></li> <li><a href=\"https://postman.monei.com/\">Postman Collection</a></li> </ul> <p>Our SDKs handle authentication, error handling, and request formatting automatically.</p> <p>You can download the OpenAPI specification from the <a href=\"https://js.monei.com/api/v1/openapi.json\">https://js.monei.com/api/v1/openapi.json</a> and generate your own client library using the <a href=\"https://openapi-generator.tech/\">OpenAPI Generator</a>.</p> <h3>Important Requirements</h3> <ul> <li>All API requests must be made over HTTPS</li> <li>If you are not using our official SDKs, you <strong>must provide a valid <code>User-Agent</code> header</strong> with each request</li> <li>Requests without proper authentication will return a <code>401 Unauthorized</code> error</li> </ul> <h3>Error Handling</h3> <p>The API returns consistent error codes and messages to help you troubleshoot issues. Each response includes a <code>statusCode</code> attribute indicating the outcome of your request.</p> <h3>Rate Limits</h3> <p>The API implements rate limiting to ensure stability. If you exceed the limits, requests will return a <code>429 Too Many Requests</code> status code.</p> # noqa: E501

The version of the OpenAPI document: 1.4.6
The version of the OpenAPI document: 1.5.4
Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

__version__ = "1.2.6"

# import apis into sdk package
from Monei.api.apple_pay_domain_api import ApplePayDomainApi
from Monei.api.bizum_api import BizumApi
from Monei.api.payments_api import PaymentsApi
from Monei.api.subscriptions_api import SubscriptionsApi

# import ApiClient
from Monei.api_client import ApiClient

# import Configuration
from Monei.configuration import Configuration

# import exceptions
from Monei.exceptions import OpenApiException
from Monei.exceptions import ApiAttributeError
from Monei.exceptions import ApiTypeError
from Monei.exceptions import ApiValueError
from Monei.exceptions import ApiKeyError
from Monei.exceptions import ApiException
# import models into sdk package
from Monei.models.activate_subscription_request import ActivateSubscriptionRequest
from Monei.models.address import Address
from Monei.models.cancel_payment_request import CancelPaymentRequest
from Monei.models.cancel_subscription_request import CancelSubscriptionRequest
from Monei.models.capture_payment_request import CapturePaymentRequest
from Monei.models.confirm_payment_request import ConfirmPaymentRequest
from Monei.models.confirm_payment_request_payment_method import ConfirmPaymentRequestPaymentMethod
from Monei.models.confirm_payment_request_payment_method_card import ConfirmPaymentRequestPaymentMethodCard
from Monei.models.create_payment_request import CreatePaymentRequest
from Monei.models.create_subscription_request import CreateSubscriptionRequest
from Monei.models.error import Error
from Monei.models.inline_response200 import InlineResponse200
from Monei.models.inline_response2001 import InlineResponse2001
from Monei.models.pause_subscription_request import PauseSubscriptionRequest
from Monei.models.payment import Payment
from Monei.models.payment_billing_details import PaymentBillingDetails
from Monei.models.payment_cancellation_reason import PaymentCancellationReason
from Monei.models.payment_customer import PaymentCustomer
from Monei.models.payment_last_refund_reason import PaymentLastRefundReason
from Monei.models.payment_message_channel import PaymentMessageChannel
from Monei.models.payment_message_language import PaymentMessageLanguage
from Monei.models.payment_next_action import PaymentNextAction
from Monei.models.payment_payment_method import PaymentPaymentMethod
from Monei.models.payment_payment_method_bizum import PaymentPaymentMethodBizum
from Monei.models.payment_payment_method_bizum_input import PaymentPaymentMethodBizumInput
from Monei.models.payment_payment_method_card import PaymentPaymentMethodCard
from Monei.models.payment_payment_method_card_input import PaymentPaymentMethodCardInput
from Monei.models.payment_payment_method_cofidis import PaymentPaymentMethodCofidis
from Monei.models.payment_payment_method_input import PaymentPaymentMethodInput
from Monei.models.payment_payment_method_klarna import PaymentPaymentMethodKlarna
from Monei.models.payment_payment_method_mbway import PaymentPaymentMethodMbway
from Monei.models.payment_payment_method_paypal import PaymentPaymentMethodPaypal
from Monei.models.payment_payment_method_sepa import PaymentPaymentMethodSepa
from Monei.models.payment_payment_method_trustly import PaymentPaymentMethodTrustly
from Monei.models.payment_refund_reason import PaymentRefundReason
from Monei.models.payment_sequence import PaymentSequence
from Monei.models.payment_sequence_recurring import PaymentSequenceRecurring
from Monei.models.payment_session_details import PaymentSessionDetails
from Monei.models.payment_shipping_details import PaymentShippingDetails
from Monei.models.payment_shop import PaymentShop
from Monei.models.payment_status import PaymentStatus
from Monei.models.payment_trace_details import PaymentTraceDetails
from Monei.models.payment_transaction_type import PaymentTransactionType
from Monei.models.recurring_payment_request import RecurringPaymentRequest
from Monei.models.refund_payment_request import RefundPaymentRequest
from Monei.models.register_domain_request import RegisterDomainRequest
from Monei.models.send_payment_link_request import SendPaymentLinkRequest
from Monei.models.send_payment_receipt_request import SendPaymentReceiptRequest
from Monei.models.send_payment_request import SendPaymentRequest
from Monei.models.subscription import Subscription
from Monei.models.subscription_interval import SubscriptionInterval
from Monei.models.subscription_last_payment import SubscriptionLastPayment
from Monei.models.subscription_payment_method import SubscriptionPaymentMethod
from Monei.models.subscription_payment_method_card import SubscriptionPaymentMethodCard
from Monei.models.subscription_status import SubscriptionStatus
from Monei.models.update_subscription_request import UpdateSubscriptionRequest
from Monei.models.validate_bizum_phone_request import ValidateBizumPhoneRequest

# import custom MoneiClient
from Monei.monei_client import MoneiClient
12 changes: 3 additions & 9 deletions Monei/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
from __future__ import absolute_import

# flake8: noqa

# import apis into api package
from Monei.api.apple_pay_domain_api import ApplePayDomainApi
from Monei.api.bizum_api import BizumApi
from Monei.api.payments_api import PaymentsApi
from Monei.api.subscriptions_api import SubscriptionsApi
# do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all apis from one package, import them with
# from Monei.apis import ApplePayDomainApi
Loading
Loading