active_merchant-epsilon 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.env.sample +3 -0
  3. data/.gitignore +17 -0
  4. data/CHANGELOG.md +29 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +256 -0
  8. data/Rakefile +19 -0
  9. data/active_merchant-epsilon.gemspec +31 -0
  10. data/lib/active_merchant/billing/convenience_store.rb +55 -0
  11. data/lib/active_merchant/billing/gateways/epsilon.rb +194 -0
  12. data/lib/active_merchant/billing/gateways/epsilon/epsilon_base.rb +132 -0
  13. data/lib/active_merchant/billing/gateways/epsilon/epsilon_mission_code.rb +30 -0
  14. data/lib/active_merchant/billing/gateways/epslion_convenience_store.rb +27 -0
  15. data/lib/active_merchant/epsilon.rb +9 -0
  16. data/lib/active_merchant/epsilon/version.rb +5 -0
  17. data/test/fixtures/vcr_cassettes/autheticate_three_d_secure_card_successful.yml +46 -0
  18. data/test/fixtures/vcr_cassettes/cancel_recurring_fail.yml +82 -0
  19. data/test/fixtures/vcr_cassettes/cancel_recurring_successful.yml +83 -0
  20. data/test/fixtures/vcr_cassettes/change_recurring_amount_failure.yml +85 -0
  21. data/test/fixtures/vcr_cassettes/change_recurring_amount_successful.yml +85 -0
  22. data/test/fixtures/vcr_cassettes/convenience_store_purchase_fail.yml +39 -0
  23. data/test/fixtures/vcr_cassettes/convenience_store_purchase_successful.yml +50 -0
  24. data/test/fixtures/vcr_cassettes/find_user_failure.yml +44 -0
  25. data/test/fixtures/vcr_cassettes/find_user_success.yml +44 -0
  26. data/test/fixtures/vcr_cassettes/installment_purchase_successful.yml +46 -0
  27. data/test/fixtures/vcr_cassettes/purchase_fail.yml +45 -0
  28. data/test/fixtures/vcr_cassettes/purchase_successful.yml +46 -0
  29. data/test/fixtures/vcr_cassettes/purchase_with_three_d_secure_card_successful.yml +45 -0
  30. data/test/fixtures/vcr_cassettes/purchase_with_verification_value.yml +46 -0
  31. data/test/fixtures/vcr_cassettes/recurring_fail.yml +45 -0
  32. data/test/fixtures/vcr_cassettes/recurring_successful.yml +46 -0
  33. data/test/fixtures/vcr_cassettes/registered_purchase_fail.yml +45 -0
  34. data/test/fixtures/vcr_cassettes/registered_purchase_successful.yml +46 -0
  35. data/test/fixtures/vcr_cassettes/registered_recurring_fail.yml +45 -0
  36. data/test/fixtures/vcr_cassettes/registered_recurring_successful.yml +46 -0
  37. data/test/fixtures/vcr_cassettes/revolving_purchase_successful.yml +46 -0
  38. data/test/fixtures/vcr_cassettes/terminate_recurring_fail.yml +96 -0
  39. data/test/fixtures/vcr_cassettes/terminate_recurring_successful.yml +82 -0
  40. data/test/fixtures/vcr_cassettes/verify_fail.yml +45 -0
  41. data/test/fixtures/vcr_cassettes/verify_successful.yml +85 -0
  42. data/test/fixtures/vcr_cassettes/void_fail.yml +42 -0
  43. data/test/fixtures/vcr_cassettes/void_successful.yml +85 -0
  44. data/test/remote/gateways/remote_epsilon_convenience_store_test.rb +27 -0
  45. data/test/remote/gateways/remote_epsilon_test.rb +249 -0
  46. data/test/test_helper.rb +162 -0
  47. data/test/unit/gateways/epsilon_test.rb +11 -0
  48. data/wercker.yml +18 -0
  49. metadata +248 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1416470209&user_name=YAMADA+TARO&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O1416471014&st_code=10000-0000-0000&mission_code=&item_price=10000&process_code=2&xml=1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 20 Nov 2014 08:10:18 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="909" />
38
+ <result err_detail="%89%DB%8B%E0%8B%E6%95%AA%82%CC%8Ew%92%E8%82%AA%88%D9%8F%ED%82%C5%82%B7" />
39
+ <result pareq="" />
40
+ <result result="9" />
41
+ <result trans_code="" />
42
+ </Epsilon_result>
43
+ http_version:
44
+ recorded_at: Thu, 20 Nov 2014 08:10:15 GMT
45
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1416470209&user_name=YAMADA+TARO&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O1416470378&st_code=10000-0000-0000&mission_code=6&item_price=10000&process_code=2&xml=1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 20 Nov 2014 07:59:42 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="" />
38
+ <result err_detail="" />
39
+ <result kari_flag="0" />
40
+ <result pareq="" />
41
+ <result result="1" />
42
+ <result trans_code="498274" />
43
+ </Epsilon_result>
44
+ http_version:
45
+ recorded_at: Thu, 20 Nov 2014 07:59:40 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1429255811&user_name=TARO+YAMADA&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O11681474&mission_code=1&item_price=10000&process_code=1&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.4.0&st_code=10000-0000-0000&card_number=4242424242424242&expire_y=2016&expire_m=10&card_st_code=80&pay_time=&security_code=000&security_check=1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Fri, 17 Apr 2015 07:30:12 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="" />
38
+ <result err_detail="" />
39
+ <result kari_flag="0" />
40
+ <result pareq="" />
41
+ <result result="1" />
42
+ <result trans_code="524519" />
43
+ </Epsilon_result>
44
+ http_version:
45
+ recorded_at: Fri, 17 Apr 2015 07:30:13 GMT
46
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,96 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1433840422&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O22389866&st_code=10000-0000-0000&mission_code=2&item_price=10000&process_code=1&card_number=4242424242424242&expire_y=2016&expire_m=10&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.5.0
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 09 Jun 2015 09:00:22 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="" />
38
+ <result err_detail="" />
39
+ <result kari_flag="0" />
40
+ <result pareq="" />
41
+ <result result="1" />
42
+ <result trans_code="534678" />
43
+ </Epsilon_result>
44
+ http_version:
45
+ recorded_at: Tue, 09 Jun 2015 09:00:23 GMT
46
+ - request:
47
+ method: post
48
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
49
+ body:
50
+ encoding: US-ASCII
51
+ string: contract_code=[CONTRACT_CODE]&user_id=U1433840422wrong&xml=1&process_code=9
52
+ headers:
53
+ Content-Type:
54
+ - application/x-www-form-urlencoded
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ Accept:
58
+ - "*/*"
59
+ User-Agent:
60
+ - Ruby
61
+ response:
62
+ status:
63
+ code: 500
64
+ message: Internal Server Error
65
+ headers:
66
+ Date:
67
+ - Tue, 09 Jun 2015 09:00:24 GMT
68
+ Server:
69
+ - Apache
70
+ Content-Length:
71
+ - '535'
72
+ Connection:
73
+ - close
74
+ Content-Type:
75
+ - text/html; charset=iso-8859-1
76
+ body:
77
+ encoding: UTF-8
78
+ string: |
79
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
80
+ <html><head>
81
+ <title>500 Internal Server Error</title>
82
+ </head><body>
83
+ <h1>Internal Server Error</h1>
84
+ <p>The server encountered an internal error or
85
+ misconfiguration and was unable to complete
86
+ your request.</p>
87
+ <p>Please contact the server administrator,
88
+ you@example.com and inform them of the time the error occurred,
89
+ and anything you might have done that may have
90
+ caused the error.</p>
91
+ <p>More information about this error may be available
92
+ in the server error log.</p>
93
+ </body></html>
94
+ http_version:
95
+ recorded_at: Tue, 09 Jun 2015 09:00:24 GMT
96
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,82 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1433839922&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O2281725&st_code=10000-0000-0000&mission_code=2&item_price=10000&process_code=1&card_number=4242424242424242&expire_y=2016&expire_m=10&card_st_code=&pay_time=&tds_check_code=&user_agent=ActiveMerchant%3A%3AEpsilon-0.5.0
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 09 Jun 2015 08:52:02 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="" />
38
+ <result err_detail="" />
39
+ <result kari_flag="0" />
40
+ <result pareq="" />
41
+ <result result="1" />
42
+ <result trans_code="534647" />
43
+ </Epsilon_result>
44
+ http_version:
45
+ recorded_at: Tue, 09 Jun 2015 08:52:03 GMT
46
+ - request:
47
+ method: post
48
+ uri: https://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi
49
+ body:
50
+ encoding: US-ASCII
51
+ string: contract_code=[CONTRACT_CODE]&user_id=U1433839922&xml=1&process_code=9
52
+ headers:
53
+ Content-Type:
54
+ - application/x-www-form-urlencoded
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ Accept:
58
+ - "*/*"
59
+ User-Agent:
60
+ - Ruby
61
+ response:
62
+ status:
63
+ code: 200
64
+ message: OK
65
+ headers:
66
+ Date:
67
+ - Tue, 09 Jun 2015 08:52:03 GMT
68
+ Server:
69
+ - Apache
70
+ Transfer-Encoding:
71
+ - chunked
72
+ Content-Type:
73
+ - text/xml
74
+ body:
75
+ encoding: UTF-8
76
+ string: "<?xml version=\"1.0\" encoding=\"x-sjis-cp932\" ?>\r\n <Epsilon_result>\r\n
77
+ \ <result result=\"1\" />\r\n <result user_id=\"U1433839922\" />\r\n
78
+ \ <result user_name=\"YAMADA%20Taro\" />\r\n <result memo1=\"\" />\r\n
79
+ \ <result memo2=\"\" />\r\n </Epsilon_result>\r\n"
80
+ http_version:
81
+ recorded_at: Tue, 09 Jun 2015 08:52:04 GMT
82
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1413355550&user_name=TARO+YAMADA&user_mail_add=yamada-taro%40example.com&item_code=verifycreditcard&item_name=verify+credit+card&order_number=1413355550U1413355550&st_code=10000-0000-0000&mission_code=1&item_price=1&process_code=1&card_number=0000000000000000&expire_y=2015&expire_m=10&user_agent=ActiveMerchant%3A%3AEpsilon-0.0.1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Wed, 15 Oct 2014 06:45:50 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="601" />
38
+ <result err_detail="%82%B2%97%98%97p%82%CC%93X%95%DC%82%C5%82%CD%97%98%97p%82%C5%82%AB%82%C8%82%A2%83J%81%5B%83h%94%D4%8D%86%82%C5%82%B7%81B%8D%C4%93x%93%FC%97%CD%82%A8%8A%E8%82%A2%82%A2%82%BD%82%B5%82%DC%82%B7%81B" />
39
+ <result pareq="" />
40
+ <result result="0" />
41
+ <result trans_code="494191" />
42
+ </Epsilon_result>
43
+ http_version:
44
+ recorded_at: Wed, 15 Oct 2014 06:45:52 GMT
45
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,85 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://beta.epsilon.jp/cgi-bin/order/direct_card_payment.cgi
6
+ body:
7
+ encoding: US-ASCII
8
+ string: contract_code=[CONTRACT_CODE]&user_id=U1413355542&user_name=TARO+YAMADA&user_mail_add=yamada-taro%40example.com&item_code=verifycreditcard&item_name=verify+credit+card&order_number=1413355542U1413355542&st_code=10000-0000-0000&mission_code=1&item_price=1&process_code=1&card_number=4242424242424242&expire_y=2015&expire_m=10&user_agent=ActiveMerchant%3A%3AEpsilon-0.0.1
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Wed, 15 Oct 2014 06:45:42 GMT
25
+ Server:
26
+ - Apache
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Content-Type:
30
+ - text/xml; charset=CP932
31
+ body:
32
+ encoding: UTF-8
33
+ string: |-
34
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
35
+ <Epsilon_result>
36
+ <result acsurl="" />
37
+ <result err_code="" />
38
+ <result err_detail="" />
39
+ <result kari_flag="1" />
40
+ <result pareq="" />
41
+ <result result="1" />
42
+ <result trans_code="494187" />
43
+ </Epsilon_result>
44
+ http_version:
45
+ recorded_at: Wed, 15 Oct 2014 06:45:44 GMT
46
+ - request:
47
+ method: post
48
+ uri: https://beta.epsilon.jp/cgi-bin/order/cancel_payment.cgi
49
+ body:
50
+ encoding: US-ASCII
51
+ string: contract_code=[CONTRACT_CODE]&order_number=1413355542U1413355542
52
+ headers:
53
+ Content-Type:
54
+ - application/x-www-form-urlencoded
55
+ Accept-Encoding:
56
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
57
+ Accept:
58
+ - "*/*"
59
+ User-Agent:
60
+ - Ruby
61
+ response:
62
+ status:
63
+ code: 200
64
+ message: OK
65
+ headers:
66
+ Date:
67
+ - Wed, 15 Oct 2014 06:45:45 GMT
68
+ Server:
69
+ - Apache
70
+ Transfer-Encoding:
71
+ - chunked
72
+ Content-Type:
73
+ - text/xml; charset=CP932
74
+ body:
75
+ encoding: UTF-8
76
+ string: |-
77
+ <?xml version="1.0" encoding="x-sjis-cp932"?>
78
+ <Epsilon_result>
79
+ <result err_code="" />
80
+ <result err_detail="" />
81
+ <result result="1" />
82
+ </Epsilon_result>
83
+ http_version:
84
+ recorded_at: Wed, 15 Oct 2014 06:45:45 GMT
85
+ recorded_with: VCR 2.9.3