Skip to content

Commit

Permalink
Add RevRec attributes to shipping methods
Browse files Browse the repository at this point in the history
  • Loading branch information
faiberrec committed Feb 13, 2024
1 parent bc68327 commit 2a9dba7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Tests/Recurly/ShippingMethod_Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

class Recurly_ShippingMethodTest extends Recurly_TestCase
{
function defaultResponses() {
return array(
array('GET', '/shipping_methods/fedex_ground', 'shipping_methods/show-200.xml'),
);
}

public function testPerformanceObligation() {
$shipping_method = Recurly_ShippingMethod::get('fedex_ground', $this->client);

$this->assertInstanceOf('Recurly_ShippingMethod', $shipping_method);
$this->assertEquals('fedex_ground', $shipping_method->code);
$this->assertEquals('FedEx Ground', $shipping_method->name);
$this->assertEquals('twywqfr48v9l', $shipping_method->liability_gl_account_id);
$this->assertEquals('thproqnpcuwp', $shipping_method->revenue_gl_account_id);
$this->assertEquals('4', $shipping_method->performance_obligation_id);
$this->assertInstanceOf('DateTime', $shipping_method->created_at);
$this->assertInstanceOf('DateTime', $shipping_method->updated_at);
}
}
15 changes: 15 additions & 0 deletions Tests/fixtures/shipping_methods/show-200.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<shipping_method href="https://api.recurly.com/v2/shipping_methods/fedex_ground">
<code>fedex_ground</code>
<name>FedEx Ground</name>
<accounting_code></accounting_code>
<liability_gl_account_id>twywqfr48v9l</liability_gl_account_id>
<revenue_gl_account_id>thproqnpcuwp</revenue_gl_account_id>
<performance_obligation_id>4</performance_obligation_id>
<tax_code></tax_code>
<created_at type="datetime">2019-05-07T16:36:22Z</created_at>
<updated_at type="datetime">2019-05-07T16:36:22Z</updated_at>
</shipping_method>
3 changes: 3 additions & 0 deletions lib/recurly/shipping_method.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @property string $name The name of the shipping method.
* @property string $accounting_code The accounting code of the shipping method.
* @property string $tax_code The tax code of the shipping method.
* @property string $liability_gl_account_id The ID of the liability general ledger account associated with the plan.
* @property string $revenue_gl_account_id The ID of the revenue general ledger account associated with the plan.
* @property string $performance_obligation_id The ID of the performance obligation associated with the plan.
* @property DateTime $created_at The date and time the shipping method was created.
* @property DateTime $updated_at The date and time the shipping method was last updated.
*/
Expand Down

0 comments on commit 2a9dba7

Please sign in to comment.