From 60f3ad1c08fea4892b5fb0dce86b7ff01f12b59f Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Wed, 21 Nov 2018 12:43:26 -0600 Subject: [PATCH] Add exemption certificate attribute to Account --- Tests/Recurly/Account_Test.php | 4 +++- Tests/fixtures/accounts/show-200.xml | 1 + lib/recurly/account.php | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Tests/Recurly/Account_Test.php b/Tests/Recurly/Account_Test.php index be8f31f8..bbdf02f0 100644 --- a/Tests/Recurly/Account_Test.php +++ b/Tests/Recurly/Account_Test.php @@ -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'); @@ -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'; @@ -143,7 +145,7 @@ public function testXml() { $account->custom_fields[] = new Recurly_CustomField("serial_number", "4567-8900-1234"); $this->assertEquals( - "\nact123Verena
123 Main St.
falseI123 Main St.San FranciscoCA94110US555-555-5555verena@example.comWorkVerenaExampleRecurly Inc.123 Dolores St.San FranciscoCA94110US555-555-5555verena@example.comHomeVerenaExampleen-USserial_number4567-8900-1234599USDmarketing_contentpickle sticks blog postmailchimp67a904de95.0914d8f4b4
\n", + "\nact123Verena
123 Main St.
falseI123 Main St.San FranciscoCA94110US555-555-5555verena@example.comWorkVerenaExampleRecurly Inc.123 Dolores St.San FranciscoCA94110US555-555-5555verena@example.comHomeVerenaExampleen-USserial_number4567-8900-1234599USDmarketing_contentpickle sticks blog postmailchimp67a904de95.0914d8f4b4Some Certificate
\n", $account->xml() ); } diff --git a/Tests/fixtures/accounts/show-200.xml b/Tests/fixtures/accounts/show-200.xml index 0c40fc94..c1afeda4 100644 --- a/Tests/fixtures/accounts/show-200.xml +++ b/Tests/fixtures/accounts/show-200.xml @@ -18,6 +18,7 @@ Content-Type: application/xml; charset=utf-8 ST-1937 I true + Some Certificate en-US
123 Main St. diff --git a/lib/recurly/account.php b/lib/recurly/account.php index 4e030174..0763b283 100644 --- a/lib/recurly/account.php +++ b/lib/recurly/account.php @@ -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. @@ -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() {