-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds revrec features to Item, GiftCard, and ShippingMethod
- Loading branch information
1 parent
4990e0b
commit de2a847
Showing
11 changed files
with
177 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gift_card href="https://api.recurly.com/v2/gift_cards/1998400800965102260"> | ||
<gifter_account href="https://api.recurly.com/v2/accounts/eteum"/> | ||
<purchase_invoice href="https://api.recurly.com/v2/invoices/1056"/> | ||
<id type="integer">1998400800965102260</id> | ||
<redemption_code>S2TNPI1Z4BRKM9U0</redemption_code> | ||
<product_code>first-gift-card</product_code> | ||
<unit_amount_in_cents type="integer">1000</unit_amount_in_cents> | ||
<currency>USD</currency> | ||
<delivery> | ||
<method>email</method> | ||
<email_address>[email protected]</email_address> | ||
<deliver_at nil="nil"></deliver_at> | ||
<first_name>Sally</first_name> | ||
<last_name>DuMonde</last_name> | ||
<address nil="nil"></address> | ||
<gifter_name>Benjamin</gifter_name> | ||
<personal_message>Happy birthday!</personal_message> | ||
</delivery> | ||
<created_at type="datetime">2024-02-08T17:48:38Z</created_at> | ||
<updated_at type="datetime">2024-02-08T17:48:38Z</updated_at> | ||
<delivered_at type="datetime">2024-02-08T17:48:38Z</delivered_at> | ||
<redeemed_at nil="nil"></redeemed_at> | ||
<canceled_at nil="nil"></canceled_at> | ||
<a name="redeem" href="https://api.recurly.com/v2/gift_cards/S2TNPI1Z4BRKM9U0/redeem" method="post"/> | ||
<liability_gl_account_id>suaz415ebc94</liability_gl_account_id> | ||
<revenue_gl_account_id>sxo2b1hpjrye</revenue_gl_account_id> | ||
<performance_obligation_id>7pu</performance_obligation_id> | ||
</gift_card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<item href="https://api.recurly.com/v2/items/plastic_gloves"> | ||
<item_code>plastic_gloves</item_code> | ||
<name>Awesome Plastic Gloves</name> | ||
<description>Sleek Plastic</description> | ||
<external_sku>awesome-plastic-gloves</external_sku> | ||
<accounting_code>1569273944</accounting_code> | ||
<revenue_schedule_type>never</revenue_schedule_type> | ||
<tax_exempt type="boolean">true</tax_exempt> | ||
<tax_code nil="nil"/> | ||
<state>active</state> | ||
<liability_gl_account_id>suaz415ebc94</liability_gl_account_id> | ||
<revenue_gl_account_id>sxo2b1hpjrye</revenue_gl_account_id> | ||
<performance_obligation_id>7pu</performance_obligation_id> | ||
<created_at type="datetime">2019-09-23T21:25:45Z</created_at> | ||
<updated_at type="datetime">2019-09-23T21:25:45Z</updated_at> | ||
<deleted_at nil="nil"/> | ||
</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ups-ground"> | ||
<code>ups-ground</code> | ||
<name>UPS - Ground</name> | ||
<accounting_code></accounting_code> | ||
<tax_code nil="nil"></tax_code> | ||
<liability_gl_account_id>suaz415ebc94</liability_gl_account_id> | ||
<revenue_gl_account_id>sxo2b1hpjrye</revenue_gl_account_id> | ||
<performance_obligation_id>7pu</performance_obligation_id> | ||
<created_at type="datetime">2023-07-10T19:54:21Z</created_at> | ||
<updated_at type="datetime">2023-12-04T18:54:45Z</updated_at> | ||
</shipping_method> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml; | ||
using FluentAssertions; | ||
using Recurly.Test.Fixtures; | ||
using Xunit; | ||
|
||
namespace Recurly.Test | ||
{ | ||
public class GiftCardTest : BaseTest | ||
{ | ||
[RecurlyFact(TestEnvironment.Type.Unit)] | ||
public void CheckForRevRecData() | ||
{ | ||
var giftCard = new GiftCard(); | ||
|
||
var xmlFixture = FixtureImporter.Get(FixtureType.GiftCards, "revrec.show-200").Xml; | ||
XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(xmlFixture)); | ||
giftCard.ReadXml(reader); | ||
|
||
giftCard.LiabilityGlAccountId.Should().Be("suaz415ebc94"); | ||
giftCard.RevenueGlAccountId.Should().Be("sxo2b1hpjrye"); | ||
giftCard.PerformanceObligationId.Should().Be("7pu"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Xml; | ||
using FluentAssertions; | ||
using Recurly.Test.Fixtures; | ||
using Xunit; | ||
|
||
namespace Recurly.Test | ||
{ | ||
public class ShippingMethodTest : BaseTest | ||
{ | ||
[RecurlyFact(TestEnvironment.Type.Unit)] | ||
public void CheckForRevRecData() | ||
{ | ||
var shippingMethod = new ShippingMethod(); | ||
|
||
var xmlFixture = FixtureImporter.Get(FixtureType.ShippingMethods, "revrec.show-200").Xml; | ||
XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(xmlFixture)); | ||
shippingMethod.ReadXml(reader); | ||
|
||
shippingMethod.LiabilityGlAccountId.Should().Be("suaz415ebc94"); | ||
shippingMethod.RevenueGlAccountId.Should().Be("sxo2b1hpjrye"); | ||
shippingMethod.PerformanceObligationId.Should().Be("7pu"); | ||
} | ||
} | ||
} |