zuora-ruby 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.rubocop.yml +11 -1
- data/README.md +101 -172
- data/bin/console +2 -2
- data/lib/utils/schema_model.rb +194 -0
- data/lib/zuora.rb +30 -72
- data/lib/zuora/calls/amend.rb +68 -0
- data/lib/zuora/calls/create.rb +9 -0
- data/lib/zuora/calls/delete.rb +20 -0
- data/lib/zuora/calls/generate.rb +22 -0
- data/lib/zuora/calls/login.rb +21 -0
- data/lib/zuora/calls/query.rb +15 -0
- data/lib/zuora/calls/subscribe.rb +75 -0
- data/lib/zuora/calls/update.rb +9 -0
- data/lib/zuora/calls/upsert.rb +29 -0
- data/lib/zuora/client.rb +84 -94
- data/lib/zuora/dispatcher.rb +45 -0
- data/lib/zuora/object.rb +5 -0
- data/lib/zuora/response.rb +50 -0
- data/lib/zuora/utils/envelope.rb +98 -0
- data/lib/zuora/version.rb +1 -4
- data/zuora_ruby.gemspec +10 -11
- metadata +57 -67
- data/lib/zuora/models.rb +0 -11
- data/lib/zuora/models/account.rb +0 -64
- data/lib/zuora/models/card_holder.rb +0 -54
- data/lib/zuora/models/contact.rb +0 -71
- data/lib/zuora/models/dirty.rb +0 -192
- data/lib/zuora/models/payment_method.rb +0 -1
- data/lib/zuora/models/payment_methods/credit_card.rb +0 -37
- data/lib/zuora/models/rate_plan.rb +0 -17
- data/lib/zuora/models/rate_plan_charge.rb +0 -119
- data/lib/zuora/models/subscription.rb +0 -80
- data/lib/zuora/models/tier.rb +0 -27
- data/lib/zuora/models/validation_predicates.rb +0 -29
- data/lib/zuora/resources.rb +0 -6
- data/lib/zuora/resources/accounts.rb +0 -20
- data/lib/zuora/resources/payment_methods.rb +0 -1
- data/lib/zuora/resources/payment_methods/credit_card.rb +0 -24
- data/lib/zuora/resources/subscriptions.rb +0 -17
- data/lib/zuora/serializers.rb +0 -1
- data/lib/zuora/serializers/attribute.rb +0 -35
- data/lib/zuora/serializers/noop.rb +0 -18
- data/zuora/fixtures/vcr_cassettes/account_create_.yml +0 -111
- data/zuora/fixtures/vcr_cassettes/account_update_.yml +0 -113
- data/zuora/fixtures/vcr_cassettes/subscription_create_.yml +0 -114
- data/zuora/fixtures/vcr_cassettes/subscription_update_.yml +0 -114
@@ -1,113 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/connections
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
User-Agent:
|
11
|
-
- Faraday v0.9.2
|
12
|
-
Apiaccesskeyid:
|
13
|
-
- "<ZUORA_SANDBOX_USERNAME>"
|
14
|
-
Apisecretaccesskey:
|
15
|
-
- "<ZUORA_SANDBOX_PASSWORD>"
|
16
|
-
Content-Type:
|
17
|
-
- application/json
|
18
|
-
Content-Length:
|
19
|
-
- '0'
|
20
|
-
Accept-Encoding:
|
21
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
-
Accept:
|
23
|
-
- "*/*"
|
24
|
-
response:
|
25
|
-
status:
|
26
|
-
code: 200
|
27
|
-
message: OK
|
28
|
-
headers:
|
29
|
-
Server:
|
30
|
-
- Zuora App
|
31
|
-
Content-Type:
|
32
|
-
- application/json;charset=utf-8
|
33
|
-
Content-Length:
|
34
|
-
- '22'
|
35
|
-
Expires:
|
36
|
-
- Fri, 15 Jan 2016 19:25:55 GMT
|
37
|
-
Cache-Control:
|
38
|
-
- max-age=0, no-cache, no-store
|
39
|
-
Pragma:
|
40
|
-
- no-cache
|
41
|
-
Date:
|
42
|
-
- Fri, 15 Jan 2016 19:25:55 GMT
|
43
|
-
Connection:
|
44
|
-
- keep-alive
|
45
|
-
Set-Cookie:
|
46
|
-
- ZSession=seOaOoEwQBAJwzt8k9_40U_ZoGXdKpzXBJYeeXqeDI-LudNbKJsJWgKZA5Of2nLdm_bolnZYuEKQfULWSpCsWLMr7k7Ph24t4DJ5JmS9Lk7WKH00AoeHR7b3b9giAL3m9JRGJjnz8C2OFU8KKAqb9CSLHd9vnX-ccCcdA7i3ybQbD579au-l0g8RCmzV32ox4Y-WOKS9762DrIDQBlskNMD05uXH6rCZ_ed_fIcYPPXpJXdw94d8uiKbt9-IyKbs;
|
47
|
-
Path=/; Secure; HttpOnly
|
48
|
-
body:
|
49
|
-
encoding: UTF-8
|
50
|
-
string: |-
|
51
|
-
{
|
52
|
-
"success" : true
|
53
|
-
}
|
54
|
-
http_version:
|
55
|
-
recorded_at: Fri, 15 Jan 2016 19:25:55 GMT
|
56
|
-
- request:
|
57
|
-
method: put
|
58
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/accounts
|
59
|
-
body:
|
60
|
-
encoding: UTF-8
|
61
|
-
string: '{"name":"Abc","autoPay":true,"currency":"USD","billCycleDay":"0","paymentTerm":"Net
|
62
|
-
30","accountNumber":"123456","soldToContact":{"firstName":"Abc","lastName":"Def","address1":"123
|
63
|
-
Main St","city":"Palm Springs","state":"FL","zipCode":"90210","country":"US"},"billToContact":{"firstName":"Abc","lastName":"Def","address1":"123
|
64
|
-
Main St","city":"Palm Springs","state":"FL","zipCode":"90210","country":"US"},"creditCard":{"cardType":"Visa","cardNumber":"4111111111111111","expirationMonth":"03","expirationYear":"2017","securityCode":"122"}}'
|
65
|
-
headers:
|
66
|
-
User-Agent:
|
67
|
-
- Faraday v0.9.2
|
68
|
-
Content-Type:
|
69
|
-
- application/json
|
70
|
-
Cookie:
|
71
|
-
- ZSession=seOaOoEwQBAJwzt8k9_40U_ZoGXdKpzXBJYeeXqeDI-LudNbKJsJWgKZA5Of2nLdm_bolnZYuEKQfULWSpCsWLMr7k7Ph24t4DJ5JmS9Lk7WKH00AoeHR7b3b9giAL3m9JRGJjnz8C2OFU8KKAqb9CSLHd9vnX-ccCcdA7i3ybQbD579au-l0g8RCmzV32ox4Y-WOKS9762DrIDQBlskNMD05uXH6rCZ_ed_fIcYPPXpJXdw94d8uiKbt9-IyKbs;
|
72
|
-
Accept-Encoding:
|
73
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
74
|
-
Accept:
|
75
|
-
- "*/*"
|
76
|
-
response:
|
77
|
-
status:
|
78
|
-
code: 200
|
79
|
-
message: OK
|
80
|
-
headers:
|
81
|
-
Server:
|
82
|
-
- Zuora App
|
83
|
-
Content-Type:
|
84
|
-
- application/json;charset=utf-8
|
85
|
-
Content-Length:
|
86
|
-
- '160'
|
87
|
-
Expires:
|
88
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
89
|
-
Cache-Control:
|
90
|
-
- max-age=0, no-cache, no-store
|
91
|
-
Pragma:
|
92
|
-
- no-cache
|
93
|
-
Date:
|
94
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
95
|
-
Connection:
|
96
|
-
- keep-alive
|
97
|
-
Set-Cookie:
|
98
|
-
- ZSession=CGpSWWA6PatM21pEZjyznwDiVhS5jLlHrFSLbWEzNxAhuVd1kbgq7wiMvNb24TSpA1LTWcn4iq3FFeLosRWH57Em65wDc2bflwX4UFbLimijMiYw7WMyPJQwgXrlcY6vDVbaDa73i4EQPo7qEt0jtnGmxnYCGx5N4J_o74i1pODWb9bOne-2VvUy8R5zmTIbikQGpuYqK_LPgVOQzFj63W_Ot527jBc2vhnV4M6iXh-xpJ9gcEzQat7vfkvqURLz;
|
99
|
-
Path=/; Secure; HttpOnly
|
100
|
-
body:
|
101
|
-
encoding: UTF-8
|
102
|
-
string: |-
|
103
|
-
{
|
104
|
-
"success" : false,
|
105
|
-
"processId" : "43E33BC8CA606840",
|
106
|
-
"reasons" : [ {
|
107
|
-
"code" : 50000000,
|
108
|
-
"message" : "Request method 'PUT' not supported"
|
109
|
-
} ]
|
110
|
-
}
|
111
|
-
http_version:
|
112
|
-
recorded_at: Fri, 15 Jan 2016 19:25:56 GMT
|
113
|
-
recorded_with: VCR 3.0.1
|
@@ -1,114 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/connections
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
User-Agent:
|
11
|
-
- Faraday v0.9.2
|
12
|
-
Apiaccesskeyid:
|
13
|
-
- "<ZUORA_SANDBOX_USERNAME>"
|
14
|
-
Apisecretaccesskey:
|
15
|
-
- "<ZUORA_SANDBOX_PASSWORD>"
|
16
|
-
Content-Type:
|
17
|
-
- application/json
|
18
|
-
Content-Length:
|
19
|
-
- '0'
|
20
|
-
Accept-Encoding:
|
21
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
-
Accept:
|
23
|
-
- "*/*"
|
24
|
-
response:
|
25
|
-
status:
|
26
|
-
code: 200
|
27
|
-
message: OK
|
28
|
-
headers:
|
29
|
-
Server:
|
30
|
-
- Zuora App
|
31
|
-
Content-Type:
|
32
|
-
- application/json;charset=utf-8
|
33
|
-
Content-Length:
|
34
|
-
- '22'
|
35
|
-
Expires:
|
36
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
37
|
-
Cache-Control:
|
38
|
-
- max-age=0, no-cache, no-store
|
39
|
-
Pragma:
|
40
|
-
- no-cache
|
41
|
-
Date:
|
42
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
43
|
-
Connection:
|
44
|
-
- keep-alive
|
45
|
-
Set-Cookie:
|
46
|
-
- ZSession=R-kRFnqPxT5TKoUxBLInRrbJ3LKeJs6h-49mDFGg9d6yMVTvf0XYcMe843f36xXNMJSEr3ugyh57cRXqBGW2ndut5DFzIG95u1tXZrZe3hi6bA7QOuaTON8Qo2XJjnad3HkxhIYxIeDrj7BFdpvsYrSgr62x-Rx72KvMmBogxyDHnkCM_VsmdXtCViAH1ikR8Jsn-KI79PDxgMqlUU2RRlbB_QvGkn8GHFKJuGAEaNwuh7j2WQqXLO3KpXpjnhT7;
|
47
|
-
Path=/; Secure; HttpOnly
|
48
|
-
body:
|
49
|
-
encoding: UTF-8
|
50
|
-
string: |-
|
51
|
-
{
|
52
|
-
"success" : true
|
53
|
-
}
|
54
|
-
http_version:
|
55
|
-
recorded_at: Fri, 15 Jan 2016 19:25:56 GMT
|
56
|
-
- request:
|
57
|
-
method: post
|
58
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/subscriptions
|
59
|
-
body:
|
60
|
-
encoding: UTF-8
|
61
|
-
string: '{"renewalTerm":3,"renewalTermPeriodType":"week","termType":"TERMED","autoRenew":true,"invoiceTargetDate":"-4712-01-01","accountKey":"123456","contractEffectiveDate":"-4712-01-01","invoiceCollect":false,"initialTerm":"12","initialTermPeriodType":"Week","notes":"Test
|
62
|
-
POST subscription from zuora-ruby"}'
|
63
|
-
headers:
|
64
|
-
User-Agent:
|
65
|
-
- Faraday v0.9.2
|
66
|
-
Content-Type:
|
67
|
-
- application/json
|
68
|
-
Cookie:
|
69
|
-
- ZSession=R-kRFnqPxT5TKoUxBLInRrbJ3LKeJs6h-49mDFGg9d6yMVTvf0XYcMe843f36xXNMJSEr3ugyh57cRXqBGW2ndut5DFzIG95u1tXZrZe3hi6bA7QOuaTON8Qo2XJjnad3HkxhIYxIeDrj7BFdpvsYrSgr62x-Rx72KvMmBogxyDHnkCM_VsmdXtCViAH1ikR8Jsn-KI79PDxgMqlUU2RRlbB_QvGkn8GHFKJuGAEaNwuh7j2WQqXLO3KpXpjnhT7;
|
70
|
-
Accept-Encoding:
|
71
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
72
|
-
Accept:
|
73
|
-
- "*/*"
|
74
|
-
response:
|
75
|
-
status:
|
76
|
-
code: 200
|
77
|
-
message: OK
|
78
|
-
headers:
|
79
|
-
Server:
|
80
|
-
- Zuora App
|
81
|
-
Content-Type:
|
82
|
-
- application/json;charset=utf-8
|
83
|
-
Content-Length:
|
84
|
-
- '304'
|
85
|
-
Expires:
|
86
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
87
|
-
Cache-Control:
|
88
|
-
- max-age=0, no-cache, no-store
|
89
|
-
Pragma:
|
90
|
-
- no-cache
|
91
|
-
Date:
|
92
|
-
- Fri, 15 Jan 2016 19:25:56 GMT
|
93
|
-
Connection:
|
94
|
-
- keep-alive
|
95
|
-
Set-Cookie:
|
96
|
-
- ZSession=N3s-LaLVoObl0D8YagtPcjeTe3ykE2bTVHuj1rbFhB54JjIwHnobsDnsRJRkemgMKfjcQNcUDtUWsyjyeNlxlfv0xUKm7m2dKxFaHj4bdIQ-DMrSa-zdV0I5sgRgLfn8fH7WKiOFqB3iuSl8d_mo4RSk2_m_vDUgPlIUFQKaBHbvvUsZGaD5ugegLJqBVnO_b5SRm4lfi8HwWBJ5NFvYkd4DUaknfQN7PzPdr7CiHyZg0ROk7Mw6M7mmjw4ufEAW;
|
97
|
-
Path=/; Secure; HttpOnly
|
98
|
-
body:
|
99
|
-
encoding: UTF-8
|
100
|
-
string: |-
|
101
|
-
{
|
102
|
-
"success" : false,
|
103
|
-
"processId" : "701D3B2AAC3AC4E7",
|
104
|
-
"reasons" : [ {
|
105
|
-
"code" : 53001820,
|
106
|
-
"message" : "'renewalTermPeriodType' value should be one of: Month, Year, Day, Week"
|
107
|
-
}, {
|
108
|
-
"code" : 53001020,
|
109
|
-
"message" : "'invoiceTargetDate' must match \"\\d{4}-\\d{1,2}-\\d{1,2}\""
|
110
|
-
} ]
|
111
|
-
}
|
112
|
-
http_version:
|
113
|
-
recorded_at: Fri, 15 Jan 2016 19:25:57 GMT
|
114
|
-
recorded_with: VCR 3.0.1
|
@@ -1,114 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/connections
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
User-Agent:
|
11
|
-
- Faraday v0.9.2
|
12
|
-
Apiaccesskeyid:
|
13
|
-
- "<ZUORA_SANDBOX_USERNAME>"
|
14
|
-
Apisecretaccesskey:
|
15
|
-
- "<ZUORA_SANDBOX_PASSWORD>"
|
16
|
-
Content-Type:
|
17
|
-
- application/json
|
18
|
-
Content-Length:
|
19
|
-
- '0'
|
20
|
-
Accept-Encoding:
|
21
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
-
Accept:
|
23
|
-
- "*/*"
|
24
|
-
response:
|
25
|
-
status:
|
26
|
-
code: 200
|
27
|
-
message: OK
|
28
|
-
headers:
|
29
|
-
Server:
|
30
|
-
- Zuora App
|
31
|
-
Content-Type:
|
32
|
-
- application/json;charset=utf-8
|
33
|
-
Content-Length:
|
34
|
-
- '22'
|
35
|
-
Expires:
|
36
|
-
- Fri, 15 Jan 2016 19:25:57 GMT
|
37
|
-
Cache-Control:
|
38
|
-
- max-age=0, no-cache, no-store
|
39
|
-
Pragma:
|
40
|
-
- no-cache
|
41
|
-
Date:
|
42
|
-
- Fri, 15 Jan 2016 19:25:57 GMT
|
43
|
-
Connection:
|
44
|
-
- keep-alive
|
45
|
-
Set-Cookie:
|
46
|
-
- ZSession=xuPDHC0vDbpykpLgYfs3R7ALV1jYa8L7xucWC3Y_thICXtaBKHx5tZ7GjsPklFnEaTqTUR30qDpJllrlz_UL8uYhcMDvU84rYzFx1McoN4LxsVWXccZ2G7TM4vD3eg4eFlDFqhzc37mFpsIBM_8mB6_7FhwKUcT8oHcFkH-aD46T6fjjp3DCB0Vby1UJ0-m6DGU0O3QzdZ2TBhCYewLp20ssG6TKZ3wE26WYogYfmmxWNZtxGWW5LwI5dtjdY4bt;
|
47
|
-
Path=/; Secure; HttpOnly
|
48
|
-
body:
|
49
|
-
encoding: UTF-8
|
50
|
-
string: |-
|
51
|
-
{
|
52
|
-
"success" : true
|
53
|
-
}
|
54
|
-
http_version:
|
55
|
-
recorded_at: Fri, 15 Jan 2016 19:25:57 GMT
|
56
|
-
- request:
|
57
|
-
method: post
|
58
|
-
uri: https://apisandbox-api.zuora.com/rest/v1/subscriptions
|
59
|
-
body:
|
60
|
-
encoding: UTF-8
|
61
|
-
string: '{"renewalTerm":3,"renewalTermPeriodType":"week","termType":"TERMED","autoRenew":true,"invoiceTargetDate":"-4712-01-01","accountKey":"123456","contractEffectiveDate":"-4712-01-01","invoiceCollect":false,"initialTerm":"12","initialTermPeriodType":"Week","notes":"Test
|
62
|
-
POST subscription from zuora-ruby"}'
|
63
|
-
headers:
|
64
|
-
User-Agent:
|
65
|
-
- Faraday v0.9.2
|
66
|
-
Content-Type:
|
67
|
-
- application/json
|
68
|
-
Cookie:
|
69
|
-
- ZSession=xuPDHC0vDbpykpLgYfs3R7ALV1jYa8L7xucWC3Y_thICXtaBKHx5tZ7GjsPklFnEaTqTUR30qDpJllrlz_UL8uYhcMDvU84rYzFx1McoN4LxsVWXccZ2G7TM4vD3eg4eFlDFqhzc37mFpsIBM_8mB6_7FhwKUcT8oHcFkH-aD46T6fjjp3DCB0Vby1UJ0-m6DGU0O3QzdZ2TBhCYewLp20ssG6TKZ3wE26WYogYfmmxWNZtxGWW5LwI5dtjdY4bt;
|
70
|
-
Accept-Encoding:
|
71
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
72
|
-
Accept:
|
73
|
-
- "*/*"
|
74
|
-
response:
|
75
|
-
status:
|
76
|
-
code: 200
|
77
|
-
message: OK
|
78
|
-
headers:
|
79
|
-
Server:
|
80
|
-
- Zuora App
|
81
|
-
Content-Type:
|
82
|
-
- application/json;charset=utf-8
|
83
|
-
Content-Length:
|
84
|
-
- '304'
|
85
|
-
Expires:
|
86
|
-
- Fri, 15 Jan 2016 19:25:57 GMT
|
87
|
-
Cache-Control:
|
88
|
-
- max-age=0, no-cache, no-store
|
89
|
-
Pragma:
|
90
|
-
- no-cache
|
91
|
-
Date:
|
92
|
-
- Fri, 15 Jan 2016 19:25:57 GMT
|
93
|
-
Connection:
|
94
|
-
- keep-alive
|
95
|
-
Set-Cookie:
|
96
|
-
- ZSession=zclVVC03awBAyPC54doXc0DA3Ax7VLNB6n4h-RG750OyU1oNMgR_MKhZP2BmHY0AyASTJY_L7_vOMDSqt96wOukAYjxrJwNYXe5aU3zzMc6Sq0Re-B9RmKqhejpNlKe9NFrkU1XyBLDX2NNy2agXLbEzEyo2u7-8Uet9IdernwenP0CY7XoHiHjwxkQm9Kw9nPM6QbwlfXUwEl5yh3qScKhhjx7EihlgUZpV8t0fp4wrGao9WJNuHwC5bNMGLzNU;
|
97
|
-
Path=/; Secure; HttpOnly
|
98
|
-
body:
|
99
|
-
encoding: UTF-8
|
100
|
-
string: |-
|
101
|
-
{
|
102
|
-
"success" : false,
|
103
|
-
"processId" : "BCD764763E1C61A8",
|
104
|
-
"reasons" : [ {
|
105
|
-
"code" : 53001020,
|
106
|
-
"message" : "'invoiceTargetDate' must match \"\\d{4}-\\d{1,2}-\\d{1,2}\""
|
107
|
-
}, {
|
108
|
-
"code" : 53001820,
|
109
|
-
"message" : "'renewalTermPeriodType' value should be one of: Month, Year, Day, Week"
|
110
|
-
} ]
|
111
|
-
}
|
112
|
-
http_version:
|
113
|
-
recorded_at: Fri, 15 Jan 2016 19:25:59 GMT
|
114
|
-
recorded_with: VCR 3.0.1
|