recurly 0.4.15 → 0.4.16

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of recurly might be problematic. Click here for more details.

Files changed (65) hide show
  1. data/lib/patches/rails2/active_resource/base.rb +35 -0
  2. data/lib/patches/rails3/active_model/serializers/xml.rb +28 -0
  3. data/lib/recurly.rb +14 -4
  4. data/lib/recurly/account.rb +6 -3
  5. data/lib/recurly/base.rb +1 -2
  6. data/lib/recurly/subscription.rb +7 -0
  7. data/lib/recurly/version.rb +1 -1
  8. data/spec/config/recurly.yml +4 -4
  9. data/spec/integration/subscription_spec.rb +2 -1
  10. metadata +108 -220
  11. data/spec/vcr/account/accept-language-account/1313708721.yml +0 -60
  12. data/spec/vcr/account/close/1313708721.yml +0 -132
  13. data/spec/vcr/account/create-blank/1313708721.yml +0 -44
  14. data/spec/vcr/account/create-duplicate/1313708721.yml +0 -98
  15. data/spec/vcr/account/create-min/1313708721.yml +0 -56
  16. data/spec/vcr/account/create/1313708721.yml +0 -60
  17. data/spec/vcr/account/find/1313708721.yml +0 -137
  18. data/spec/vcr/account/list/1313708721.yml +0 -1307
  19. data/spec/vcr/account/update/1313708721.yml +0 -216
  20. data/spec/vcr/billing/create/1313708721.yml +0 -181
  21. data/spec/vcr/billing/destroy/1313708721.yml +0 -240
  22. data/spec/vcr/billing/errors/1313708721.yml +0 -106
  23. data/spec/vcr/billing/find/1313708721.yml +0 -234
  24. data/spec/vcr/billing/update/1313708721.yml +0 -251
  25. data/spec/vcr/charge/create/1313708721.yml +0 -222
  26. data/spec/vcr/charge/delete-uninvoiced/1313708721.yml +0 -247
  27. data/spec/vcr/charge/list-all/1313708721.yml +0 -276
  28. data/spec/vcr/charge/list-invoiced/1313708721.yml +0 -411
  29. data/spec/vcr/charge/list-pending/1313708721.yml +0 -276
  30. data/spec/vcr/charge/lookup/1313708721.yml +0 -152
  31. data/spec/vcr/coupon/create/1296774903.yml +0 -97
  32. data/spec/vcr/coupon/destroy/1296774903.yml +0 -97
  33. data/spec/vcr/credit/create/1313708090.yml +0 -152
  34. data/spec/vcr/credit/delete/1313708090.yml +0 -211
  35. data/spec/vcr/credit/list/1313708090.yml +0 -276
  36. data/spec/vcr/credit/lookup/1313708090.yml +0 -152
  37. data/spec/vcr/invoice/create-no-charges/1296674173.yml +0 -166
  38. data/spec/vcr/invoice/create/1296674173.yml +0 -302
  39. data/spec/vcr/invoice/list/1296674173.yml +0 -405
  40. data/spec/vcr/invoice/lookup/1296674173.yml +0 -304
  41. data/spec/vcr/plan/all.yml +0 -233
  42. data/spec/vcr/plan/find.yml +0 -136
  43. data/spec/vcr/plan/update.yml +0 -152
  44. data/spec/vcr/subscription/addons/add/1296674173.yml +0 -177
  45. data/spec/vcr/subscription/addons/create/1296674173.yml +0 -177
  46. data/spec/vcr/subscription/addons/remove/1296674173.yml +0 -177
  47. data/spec/vcr/subscription/cancel-with-code/1296674173.yml +0 -400
  48. data/spec/vcr/subscription/cancel/1296674173.yml +0 -348
  49. data/spec/vcr/subscription/change1/1296674173.yml +0 -354
  50. data/spec/vcr/subscription/change2/1296674173.yml +0 -354
  51. data/spec/vcr/subscription/create/1296674173.yml +0 -192
  52. data/spec/vcr/subscription/find/1296674173.yml +0 -244
  53. data/spec/vcr/subscription/reactivate/1296674173.yml +0 -377
  54. data/spec/vcr/subscription/refund-full/1296674173.yml +0 -328
  55. data/spec/vcr/subscription/refund-none/1296674173.yml +0 -328
  56. data/spec/vcr/subscription/refund-partial/1296674173.yml +0 -328
  57. data/spec/vcr/transaction/all/1311126815.yml +0 -397
  58. data/spec/vcr/transaction/create-no-account/1311126815.yml +0 -82
  59. data/spec/vcr/transaction/create-with-account/1311126815.yml +0 -196
  60. data/spec/vcr/transaction/list-filled/1311126815.yml +0 -544
  61. data/spec/vcr/transaction/list-initial/1311126815.yml +0 -184
  62. data/spec/vcr/transaction/lookup/1311126815.yml +0 -487
  63. data/spec/vcr/transaction/void/1311126815.yml +0 -321
  64. data/spec/vcr/transparent/post-url/1317063400.yml +0 -105
  65. data/spec/vcr/transparent/post-url/1317063474.yml +0 -105
@@ -1,136 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/paid.xml
6
- body:
7
- headers:
8
- user-agent:
9
- - Recurly Ruby Client v0.4.13
10
- accept:
11
- - application/xml
12
- accept-encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- response: !ruby/struct:VCR::Response
15
- status: !ruby/struct:VCR::ResponseStatus
16
- code: 200
17
- message: OK
18
- headers:
19
- content-type:
20
- - application/xml; charset=utf-8
21
- etag:
22
- - "\"7487d065869e9c487e0a588e1edea5dc\""
23
- cache-control:
24
- - max-age=0, private, must-revalidate
25
- x-ua-compatible:
26
- - IE=Edge
27
- server:
28
- - thin 1.2.11 codename Bat-Shit Crazy
29
- body: |
30
- <?xml version="1.0" encoding="UTF-8"?>
31
- <plan>
32
- <plan_code>paid</plan_code>
33
- <name>paid</name>
34
- <description></description>
35
- <success_url></success_url>
36
- <cancel_url></cancel_url>
37
- <created_at type="datetime">2011-09-22T21:54:04Z</created_at>
38
- <unit_amount_in_cents type="integer">1400</unit_amount_in_cents>
39
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
40
- <plan_interval_length type="integer">1</plan_interval_length>
41
- <plan_interval_unit>months</plan_interval_unit>
42
- <trial_interval_length type="integer">0</trial_interval_length>
43
- <trial_interval_unit>days</trial_interval_unit>
44
- </plan>
45
-
46
- http_version: "1.1"
47
- - !ruby/struct:VCR::HTTPInteraction
48
- request: !ruby/struct:VCR::Request
49
- method: :get
50
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/trial.xml
51
- body:
52
- headers:
53
- user-agent:
54
- - Recurly Ruby Client v0.4.13
55
- accept:
56
- - application/xml
57
- accept-encoding:
58
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
59
- response: !ruby/struct:VCR::Response
60
- status: !ruby/struct:VCR::ResponseStatus
61
- code: 200
62
- message: OK
63
- headers:
64
- content-type:
65
- - application/xml; charset=utf-8
66
- etag:
67
- - "\"30194122ddc8b67ae0416d6254a14cb0\""
68
- cache-control:
69
- - max-age=0, private, must-revalidate
70
- x-ua-compatible:
71
- - IE=Edge
72
- server:
73
- - thin 1.2.11 codename Bat-Shit Crazy
74
- body: |
75
- <?xml version="1.0" encoding="UTF-8"?>
76
- <plan>
77
- <plan_code>trial</plan_code>
78
- <name>Trial</name>
79
- <description></description>
80
- <success_url></success_url>
81
- <cancel_url></cancel_url>
82
- <created_at type="datetime">2011-09-22T21:58:23Z</created_at>
83
- <unit_amount_in_cents type="integer"></unit_amount_in_cents>
84
- <setup_fee_in_cents type="integer"></setup_fee_in_cents>
85
- <plan_interval_length type="integer">1</plan_interval_length>
86
- <plan_interval_unit>months</plan_interval_unit>
87
- <trial_interval_length type="integer">1</trial_interval_length>
88
- <trial_interval_unit>months</trial_interval_unit>
89
- </plan>
90
-
91
- http_version: "1.1"
92
- - !ruby/struct:VCR::HTTPInteraction
93
- request: !ruby/struct:VCR::Request
94
- method: :get
95
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/paid.xml
96
- body:
97
- headers:
98
- user-agent:
99
- - Recurly Ruby Client v0.4.13
100
- accept:
101
- - application/xml
102
- accept-encoding:
103
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
104
- response: !ruby/struct:VCR::Response
105
- status: !ruby/struct:VCR::ResponseStatus
106
- code: 200
107
- message: OK
108
- headers:
109
- content-type:
110
- - application/xml; charset=utf-8
111
- etag:
112
- - "\"7487d065869e9c487e0a588e1edea5dc\""
113
- cache-control:
114
- - max-age=0, private, must-revalidate
115
- x-ua-compatible:
116
- - IE=Edge
117
- server:
118
- - thin 1.2.11 codename Bat-Shit Crazy
119
- body: |
120
- <?xml version="1.0" encoding="UTF-8"?>
121
- <plan>
122
- <plan_code>paid</plan_code>
123
- <name>paid</name>
124
- <description></description>
125
- <success_url></success_url>
126
- <cancel_url></cancel_url>
127
- <created_at type="datetime">2011-09-22T21:54:04Z</created_at>
128
- <unit_amount_in_cents type="integer">1400</unit_amount_in_cents>
129
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
130
- <plan_interval_length type="integer">1</plan_interval_length>
131
- <plan_interval_unit>months</plan_interval_unit>
132
- <trial_interval_length type="integer">0</trial_interval_length>
133
- <trial_interval_unit>days</trial_interval_unit>
134
- </plan>
135
-
136
- http_version: "1.1"
@@ -1,152 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/test.xml
6
- body:
7
- headers:
8
- user-agent:
9
- - Recurly Ruby Client v0.4.13
10
- accept:
11
- - application/xml
12
- accept-encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- response: !ruby/struct:VCR::Response
15
- status: !ruby/struct:VCR::ResponseStatus
16
- code: 200
17
- message: OK
18
- headers:
19
- content-type:
20
- - application/xml; charset=utf-8
21
- etag:
22
- - "\"b648e205155e2d8f9ecb4a37fa0d8b9c\""
23
- cache-control:
24
- - max-age=0, private, must-revalidate
25
- x-ua-compatible:
26
- - IE=Edge
27
- server:
28
- - thin 1.2.11 codename Bat-Shit Crazy
29
- body: |
30
- <?xml version="1.0" encoding="UTF-8"?>
31
- <plan>
32
- <plan_code>test</plan_code>
33
- <name>Test Plan</name>
34
- <description></description>
35
- <success_url></success_url>
36
- <cancel_url></cancel_url>
37
- <created_at type="datetime">2011-09-22T21:58:24Z</created_at>
38
- <unit_amount_in_cents type="integer">200</unit_amount_in_cents>
39
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
40
- <plan_interval_length type="integer">1</plan_interval_length>
41
- <plan_interval_unit>months</plan_interval_unit>
42
- <trial_interval_length type="integer">0</trial_interval_length>
43
- <trial_interval_unit>months</trial_interval_unit>
44
- </plan>
45
-
46
- http_version: "1.1"
47
- - !ruby/struct:VCR::HTTPInteraction
48
- request: !ruby/struct:VCR::Request
49
- method: :put
50
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/test.xml
51
- body: |
52
- <?xml version="1.0" encoding="UTF-8"?>
53
- <plan>
54
- <plan-code>test</plan-code>
55
- <name>Test Plan</name>
56
- <description nil="true"></description>
57
- <success-url nil="true"></success-url>
58
- <cancel-url nil="true"></cancel-url>
59
- <created-at type="datetime">2011-09-22T21:58:24Z</created-at>
60
- <unit-amount-in-cents type="integer">200</unit-amount-in-cents>
61
- <setup-fee-in-cents type="integer">0</setup-fee-in-cents>
62
- <plan-interval-length type="integer">1</plan-interval-length>
63
- <plan-interval-unit>months</plan-interval-unit>
64
- <trial-interval-length type="integer">0</trial-interval-length>
65
- <trial-interval-unit>months</trial-interval-unit>
66
- </plan>
67
-
68
- headers:
69
- user-agent:
70
- - Recurly Ruby Client v0.4.13
71
- content-type:
72
- - application/xml
73
- response: !ruby/struct:VCR::Response
74
- status: !ruby/struct:VCR::ResponseStatus
75
- code: 200
76
- message: OK
77
- headers:
78
- content-type:
79
- - application/xml; charset=utf-8
80
- etag:
81
- - "\"b648e205155e2d8f9ecb4a37fa0d8b9c\""
82
- cache-control:
83
- - max-age=0, private, must-revalidate
84
- x-ua-compatible:
85
- - IE=Edge
86
- set-cookie:
87
- - _recurly_session=32783c12e0e06cb9470d4ae50029304b; domain=.lvh.me; path=/; HttpOnly
88
- server:
89
- - thin 1.2.11 codename Bat-Shit Crazy
90
- body: |
91
- <?xml version="1.0" encoding="UTF-8"?>
92
- <plan>
93
- <plan_code>test</plan_code>
94
- <name>Test Plan</name>
95
- <description></description>
96
- <success_url></success_url>
97
- <cancel_url></cancel_url>
98
- <created_at type="datetime">2011-09-22T21:58:24Z</created_at>
99
- <unit_amount_in_cents type="integer">200</unit_amount_in_cents>
100
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
101
- <plan_interval_length type="integer">1</plan_interval_length>
102
- <plan_interval_unit>months</plan_interval_unit>
103
- <trial_interval_length type="integer">0</trial_interval_length>
104
- <trial_interval_unit>months</trial_interval_unit>
105
- </plan>
106
-
107
- http_version: "1.1"
108
- - !ruby/struct:VCR::HTTPInteraction
109
- request: !ruby/struct:VCR::Request
110
- method: :get
111
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/test.xml
112
- body:
113
- headers:
114
- user-agent:
115
- - Recurly Ruby Client v0.4.13
116
- accept:
117
- - application/xml
118
- accept-encoding:
119
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
120
- response: !ruby/struct:VCR::Response
121
- status: !ruby/struct:VCR::ResponseStatus
122
- code: 200
123
- message: OK
124
- headers:
125
- content-type:
126
- - application/xml; charset=utf-8
127
- etag:
128
- - "\"b648e205155e2d8f9ecb4a37fa0d8b9c\""
129
- cache-control:
130
- - max-age=0, private, must-revalidate
131
- x-ua-compatible:
132
- - IE=Edge
133
- server:
134
- - thin 1.2.11 codename Bat-Shit Crazy
135
- body: |
136
- <?xml version="1.0" encoding="UTF-8"?>
137
- <plan>
138
- <plan_code>test</plan_code>
139
- <name>Test Plan</name>
140
- <description></description>
141
- <success_url></success_url>
142
- <cancel_url></cancel_url>
143
- <created_at type="datetime">2011-09-22T21:58:24Z</created_at>
144
- <unit_amount_in_cents type="integer">200</unit_amount_in_cents>
145
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
146
- <plan_interval_length type="integer">1</plan_interval_length>
147
- <plan_interval_unit>months</plan_interval_unit>
148
- <trial_interval_length type="integer">0</trial_interval_length>
149
- <trial_interval_unit>months</trial_interval_unit>
150
- </plan>
151
-
152
- http_version: "1.1"
@@ -1,177 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :post
5
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/accounts.xml
6
- body: |
7
- <?xml version="1.0" encoding="UTF-8"?>
8
- <account>
9
- <account-code>subscription-addons-add-1296674173</account-code>
10
- <first-name>Verena</first-name>
11
- <last-name>Test</last-name>
12
- <email>verena@test.com</email>
13
- <company-name>Recurly Ruby Gem</company-name>
14
- <billing-info>
15
- <credit-card>
16
- </credit-card>
17
- </billing-info>
18
- <accept-language nil="true"></accept-language>
19
- </account>
20
-
21
- headers:
22
- user-agent:
23
- - Recurly Ruby Client v0.4.13
24
- content-type:
25
- - application/xml
26
- response: !ruby/struct:VCR::Response
27
- status: !ruby/struct:VCR::ResponseStatus
28
- code: 201
29
- message: Created
30
- headers:
31
- location:
32
- - http://api.lvh.me:3000/accounts/subscription-addons-add-1296674173
33
- content-type:
34
- - application/xml; charset=utf-8
35
- cache-control:
36
- - no-cache
37
- x-ua-compatible:
38
- - IE=Edge
39
- set-cookie:
40
- - _recurly_session=bee1827688f46ea797d3b6bde1a5eab0; domain=.lvh.me; path=/; HttpOnly
41
- server:
42
- - thin 1.2.11 codename Bat-Shit Crazy
43
- body: |
44
- <?xml version="1.0" encoding="UTF-8"?>
45
- <account>
46
- <id>subscription-addons-add-1296674173</id>
47
- <account_code>subscription-addons-add-1296674173</account_code>
48
- <username></username>
49
- <email>verena@test.com</email>
50
- <first_name>Verena</first_name>
51
- <last_name>Test</last_name>
52
- <company_name>Recurly Ruby Gem</company_name>
53
- <balance_in_cents type="integer">0</balance_in_cents>
54
- <closed type="boolean">false</closed>
55
- <hosted_login_token>0812174f8ab04592b0044df5dc3f6e57</hosted_login_token>
56
- <created_at type="datetime">2011-09-22T22:01:37Z</created_at>
57
- <state>active</state>
58
- </account>
59
-
60
- http_version: "1.1"
61
- - !ruby/struct:VCR::HTTPInteraction
62
- request: !ruby/struct:VCR::Request
63
- method: :get
64
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/plans/paid.xml
65
- body:
66
- headers:
67
- user-agent:
68
- - Recurly Ruby Client v0.4.13
69
- accept:
70
- - application/xml
71
- accept-encoding:
72
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
73
- response: !ruby/struct:VCR::Response
74
- status: !ruby/struct:VCR::ResponseStatus
75
- code: 200
76
- message: OK
77
- headers:
78
- content-type:
79
- - application/xml; charset=utf-8
80
- etag:
81
- - "\"7487d065869e9c487e0a588e1edea5dc\""
82
- cache-control:
83
- - max-age=0, private, must-revalidate
84
- x-ua-compatible:
85
- - IE=Edge
86
- server:
87
- - thin 1.2.11 codename Bat-Shit Crazy
88
- body: |
89
- <?xml version="1.0" encoding="UTF-8"?>
90
- <plan>
91
- <plan_code>paid</plan_code>
92
- <name>paid</name>
93
- <description></description>
94
- <success_url></success_url>
95
- <cancel_url></cancel_url>
96
- <created_at type="datetime">2011-09-22T21:54:04Z</created_at>
97
- <unit_amount_in_cents type="integer">1400</unit_amount_in_cents>
98
- <setup_fee_in_cents type="integer">0</setup_fee_in_cents>
99
- <plan_interval_length type="integer">1</plan_interval_length>
100
- <plan_interval_unit>months</plan_interval_unit>
101
- <trial_interval_length type="integer">0</trial_interval_length>
102
- <trial_interval_unit>days</trial_interval_unit>
103
- </plan>
104
-
105
- http_version: "1.1"
106
- - !ruby/struct:VCR::HTTPInteraction
107
- request: !ruby/struct:VCR::Request
108
- method: :post
109
- uri: http://2a655d41659d4ae0b37fcaec06331bf5:@api.lvh.me:3000/accounts/subscription-addons-add-1296674173/subscription.xml
110
- body: |
111
- <?xml version="1.0" encoding="UTF-8"?>
112
- <subscription>
113
- <plan-code>paid</plan-code>
114
- <quantity type="integer">1</quantity>
115
- <account>
116
- <account-code>subscription-addons-add-1296674173</account-code>
117
- <first-name>Verena</first-name>
118
- <last-name>Test</last-name>
119
- <email>verena@test.com</email>
120
- <company-name>Recurly Ruby Gem</company-name>
121
- <billing-info>
122
- <first-name>Verena</first-name>
123
- <last-name>Test</last-name>
124
- <address1>123 Test St</address1>
125
- <city>San Francisco</city>
126
- <state>CA</state>
127
- <zip>94115</zip>
128
- <country>US</country>
129
- <credit-card>
130
- <number>4111111111111111</number>
131
- <year type="integer">2012</year>
132
- <month type="integer">9</month>
133
- <verification-value>123</verification-value>
134
- </credit-card>
135
- </billing-info>
136
- <accept-language nil="true"></accept-language>
137
- <id>subscription-addons-add-1296674173</id>
138
- <username nil="true"></username>
139
- <balance-in-cents type="integer">0</balance-in-cents>
140
- <closed type="boolean">false</closed>
141
- <hosted-login-token>0812174f8ab04592b0044df5dc3f6e57</hosted-login-token>
142
- <created-at type="datetime">2011-09-22T22:01:37Z</created-at>
143
- <state>active</state>
144
- </account>
145
- <add-ons type="array">
146
- <add-on>
147
- <add-on-code>special</add-on-code>
148
- <quantity type="integer">1</quantity>
149
- <unit-amount type="integer">10</unit-amount>
150
- </add-on>
151
- </add-ons>
152
- <addons type="array"/>
153
- </subscription>
154
-
155
- headers:
156
- user-agent:
157
- - Recurly Ruby Client v0.4.13
158
- content-type:
159
- - application/xml
160
- response: !ruby/struct:VCR::Response
161
- status: !ruby/struct:VCR::ResponseStatus
162
- code: 422
163
- message:
164
- headers:
165
- content-type:
166
- - application/xml
167
- content-length:
168
- - "94"
169
- server:
170
- - thin 1.2.11 codename Bat-Shit Crazy
171
- body: |
172
- <?xml version="1.0" encoding="UTF-8"?>
173
- <errors>
174
- <error>Method not allowed</error>
175
- </errors>
176
-
177
- http_version: "1.1"