-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #878 from recurly/add_revrec_features_to_ruby
Add RevRec features to ruby
- Loading branch information
Showing
43 changed files
with
1,350 additions
and
105 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,16 @@ | ||
module Recurly | ||
class GeneralLedgerAccount < Resource | ||
belongs_to :site | ||
|
||
define_attribute_methods %w( | ||
id | ||
code | ||
description | ||
account_type | ||
) | ||
|
||
def self.collection_path | ||
"general_ledger_accounts" | ||
end | ||
end | ||
end |
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,15 @@ | ||
module Recurly | ||
class PerformanceObligation < Resource | ||
|
||
define_attribute_methods %w( | ||
id | ||
name | ||
created_at | ||
updated_at | ||
) | ||
|
||
def self.collection_path | ||
"performance_obligations" | ||
end | ||
end | ||
end |
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,18 @@ | ||
module Recurly | ||
module RevRec | ||
POB_ATTRIBUTE = %i(performance_obligation_id).freeze | ||
POB_NATIVE_ATTRIBUTE = %i(performance_obligation_identifier).freeze | ||
|
||
GLA_ID_ATTRIBUTES = %i(liability_gl_account_id revenue_gl_account_id).freeze | ||
GLA_CODE_ATTRIBUTES = %i(liability_gl_account_code revenue_gl_account_code).freeze | ||
|
||
PRODUCT_NATIVE_ATTRS = (POB_NATIVE_ATTRIBUTE + GLA_ID_ATTRIBUTES).freeze | ||
PRODUCT_ATTRIBUTES = (POB_ATTRIBUTE + GLA_ID_ATTRIBUTES).freeze | ||
|
||
LINE_ITEM_ATTRIBUTES = (POB_ATTRIBUTE + GLA_CODE_ATTRIBUTES).freeze | ||
ALL_ATTRIBUTES = (PRODUCT_ATTRIBUTES + LINE_ITEM_ATTRIBUTES).uniq.freeze | ||
|
||
SETUP_FEE_ATTRIBUTES = PRODUCT_ATTRIBUTES.map { |key| :"setup_fee_#{key}" }.freeze | ||
PLAN_ATTRIBUTES = [*PRODUCT_ATTRIBUTES, *SETUP_FEE_ATTRIBUTES].freeze | ||
end | ||
end |
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,39 @@ | ||
HTTP/1.1 201 Created | ||
Content-Type: application/xml; charset=utf-8 | ||
Location: https://api.recurly.com/v2/adjustments/67360781108ceacd23dee747b7b1f5af | ||
|
||
<adjustment href="https://api.recurly.com/v2/adjustments/67360781108ceacd23dee747b7b1f5af"> | ||
<account href="https://api.recurly.com/v2/accounts/7747ed3b-1771-4a03-b32a-503e9d65d3ad"/> | ||
<bill_for_account href="https://api.recurly.com/v2/accounts/account1"/> | ||
<item_code nil="nil"/> | ||
<external_sku nil="nil"/> | ||
<credit_adjustments href="https://api.recurly.com/v2/adjustments/67360781108ceacd23dee747b7b1f5af/credit_adjustments"/> | ||
<refundable_total_in_cents type="integer">0</refundable_total_in_cents> | ||
<uuid>67360781108ceacd23dee747b7b1f5af</uuid> | ||
<state>pending</state> | ||
<description nil="nil"/> | ||
<accounting_code nil="nil"/> | ||
<product_code nil="nil"/> | ||
<origin>debit</origin> | ||
<unit_amount_in_cents type="integer">5000</unit_amount_in_cents> | ||
<quantity type="integer">1</quantity> | ||
<discount_in_cents type="integer">0</discount_in_cents> | ||
<tax_in_cents type="integer">0</tax_in_cents> | ||
<total_in_cents type="integer">5000</total_in_cents> | ||
<currency>USD</currency> | ||
<proration_rate nil="nil"/> | ||
<start_date type="datetime">2023-01-18T23:34:52Z</start_date> | ||
<end_date nil="nil"/> | ||
<created_at type="datetime">2023-01-18T23:34:52Z</created_at> | ||
<updated_at type="datetime">2023-01-18T23:34:52Z</updated_at> | ||
<revenue_schedule_type>at_invoice</revenue_schedule_type> | ||
<liability_gl_account_code>liability_gla</liability_gl_account_code> | ||
<revenue_gl_account_code>revenue_gla</revenue_gl_account_code> | ||
<performance_obligation_id>5</performance_obligation_id> | ||
<custom_fields type="array"> | ||
<custom_field> | ||
<name>field1</name> | ||
<value>priceless</value> | ||
</custom_field> | ||
</custom_fields> | ||
</adjustment> |
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,64 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<adjustment href="https://api.recurly.com/v2/adjustments/abcdef1234567890" type="charge"> | ||
<account href="https://api.recurly.com/v2/accounts/account"/> | ||
<bill_for_account href="https://api.recurly.com/v2/accounts/abcdef1234567890"/> | ||
<invoice href="https://api.recurly.com/v2/invoices/created-invoice"/> | ||
<subscription href="https://api.recurly.com/v2/subscriptions/abcdef1234567890"/> | ||
<credit_adjustments href="https://api.recurly.com/v2/adjustments/abcdef1234567890/credit_adjustments"/> | ||
<item href="https://api.recurly.com/v2/items/plastic_gloves"/> | ||
<item_code>plastic_gloves</item_code> | ||
<external_sku>plastic_gloves</external_sku> | ||
<uuid>abcdef1234567890</uuid> | ||
<state>pending</state> | ||
<accounting_code nil="nil"></accounting_code> | ||
<origin>plan</origin> | ||
<description>$12 Annual Subscription</description> | ||
<unit_amount_in_cents type="integer">1200</unit_amount_in_cents> | ||
<quantity type="integer">1</quantity> | ||
<quantity_decimal>1.2</quantity_decimal> | ||
<discount_in_cents type="integer">0</discount_in_cents> | ||
<tax_in_cents type="integer">5000</tax_in_cents> | ||
<tax_type>usst</tax_type> | ||
<tax_region>CA</tax_region> | ||
<tax_rate type="float">0.0875</tax_rate> | ||
<total_in_cents type="integer">1200</total_in_cents> | ||
<currency>USD</currency> | ||
<product_code>basic</product_code> | ||
<revenue_schedule_type>evenly</revenue_schedule_type> | ||
<surcharge_in_cents type="integer">100</surcharge_in_cents> | ||
<avalara_service_type type="integer">3</avalara_service_type> | ||
<avalara_transaction_type type="integer">600</avalara_transaction_type> | ||
<liability_gl_account_code>liability_gla</liability_gl_account_code> | ||
<revenue_gl_account_code>revenue_gla</revenue_gl_account_code> | ||
<performance_obligation_id>5</performance_obligation_id> | ||
<tax_details type="array"> | ||
<tax_detail> | ||
<name>california</name> | ||
<type>state</type> | ||
<tax_rate type="float">0.065</tax_rate> | ||
<tax_in_cents type="integer">3000</tax_in_cents> | ||
<level>state</level> | ||
<billable type="boolean">true</billable> | ||
</tax_detail> | ||
<tax_detail> | ||
<name>san francisco</name> | ||
<type>county</type> | ||
<tax_rate type="float">0.02</tax_rate> | ||
<tax_in_cents type="integer">2000</tax_in_cents> | ||
</tax_detail> | ||
</tax_details> | ||
<proration_rate type="float">0.5</proration_rate> | ||
<original_adjustment_uuid>abcdefg1234567</original_adjustment_uuid> | ||
<start_date type="datetime">2011-04-30T07:00:00Z</start_date> | ||
<end_date type="datetime">2011-04-30T07:00:00Z</end_date> | ||
<created_at type="datetime">2011-08-31T03:30:00Z</created_at> | ||
<custom_fields> | ||
<custom_field> | ||
<name>field1</name> | ||
<value>priceless</value> | ||
</custom_field> | ||
</custom_fields> | ||
</adjustment> |
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 |
---|---|---|
@@ -1,35 +1,33 @@ | ||
HTTP/1.1 200 OK | ||
Content-Type: application/xml; charset=utf-8 | ||
Link: <https://api.recurly.com/v2/business_entities?cursor=1234567890&per_page=20>; rel="start", <https://api.recurly.com/v2/business_entities?cursor=1234566890&per_page=20>; rel="next" | ||
|
||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<business_entities type="array"> | ||
<business_entity href="https://api.recurly.com/v2/business_entities/sbup2j0fx800"> | ||
<id>sbup2j0fx800</id> | ||
<code>default</code> | ||
<name>Default Business Entity</name> | ||
<invoice_display_address> | ||
<address1>123 Main Ave</address1> | ||
<address2 nil="nil"></address2> | ||
<city>San Francisco</city> | ||
<state>CA</state> | ||
<zip>90210</zip> | ||
<country>US</country> | ||
<phone nil="nil"></phone> | ||
</invoice_display_address> | ||
<tax_address> | ||
<address1>123 Main Ave</address1> | ||
<address2 nil="nil"></address2> | ||
<city>San Francisco</city> | ||
<state>CA</state> | ||
<zip>90210</zip> | ||
<country>US</country> | ||
<phone nil="nil"></phone> | ||
</tax_address> | ||
<default_vat_number nil="nil"></default_vat_number> | ||
<default_registration_number nil="nil"></default_registration_number> | ||
<created_at type="datetime">2023-03-01T16:26:40Z</created_at> | ||
<updated_at type="datetime">2023-04-01T16:26:40Z</updated_at> | ||
</business_entity> | ||
</business_entities> | ||
<business_entity href="https://api.recurly.com/v2/business_entities/sbup2j0fx800"> | ||
<id>sbup2j0fx800</id> | ||
<code>default</code> | ||
<name>Default Business Entity</name> | ||
<invoice_display_address> | ||
<address1>123 Main Ave</address1> | ||
<address2 nil="nil"></address2> | ||
<city>San Francisco</city> | ||
<state>CA</state> | ||
<zip>90210</zip> | ||
<country>US</country> | ||
<phone nil="nil"></phone> | ||
</invoice_display_address> | ||
<tax_address> | ||
<address1>123 Main Ave</address1> | ||
<address2 nil="nil"></address2> | ||
<city>San Francisco</city> | ||
<state>CA</state> | ||
<zip>90210</zip> | ||
<country>US</country> | ||
<phone nil="nil"></phone> | ||
</tax_address> | ||
<default_vat_number nil="nil"></default_vat_number> | ||
<default_registration_number nil="nil"></default_registration_number> | ||
<default_liability_gl_account_id>12345</default_liability_gl_account_id> | ||
<default_revenue_gl_account_id>56789</default_revenue_gl_account_id> | ||
<created_at type="datetime">2023-03-01T16:26:40Z</created_at> | ||
<updated_at type="datetime">2023-04-01T16:26:40Z</updated_at> | ||
</business_entity> |
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,12 @@ | ||
HTTP/1.1 201 Created | ||
Content-Type: application/xml; charset=utf-8 | ||
|
||
<?xml version="1.0" encoding="UTF-8"?> | ||
<general_ledger_account href="https://api.recurly.com/v2/general_ledger_accounts/u90r5deeaxix"> | ||
<id>u90r5deeaxix</id> | ||
<code>code1</code> | ||
<account_type>revenue</account_type> | ||
<description>string</description> | ||
<created_at type="datetime">2024-01-16T14:34:16Z</created_at> | ||
<updated_at type="datetime">2024-01-16T14:34:16Z</updated_at> | ||
</general_ledger_account> |
Oops, something went wrong.