Skip to content

Commit dafa539

Browse files
authored
Merge pull request #733 from recurly/adds_vertex_transaction_type_to_plans
Adding Vertex Transaction Type for Purchases Invoices and Adjustments
2 parents ade585d + 2767f52 commit dafa539

7 files changed

Lines changed: 942 additions & 1 deletion

recurly/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ class Adjustment(Resource):
10551055
'revenue_gl_account_code',
10561056
'revenue_gl_account_id',
10571057
'performance_obligation_id',
1058+
'vertex_transaction_type',
10581059
)
10591060
xml_attribute_attributes = ('type',)
10601061
_classes_for_nodename = {
@@ -1138,7 +1139,8 @@ class Invoice(Resource):
11381139
'billing_info_uuid',
11391140
'dunning_campaign_id',
11401141
'refundable_in_cents',
1141-
'used_tax_service'
1142+
'used_tax_service',
1143+
'vertex_transaction_type',
11421144
)
11431145

11441146
blacklist_attributes = (
@@ -1406,6 +1408,7 @@ class Purchase(Resource):
14061408
'transaction_type',
14071409
'billing_info_uuid',
14081410
'ramp_intervals',
1411+
'vertex_transaction_type',
14091412
)
14101413

14111414
def invoice(self):
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
POST https://api.recurly.com/v2/accounts/chargemock/adjustments HTTP/1.1
2+
X-Api-Version: {api-version}
3+
Accept: application/xml
4+
Authorization: Basic YXBpa2V5Og==
5+
User-Agent: {user-agent}
6+
Content-Type: application/xml; charset=utf-8
7+
8+
<?xml version="1.0" encoding="UTF-8"?>
9+
<adjustment type="charge">
10+
<currency>USD</currency>
11+
<description>test charge</description>
12+
<unit_amount_in_cents type="integer">1000</unit_amount_in_cents>
13+
<vertex_transaction_type>sale</vertex_transaction_type>
14+
</adjustment>
15+

16+
HTTP/1.1 201 Created
17+
Content-Type: application/xml; charset=utf-8
18+
Location: https://api.recurly.com/v2/adjustments/4ba1531325014b4f969cd13676f514d8
19+
20+
<?xml version="1.0" encoding="UTF-8"?>
21+
<adjustment>
22+
<uuid>4ba1531325014b4f969cd13676f514d8</uuid>
23+
<account_code>chargemock</account_code>
24+
<unit_amount_in_cents type="integer">1000</unit_amount_in_cents>
25+
<currency>USD</currency>
26+
<start_date type="datetime">2009-11-03T23:27:46-08:00</start_date>
27+
<end_date type="datetime"></end_date>
28+
<description>test charge</description>
29+
<vertex_transaction_type>sale</vertex_transaction_type>
30+
<created_at type="datetime">2009-11-03T23:27:46-08:00</created_at>
31+
</adjustment>
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
POST https://api.recurly.com/v2/purchases HTTP/1.1
2+
X-Api-Version: {api-version}
3+
Accept: application/xml
4+
Authorization: Basic YXBpa2V5Og==
5+
User-Agent: {user-agent}
6+
Content-Type: application/xml; charset=utf-8
7+
8+
<?xml version="1.0" encoding="UTF-8"?>
9+
<purchase>
10+
<account>
11+
<account_code>testmock</account_code>
12+
</account>
13+
<adjustments>
14+
<adjustment>
15+
<unit_amount_in_cents type="integer">500</unit_amount_in_cents>
16+
<vertex_transaction_type>sale</vertex_transaction_type>
17+
</adjustment>
18+
</adjustments>
19+
<currency>USD</currency>
20+
<vertex_transaction_type>rental</vertex_transaction_type>
21+
</purchase>
22+

23+
HTTP/1.1 201 Created
24+
Content-Type: application/xml; charset=utf-8
25+
Location: https://api.recurly.com/v2/invoices/1360
26+
27+
<?xml version="1.0" encoding="UTF-8"?>
28+
<invoice_collection>
29+
<charge_invoice href="https://api.recurly.com/v2/invoices/1360">
30+
<account href="https://api.recurly.com/v2/accounts/testmock"/>
31+
<dunning_campaign_id nil="nil"></dunning_campaign_id>
32+
<business_entity href="https://api.recurly.com/v2/business_entities/t58pm17a74k6"/>
33+
<address>
34+
<name_on_account nil="nil"></name_on_account>
35+
<first_name>test</first_name>
36+
<last_name>mock</last_name>
37+
<company></company>
38+
<address1>test</address1>
39+
<address2></address2>
40+
<city>San Francisco</city>
41+
<state>CA</state>
42+
<zip>94016</zip>
43+
<country>US</country>
44+
<phone></phone>
45+
</address>
46+
<uuid>6f4654a0444808153e65594a08b9e7a3</uuid>
47+
<state>paid</state>
48+
<invoice_number_prefix></invoice_number_prefix>
49+
<invoice_number type="integer">1360</invoice_number>
50+
<vat_number></vat_number>
51+
<tax_in_cents type="integer">51</tax_in_cents>
52+
<total_in_cents type="integer">551</total_in_cents>
53+
<currency>USD</currency>
54+
<created_at type="datetime">2024-02-23T19:55:22Z</created_at>
55+
<updated_at type="datetime">2024-02-23T19:55:22Z</updated_at>
56+
<attempt_next_collection_at nil="nil"></attempt_next_collection_at>
57+
<closed_at type="datetime">2024-02-23T19:55:22Z</closed_at>
58+
<customer_notes nil="nil"></customer_notes>
59+
<recovery_reason nil="nil"></recovery_reason>
60+
<gateway_code nil="nil"></gateway_code>
61+
<subtotal_before_discount_in_cents type="integer">500</subtotal_before_discount_in_cents>
62+
<subtotal_in_cents type="integer">500</subtotal_in_cents>
63+
<discount_in_cents type="integer">0</discount_in_cents>
64+
<due_on type="datetime">2024-02-23T19:55:22Z</due_on>
65+
<balance_in_cents type="integer">0</balance_in_cents>
66+
<type>charge</type>
67+
<origin>purchase</origin>
68+
<credit_invoices href="https://api.recurly.com/v2/invoices/1360/credit_invoices"/>
69+
<refundable_total_in_cents type="integer">551</refundable_total_in_cents>
70+
<credit_payments type="array">
71+
</credit_payments>
72+
<net_terms type="integer">0</net_terms>
73+
<collection_method>automatic</collection_method>
74+
<po_number nil="nil"></po_number>
75+
<terms_and_conditions nil="nil"></terms_and_conditions>
76+
<tax_type>usst</tax_type>
77+
<tax_region>CA</tax_region>
78+
<tax_rate type="float">0.1025</tax_rate>
79+
<used_tax_service type="boolean">true</used_tax_service>
80+
<vertex_transaction_type>rental</vertex_transaction_type>
81+
<line_items type="array">
82+
<adjustment href="https://api.recurly.com/v2/adjustments/6f46549f12d532b7579250425881a3bb" type="charge">
83+
<account href="https://api.recurly.com/v2/accounts/testmock"/>
84+
<bill_for_account href="https://api.recurly.com/v2/accounts/testmock"/>
85+
<item_code nil="nil"></item_code>
86+
<external_sku nil="nil"></external_sku>
87+
<invoice href="https://api.recurly.com/v2/invoices/1360"/>
88+
<credit_adjustments href="https://api.recurly.com/v2/adjustments/6f46549f12d532b7579250425881a3bb/credit_adjustments"/>
89+
<refundable_total_in_cents type="integer">551</refundable_total_in_cents>
90+
<uuid>6f46549f12d532b7579250425881a3bb</uuid>
91+
<state>invoiced</state>
92+
<description nil="nil"></description>
93+
<accounting_code nil="nil"></accounting_code>
94+
<product_code nil="nil"></product_code>
95+
<origin>debit</origin>
96+
<unit_amount_in_cents type="integer">500</unit_amount_in_cents>
97+
<quantity type="integer">1</quantity>
98+
<discount_in_cents type="integer">0</discount_in_cents>
99+
<tax_in_cents type="integer">51</tax_in_cents>
100+
<total_in_cents type="integer">551</total_in_cents>
101+
<tax_inclusive type="boolean">false</tax_inclusive>
102+
<currency>USD</currency>
103+
<proration_rate nil="nil"></proration_rate>
104+
<tax_type>usst</tax_type>
105+
<tax_region>CA</tax_region>
106+
<tax_rate type="float">0.1025</tax_rate>
107+
<tax_exempt type="boolean">false</tax_exempt>
108+
<tax_code nil="nil"></tax_code>
109+
<start_date type="datetime">2024-02-23T19:55:20Z</start_date>
110+
<end_date nil="nil"></end_date>
111+
<created_at type="datetime">2024-02-23T19:55:22Z</created_at>
112+
<updated_at type="datetime">2024-02-23T19:55:22Z</updated_at>
113+
<revenue_schedule_type></revenue_schedule_type>
114+
<custom_fields type="array">
115+
</custom_fields>
116+
<vertex_transaction_type>sale</vertex_transaction_type>
117+
</adjustment>
118+
</line_items>
119+
<transactions type="array">
120+
<transaction href="https://api.recurly.com/v2/transactions/6f4654a1a6ba44d5272c794d0d9bd5f0" type="credit_card">
121+
<account href="https://api.recurly.com/v2/accounts/testmock"/>
122+
<invoice href="https://api.recurly.com/v2/invoices/1360"/>
123+
<uuid>6f4654a1a6ba44d5272c794d0d9bd5f0</uuid>
124+
<action>purchase</action>
125+
<amount_in_cents type="integer">551</amount_in_cents>
126+
<tax_in_cents type="integer">51</tax_in_cents>
127+
<currency>USD</currency>
128+
<status>success</status>
129+
<payment_method>credit_card</payment_method>
130+
<reference>8996823</reference>
131+
<source>transaction</source>
132+
<recurring type="boolean">false</recurring>
133+
<test type="boolean">true</test>
134+
<voidable type="boolean">true</voidable>
135+
<refundable type="boolean">true</refundable>
136+
<ip_address>172.22.0.1</ip_address>
137+
<gateway_type>test</gateway_type>
138+
<origin>api</origin>
139+
<description nil="nil"></description>
140+
<message>Successful test transaction</message>
141+
<approval_code nil="nil"></approval_code>
142+
<failure_type nil="nil"></failure_type>
143+
<gateway_error_codes nil="nil"></gateway_error_codes>
144+
<cvv_result code="" nil="nil"/>
145+
<avs_result code="D">Street address and postal code match.</avs_result>
146+
<avs_result_street nil="nil"></avs_result_street>
147+
<avs_result_postal nil="nil"></avs_result_postal>
148+
<created_at type="datetime">2024-02-23T19:55:21Z</created_at>
149+
<collected_at type="datetime">2024-02-23T19:55:22Z</collected_at>
150+
<updated_at type="datetime">2024-02-23T19:55:22Z</updated_at>
151+
<backup_payment_method_used type="boolean">false</backup_payment_method_used>
152+
<details>
153+
<account>
154+
<account_code>testmock</account_code>
155+
<first_name></first_name>
156+
<last_name></last_name>
157+
<company></company>
158+
<email></email>
159+
<billing_info type="credit_card">
160+
<first_name>test</first_name>
161+
<last_name>mock</last_name>
162+
<address1>test</address1>
163+
<address2></address2>
164+
<city>San Francisco</city>
165+
<state>CA</state>
166+
<zip>94016</zip>
167+
<country>US</country>
168+
<phone></phone>
169+
<vat_number></vat_number>
170+
<card_type>Visa</card_type>
171+
<year type="integer">2030</year>
172+
<month type="integer">12</month>
173+
<first_six>411111</first_six>
174+
<last_four>1111</last_four>
175+
</billing_info>
176+
</account>
177+
</details>
178+
</transaction>
179+
</transactions>
180+
<a name="refund" href="https://api.recurly.com/v2/invoices/1360/refund" method="post"/>
181+
</charge_invoice>
182+
<credit_invoices type="array">
183+
</credit_invoices>
184+
</invoice_collection>

0 commit comments

Comments
 (0)