diff --git a/CHANGELOG.md b/CHANGELOG.md index 40f55443..59a7cd7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * Reverted #64, removing `balance_in_cents_invoiced` and `balance_in_cents_uninvoiced` from `Recurly_Account`. They were never added to the API. +* Added tax_code to plans, add-ons and adjustments [120](https://github.com/recurly/recurly-client-php/pull/120) ## Version 2.3.2 (Oct 21st, 2014) diff --git a/Tests/Recurly/Adjustment_Test.php b/Tests/Recurly/Adjustment_Test.php index 93abb4a8..336a1063 100644 --- a/Tests/Recurly/Adjustment_Test.php +++ b/Tests/Recurly/Adjustment_Test.php @@ -68,11 +68,13 @@ public function testXml() { $charge->currency = 'USD'; $charge->quantity = 1; $charge->accounting_code = 'bandwidth'; + $charge->tax_exempt = false; + $charge->tax_code = 'fake-tax-code'; // This deprecated parameter should be ignored: $charge->taxable = 0; - $expected = "\nUSD50001Charge for extra bandwidthbandwidth\n"; + $expected = "\nUSD50001Charge for extra bandwidthbandwidthfalsefake-tax-code\n"; $this->assertEquals($expected, $charge->xml()); } } diff --git a/Tests/Recurly/Plan_Test.php b/Tests/Recurly/Plan_Test.php index dcb64fe1..4d915859 100644 --- a/Tests/Recurly/Plan_Test.php +++ b/Tests/Recurly/Plan_Test.php @@ -62,9 +62,11 @@ public function testUpdateXml() { $plan->unit_amount_in_cents->addCurrency('EUR', 1200); $plan->setup_fee_in_cents->addCurrency('EUR', 500); $plan->total_billing_cycles = NULL; + $plan->tax_exempt = false; + $plan->tax_code = 'fake-tax-code'; $this->assertEquals( - "\nplatinumPlatinum Plan15001200500500\n", + "\nplatinumPlatinum Plan15001200500500falsefake-tax-code\n", $plan->xml() ); } diff --git a/lib/recurly/addon.php b/lib/recurly/addon.php index d5558d46..d97b6f0e 100644 --- a/lib/recurly/addon.php +++ b/lib/recurly/addon.php @@ -14,7 +14,7 @@ public static function init() { Recurly_Addon::$_writeableAttributes = array( 'add_on_code','name','display_quantity','default_quantity', - 'unit_amount_in_cents','accounting_code' + 'unit_amount_in_cents','accounting_code','tax_code' ); Recurly_Addon::$_nestedAttributes = array(); } diff --git a/lib/recurly/adjustment.php b/lib/recurly/adjustment.php index a68ff024..0b96225e 100644 --- a/lib/recurly/adjustment.php +++ b/lib/recurly/adjustment.php @@ -9,7 +9,7 @@ public static function init() { Recurly_Adjustment::$_writeableAttributes = array( 'currency','unit_amount_in_cents','quantity','description', - 'accounting_code','tax_exempt' + 'accounting_code','tax_exempt','tax_code' ); Recurly_Adjustment::$_nestedAttributes = array( 'invoice' diff --git a/lib/recurly/plan.php b/lib/recurly/plan.php index ea68e68e..b6611a04 100644 --- a/lib/recurly/plan.php +++ b/lib/recurly/plan.php @@ -19,7 +19,7 @@ public static function init() 'bypass_hosted_confirmation','unit_name','payment_page_tos_link', 'plan_interval_length','plan_interval_unit','trial_interval_length', 'trial_interval_unit','unit_amount_in_cents','setup_fee_in_cents', - 'total_billing_cycles','accounting_code','tax_exempt' + 'total_billing_cycles','accounting_code','tax_exempt','tax_code' ); Recurly_Plan::$_nestedAttributes = array( 'add_ons'