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

adds vertex_transaction_type to v2 php #827

Merged
merged 1 commit into from
Nov 1, 2024
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
6 changes: 4 additions & 2 deletions Tests/Recurly/Plan_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ public function testCreateXml() {
$plan->total_billing_cycles = 6;
$plan->auto_renew = false;
$plan->dunning_campaign_id = '1234abcd';
$plan->vertex_transaction_type = 'lease';

$this->assertEquals(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<plan><auto_renew>false</auto_renew><dunning_campaign_id>1234abcd</dunning_campaign_id><name>Platinum &amp; Gold Plan</name><plan_code>platinum</plan_code><pricing_model>fixed</pricing_model><setup_fee_in_cents><EUR>500</EUR></setup_fee_in_cents><total_billing_cycles>6</total_billing_cycles><trial_requires_billing_info>false</trial_requires_billing_info><unit_amount_in_cents><USD>1500</USD><EUR>1200</EUR></unit_amount_in_cents></plan>\n",
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<plan><auto_renew>false</auto_renew><dunning_campaign_id>1234abcd</dunning_campaign_id><name>Platinum &amp; Gold Plan</name><plan_code>platinum</plan_code><pricing_model>fixed</pricing_model><setup_fee_in_cents><EUR>500</EUR></setup_fee_in_cents><vertex_transaction_type>lease</vertex_transaction_type><total_billing_cycles>6</total_billing_cycles><trial_requires_billing_info>false</trial_requires_billing_info><unit_amount_in_cents><USD>1500</USD><EUR>1200</EUR></unit_amount_in_cents></plan>\n",
$plan->xml()
);
}
Expand Down Expand Up @@ -145,9 +146,10 @@ public function testUpdateXml() {
$plan->trial_requires_billing_info = false;
$plan->tax_code = 'fake-tax-code';
$plan->dunning_campaign_id = '1234abcd';
$plan->vertex_transaction_type = 'rental';

$this->assertEquals(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<plan><dunning_campaign_id>1234abcd</dunning_campaign_id><name>Platinum Plan</name><plan_code>platinum</plan_code><setup_fee_in_cents><USD>500</USD><EUR>500</EUR></setup_fee_in_cents><tax_code>fake-tax-code</tax_code><tax_exempt>false</tax_exempt><total_billing_cycles nil=\"nil\"></total_billing_cycles><trial_requires_billing_info>false</trial_requires_billing_info><unit_amount_in_cents><USD>1500</USD><EUR>1200</EUR></unit_amount_in_cents></plan>\n",
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<plan><dunning_campaign_id>1234abcd</dunning_campaign_id><name>Platinum Plan</name><plan_code>platinum</plan_code><setup_fee_in_cents><USD>500</USD><EUR>500</EUR></setup_fee_in_cents><tax_code>fake-tax-code</tax_code><vertex_transaction_type>rental</vertex_transaction_type><tax_exempt>false</tax_exempt><total_billing_cycles nil=\"nil\"></total_billing_cycles><trial_requires_billing_info>false</trial_requires_billing_info><unit_amount_in_cents><USD>1500</USD><EUR>1200</EUR></unit_amount_in_cents></plan>\n",
$plan->xml()
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @property string $cancel_url Deprecated URL to redirect to on canceled signup on the hosted payment pages.
* @property boolean $tax_exempt true exempts tax on the plan, false applies tax on the plan. If not defined, then defaults to the Plan and Site settings.
* @property string $tax_code Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of unknown, physical, or digital. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules.
* @property string $vertex_transaction_type Optional field for Vertex merchants. The Vertex "transaction type" input contributes towards accurate tax calculation by identifying the transaction as a standard sale, a rental, or a lease. Either 'sale', 'rental', or 'lease'.
* @property string $add_on_code Add-on code. Max of 50 characters.
* @property string $add_on_type Whether the add-on is Fixed-Price (fixed), or Usage-Based (usage).
* @property integer $default_quantity Default quantity for the hosted pages.
Expand Down Expand Up @@ -150,6 +151,7 @@ protected function getWriteableAttributes() {
'setup_fee_revenue_schedule_type',
'success_url',
'tax_code',
'vertex_transaction_type',
'tax_exempt',
'total_billing_cycles',
'trial_interval_length',
Expand Down
Loading