wepay-api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +118 -0
- data/Rakefile +7 -0
- data/lib/wepay-api.rb +2 -0
- data/lib/wepay.rb +23 -0
- data/lib/wepay/api.rb +27 -0
- data/lib/wepay/api/account.rb +86 -0
- data/lib/wepay/api/base.rb +25 -0
- data/lib/wepay/api/checkout.rb +68 -0
- data/lib/wepay/api/preapproval.rb +50 -0
- data/lib/wepay/api/subscription.rb +50 -0
- data/lib/wepay/api/subscription_plan.rb +59 -0
- data/lib/wepay/api/withdrawal.rb +41 -0
- data/lib/wepay/client.rb +63 -0
- data/lib/wepay/client/data.rb +31 -0
- data/lib/wepay/client/token.rb +30 -0
- data/lib/wepay/configuration.rb +34 -0
- data/lib/wepay/error.rb +28 -0
- data/lib/wepay/middleware.rb +44 -0
- data/lib/wepay/oauth.rb +32 -0
- data/lib/wepay/version.rb +3 -0
- data/spec/fixtures/vcr_cassettes/Wepay_Middleware/Wepay_Middleware_CheckStatus/raises_a_Wepay_ApiError_with_proper_error_type_message_and_code.yml +35 -0
- data/spec/fixtures/vcr_cassettes/wepay_account.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_add_bank.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_balance.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_create.yml +46 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_delete.yml +48 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_find.yml +43 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_get_tax.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_modify.yml +49 -0
- data/spec/fixtures/vcr_cassettes/wepay_account_set_tax.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout.yml +40 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_cancel.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_capture.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_create.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_find.yml +51 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_modify.yml +40 -0
- data/spec/fixtures/vcr_cassettes/wepay_checkout_refund.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_preapproval.yml +39 -0
- data/spec/fixtures/vcr_cassettes/wepay_preapproval_cancel.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_preapproval_create.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_preapproval_find.yml +39 -0
- data/spec/fixtures/vcr_cassettes/wepay_preapproval_modify.yml +39 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_cancel.yml +36 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_create.yml +48 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_find.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_modify.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan.yml +39 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan_create.yml +48 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan_delete.yml +48 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan_find.yml +39 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan_get_button.yml +48 -0
- data/spec/fixtures/vcr_cassettes/wepay_subscription_plan_modify.yml +49 -0
- data/spec/fixtures/vcr_cassettes/wepay_withdrawal.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_withdrawal_create.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_withdrawal_find.yml +38 -0
- data/spec/fixtures/vcr_cassettes/wepay_withdrawal_modify.yml +38 -0
- data/spec/settings.yml.example +6 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/matchers.rb +5 -0
- data/spec/support/rspec_helper.rb +30 -0
- data/spec/support/settings.rb +14 -0
- data/spec/support/vcr.rb +17 -0
- data/spec/wepay/api/account_spec.rb +110 -0
- data/spec/wepay/api/checkout_spec.rb +86 -0
- data/spec/wepay/api/preapproval_spec.rb +69 -0
- data/spec/wepay/api/subscription_plan_spec.rb +83 -0
- data/spec/wepay/api/subscription_spec.rb +65 -0
- data/spec/wepay/api/withdrawal_spec.rb +53 -0
- data/spec/wepay/api_spec.rb +9 -0
- data/spec/wepay/configuration_spec.rb +25 -0
- data/spec/wepay/middleware_spec.rb +21 -0
- data/spec/wepay/oauth_spec.rb +23 -0
- data/wepay-api.gemspec +29 -0
- metadata +273 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/checkout/capture
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"checkout_id":"1234567890"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Wed, 04 Dec 2013 05:21:57 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"checkout_id":1234567890,"state":"captured"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 04 Dec 2013 05:21:57 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/checkout/create
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"account_id":123456, "short_description":"Payment", "type":"GOODS", "amount":"10"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Wed, 04 Dec 2013 04:08:44 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"checkout_id":1234567890,"checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1234567890\/8a1fc59e"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 04 Dec 2013 04:08:44 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/checkout/find
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"account_id":"123456"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Wed, 04 Dec 2013 04:58:49 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '[{"checkout_id":706495338,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/706495338\/8a1fc59e","short_description":"Film
|
36
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386130124,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":958816232,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/958816232\/6444a979","short_description":"Film
|
37
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386129981,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":1537338904,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1537338904\/28673036","short_description":"Film
|
38
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386129892,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":1136746259,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1136746259\/87b3a6d7","short_description":"Film
|
39
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386129733,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":1492928395,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1492928395\/952490b7","short_description":"Film
|
40
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386129574,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":1245652019,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1245652019\/13b13f25","short_description":"Film
|
41
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386129430,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":755211988,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/755211988\/7788b18a","short_description":"Film
|
42
|
+
payment","currency":"USD","amount":10,"fee_payer":"payee_from_app","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"http:\/\/localhost:3000\/films\/11","auto_capture":false,"app_fee":0,"create_time":1386068890,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"reference_id":"cd42553da8d6985d254affdf12a7eb3f","tax":0,"dispute_uri":""},{"checkout_id":1647151024,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1647151024\/20e3a921","short_description":"Film
|
43
|
+
payment","currency":"USD","amount":10,"fee_payer":"payee_from_app","state":"captured","soft_descriptor":"WPY*Descriptor","redirect_uri":"http:\/\/localhost:3000\/films\/11","auto_capture":false,"app_fee":0,"create_time":1386067492,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"gross":10,"fee":0.59,"reference_id":"c7ee62b922f753ac864a1d94acd60db6","tax":0,"payer_email":"adb@adsf.com","payer_name":"ABC XYZ","dispute_uri":"https:\/\/stage.wepay.com\/dispute\/payer_create\/589927\/83bc308ef5e46e364e1c"},{"checkout_id":1807302646,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1807302646\/8fda83b3","short_description":"Film
|
44
|
+
payment","currency":"USD","amount":10,"fee_payer":"payer","state":"captured","soft_descriptor":"WPY*Descriptor","redirect_uri":"http:\/\/localhost:3000\/films\/11","auto_capture":false,"app_fee":0,"create_time":1386065853,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"gross":10.59,"fee":0.59,"reference_id":"ae876e273e6ea808406bd3e82bceb802","tax":0,"payer_email":"ab@example.com","payer_name":"ABC XYZ","dispute_uri":"https:\/\/stage.wepay.com\/dispute\/payer_create\/589895\/aa528fca6a3927f9019c"},{"checkout_id":2098870574,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/2098870574\/541d45b8","short_description":"test
|
45
|
+
checkout creation","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386054830,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":641728106,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/641728106\/9112f538","short_description":"test
|
46
|
+
checkout creation","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386054675,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":727378956,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/727378956\/aaccc4c1","short_description":"test
|
47
|
+
checkout creation","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386054386,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""},{"checkout_id":598393707,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/598393707\/ddd287aa","short_description":"test
|
48
|
+
checkout creation","currency":"USD","amount":10,"fee_payer":"payer","state":"expired","soft_descriptor":"WPY*Descriptor","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386053889,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"tax":0,"dispute_uri":""}]'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Wed, 04 Dec 2013 04:58:50 GMT
|
51
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/checkout/modify
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"checkout_id":"1234567890", "callback_uri":"https://www.example.com/ipn/12345"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Wed, 04 Dec 2013 05:27:41 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"checkout_id":1234567890,"account_id":123456,"type":"GOODS","checkout_uri":"https:\/\/stage.wepay.com\/api\/checkout\/1234567890\/8e4bc966","short_description":"Film
|
36
|
+
payment","currency":"USD","amount":10,"fee_payer":"payee_from_app","state":"new","soft_descriptor":"WPY*Juntobox
|
37
|
+
Films","redirect_uri":"","auto_capture":false,"app_fee":0,"create_time":1386134440,"mode":"regular","amount_refunded":0,"amount_charged_back":0,"callback_uri":"https:\/\/www.example.com\/ipn\/12345","tax":0,"dispute_uri":""}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Wed, 04 Dec 2013 05:27:41 GMT
|
40
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/checkout/refund
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"checkout_id":"1234567890", "refund_reason":"no reason"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Wed, 04 Dec 2013 05:21:57 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"checkout_id":1234567890,"state":"refunded"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 04 Dec 2013 05:21:57 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/preapproval
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"preapproval_id":123456}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 03:57:59 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"preapproval_id":123456789,"account_id":123456,"preapproval_uri":"https:\/\/stage.wepay.com\/api\/preapproval\/123456789\/377e07c4","short_description":"Payment","currency":"USD","amount":10,"fee_payer":"payer","state":"approved","redirect_uri":null,"app_fee":0,"period":"yearly","frequency":1,"start_time":1387165984,"end_time":1544950614,"auto_recur":false,"create_time":1387165984,"manage_uri":"https:\/\/stage.wepay.com\/preapproval\/view\/123456789\/377e07c4","mode":"regular","payer_email":"user@example.com","payer_name":"Test
|
36
|
+
User 1"}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 16 Dec 2013 03:58:00 GMT
|
39
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/preapproval/cancel
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"preapproval_id":123456789}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 04:07:35 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"preapproval_id":123456789,"state":"cancelled"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 16 Dec 2013 04:07:35 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/preapproval/create
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"short_description":"Payment","period":"yearly","amount":10,"account_id":123456}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 03:53:04 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"preapproval_id":123456789,"preapproval_uri":"https:\/\/stage.wepay.com\/api\/preapproval\/123456789\/377e07c4"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 16 Dec 2013 03:53:04 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/preapproval/find
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"account_id":123456}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 04:05:10 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '[{"preapproval_id":123456789,"account_id":123456,"preapproval_uri":"https:\/\/stage.wepay.com\/api\/preapproval\/123456789\/377e07c4","short_description":"Payment","currency":"USD","amount":10,"fee_payer":"payer","state":"approved","redirect_uri":null,"app_fee":0,"period":"yearly","frequency":1,"start_time":1387165984,"end_time":1544950614,"auto_recur":false,"create_time":1387165984,"manage_uri":"https:\/\/stage.wepay.com\/preapproval\/view\/123456789\/377e07c4","mode":"regular","payer_email":"user@example.com","payer_name":"Test
|
36
|
+
User 1"}]'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 16 Dec 2013 04:05:10 GMT
|
39
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/preapproval/modify
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"preapproval_id":123456789,"callback_uri":"https://www.example.com/ipn/12345"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 04:06:08 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"preapproval_id":123456789,"account_id":123456,"preapproval_uri":"https:\/\/stage.wepay.com\/api\/preapproval\/123456789\/377e07c4","short_description":"Payment","currency":"USD","amount":10,"fee_payer":"payer","state":"approved","redirect_uri":null,"app_fee":0,"period":"yearly","frequency":1,"start_time":1387165984,"end_time":1544950614,"auto_recur":false,"create_time":1387165984,"manage_uri":"https:\/\/stage.wepay.com\/preapproval\/view\/123456789\/377e07c4","mode":"regular","callback_uri":"https:\/\/www.example.com\/ipn\/12345","payer_email":"user@example.com","payer_name":"Test
|
36
|
+
User 1"}'
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 16 Dec 2013 04:06:09 GMT
|
39
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://stage.wepayapi.com/v2/subscription
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"subscription_id":123456789}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.8
|
12
|
+
Authorization:
|
13
|
+
- Bearer access_token
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message:
|
20
|
+
headers:
|
21
|
+
server:
|
22
|
+
- nginx
|
23
|
+
date:
|
24
|
+
- Mon, 16 Dec 2013 05:30:27 GMT
|
25
|
+
content-type:
|
26
|
+
- application/json
|
27
|
+
transfer-encoding:
|
28
|
+
- chunked
|
29
|
+
connection:
|
30
|
+
- close
|
31
|
+
strict-transport-security:
|
32
|
+
- max-age=2592000
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"subscription_plan_id":1234567890,"subscription_id":123456789,"subscription_uri":"https:\/\/stage.wepay.com\/subscriptions\/123456789\/b848e5cb","payer_name":"","payer_email":"","currency":"USD","amount":10,"period":"yearly","quantity":1,"mode":"regular","app_fee":0,"fee_payer":"payee","state":"new","create_time":1387171638,"trial_days_remaining":0,"redirect_uri":"","callback_uri":"","reference_id":"","transition_expire_time":0,"transition_subscription_plan_id":0,"transition_prorate":false,"transition_quantity":0}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 16 Dec 2013 05:30:27 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|