Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Mandate #625

Merged
merged 1 commit into from
Nov 6, 2019
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cache:
env:
global:
# If changing this number, please also change it in `tests/conftest.py`.
- STRIPE_MOCK_VERSION=0.63.0
- STRIPE_MOCK_VERSION=0.72.0

before_install:
# Unpack and start stripe-mock so that the test suite can talk to it
Expand Down
1 change: 1 addition & 0 deletions stripe/api_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from stripe.api_resources.invoice_line_item import InvoiceLineItem
from stripe.api_resources.issuer_fraud_record import IssuerFraudRecord
from stripe.api_resources.login_link import LoginLink
from stripe.api_resources.mandate import Mandate
from stripe.api_resources.order import Order
from stripe.api_resources.order_return import OrderReturn
from stripe.api_resources.payment_intent import PaymentIntent
Expand Down
7 changes: 7 additions & 0 deletions stripe/api_resources/mandate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import absolute_import, division, print_function

from stripe.api_resources.abstract import APIResource


class Mandate(APIResource):
OBJECT_NAME = "mandate"
1 change: 1 addition & 0 deletions stripe/object_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
api_resources.issuing.Dispute.OBJECT_NAME: api_resources.issuing.Dispute,
api_resources.issuing.Transaction.OBJECT_NAME: api_resources.issuing.Transaction,
api_resources.LoginLink.OBJECT_NAME: api_resources.LoginLink,
api_resources.Mandate.OBJECT_NAME: api_resources.Mandate,
api_resources.Order.OBJECT_NAME: api_resources.Order,
api_resources.OrderReturn.OBJECT_NAME: api_resources.OrderReturn,
api_resources.PaymentIntent.OBJECT_NAME: api_resources.PaymentIntent,
Expand Down
15 changes: 15 additions & 0 deletions tests/api_resources/test_mandate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import absolute_import, division, print_function

import stripe


TEST_RESOURCE_ID = "mandate_123"


class TestMandateSchedule(object):
def test_is_retrievable(self, request_mock):
resource = stripe.Mandate.retrieve(TEST_RESOURCE_ID)
request_mock.assert_requested(
"get", "/v1/mandates/%s" % TEST_RESOURCE_ID
)
assert isinstance(resource, stripe.Mandate)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


# When changing this number, don't forget to change it in `.travis.yml` too.
MOCK_MINIMUM_VERSION = "0.63.0"
MOCK_MINIMUM_VERSION = "0.72.0"

# Starts stripe-mock if an OpenAPI spec override is found in `openapi/`, and
# otherwise fall back to `STRIPE_MOCK_PORT` or 12111.
Expand Down