Skip to content

Commit

Permalink
Merge pull request #507 from stripe/remi-add-account-links
Browse files Browse the repository at this point in the history
Add support for the Account Link resource
  • Loading branch information
ob-stripe authored Dec 11, 2018
2 parents 3e06036 + 7b1bdb0 commit bfdd8e3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cache:
env:
global:
# If changing this number, please also change it in `tests/conftest.py`.
- STRIPE_MOCK_VERSION=0.38.0
- STRIPE_MOCK_VERSION=0.39.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 @@ -5,6 +5,7 @@
from stripe.api_resources.list_object import ListObject

from stripe.api_resources.account import Account
from stripe.api_resources.account_link import AccountLink
from stripe.api_resources.alipay_account import AlipayAccount
from stripe.api_resources.apple_pay_domain import ApplePayDomain
from stripe.api_resources.application_fee import ApplicationFee
Expand Down
7 changes: 7 additions & 0 deletions stripe/api_resources/account_link.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 CreateableAPIResource


class AccountLink(CreateableAPIResource):
OBJECT_NAME = 'account_link'
1 change: 1 addition & 0 deletions stripe/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def load_object_classes():

# business objects
api_resources.Account.OBJECT_NAME: api_resources.Account,
api_resources.AccountLink.OBJECT_NAME: api_resources.AccountLink,
api_resources.AlipayAccount.OBJECT_NAME: api_resources.AlipayAccount,
api_resources.ApplePayDomain.OBJECT_NAME: api_resources.ApplePayDomain,
api_resources.ApplicationFee.OBJECT_NAME: api_resources.ApplicationFee,
Expand Down
18 changes: 18 additions & 0 deletions tests/api_resources/test_account_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import absolute_import, division, print_function

import stripe


class TestAccountLink(object):
def test_is_creatable(self, request_mock):
resource = stripe.AccountLink.create(
account='acct_123',
failure_url='https://stripe.com/failure',
success_url='https://stripe.com/success',
type='custom_account_verification'
)
request_mock.assert_requested(
'post',
'/v1/account_links'
)
assert isinstance(resource, stripe.AccountLink)
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tests.request_mock import RequestMock


MOCK_MINIMUM_VERSION = '0.38.0'
MOCK_MINIMUM_VERSION = '0.39.0'
MOCK_PORT = os.environ.get('STRIPE_MOCK_PORT', 12111)


Expand Down

0 comments on commit bfdd8e3

Please sign in to comment.