paymaya 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +75 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +9 -0
- data/LICENSE.md +7 -0
- data/README.md +35 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/vcr_cassettes/create_card.yml +54 -0
- data/fixtures/vcr_cassettes/create_card_vault_payment.yml +55 -0
- data/fixtures/vcr_cassettes/create_checkout.yml +65 -0
- data/fixtures/vcr_cassettes/create_customer.yml +58 -0
- data/fixtures/vcr_cassettes/create_payment.yml +57 -0
- data/fixtures/vcr_cassettes/create_payment_token.yml +54 -0
- data/fixtures/vcr_cassettes/create_subscription.yml +54 -0
- data/fixtures/vcr_cassettes/delete_card.yml +50 -0
- data/fixtures/vcr_cassettes/delete_checkout_webhook.yml +107 -0
- data/fixtures/vcr_cassettes/delete_customer.yml +52 -0
- data/fixtures/vcr_cassettes/delete_payment_vault_webhook.yml +50 -0
- data/fixtures/vcr_cassettes/delete_subscription.yml +50 -0
- data/fixtures/vcr_cassettes/get_customization.yml +57 -0
- data/fixtures/vcr_cassettes/list_cards.yml +50 -0
- data/fixtures/vcr_cassettes/list_checkout_webhooks.yml +54 -0
- data/fixtures/vcr_cassettes/list_payment_vault_webhooks.yml +50 -0
- data/fixtures/vcr_cassettes/list_refunds.yml +51 -0
- data/fixtures/vcr_cassettes/list_subscription_payments.yml +52 -0
- data/fixtures/vcr_cassettes/list_subscriptions.yml +50 -0
- data/fixtures/vcr_cassettes/refund_payment.yml +54 -0
- data/fixtures/vcr_cassettes/register_checkout_webhook.yml +60 -0
- data/fixtures/vcr_cassettes/register_payment_vault_webhook.yml +54 -0
- data/fixtures/vcr_cassettes/remove_customization.yml +56 -0
- data/fixtures/vcr_cassettes/retrieve_card.yml +50 -0
- data/fixtures/vcr_cassettes/retrieve_checkout.yml +61 -0
- data/fixtures/vcr_cassettes/retrieve_customer.yml +52 -0
- data/fixtures/vcr_cassettes/retrieve_payment.yml +51 -0
- data/fixtures/vcr_cassettes/retrieve_payment_vault_webhook.yml +50 -0
- data/fixtures/vcr_cassettes/retrieve_refund.yml +51 -0
- data/fixtures/vcr_cassettes/retrieve_subscription.yml +50 -0
- data/fixtures/vcr_cassettes/set_customization.yml +62 -0
- data/fixtures/vcr_cassettes/update_card.yml +52 -0
- data/fixtures/vcr_cassettes/update_checkout_webhook.yml +113 -0
- data/fixtures/vcr_cassettes/update_customer.yml +56 -0
- data/fixtures/vcr_cassettes/update_payment_vault_webhook.yml +52 -0
- data/fixtures/vcr_cassettes/void_payment.yml +53 -0
- data/lib/paymaya.rb +28 -0
- data/lib/paymaya/checkout.rb +5 -0
- data/lib/paymaya/checkout/checkout.rb +35 -0
- data/lib/paymaya/checkout/customization.rb +37 -0
- data/lib/paymaya/checkout/webhook.rb +40 -0
- data/lib/paymaya/configuration.rb +22 -0
- data/lib/paymaya/helper.rb +114 -0
- data/lib/paymaya/payment_vault/card_vault/card.rb +44 -0
- data/lib/paymaya/payment_vault/card_vault/customer.rb +38 -0
- data/lib/paymaya/payment_vault/card_vault/payment.rb +24 -0
- data/lib/paymaya/payment_vault/card_vault/subscription.rb +50 -0
- data/lib/paymaya/payment_vault/payment.rb +58 -0
- data/lib/paymaya/payment_vault/payment_token.rb +20 -0
- data/lib/paymaya/payment_vault/webhook.rb +44 -0
- data/lib/paymaya/version.rb +4 -0
- data/paymaya.gemspec +29 -0
- metadata +205 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://sk-VrEDVetYZ6f4R1w4g0npwLzeBXtksd1smJ5lqk9Yh4y:@pg-sandbox.paymaya.com/checkout/v1/customizations
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"logoUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/yourlogo.svg","iconUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/youricon.ico","appleTouchIconUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/youricon_ios.ico","customTitle":"Checkout
|
9
|
+
Page Title","colorScheme":"#368d5c"}'
|
10
|
+
headers:
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Accept-Encoding:
|
14
|
+
- gzip, deflate
|
15
|
+
User-Agent:
|
16
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
Content-Length:
|
20
|
+
- '360'
|
21
|
+
Host:
|
22
|
+
- pg-sandbox.paymaya.com
|
23
|
+
response:
|
24
|
+
status:
|
25
|
+
code: 200
|
26
|
+
message: OK
|
27
|
+
headers:
|
28
|
+
Date:
|
29
|
+
- Sun, 25 Dec 2016 10:51:36 GMT
|
30
|
+
Content-Type:
|
31
|
+
- application/json; charset=utf-8
|
32
|
+
Content-Length:
|
33
|
+
- '360'
|
34
|
+
Connection:
|
35
|
+
- close
|
36
|
+
Access-Control-Allow-Origin:
|
37
|
+
- "*"
|
38
|
+
Vary:
|
39
|
+
- X-HTTP-Method-Override
|
40
|
+
X-Content-Type-Options:
|
41
|
+
- nosniff
|
42
|
+
Strict-Transport-Security:
|
43
|
+
- max-age=31536000
|
44
|
+
Cache-Control:
|
45
|
+
- private, no-cache, no-store, must-revalidate, max-age=0
|
46
|
+
Pragma:
|
47
|
+
- no-cache
|
48
|
+
X-Xss-Protection:
|
49
|
+
- 1; mode=block
|
50
|
+
X-Frame-Options:
|
51
|
+
- DENY
|
52
|
+
Etag:
|
53
|
+
- W/"168-4SUIzIvDitn8lbnZm7RHLA"
|
54
|
+
Via:
|
55
|
+
- kong/0.4.2
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"logoUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/yourlogo.svg","iconUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/youricon.ico","appleTouchIconUrl":"https://cdn.paymaya.com/production/checkout_api/customization_example/youricon_ios.ico","customTitle":"Checkout
|
59
|
+
Page Title","colorScheme":"#368d5c"}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Sun, 25 Dec 2016 10:51:36 GMT
|
62
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://sk-GgVT0xX7YJcWBauR4UqnMkyFt8GpksixEUaV7qWnDJc:@pg-sandbox.paymaya.com/payments/v1/customers/5f39f980-225f-4805-b61f-50e84ce3fcdf/cards/wdi6mkRvsaLNTiTOoMJD3GLUrdC0SdBvr7e6LbJvjxU2gjdr5k9Gynj0GQN7f9fofsDBlqy0Zzq6u4Vwhfd8hug0dCQo3NSb3RDV2GndnhmSEkKoY4eoAlxYaZUtJ4mFObMGGHxPmTaXZC9rBuPXe5JIZwFkzz5X1SXU
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"isDefault":true}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '18'
|
20
|
+
Host:
|
21
|
+
- pg-sandbox.paymaya.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Thu, 29 Dec 2016 03:16:32 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '338'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Etag:
|
38
|
+
- W/"152-L7VXPz19UjjZKNt8yR1CEA"
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Frame-Options:
|
42
|
+
- DENY
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
Via:
|
46
|
+
- kong/0.4.2
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"state":"VERIFIED","cardTokenId":"wdi6mkRvsaLNTiTOoMJD3GLUrdC0SdBvr7e6LbJvjxU2gjdr5k9Gynj0GQN7f9fofsDBlqy0Zzq6u4Vwhfd8hug0dCQo3NSb3RDV2GndnhmSEkKoY4eoAlxYaZUtJ4mFObMGGHxPmTaXZC9rBuPXe5JIZwFkzz5X1SXU","cardType":"master-card","maskedPan":"2346","createdAt":"2016-12-29T02:41:57.000Z","updatedAt":"2016-12-29T03:16:32.000Z","default":true}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Thu, 29 Dec 2016 03:16:31 GMT
|
52
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,113 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://sk-VrEDVetYZ6f4R1w4g0npwLzeBXtksd1smJ5lqk9Yh4y:@pg-sandbox.paymaya.com/checkout/v1/webhooks/f6be27a8-3b96-4cf4-bcfc-7b86f5e7c93d
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"name":"CHECKOUT_DROPOUT","callbackUrl":"http://userwebsite.com/checkout_droupout"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '84'
|
20
|
+
Host:
|
21
|
+
- pg-sandbox.paymaya.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 404
|
25
|
+
message: Not Found
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Sun, 25 Dec 2016 10:21:49 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '74'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
Strict-Transport-Security:
|
40
|
+
- max-age=31536000
|
41
|
+
Cache-Control:
|
42
|
+
- private, no-cache, no-store, must-revalidate, max-age=0
|
43
|
+
Pragma:
|
44
|
+
- no-cache
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
X-Frame-Options:
|
48
|
+
- DENY
|
49
|
+
Etag:
|
50
|
+
- W/"4a-sMCQrZAm6HsNi/P6fhhJgw"
|
51
|
+
Via:
|
52
|
+
- kong/0.4.2
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"error":{"code":-3,"message":"Requested resource/information not found"}}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sun, 25 Dec 2016 10:21:49 GMT
|
58
|
+
- request:
|
59
|
+
method: put
|
60
|
+
uri: https://sk-VrEDVetYZ6f4R1w4g0npwLzeBXtksd1smJ5lqk9Yh4y:@pg-sandbox.paymaya.com/checkout/v1/webhooks/d1145ee5-53ac-414a-b5d2-10efd5fd1acb
|
61
|
+
body:
|
62
|
+
encoding: UTF-8
|
63
|
+
string: '{"name":"CHECKOUT_DROPOUT","callbackUrl":"http://userwebsite.com/checkout_droupout"}'
|
64
|
+
headers:
|
65
|
+
Accept:
|
66
|
+
- "*/*"
|
67
|
+
Accept-Encoding:
|
68
|
+
- gzip, deflate
|
69
|
+
User-Agent:
|
70
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
71
|
+
Content-Type:
|
72
|
+
- application/json
|
73
|
+
Content-Length:
|
74
|
+
- '84'
|
75
|
+
Host:
|
76
|
+
- pg-sandbox.paymaya.com
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 200
|
80
|
+
message: OK
|
81
|
+
headers:
|
82
|
+
Date:
|
83
|
+
- Sun, 25 Dec 2016 10:23:03 GMT
|
84
|
+
Content-Type:
|
85
|
+
- application/json; charset=utf-8
|
86
|
+
Content-Length:
|
87
|
+
- '128'
|
88
|
+
Connection:
|
89
|
+
- close
|
90
|
+
Access-Control-Allow-Origin:
|
91
|
+
- "*"
|
92
|
+
X-Content-Type-Options:
|
93
|
+
- nosniff
|
94
|
+
Strict-Transport-Security:
|
95
|
+
- max-age=31536000
|
96
|
+
Cache-Control:
|
97
|
+
- private, no-cache, no-store, must-revalidate, max-age=0
|
98
|
+
Pragma:
|
99
|
+
- no-cache
|
100
|
+
X-Xss-Protection:
|
101
|
+
- 1; mode=block
|
102
|
+
X-Frame-Options:
|
103
|
+
- DENY
|
104
|
+
Etag:
|
105
|
+
- W/"80-xUeqJ1gw80zZbSVamWk4+Q"
|
106
|
+
Via:
|
107
|
+
- kong/0.4.2
|
108
|
+
body:
|
109
|
+
encoding: UTF-8
|
110
|
+
string: '{"name":"CHECKOUT_DROPOUT","callbackUrl":"http://userwebsite.com/checkout_droupout","id":"d1145ee5-53ac-414a-b5d2-10efd5fd1acb"}'
|
111
|
+
http_version:
|
112
|
+
recorded_at: Sun, 25 Dec 2016 10:23:03 GMT
|
113
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://sk-dOxQfFiCZ7ImhHAsLLTVPpuVt3XBtqPzbcpeJa3TBJv:@pg-sandbox.paymaya.com/payments/v1/customers/c52866a8-c30f-4233-afd4-473b069ac751
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"firstName":"Ysabelle","middleName":"Cruz","lastName":"Santos","birthday":"1987-01-01","sex":"F","contact":{"phone":"+63(2)1234567890","email":"ysadcsantos@gmail.com"},"billingAddress":{"line1":"9F
|
9
|
+
Robinsons Cybergate 3","line2":"Pioneer Street","city":"Mandaluyong City","state":"Metro
|
10
|
+
Manila","zipCode":"12345","countryCode":"PH"},"metadata":{}}'
|
11
|
+
headers:
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip, deflate
|
16
|
+
User-Agent:
|
17
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
18
|
+
Content-Type:
|
19
|
+
- application/json
|
20
|
+
Content-Length:
|
21
|
+
- '348'
|
22
|
+
Host:
|
23
|
+
- pg-sandbox.paymaya.com
|
24
|
+
response:
|
25
|
+
status:
|
26
|
+
code: 200
|
27
|
+
message: OK
|
28
|
+
headers:
|
29
|
+
Date:
|
30
|
+
- Wed, 28 Dec 2016 19:15:42 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Content-Length:
|
34
|
+
- '456'
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Access-Control-Allow-Origin:
|
38
|
+
- "*"
|
39
|
+
Etag:
|
40
|
+
- W/"1c8-8cxne/ywLsVx/7sJhTBGCA"
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Frame-Options:
|
44
|
+
- DENY
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
Via:
|
48
|
+
- kong/0.4.2
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"id":"c52866a8-c30f-4233-afd4-473b069ac751","firstName":"Ysabelle","middleName":"Cruz","lastName":"Santos","contact":{"phone":"+63(2)1234567890","email":"ysadcsantos@gmail.com"},"billingAddress":{"line1":"9F
|
52
|
+
Robinsons Cybergate 3","line2":"Pioneer Street","city":"Mandaluyong City","state":"Metro
|
53
|
+
Manila","zipCode":"12345","countryCode":"PH"},"sex":"F","birthday":"1987-01-01","createdAt":"2016-12-28T19:15:12.000Z","updatedAt":"2016-12-28T19:15:42.000Z"}'
|
54
|
+
http_version:
|
55
|
+
recorded_at: Wed, 28 Dec 2016 19:15:42 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: put
|
5
|
+
uri: https://sk-GgVT0xX7YJcWBauR4UqnMkyFt8GpksixEUaV7qWnDJc:@pg-sandbox.paymaya.com/payments/v1/webhooks/674a08c7-e68e-4386-a5cb-750db1d3675a
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"name":"3DS_PAYMENT_SUCCESS","callbackUrl":"http://anewwebhook.com/success-webhook"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '85'
|
20
|
+
Host:
|
21
|
+
- pg-sandbox.paymaya.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 28 Dec 2016 17:53:49 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '207'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Etag:
|
38
|
+
- W/"cf-I64UAqirUZBJIjrHqTQe9A"
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Frame-Options:
|
42
|
+
- DENY
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
Via:
|
46
|
+
- kong/0.4.2
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"id":"674a08c7-e68e-4386-a5cb-750db1d3675a","name":"3DS_PAYMENT_SUCCESS","callbackUrl":"http://anewwebhook.com/success-webhook","createdAt":"2016-11-17T04:57:50.000Z","updatedAt":"2016-12-28T17:53:49.000Z"}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Wed, 28 Dec 2016 17:53:59 GMT
|
52
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://sk-GgVT0xX7YJcWBauR4UqnMkyFt8GpksixEUaV7qWnDJc:@pg-sandbox.paymaya.com/payments/v1/payments/4873e908-0a78-416b-b2f4-432080e6ee85
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"reason":"Void reason"}'
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.0 (darwin15.0.0 x86_64) ruby/2.3.0p0
|
16
|
+
Content-Type:
|
17
|
+
- application/json
|
18
|
+
Content-Length:
|
19
|
+
- '24'
|
20
|
+
Host:
|
21
|
+
- pg-sandbox.paymaya.com
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Date:
|
28
|
+
- Wed, 28 Dec 2016 17:09:39 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Content-Length:
|
32
|
+
- '418'
|
33
|
+
Connection:
|
34
|
+
- close
|
35
|
+
Access-Control-Allow-Origin:
|
36
|
+
- "*"
|
37
|
+
Etag:
|
38
|
+
- W/"1a2-kRKMzgp9svMkQPps/aWMZg"
|
39
|
+
X-Content-Type-Options:
|
40
|
+
- nosniff
|
41
|
+
X-Frame-Options:
|
42
|
+
- DENY
|
43
|
+
X-Xss-Protection:
|
44
|
+
- 1; mode=block
|
45
|
+
Via:
|
46
|
+
- kong/0.4.2
|
47
|
+
body:
|
48
|
+
encoding: UTF-8
|
49
|
+
string: '{"id":"4873e908-0a78-416b-b2f4-432080e6ee85","isPaid":false,"status":"VOIDED","amount":100,"currency":"PHP","createdAt":"2016-12-28T17:07:41.000Z","updatedAt":"2016-12-28T17:09:39.000Z","description":"Charge
|
50
|
+
for ysadcsantos@gmail.com","paymentTokenId":"Vnb2kkHJ5FkzJ8gE3RZquLRe7iKsEVe9V75e2pwWyMH0jeY94VU5XAq5KF7MQAA3xpK6SfxmQfFpusAHIZtgJW2r6rcEu47CE9W5ExsrBAQPgcCVvOa4ymp4GxCAQFmqb36sWxk2MSeZNXg3HlP6B4hE7Ab2G9Nyaac"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Wed, 28 Dec 2016 17:09:48 GMT
|
53
|
+
recorded_with: VCR 3.0.3
|
data/lib/paymaya.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'paymaya/version'
|
3
|
+
require 'paymaya/helper'
|
4
|
+
require 'paymaya/configuration'
|
5
|
+
require 'paymaya/checkout/webhook'
|
6
|
+
require 'paymaya/checkout/customization'
|
7
|
+
require 'paymaya/checkout/checkout'
|
8
|
+
require 'paymaya/payment_vault/card_vault/customer'
|
9
|
+
require 'paymaya/payment_vault/card_vault/card'
|
10
|
+
require 'paymaya/payment_vault/card_vault/payment'
|
11
|
+
require 'paymaya/payment_vault/card_vault/subscription'
|
12
|
+
require 'paymaya/payment_vault/payment'
|
13
|
+
require 'paymaya/payment_vault/payment_token'
|
14
|
+
require 'paymaya/payment_vault/webhook'
|
15
|
+
|
16
|
+
module Paymaya
|
17
|
+
class << self
|
18
|
+
attr_accessor :configuration
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.config
|
22
|
+
@configuration ||= Configuration.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.configure
|
26
|
+
yield(config)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'rest-client'
|
3
|
+
|
4
|
+
require 'paymaya/helper'
|
5
|
+
|
6
|
+
module Paymaya
|
7
|
+
module Checkout
|
8
|
+
module Checkout
|
9
|
+
def self.create(total_amount:, buyer:, items:, redirect_url: nil,
|
10
|
+
request_reference_number: nil, metadata: nil)
|
11
|
+
currency = total_amount[:currency]
|
12
|
+
payload = { total_amount: Helper.stringify_numbers(total_amount, currency),
|
13
|
+
buyer: buyer, items: Helper.stringify_numbers(items, currency) }
|
14
|
+
payload[:redirect_url] = redirect_url unless redirect_url.nil?
|
15
|
+
unless request_reference_number.nil?
|
16
|
+
payload[:request_reference_number] = request_reference_number
|
17
|
+
end
|
18
|
+
payload[:metadata] = metadata unless metadata.nil?
|
19
|
+
Helper.request(:post, checkout_url, payload,
|
20
|
+
Helper.checkout_public_auth_headers)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.retrieve(id)
|
24
|
+
Helper.request(:get, "#{checkout_url}/#{id}", {},
|
25
|
+
Helper.checkout_secret_auth_headers)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.checkout_url
|
29
|
+
"#{Paymaya.config.base_url}/checkout/v1/checkouts"
|
30
|
+
end
|
31
|
+
|
32
|
+
private_class_method :checkout_url
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|