Skip to content

Commit

Permalink
Merge pull request #253 from recurly/aaron-suarez/add-tokenization
Browse files Browse the repository at this point in the history
Add gateway_token and gateway_code fields to BillingInfo class
  • Loading branch information
bhelx authored Jul 18, 2018
2 parents e425bd9 + 3e2b7fd commit f1a28f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recurly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ class BillingInfo(Resource):
'currency',
'updated_at',
'external_hpp_type',
'gateway_token',
'gateway_code',
)
sensitive_attributes = ('number', 'verification_value', 'account_number')
xml_attribute_attributes = ('type',)
Expand Down
4 changes: 4 additions & 0 deletions tests/fixtures/billing-info/created.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Content-Type: application/xml; charset=utf-8
<zip>94105</zip>
<country>US</country>
<currency>USD</currency>
<gateway_token>gatewaytoken123</gateway_token>
<gateway_code>gatewaycode123</gateway_code>
</billing_info>

HTTP/1.1 201 Created
Expand All @@ -40,4 +42,6 @@ Location: https://api.recurly.com/v2/accounts/binfomock/billing_info
<first_six>411111</first_six>
<last_four>1111</last_four>
<currency>USD</currency>
<gateway_token>gatewaytoken123</gateway_token>
<gateway_code>gatewaycode123</gateway_code>
</billing_info>
5 changes: 5 additions & 0 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,15 @@ def test_billing_info(self):
verification_value='7777',
year='2015',
month='12',
gateway_token='gatewaytoken123',
gateway_code='gatewaycode123',
)
with self.mock_request('billing-info/created.xml'):
account.update_billing_info(binfo)

self.assertEqual(binfo.gateway_token, 'gatewaytoken123')
self.assertEqual(binfo.gateway_code, 'gatewaycode123')

logger.removeHandler(log_handler)
log_content = log_content.getvalue()
self.assertTrue('<billing_info' in log_content)
Expand Down

0 comments on commit f1a28f3

Please sign in to comment.