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 preferred_time_zone to Account #734

Merged
merged 1 commit into from
Jan 10, 2023
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
4 changes: 3 additions & 1 deletion Tests/Recurly/Account_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function testGetAccount() {
$this->assertEquals($account->cc_emails, 'cheryl.hines@example.com,richard.lewis@example.com');
$this->assertEquals($account->has_paused_subscription, false);
$this->assertEquals($account->preferred_locale, 'en-US');
$this->assertEquals($account->preferred_time_zone, 'America/Los_Angeles');
$this->assertEquals($account->dunning_campaign_id, '1234abcd');
$this->assertInstanceOf('Recurly_Stub', $account->entitlements);

Expand Down Expand Up @@ -105,6 +106,7 @@ public function testXml() {
$account->exemption_certificate = 'Some Certificate';
$account->entity_use_code = 'I';
$account->preferred_locale = 'en-US';
$account->preferred_time_zone = 'America/Los_Angeles';
$account->dunning_campaign_id = '1234abcd';

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

$this->assertEquals(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\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><dunning_campaign_id>1234abcd</dunning_campaign_id></account>\n",
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\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><preferred_time_zone>America/Los_Angeles</preferred_time_zone><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><dunning_campaign_id>1234abcd</dunning_campaign_id></account>\n",
$account->xml()
);
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/fixtures/accounts/hierarchy/show-parent-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Content-Type: application/xml; charset=utf-8
<company_name nil="nil"></company_name>
<vat_number nil="nil"></vat_number>
<preferred_locale nil="nil"></preferred_locale>
<preferred_time_zone nil="nil"></preferred_time_zone>
<address>
<address1 nil="nil"></address1>
<address2 nil="nil"></address2>
Expand All @@ -44,4 +45,4 @@ Content-Type: application/xml; charset=utf-8
<has_past_due_invoice type="boolean">false</has_past_due_invoice>
<has_paused_subscription type="boolean">false</has_paused_subscription>
<bill_to>self</bill_to>
</account>
</account>
1 change: 1 addition & 0 deletions Tests/fixtures/accounts/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Content-Type: application/xml; charset=utf-8
<tax_exempt type="boolean">true</tax_exempt>
<exemption_certificate>Some Certificate</exemption_certificate>
<preferred_locale>en-US</preferred_locale>
<preferred_time_zone>America/Los_Angeles</preferred_time_zone>
<address>
<address1>123 Main St.</address1>
<address2>APT #6</address2>
Expand Down
3 changes: 2 additions & 1 deletion lib/recurly/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @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.
* @property string $preferred_locale The locale for the emails
* @property string $preferred_time_zone The IANA time zone name to use for the emails
* @property string $has_live_subscription True if the account has at least one live subscription.
* @property string $has_active_subscription True if the account has at least one active subscription.
* @property string $has_future_subscription True if the account has at least one future subscription.
Expand Down Expand Up @@ -143,7 +144,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', 'exemption_certificate',
'preferred_locale', 'preferred_time_zone', 'custom_fields', 'account_acquisition', 'exemption_certificate',
'parent_account_code', 'transaction_type', 'dunning_campaign_id', 'invoice_template_uuid',
);
}
Expand Down