veritrans 1.2.6 → 2.0.0beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +13 -5
  2. data/.gitignore +4 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +111 -0
  6. data/README.md +258 -0
  7. data/Rakefile +7 -0
  8. data/api_reference.md +219 -0
  9. data/bin/veritrans +59 -48
  10. data/example/index.erb +118 -0
  11. data/example/response.erb +28 -0
  12. data/example/sinatra.rb +76 -0
  13. data/example/style.css +45 -0
  14. data/example/veritrans.yml +12 -0
  15. data/lib/generators/templates/assets/credit_card_form.js +50 -0
  16. data/lib/generators/templates/payments_controller.rb +81 -0
  17. data/lib/generators/templates/veritrans.rb +43 -0
  18. data/lib/generators/templates/veritrans.yml +13 -0
  19. data/lib/generators/templates/views/_credit_card_form.erb +42 -0
  20. data/lib/generators/templates/views/_veritrans_include.erb +10 -0
  21. data/lib/generators/templates/views/payments/create.erb +15 -0
  22. data/lib/generators/templates/views/payments/new.erb +6 -0
  23. data/lib/generators/veritrans/install_generator.rb +32 -0
  24. data/lib/generators/veritrans/payment_form_generator.rb +45 -0
  25. data/lib/veritrans/api.rb +90 -0
  26. data/lib/veritrans/cli.rb +166 -0
  27. data/lib/veritrans/client.rb +77 -209
  28. data/lib/veritrans/config.rb +48 -62
  29. data/lib/veritrans/events.rb +125 -0
  30. data/lib/veritrans/result.rb +81 -0
  31. data/lib/veritrans/version.rb +1 -41
  32. data/lib/veritrans.rb +79 -15
  33. data/license.txt +202 -0
  34. data/spec/cli_spec.rb +86 -0
  35. data/spec/configs/veritrans.yml +7 -0
  36. data/spec/configs/veritrans_flat.yml +2 -0
  37. data/spec/fixtures/approve_failed.yml +48 -0
  38. data/spec/fixtures/cancel_failed.yml +48 -0
  39. data/spec/fixtures/cancel_success.yml +106 -0
  40. data/spec/fixtures/capture_failed.yml +48 -0
  41. data/spec/fixtures/charge.yml +50 -0
  42. data/spec/fixtures/charge_direct.yml +56 -0
  43. data/spec/fixtures/charge_vtweb.yml +50 -0
  44. data/spec/fixtures/cli_test_1111-not-exists.yml +45 -0
  45. data/spec/fixtures/cli_test_not_exists.yml +45 -0
  46. data/spec/fixtures/cli_test_real_txn.yml +55 -0
  47. data/spec/fixtures/cli_test_unauthorized.yml +47 -0
  48. data/spec/fixtures/events_test_real_txn.yml +55 -0
  49. data/spec/fixtures/status_fail.yml +46 -0
  50. data/spec/fixtures/status_success.yml +109 -0
  51. data/spec/spec_helper.rb +29 -0
  52. data/spec/veritrans_client_spec.rb +83 -0
  53. data/spec/veritrans_config_spec.rb +48 -0
  54. data/spec/veritrans_events_spec.rb +70 -0
  55. data/spec/veritrans_logger_spec.rb +46 -0
  56. data/testing_webhooks.md +80 -0
  57. data/veritrans.gemspec +23 -0
  58. metadata +82 -31
  59. data/config/veritrans.yml +0 -24
  60. data/lib/generators/install_generator.rb +0 -78
  61. data/lib/generators/templates/app/controllers/vtlink/merchant_controller.rb +0 -7
  62. data/lib/generators/templates/app/controllers/vtlink/veritrans_controller.rb +0 -112
  63. data/lib/generators/templates/app/views/layouts/layout_auto_post.html.erb +0 -15
  64. data/lib/generators/templates/app/views/vtlink/merchant/checkout.html.erb +0 -43
  65. data/lib/generators/templates/app/views/vtlink/veritrans/cancel.html.erb +0 -2
  66. data/lib/generators/templates/app/views/vtlink/veritrans/confirm.html.erb +0 -13
  67. data/lib/generators/templates/app/views/vtlink/veritrans/error.html.erb +0 -2
  68. data/lib/generators/templates/app/views/vtlink/veritrans/finish.html.erb +0 -2
  69. data/lib/generators/templates/app/views/vtlink/veritrans/pay.html.erb +0 -2
  70. data/lib/generators/templates/config/veritrans.yml +0 -13
  71. data/lib/veritrans/hash_generator.rb +0 -19
  72. data/lib/veritrans/post_data.rb +0 -163
  73. data/lib/veritrans/v_t_direct.rb +0 -145
data/spec/cli_spec.rb ADDED
@@ -0,0 +1,86 @@
1
+ describe Veritrans do
2
+
3
+ before do
4
+ stub_const("CONFIG", {})
5
+
6
+ stub_request(:any, /.*example.*/).to_return(lambda { |req|
7
+ @request = req
8
+ {body: "ok", status: 200}
9
+ })
10
+ end
11
+
12
+ it "should send json" do
13
+ silence_stream(STDOUT) do
14
+ Veritrans::CLI.test_webhook(["http://example.com"])
15
+ end
16
+
17
+ data = ActiveSupport::JSON.decode(@request.body)
18
+ data.class.should == String
19
+ data = ActiveSupport::JSON.decode(data)
20
+
21
+ data["status_code"].should == "200"
22
+ data["status_message"].should == "Veritrans payment notification"
23
+ data["payment_type"].should == "credit_card"
24
+
25
+ @request.headers["Content-Type"].should == "application/json"
26
+ @request.headers["User-Agent"].should == "Veritrans gem #{Veritrans::VERSION} - webhook tester"
27
+ end
28
+
29
+ it "should raise error if payment not found" do
30
+ CONFIG[:order] = "1111-not-exists"
31
+ CONFIG[:config_path] = "./example/veritrans.yml"
32
+
33
+ VCR.use_cassette("cli_test_not_exists") do
34
+ silence_stream(STDOUT) do
35
+ expect {
36
+ Veritrans::CLI.test_webhook(["http://example.com"])
37
+ }.to raise_error(Veritrans::CLI::OrderNotFound)
38
+ end
39
+ end
40
+ end
41
+
42
+ it "should raise error if can't find config" do
43
+ CONFIG[:order] = "1111-not-exists"
44
+ CONFIG[:config_path] = "./wrong/folder/veritrans.yml"
45
+
46
+ silence_stream(STDOUT) do
47
+ expect {
48
+ Veritrans::CLI.test_webhook(["http://example.com"])
49
+ }.to raise_error(ArgumentError, /Can not find config at .+/)
50
+ end
51
+ end
52
+
53
+ it "should raise error if authentication failed" do
54
+ CONFIG[:order] = "1111-not-exists"
55
+ CONFIG[:config_path] = "./spec/configs/veritrans.yml"
56
+
57
+ VCR.use_cassette("cli_test_unauthorized") do
58
+ silence_stream(STDOUT) do
59
+ expect {
60
+ Veritrans::CLI.test_webhook(["http://example.com"])
61
+ }.to raise_error(Veritrans::CLI::AuthenticationError, /Access denied due to unauthorized transaction/)
62
+ end
63
+ end
64
+ end
65
+
66
+ it "should send real data as json" do
67
+ CONFIG[:order] = "testing-0.2703-1415600236"
68
+ CONFIG[:config_path] = "./example/veritrans.yml"
69
+
70
+ VCR.use_cassette("cli_test_real_txn") do
71
+ silence_stream(STDOUT) do
72
+ Veritrans::CLI.test_webhook(["http://example.com"])
73
+ end
74
+ end
75
+
76
+ data = ActiveSupport::JSON.decode(@request.body)
77
+ data.class.should == String
78
+ data = ActiveSupport::JSON.decode(data)
79
+
80
+ data["status_code"].should == "200"
81
+ data["status_message"].should == "Veritrans payment notification"
82
+ data["payment_type"].should == "credit_card"
83
+ data["transaction_status"].should == "settlement"
84
+ data["approval_code"].should == "1415600254322"
85
+ end
86
+ end
@@ -0,0 +1,7 @@
1
+ development:
2
+ client_key: spec_client_key
3
+ server_key: spec_server_key
4
+ test:
5
+ client_key: test_client_key
6
+ server_key: test_server_key
7
+
@@ -0,0 +1,2 @@
1
+ client_key: flat_client_key
2
+ server_key: flat_server_key
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/not-exists/cancel
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx/1.5.13
25
+ Date:
26
+ - Tue, 04 Nov 2014 14:21:46 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '87'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - Wed, 31 Dec 1969 17:00:00 GMT
39
+ body:
40
+ encoding: UTF-8
41
+ string: |-
42
+ {
43
+ "status_code" : "404",
44
+ "status_message" : "The requested resource is not found"
45
+ }
46
+ http_version:
47
+ recorded_at: Tue, 04 Nov 2014 14:20:14 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/not-exists/cancel
6
+ body:
7
+ encoding: UTF-8
8
+ string: "{}"
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx/1.5.13
25
+ Date:
26
+ - Tue, 04 Nov 2014 14:18:37 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '87'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - Wed, 31 Dec 1969 17:00:00 GMT
39
+ body:
40
+ encoding: UTF-8
41
+ string: |-
42
+ {
43
+ "status_code" : "404",
44
+ "status_message" : "The requested resource is not found"
45
+ }
46
+ http_version:
47
+ recorded_at: Tue, 04 Nov 2014 14:17:06 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,106 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/charge
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"payment_type":"permata","transaction_details":{"order_id":1415110696,"gross_amount":100000}}'
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx/1.5.13
25
+ Date:
26
+ - Tue, 04 Nov 2014 14:19:48 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '381'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - Wed, 31 Dec 1969 17:00:00 GMT
39
+ body:
40
+ encoding: UTF-8
41
+ string: |-
42
+ {
43
+ "status_code" : "201",
44
+ "status_message" : "Success, PERMATA VA transaction is successful",
45
+ "transaction_id" : "d8757b8a-b97e-4881-9f55-69f6db6f4006",
46
+ "order_id" : "1415110696",
47
+ "payment_type" : "bank_transfer",
48
+ "transaction_time" : "2014-11-04 21:20:07",
49
+ "transaction_status" : "pending",
50
+ "permata_va_number" : "8778990000000023",
51
+ "gross_amount" : "100000.00"
52
+ }
53
+ http_version:
54
+ recorded_at: Tue, 04 Nov 2014 14:18:17 GMT
55
+ - request:
56
+ method: post
57
+ uri: https://api.sandbox.veritrans.co.id/v2/1415110696/cancel
58
+ body:
59
+ encoding: UTF-8
60
+ string: "{}"
61
+ headers:
62
+ User-Agent:
63
+ - Veritrans ruby gem 2.0.0beta
64
+ Authorization:
65
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
66
+ Accept:
67
+ - application/json
68
+ Content-Type:
69
+ - application/json
70
+ response:
71
+ status:
72
+ code: 200
73
+ message: ''
74
+ headers:
75
+ Server:
76
+ - nginx/1.5.13
77
+ Date:
78
+ - Tue, 04 Nov 2014 14:19:48 GMT
79
+ Content-Type:
80
+ - application/json
81
+ Content-Length:
82
+ - '323'
83
+ Connection:
84
+ - keep-alive
85
+ Cache-Control:
86
+ - no-cache
87
+ Pragma:
88
+ - no-cache
89
+ Expires:
90
+ - Wed, 31 Dec 1969 17:00:00 GMT
91
+ body:
92
+ encoding: UTF-8
93
+ string: |-
94
+ {
95
+ "status_code" : "200",
96
+ "status_message" : "Success, transaction is canceled",
97
+ "transaction_id" : "d8757b8a-b97e-4881-9f55-69f6db6f4006",
98
+ "order_id" : "1415110696",
99
+ "payment_type" : "bank_transfer",
100
+ "transaction_time" : "2014-11-04 21:20:07",
101
+ "transaction_status" : "cancel",
102
+ "gross_amount" : "100000.00"
103
+ }
104
+ http_version:
105
+ recorded_at: Tue, 04 Nov 2014 14:18:17 GMT
106
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/capture
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"transaction_id":"not-exists","gross_amount":1000}'
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx/1.5.13
25
+ Date:
26
+ - Tue, 04 Nov 2014 14:23:44 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '87'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - Wed, 31 Dec 1969 17:00:00 GMT
39
+ body:
40
+ encoding: UTF-8
41
+ string: |-
42
+ {
43
+ "status_code" : "404",
44
+ "status_message" : "The requested resource is not found"
45
+ }
46
+ http_version:
47
+ recorded_at: Tue, 04 Nov 2014 14:22:12 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/charge
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"payment_type":"VTWEB","transaction_details":{"order_id":"2014-11-04
9
+ 20:58:14 +0700","gross_amount":100000}}'
10
+ headers:
11
+ User-Agent:
12
+ - excon/0.40.0
13
+ Authorization:
14
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
15
+ Accept:
16
+ - application/json
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: ''
23
+ headers:
24
+ Server:
25
+ - nginx/1.5.13
26
+ Date:
27
+ - Tue, 04 Nov 2014 13:59:46 GMT
28
+ Content-Type:
29
+ - application/json
30
+ Content-Length:
31
+ - '217'
32
+ Connection:
33
+ - keep-alive
34
+ Cache-Control:
35
+ - no-cache
36
+ Pragma:
37
+ - no-cache
38
+ Expires:
39
+ - Wed, 31 Dec 1969 17:00:00 GMT
40
+ body:
41
+ encoding: UTF-8
42
+ string: |-
43
+ {
44
+ "status_code" : "201",
45
+ "status_message" : "OK, success do VTWeb transaction, please go to redirect_url",
46
+ "redirect_url" : "https://vtweb.sandbox.veritrans.co.id/v2/vtweb/f523ecff-34e7-4791-a558-3f579f731b75"
47
+ }
48
+ http_version:
49
+ recorded_at: Tue, 04 Nov 2014 13:58:15 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/charge
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"payment_type":"permata","transaction_details":{"order_id":"2014-11-04
9
+ 21:06:32 +0700","gross_amount":100000}}'
10
+ headers:
11
+ User-Agent:
12
+ - Veritrans ruby gem 2.0.0beta
13
+ Authorization:
14
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
15
+ Accept:
16
+ - application/json
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: ''
23
+ headers:
24
+ Server:
25
+ - nginx/1.5.13
26
+ Date:
27
+ - Tue, 04 Nov 2014 14:08:04 GMT
28
+ Content-Type:
29
+ - application/json
30
+ Content-Length:
31
+ - '396'
32
+ Connection:
33
+ - keep-alive
34
+ Cache-Control:
35
+ - no-cache
36
+ Pragma:
37
+ - no-cache
38
+ Expires:
39
+ - Wed, 31 Dec 1969 17:00:00 GMT
40
+ body:
41
+ encoding: UTF-8
42
+ string: |-
43
+ {
44
+ "status_code" : "201",
45
+ "status_message" : "Success, PERMATA VA transaction is successful",
46
+ "transaction_id" : "3544730a-e5ca-46b6-9512-233c37670500",
47
+ "order_id" : "2014-11-04 21:06:32 +0700",
48
+ "payment_type" : "bank_transfer",
49
+ "transaction_time" : "2014-11-04 21:08:23",
50
+ "transaction_status" : "pending",
51
+ "permata_va_number" : "8778990000000019",
52
+ "gross_amount" : "100000.00"
53
+ }
54
+ http_version:
55
+ recorded_at: Tue, 04 Nov 2014 14:06:33 GMT
56
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.veritrans.co.id/v2/charge
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"payment_type":"vtweb","transaction_details":{"order_id":"2014-11-04
9
+ 21:10:15 +0700","gross_amount":100000}}'
10
+ headers:
11
+ User-Agent:
12
+ - Veritrans ruby gem 2.0.0beta
13
+ Authorization:
14
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
15
+ Accept:
16
+ - application/json
17
+ Content-Type:
18
+ - application/json
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: ''
23
+ headers:
24
+ Server:
25
+ - nginx/1.5.13
26
+ Date:
27
+ - Tue, 04 Nov 2014 14:11:46 GMT
28
+ Content-Type:
29
+ - application/json
30
+ Content-Length:
31
+ - '217'
32
+ Connection:
33
+ - keep-alive
34
+ Cache-Control:
35
+ - no-cache
36
+ Pragma:
37
+ - no-cache
38
+ Expires:
39
+ - Wed, 31 Dec 1969 17:00:00 GMT
40
+ body:
41
+ encoding: UTF-8
42
+ string: |-
43
+ {
44
+ "status_code" : "201",
45
+ "status_message" : "OK, success do VTWeb transaction, please go to redirect_url",
46
+ "redirect_url" : "https://vtweb.sandbox.veritrans.co.id/v2/vtweb/aff32361-ad6b-4e3f-9173-95b057e68157"
47
+ }
48
+ http_version:
49
+ recorded_at: Tue, 04 Nov 2014 14:10:15 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.sandbox.veritrans.co.id/v2/1111-not-exists/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 01 Dec 2014 05:19:25 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - keep-alive
31
+ Cache-Control:
32
+ - no-cache
33
+ Pragma:
34
+ - no-cache
35
+ Expires:
36
+ - Wed, 31 Dec 1969 17:00:00 GMT
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubdomains;
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! "{\n \"status_code\" : \"404\",\n \"status_message\" : \"The requested
42
+ resource is not found\"\n}"
43
+ http_version:
44
+ recorded_at: Mon, 01 Dec 2014 05:19:46 GMT
45
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.sandbox.veritrans.co.id/v2/1111-not-exists/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 01 Dec 2014 08:10:32 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Connection:
30
+ - keep-alive
31
+ Cache-Control:
32
+ - no-cache
33
+ Pragma:
34
+ - no-cache
35
+ Expires:
36
+ - Wed, 31 Dec 1969 17:00:00 GMT
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubdomains;
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! "{\n \"status_code\" : \"404\",\n \"status_message\" : \"The requested
42
+ resource is not found\"\n}"
43
+ http_version:
44
+ recorded_at: Mon, 01 Dec 2014 08:10:52 GMT
45
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,55 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.sandbox.veritrans.co.id/v2/testing-0.2703-1415600236/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Veritrans ruby gem 2.0.0beta
12
+ Authorization:
13
+ - Basic VlQtc2VydmVyLTlIdGItUnhYa2c3LTdoem5TQ0NqeHZvWTo=
14
+ Accept:
15
+ - application/json
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: ''
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Mon, 01 Dec 2014 08:23:11 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '602'
31
+ Connection:
32
+ - keep-alive
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Expires:
38
+ - Wed, 31 Dec 1969 17:00:00 GMT
39
+ Vary:
40
+ - Accept-Encoding, User-Agent
41
+ Strict-Transport-Security:
42
+ - max-age=31536000; includeSubdomains;
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ! "{\n \"status_code\" : \"200\",\n \"status_message\" : \"Success,
46
+ transaction found\",\n \"transaction_id\" : \"b1cbcc66-5608-4af1-a3ed-0f152f9ed871\",\n
47
+ \ \"masked_card\" : \"481111-1114\",\n \"order_id\" : \"testing-0.2703-1415600236\",\n
48
+ \ \"payment_type\" : \"credit_card\",\n \"transaction_time\" : \"2014-11-10
49
+ 13:17:33\",\n \"transaction_status\" : \"settlement\",\n \"fraud_status\"
50
+ : \"accept\",\n \"approval_code\" : \"1415600254322\",\n \"signature_key\"
51
+ : \"90da23d37a4ba8fc717990c35240948ab5a97cad71e46777de77b0fe468ffac8624dc09a80a422671f1f9a56f20956ccbe16c91074327c0ba5a33c8974c8973c\",\n
52
+ \ \"bank\" : \"bni\",\n \"gross_amount\" : \"30000.00\"\n}"
53
+ http_version:
54
+ recorded_at: Mon, 01 Dec 2014 08:23:31 GMT
55
+ recorded_with: VCR 2.9.3