Skip to content

Commit

Permalink
Add exemption certificate attribute to Account
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Suarez committed Dec 11, 2018
1 parent 2969d11 commit 60f3ad1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Tests/Recurly/Account_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function testGetAccount() {
$this->assertEquals($account->created_at->getTimestamp(), 1304164800);
$this->assertEquals($account->getHref(),'https://api.recurly.com/v2/accounts/abcdef1234567890');
$this->assertTrue($account->tax_exempt);
$this->assertEquals($account->exemption_certificate, 'Some Certificate');
$this->assertEquals($account->entity_use_code, 'I');
$this->assertEquals($account->vat_location_valid, true);
$this->assertEquals($account->cc_emails, 'cheryl.hines@example.com,richard.lewis@example.com');
Expand Down Expand Up @@ -99,6 +100,7 @@ public function testXml() {
$account->first_name = 'Verena';
$account->address->address1 = "123 Main St.";
$account->tax_exempt = false;
$account->exemption_certificate = 'Some Certificate';
$account->entity_use_code = 'I';
$account->preferred_locale = 'en-US';

Expand Down Expand Up @@ -143,7 +145,7 @@ public function testXml() {
$account->custom_fields[] = new Recurly_CustomField("serial_number", "4567-8900-1234");

$this->assertEquals(
"<?xml version=\"1.0\"?>\n<account><account_code>act123</account_code><first_name>Verena</first_name><address><address1>123 Main St.</address1></address><tax_exempt>false</tax_exempt><entity_use_code>I</entity_use_code><shipping_addresses><shipping_address><address1>123 Main St.</address1><city>San Francisco</city><state>CA</state><zip>94110</zip><country>US</country><phone>555-555-5555</phone><email>verena@example.com</email><nickname>Work</nickname><first_name>Verena</first_name><last_name>Example</last_name><company>Recurly Inc.</company></shipping_address><shipping_address><address1>123 Dolores St.</address1><city>San Francisco</city><state>CA</state><zip>94110</zip><country>US</country><phone>555-555-5555</phone><email>verena@example.com</email><nickname>Home</nickname><first_name>Verena</first_name><last_name>Example</last_name></shipping_address></shipping_addresses><preferred_locale>en-US</preferred_locale><custom_fields><custom_field><name>serial_number</name><value>4567-8900-1234</value></custom_field></custom_fields><account_acquisition><cost_in_cents>599</cost_in_cents><currency>USD</currency><channel>marketing_content</channel><subchannel>pickle sticks blog post</subchannel><campaign>mailchimp67a904de95.0914d8f4b4</campaign></account_acquisition></account>\n",
"<?xml version=\"1.0\"?>\n<account><account_code>act123</account_code><first_name>Verena</first_name><address><address1>123 Main St.</address1></address><tax_exempt>false</tax_exempt><entity_use_code>I</entity_use_code><shipping_addresses><shipping_address><address1>123 Main St.</address1><city>San Francisco</city><state>CA</state><zip>94110</zip><country>US</country><phone>555-555-5555</phone><email>verena@example.com</email><nickname>Work</nickname><first_name>Verena</first_name><last_name>Example</last_name><company>Recurly Inc.</company></shipping_address><shipping_address><address1>123 Dolores St.</address1><city>San Francisco</city><state>CA</state><zip>94110</zip><country>US</country><phone>555-555-5555</phone><email>verena@example.com</email><nickname>Home</nickname><first_name>Verena</first_name><last_name>Example</last_name></shipping_address></shipping_addresses><preferred_locale>en-US</preferred_locale><custom_fields><custom_field><name>serial_number</name><value>4567-8900-1234</value></custom_field></custom_fields><account_acquisition><cost_in_cents>599</cost_in_cents><currency>USD</currency><channel>marketing_content</channel><subchannel>pickle sticks blog post</subchannel><campaign>mailchimp67a904de95.0914d8f4b4</campaign></account_acquisition><exemption_certificate>Some Certificate</exemption_certificate></account>\n",
$account->xml()
);
}
Expand Down
1 change: 1 addition & 0 deletions Tests/fixtures/accounts/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Content-Type: application/xml; charset=utf-8
<vat_number>ST-1937</vat_number>
<entity_use_code>I</entity_use_code>
<tax_exempt type="boolean">true</tax_exempt>
<exemption_certificate>Some Certificate</exemption_certificate>
<preferred_locale>en-US</preferred_locale>
<address>
<address1>123 Main St.</address1>
Expand Down
3 changes: 2 additions & 1 deletion lib/recurly/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @property string $company_name The company name of the account.
* @property string $vat_number The VAT number of the account (to avoid having the VAT applied).
* @property boolean $tax_exempt The tax status of the account. true exempts tax on the account, false applies tax on the account.
* @property string $exemption_certificate Optional field for merchants taxing through Vertex. A string representing the exemption certificate. 1-30 characters in length.
* @property Recurly_Address $address The nested address information of the account: address1, address2, city, state, zip, country, phone.
* @property string $accept_language The ISO 639-1 language code from the user's browser, indicating their preferred language and locale.
* @property string $hosted_login_token The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: https://:subdomain.recurly.com/account/:hosted_login_token.
Expand Down Expand Up @@ -105,7 +106,7 @@ protected function getWriteableAttributes() {
'account_code', 'username', 'first_name', 'last_name', 'vat_number',
'email', 'company_name', 'accept_language', 'billing_info', 'address',
'tax_exempt', 'entity_use_code', 'cc_emails', 'shipping_addresses',
'preferred_locale', 'custom_fields', 'account_acquisition'
'preferred_locale', 'custom_fields', 'account_acquisition', 'exemption_certificate'
);
}
protected function getRequiredAttributes() {
Expand Down

0 comments on commit 60f3ad1

Please sign in to comment.