activemerchant-paymentech-orbital 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. data/.gitignore +3 -1
  2. data/Rakefile +8 -2
  3. data/VERSION +1 -1
  4. data/activemerchant-paymentech-orbital.gemspec +38 -19
  5. data/config/gateway.yml.example +6 -0
  6. data/lib/active_merchant/billing/{paymentech_orbital.rb → paymentech_orbital/gateway.rb} +5 -2
  7. data/lib/active_merchant/billing/paymentech_orbital/request.rb +12 -5
  8. data/lib/active_merchant/billing/paymentech_orbital/request/end_of_day.rb +4 -0
  9. data/lib/active_merchant/billing/paymentech_orbital/request/new_order.rb +20 -1
  10. data/lib/active_merchant/billing/paymentech_orbital/request/profile_management.rb +29 -2
  11. data/lib/active_merchant/billing/paymentech_orbital/request/void.rb +6 -0
  12. data/lib/active_merchant/billing/paymentech_orbital/response.rb +57 -4
  13. data/lib/activemerchant-paymentech-orbital.rb +1 -1
  14. data/test/factories.rb +55 -4
  15. data/test/remote/auth_capture_test.rb +101 -0
  16. data/test/remote/auth_test.rb +42 -0
  17. data/test/remote/existing_profile_test.rb +137 -0
  18. data/test/remote/profile_test.rb +72 -0
  19. data/test/remote/recurring_test.rb +160 -0
  20. data/test/remote/refund_test.rb +87 -0
  21. data/test/remote/retry_test.rb +51 -0
  22. data/test/remote_helper.rb +28 -0
  23. data/test/test_helper.rb +0 -1
  24. data/test/unit_helper.rb +2 -0
  25. data/test/{payment_orbital → units/paymentech_orbital}/gateway_test.rb +1 -1
  26. data/test/{payment_orbital → units/paymentech_orbital}/request/end_of_day_test.rb +1 -1
  27. data/test/{payment_orbital → units/paymentech_orbital}/request/new_order_test.rb +1 -1
  28. data/test/{payment_orbital → units/paymentech_orbital}/request/profile_management_test.rb +6 -2
  29. data/test/{payment_orbital → units/paymentech_orbital}/request/void_test.rb +1 -1
  30. data/test/{payment_orbital → units/paymentech_orbital}/request_test.rb +1 -1
  31. metadata +53 -23
@@ -0,0 +1,87 @@
1
+ require 'remote_helper'
2
+
3
+ class RefundTest < Test::Unit::TestCase
4
+ context "Refund" do
5
+ setup do
6
+ @gateway = remote_gateway
7
+ @address = Options(:billing_address)
8
+ end
9
+
10
+ context "with amex" do
11
+ setup do
12
+ @credit_card = Factory(:amex)
13
+ @profile = @gateway.profile(:create, @credit_card, {
14
+ :address => @address
15
+ })
16
+
17
+ @response = @gateway.refund(999, nil, {
18
+ :customer_ref_num => @profile.customer_ref_num,
19
+ :order_id => @@order_id
20
+ })
21
+ end
22
+
23
+ should "be successful" do
24
+ assert @response.success?, "should be successful overall"
25
+ assert @response.approved?, "should be approved"
26
+ assert @response.profile_proc_success?, "should save profile"
27
+ end
28
+ end
29
+
30
+ context "with discover" do
31
+ setup do
32
+ @credit_card = Factory(:discover)
33
+ @profile = @gateway.profile(:create, @credit_card, {
34
+ :address => @address
35
+ })
36
+ @response = @gateway.refund(999, nil, {
37
+ :customer_ref_num => @profile.customer_ref_num,
38
+ :order_id => @@order_id
39
+ })
40
+ end
41
+
42
+ should "be successful" do
43
+ assert @response.success?, "should be successful overall"
44
+ assert @response.approved?, "should be approved"
45
+ assert @response.profile_proc_success?, "should save profile"
46
+ end
47
+ end
48
+
49
+ context "with master_card" do
50
+ setup do
51
+ @credit_card = Factory(:master_card)
52
+ @profile = @gateway.profile(:create, @credit_card, {
53
+ :address => @address
54
+ })
55
+ @response = @gateway.refund(999, nil, {
56
+ :customer_ref_num => @profile.customer_ref_num,
57
+ :order_id => @@order_id
58
+ })
59
+ end
60
+
61
+ should "be successful" do
62
+ assert @response.success?, "should be successful overall"
63
+ assert @response.approved?, "should be approved"
64
+ assert @response.profile_proc_success?, "should save profile"
65
+ end
66
+ end
67
+
68
+ context "with visa" do
69
+ setup do
70
+ @credit_card = Factory(:visa)
71
+ @profile = @gateway.profile(:create, @credit_card, {
72
+ :address => @address
73
+ })
74
+ @response = @gateway.refund(999, nil, {
75
+ :customer_ref_num => @profile.customer_ref_num,
76
+ :order_id => @@order_id
77
+ })
78
+ end
79
+
80
+ should "be successful" do
81
+ assert @response.success?, "should be successful overall"
82
+ assert @response.approved?, "should be approved"
83
+ assert @response.profile_proc_success?, "should save profile"
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,51 @@
1
+ require 'remote_helper'
2
+
3
+ # Retry:
4
+ # Auth/Capture: Trace = 1
5
+ # Auth/Capture: Trace = 1
6
+ # Auth/Capture: Trace = 1
7
+
8
+ class RetryTest < Test::Unit::TestCase
9
+ def teardown; end
10
+
11
+ context "With a visa" do
12
+ setup do
13
+ @gateway = remote_gateway
14
+ @address = Options(:billing_address)
15
+ @credit_card = Factory(:visa)
16
+ end
17
+
18
+ should "prevent prevent duplicate requests when provided same trace number" do
19
+ @purchase_response = @gateway.purchase(999, @credit_card, {
20
+ :address => @address,
21
+ :headers => {
22
+ "Trace-number" => "1"
23
+ },
24
+ :order_id => @@order_id
25
+ })
26
+ assert @purchase_response.success?, "should be successful overall"
27
+ assert @purchase_response.approved?, "should be approved"
28
+ assert @purchase_response.profile_proc_success?, "should save profile"
29
+ row = @gateway.to_a
30
+ row.shift
31
+ @@csv << row.unshift("Auth/Capture: Trace = 1")
32
+
33
+ @auth_code = @purchase_response.auth_code
34
+
35
+ 2.times { |n|
36
+ dupe_response = @gateway.purchase(999, @credit_card, {
37
+ :address => @address,
38
+ :headers => {
39
+ "Trace-number" => "1"
40
+ },
41
+ :order_id => @@order_id
42
+ })
43
+ assert_equal @auth_code, dupe_response.auth_code
44
+
45
+ row = @gateway.to_a
46
+ row.shift
47
+ @@csv << row.unshift("Auth/Capture: Trace = 1")
48
+ }
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,28 @@
1
+ require 'test_helper'
2
+ require 'faster_csv'
3
+ require 'yaml'
4
+
5
+ class Test::Unit::TestCase
6
+ @@csv = nil
7
+ @@order_id = 0
8
+
9
+ def setup
10
+ @certification_file = "certification.csv"
11
+
12
+ unless @@csv
13
+ @@csv = FasterCSV.open(@certification_file, "w")
14
+ @@csv << [
15
+ "Request Type", "Date/Time", "MerchantID", "Order #",
16
+ "IndustryType", "Amount", "Currency", "CustomerRefNum",
17
+ "Phone", "Name", "Address", "Auth Code", "AVSResp",
18
+ "CSVResp", "TxRefNum", "CustomerRefNum", "ProfileProcStatus"
19
+ ]
20
+ end
21
+
22
+ @@order_id = @@order_id + 1
23
+ end
24
+
25
+ def teardown
26
+ @@csv << @gateway.to_a
27
+ end
28
+ end
@@ -2,7 +2,6 @@ require 'rubygems'
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  require 'activemerchant-paymentech-orbital'
4
4
  require 'options'
5
- require 'mocks/active_merchant/billing/gateway'
6
5
  require 'test/unit'
7
6
  require 'shoulda'
8
7
  require 'factory_girl'
@@ -0,0 +1,2 @@
1
+ require 'test_helper'
2
+ require 'mocks/active_merchant/billing/gateway'
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class GatewayTest < Test::Unit::TestCase
4
4
  context "Initializing" do
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class EndOfDayTest < Test::Unit::TestCase
4
4
  context "Initializing" do
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class NewOrderTest < Test::Unit::TestCase
4
4
  context "Initializing" do
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class ProfileManagementTest < Test::Unit::TestCase
4
4
  context "Initializing" do
@@ -23,7 +23,11 @@ class ProfileManagementTest < Test::Unit::TestCase
23
23
  :login, :password, :merchant_id,
24
24
  :bin, :terminal_id, :currency_code,
25
25
  :currency_exponent, :customer_ref_num,
26
- :order_id
26
+ :order_id, :mb_type, :mb_order_id_generation_method,
27
+ :mb_recurring_start_date, :mb_recurring_end_date,
28
+ :mb_recurring_max_billings, :mb_recurring_frequency,
29
+ :mb_deferred_bill_date, :mb_cancel_date,
30
+ :mb_restore_billing_date, :mb_remove_flag
27
31
  ])
28
32
  end
29
33
 
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class VoidTest < Test::Unit::TestCase
4
4
  context "Initializing" do
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'unit_helper'
2
2
 
3
3
  class RequestTest < Test::Unit::TestCase
4
4
  context "Initializing" do
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant-paymentech-orbital
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - John Corrigan
@@ -9,20 +14,24 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-03 00:00:00 -05:00
17
+ date: 2010-03-24 00:00:00 -04:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: activemerchant
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - "="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 4
30
+ - 2
23
31
  version: 1.4.2
24
- version:
25
- description: A gem to provide a ruby interface for Chase Paymentech Orbital payment gateway.
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: A gem to provide a ruby interface for Chase Paymentech Orbital payment gateway. It has been development thus far to meet specific ends, so not all functionality is present.
26
35
  email: john@mintdigital.com
27
36
  executables: []
28
37
 
@@ -39,7 +48,8 @@ files:
39
48
  - Rakefile
40
49
  - VERSION
41
50
  - activemerchant-paymentech-orbital.gemspec
42
- - lib/active_merchant/billing/paymentech_orbital.rb
51
+ - config/gateway.yml.example
52
+ - lib/active_merchant/billing/paymentech_orbital/gateway.rb
43
53
  - lib/active_merchant/billing/paymentech_orbital/request.rb
44
54
  - lib/active_merchant/billing/paymentech_orbital/request/end_of_day.rb
45
55
  - lib/active_merchant/billing/paymentech_orbital/request/new_order.rb
@@ -51,13 +61,22 @@ files:
51
61
  - test/factories.rb
52
62
  - test/mocks/active_merchant/billing/gateway.rb
53
63
  - test/options.rb
54
- - test/payment_orbital/gateway_test.rb
55
- - test/payment_orbital/request/end_of_day_test.rb
56
- - test/payment_orbital/request/new_order_test.rb
57
- - test/payment_orbital/request/profile_management_test.rb
58
- - test/payment_orbital/request/void_test.rb
59
- - test/payment_orbital/request_test.rb
64
+ - test/remote/auth_capture_test.rb
65
+ - test/remote/auth_test.rb
66
+ - test/remote/existing_profile_test.rb
67
+ - test/remote/profile_test.rb
68
+ - test/remote/recurring_test.rb
69
+ - test/remote/refund_test.rb
70
+ - test/remote/retry_test.rb
71
+ - test/remote_helper.rb
60
72
  - test/test_helper.rb
73
+ - test/unit_helper.rb
74
+ - test/units/paymentech_orbital/gateway_test.rb
75
+ - test/units/paymentech_orbital/request/end_of_day_test.rb
76
+ - test/units/paymentech_orbital/request/new_order_test.rb
77
+ - test/units/paymentech_orbital/request/profile_management_test.rb
78
+ - test/units/paymentech_orbital/request/void_test.rb
79
+ - test/units/paymentech_orbital/request_test.rb
61
80
  has_rdoc: true
62
81
  homepage: http://github.com/johnideal/activemerchant-paymentech-orbital
63
82
  licenses: []
@@ -71,18 +90,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
90
  requirements:
72
91
  - - ">="
73
92
  - !ruby/object:Gem::Version
93
+ segments:
94
+ - 0
74
95
  version: "0"
75
- version:
76
96
  required_rubygems_version: !ruby/object:Gem::Requirement
77
97
  requirements:
78
98
  - - ">="
79
99
  - !ruby/object:Gem::Version
100
+ segments:
101
+ - 0
80
102
  version: "0"
81
- version:
82
103
  requirements: []
83
104
 
84
105
  rubyforge_project:
85
- rubygems_version: 1.3.5
106
+ rubygems_version: 1.3.6
86
107
  signing_key:
87
108
  specification_version: 3
88
109
  summary: A gem to provide a ruby interface for Chase Paymentech Orbital payment gateway.
@@ -91,10 +112,19 @@ test_files:
91
112
  - test/factories.rb
92
113
  - test/mocks/active_merchant/billing/gateway.rb
93
114
  - test/options.rb
94
- - test/payment_orbital/gateway_test.rb
95
- - test/payment_orbital/request/end_of_day_test.rb
96
- - test/payment_orbital/request/new_order_test.rb
97
- - test/payment_orbital/request/profile_management_test.rb
98
- - test/payment_orbital/request/void_test.rb
99
- - test/payment_orbital/request_test.rb
115
+ - test/remote/auth_capture_test.rb
116
+ - test/remote/auth_test.rb
117
+ - test/remote/existing_profile_test.rb
118
+ - test/remote/profile_test.rb
119
+ - test/remote/recurring_test.rb
120
+ - test/remote/refund_test.rb
121
+ - test/remote/retry_test.rb
122
+ - test/remote_helper.rb
100
123
  - test/test_helper.rb
124
+ - test/unit_helper.rb
125
+ - test/units/paymentech_orbital/gateway_test.rb
126
+ - test/units/paymentech_orbital/request/end_of_day_test.rb
127
+ - test/units/paymentech_orbital/request/new_order_test.rb
128
+ - test/units/paymentech_orbital/request/profile_management_test.rb
129
+ - test/units/paymentech_orbital/request/void_test.rb
130
+ - test/units/paymentech_orbital/request_test.rb