global_collect 0.2.3 → 0.3.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.
- data/HISTORY +4 -0
- data/README.markdown +4 -0
- data/Rakefile +4 -4
- data/VERSION +1 -1
- data/examples/get_order_status.rb +2 -2
- data/examples/recurring_do_payment.rb +85 -0
- data/global_collect.gemspec +41 -16
- data/lib/global_collect/builders/do_payment/payment.rb +26 -0
- data/lib/global_collect/builders/do_payment/recurring_payment.rb +4 -0
- data/lib/global_collect/builders/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb +4 -0
- data/lib/global_collect/builders/insert_order_with_payment/recurring_order.rb +4 -0
- data/lib/global_collect/request_models/do_payment/payment.rb +26 -0
- data/lib/global_collect/request_models/do_payment/recurring_payment.rb +16 -0
- data/lib/global_collect/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb +9 -0
- data/lib/global_collect/request_models/insert_order_with_payment/recurring_order.rb +9 -0
- data/lib/global_collect/requests/do_payment.rb +10 -0
- data/lib/global_collect/responses/do_payment/credit_card_response_methods.rb +29 -0
- data/lib/global_collect/responses/do_payment/response_methods.rb +14 -0
- data/lib/global_collect.rb +57 -46
- data/spec/builders/do_payment/payment_spec.rb +38 -0
- data/spec/request_models/do_payment/recurring_payment_spec.rb +13 -0
- data/spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb +38 -0
- data/spec/request_models/insert_order_with_payment/recurring_order_spec.rb +38 -0
- data/spec/responses/do_payment/credit_card_response_methods_spec.rb +16 -0
- data/spec/responses/do_payment/response_methods_spec.rb +13 -0
- data/spec/support/successful_do_payment_v1_response.xml +41 -0
- data/spec/support/unsuccessful_do_payment_v1_response.xml +12 -0
- metadata +37 -15
- data/spec/request_models/insert_order_with_payment/credit_card_online_payment_spec.rb +0 -11
data/HISTORY
CHANGED
data/README.markdown
CHANGED
@@ -107,3 +107,7 @@ To assign your own logger to the gem, simply do:
|
|
107
107
|
your_logger = Rails.logger
|
108
108
|
GlobalCollect.wire_logger = your_logger
|
109
109
|
client = GlobalCollect::ApiClient.new ...
|
110
|
+
|
111
|
+
## Contributing
|
112
|
+
|
113
|
+
Pull requests and issues (both on GitHub) are greatly appreciated. For patches, please include tests. Thanks!
|
data/Rakefile
CHANGED
@@ -23,11 +23,11 @@ END
|
|
23
23
|
gemspec.homepage = "http://github.com/timonk/global_collect"
|
24
24
|
gemspec.authors = ["Timon Karnezos"]
|
25
25
|
gemspec.add_dependency('httparty', '0.5.2')
|
26
|
-
gemspec.add_dependency('builder', '
|
27
|
-
gemspec.add_dependency('fastercsv', '
|
28
|
-
gemspec.add_dependency('fixed_width', '
|
26
|
+
gemspec.add_dependency('builder', '~> 2.0')
|
27
|
+
gemspec.add_dependency('fastercsv', '~> 1.5')
|
28
|
+
gemspec.add_dependency('fixed_width', '~> 0.2')
|
29
29
|
|
30
|
-
gemspec.add_development_dependency('fakeweb', '
|
30
|
+
gemspec.add_development_dependency('fakeweb', '~> 1.2')
|
31
31
|
end
|
32
32
|
rescue LoadError
|
33
33
|
warn "Jeweler not available. Install it with:"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require File.join(File.dirname(__FILE__), '..', "lib", "global_collect")
|
3
3
|
|
4
|
-
GlobalCollect.merchant_id = ""
|
4
|
+
GlobalCollect.merchant_id = "5393"
|
5
5
|
GlobalCollect.authentication_scheme = :ip_check
|
6
6
|
GlobalCollect.environment = :test
|
7
7
|
GlobalCollect.ip_address = ""
|
@@ -9,7 +9,7 @@ GlobalCollect.ip_address = ""
|
|
9
9
|
|
10
10
|
client = GlobalCollect.merchant_link_client
|
11
11
|
|
12
|
-
req = GlobalCollect::Requests::GetOrderStatus.new("
|
12
|
+
req = GlobalCollect::Requests::GetOrderStatus.new("777")
|
13
13
|
req.version = "2.0"
|
14
14
|
response = client.make_request(req)
|
15
15
|
p response.success?
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', "lib", "global_collect")
|
3
|
+
|
4
|
+
GlobalCollect.merchant_id = "5393"
|
5
|
+
GlobalCollect.authentication_scheme = :ip_check
|
6
|
+
GlobalCollect.environment = :test
|
7
|
+
GlobalCollect.ip_address = ""
|
8
|
+
#GlobalCollect.wire_log_file = File.join(File.dirname(__FILE__), "gc.log")
|
9
|
+
|
10
|
+
client = GlobalCollect.merchant_link_client
|
11
|
+
|
12
|
+
puts "This is a multi-stage example. Please read the source for instructions."
|
13
|
+
|
14
|
+
# ===============================================================================
|
15
|
+
# To get this example to work, you need to insert a recurring order, as commented
|
16
|
+
# out below...
|
17
|
+
# ===============================================================================
|
18
|
+
|
19
|
+
# response = client.make_request(
|
20
|
+
# GlobalCollect::Requests::InsertOrderWithPayment.new(
|
21
|
+
# [
|
22
|
+
# GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
23
|
+
# "ORDERID" => "7777",
|
24
|
+
# "AMOUNT" => "100",
|
25
|
+
# "LANGUAGECODE" => "en",
|
26
|
+
# "CURRENCYCODE" => "USD",
|
27
|
+
# "COUNTRYCODE" => "US",
|
28
|
+
# "MERCHANTREFERENCE" => "1231147777"
|
29
|
+
# ),
|
30
|
+
# GlobalCollect::Builders::InsertOrderWithPayment::RecurringOrder
|
31
|
+
# ],
|
32
|
+
# [
|
33
|
+
# GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
34
|
+
# "PAYMENTPRODUCTID" => "3",
|
35
|
+
# "AMOUNT" => "100",
|
36
|
+
# "CURRENCYCODE" => "GBP",
|
37
|
+
# "LANGUAGECODE" => "en",
|
38
|
+
# "COUNTRYCODE" => "US"
|
39
|
+
# ),
|
40
|
+
# GlobalCollect::Builders::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment
|
41
|
+
# ]
|
42
|
+
# )
|
43
|
+
# )
|
44
|
+
# p response.success?
|
45
|
+
|
46
|
+
# ===============================================================================
|
47
|
+
# Then you need to visit the FORMACTION URL in a browser, and fill in some
|
48
|
+
# example credit card data.
|
49
|
+
# Then you need to wait overnight for it to become settle-able and settle it, as
|
50
|
+
# commented out below...
|
51
|
+
# ===============================================================================
|
52
|
+
|
53
|
+
# response = client.make_request(
|
54
|
+
# GlobalCollect::Requests::SetPayment.new(
|
55
|
+
# [
|
56
|
+
# GlobalCollect::RequestModels::SetPayment::Payment.new(
|
57
|
+
# "ORDERID" => "7777",
|
58
|
+
# "PAYMENTPRODUCTID" => "3"
|
59
|
+
# ),
|
60
|
+
# GlobalCollect::Builders::SetPayment::Payment
|
61
|
+
# ]
|
62
|
+
# )
|
63
|
+
# )
|
64
|
+
# p response.success?
|
65
|
+
|
66
|
+
# ===============================================================================
|
67
|
+
# Then finally, you can call DO_PAYMENT as below:
|
68
|
+
# ===============================================================================
|
69
|
+
|
70
|
+
# response = client.make_request(
|
71
|
+
# GlobalCollect::Requests::DoPayment.new(
|
72
|
+
# [
|
73
|
+
# GlobalCollect::RequestModels::DoPayment::RecurringPayment.new(
|
74
|
+
# "MERCHANTREFERENCE" => "1231147777",
|
75
|
+
# "ORDERID" => "7777",
|
76
|
+
# "EFFORTID" => "2", # increment implied EFFORTID of 1 from IOWP
|
77
|
+
# "PAYMENTPRODUCTID" => "3",
|
78
|
+
# "AMOUNT" => "50",
|
79
|
+
# "CURRENCYCODE" => "GBP"
|
80
|
+
# ),
|
81
|
+
# GlobalCollect::Builders::DoPayment::RecurringPayment
|
82
|
+
# ]
|
83
|
+
# )
|
84
|
+
# )
|
85
|
+
# p response.success?
|
data/global_collect.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{global_collect}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Timon Karnezos"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-15}
|
13
13
|
s.description = %q{Gives minimally intrusive access to Global Collect's payment processing API.
|
14
14
|
Currently implements a very small segment of the full API but is built with
|
15
15
|
extensibility in mind.
|
@@ -33,18 +33,23 @@ extensibility in mind.
|
|
33
33
|
"examples/parse_financial_statement.rb",
|
34
34
|
"examples/parse_payment_report.rb",
|
35
35
|
"examples/process_challenged.rb",
|
36
|
+
"examples/recurring_do_payment.rb",
|
36
37
|
"examples/set_payment.rb",
|
37
38
|
"examples/test_connection.rb",
|
38
39
|
"examples/using_test_helper.rb",
|
39
40
|
"global_collect.gemspec",
|
40
41
|
"lib/global_collect.rb",
|
41
42
|
"lib/global_collect/api_client.rb",
|
43
|
+
"lib/global_collect/builders/do_payment/payment.rb",
|
44
|
+
"lib/global_collect/builders/do_payment/recurring_payment.rb",
|
42
45
|
"lib/global_collect/builders/do_refund/credit_card_payment.rb",
|
43
46
|
"lib/global_collect/builders/do_refund/payment.rb",
|
44
47
|
"lib/global_collect/builders/insert_order_with_payment/credit_card_online_payment.rb",
|
45
48
|
"lib/global_collect/builders/insert_order_with_payment/hosted_credit_card_online_payment.rb",
|
46
49
|
"lib/global_collect/builders/insert_order_with_payment/order.rb",
|
47
50
|
"lib/global_collect/builders/insert_order_with_payment/payment.rb",
|
51
|
+
"lib/global_collect/builders/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb",
|
52
|
+
"lib/global_collect/builders/insert_order_with_payment/recurring_order.rb",
|
48
53
|
"lib/global_collect/builders/set_payment/payment.rb",
|
49
54
|
"lib/global_collect/const/payment_product.rb",
|
50
55
|
"lib/global_collect/const/payment_status.rb",
|
@@ -58,6 +63,8 @@ extensibility in mind.
|
|
58
63
|
"lib/global_collect/log_parsing/payment_report/parser.rb",
|
59
64
|
"lib/global_collect/log_parsing/payment_report/report_file.rb",
|
60
65
|
"lib/global_collect/request_models/base.rb",
|
66
|
+
"lib/global_collect/request_models/do_payment/payment.rb",
|
67
|
+
"lib/global_collect/request_models/do_payment/recurring_payment.rb",
|
61
68
|
"lib/global_collect/request_models/do_refund/credit_card_payment.rb",
|
62
69
|
"lib/global_collect/request_models/do_refund/payment.rb",
|
63
70
|
"lib/global_collect/request_models/do_refund/paypal_payment.rb",
|
@@ -65,11 +72,14 @@ extensibility in mind.
|
|
65
72
|
"lib/global_collect/request_models/insert_order_with_payment/hosted_credit_card_online_payment.rb",
|
66
73
|
"lib/global_collect/request_models/insert_order_with_payment/order.rb",
|
67
74
|
"lib/global_collect/request_models/insert_order_with_payment/payment.rb",
|
75
|
+
"lib/global_collect/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb",
|
76
|
+
"lib/global_collect/request_models/insert_order_with_payment/recurring_order.rb",
|
68
77
|
"lib/global_collect/request_models/set_payment/payment.rb",
|
69
78
|
"lib/global_collect/requests/base.rb",
|
70
79
|
"lib/global_collect/requests/cancel_payment.rb",
|
71
80
|
"lib/global_collect/requests/composite.rb",
|
72
81
|
"lib/global_collect/requests/convert_amount.rb",
|
82
|
+
"lib/global_collect/requests/do_payment.rb",
|
73
83
|
"lib/global_collect/requests/do_refund.rb",
|
74
84
|
"lib/global_collect/requests/get_order_status.rb",
|
75
85
|
"lib/global_collect/requests/insert_order_with_payment.rb",
|
@@ -79,6 +89,8 @@ extensibility in mind.
|
|
79
89
|
"lib/global_collect/requests/test_connection.rb",
|
80
90
|
"lib/global_collect/responses/base.rb",
|
81
91
|
"lib/global_collect/responses/convert_amount/response_methods.rb",
|
92
|
+
"lib/global_collect/responses/do_payment/credit_card_response_methods.rb",
|
93
|
+
"lib/global_collect/responses/do_payment/response_methods.rb",
|
82
94
|
"lib/global_collect/responses/do_refund/response_methods.rb",
|
83
95
|
"lib/global_collect/responses/get_order_status/v1_response_methods.rb",
|
84
96
|
"lib/global_collect/responses/get_order_status/v2_response_methods.rb",
|
@@ -87,6 +99,7 @@ extensibility in mind.
|
|
87
99
|
"lib/global_collect/responses/success_row.rb",
|
88
100
|
"lib/global_collect/test_helper.rb",
|
89
101
|
"spec/api_client_spec.rb",
|
102
|
+
"spec/builders/do_payment/payment_spec.rb",
|
90
103
|
"spec/builders/do_refund/credit_card_payment_spec.rb",
|
91
104
|
"spec/builders/do_refund/payment_spec.rb",
|
92
105
|
"spec/builders/insert_order_with_payment/credit_card_online_payment_spec.rb",
|
@@ -105,9 +118,11 @@ extensibility in mind.
|
|
105
118
|
"spec/log_parsing/payment_report/parser_spec.rb",
|
106
119
|
"spec/log_parsing/payment_report/report_file_spec.rb",
|
107
120
|
"spec/request_models/base_spec.rb",
|
121
|
+
"spec/request_models/do_payment/recurring_payment_spec.rb",
|
108
122
|
"spec/request_models/do_refund/paypal_payment_spec.rb",
|
109
|
-
"spec/request_models/insert_order_with_payment/credit_card_online_payment_spec.rb",
|
110
123
|
"spec/request_models/insert_order_with_payment/hosted_credit_card_online_payment_spec.rb",
|
124
|
+
"spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb",
|
125
|
+
"spec/request_models/insert_order_with_payment/recurring_order_spec.rb",
|
111
126
|
"spec/requests/base_spec.rb",
|
112
127
|
"spec/requests/composite_spec.rb",
|
113
128
|
"spec/requests/convert_amount.rb",
|
@@ -115,6 +130,8 @@ extensibility in mind.
|
|
115
130
|
"spec/requests/simple_spec.rb",
|
116
131
|
"spec/responses/base_spec.rb",
|
117
132
|
"spec/responses/convert_amount/response_methods_spec.rb",
|
133
|
+
"spec/responses/do_payment/credit_card_response_methods_spec.rb",
|
134
|
+
"spec/responses/do_payment/response_methods_spec.rb",
|
118
135
|
"spec/responses/do_refund/response_methods_spec.rb",
|
119
136
|
"spec/responses/get_order_status/v1_response_methods_spec.rb",
|
120
137
|
"spec/responses/get_order_status/v2_response_methods_spec.rb",
|
@@ -129,6 +146,7 @@ extensibility in mind.
|
|
129
146
|
"spec/support/challenged_iowp_v1_response.xml",
|
130
147
|
"spec/support/successful_cancel_payment_v1_response.xml",
|
131
148
|
"spec/support/successful_convert_amount_v1_response.xml",
|
149
|
+
"spec/support/successful_do_payment_v1_response.xml",
|
132
150
|
"spec/support/successful_do_refund_v1_response.xml",
|
133
151
|
"spec/support/successful_get_order_status_v1_response.xml",
|
134
152
|
"spec/support/successful_get_order_status_v2_response.xml",
|
@@ -136,6 +154,7 @@ extensibility in mind.
|
|
136
154
|
"spec/support/successful_iowp_v1_response.xml",
|
137
155
|
"spec/support/successful_process_challenged_response.xml",
|
138
156
|
"spec/support/successful_set_payment_v1_response.xml",
|
157
|
+
"spec/support/unsuccessful_do_payment_v1_response.xml",
|
139
158
|
"spec/support/unsuccessful_do_refund_v1_response.xml",
|
140
159
|
"spec/support/unsuccessful_iowp_v1_response.xml",
|
141
160
|
"spec/support/unsuccessful_process_challenged_v1_response.xml"
|
@@ -147,6 +166,7 @@ extensibility in mind.
|
|
147
166
|
s.summary = %q{A Ruby client to the Global Collect API}
|
148
167
|
s.test_files = [
|
149
168
|
"spec/api_client_spec.rb",
|
169
|
+
"spec/builders/do_payment/payment_spec.rb",
|
150
170
|
"spec/builders/do_refund/credit_card_payment_spec.rb",
|
151
171
|
"spec/builders/do_refund/payment_spec.rb",
|
152
172
|
"spec/builders/insert_order_with_payment/credit_card_online_payment_spec.rb",
|
@@ -165,9 +185,11 @@ extensibility in mind.
|
|
165
185
|
"spec/log_parsing/payment_report/parser_spec.rb",
|
166
186
|
"spec/log_parsing/payment_report/report_file_spec.rb",
|
167
187
|
"spec/request_models/base_spec.rb",
|
188
|
+
"spec/request_models/do_payment/recurring_payment_spec.rb",
|
168
189
|
"spec/request_models/do_refund/paypal_payment_spec.rb",
|
169
|
-
"spec/request_models/insert_order_with_payment/credit_card_online_payment_spec.rb",
|
170
190
|
"spec/request_models/insert_order_with_payment/hosted_credit_card_online_payment_spec.rb",
|
191
|
+
"spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb",
|
192
|
+
"spec/request_models/insert_order_with_payment/recurring_order_spec.rb",
|
171
193
|
"spec/requests/base_spec.rb",
|
172
194
|
"spec/requests/composite_spec.rb",
|
173
195
|
"spec/requests/convert_amount.rb",
|
@@ -175,6 +197,8 @@ extensibility in mind.
|
|
175
197
|
"spec/requests/simple_spec.rb",
|
176
198
|
"spec/responses/base_spec.rb",
|
177
199
|
"spec/responses/convert_amount/response_methods_spec.rb",
|
200
|
+
"spec/responses/do_payment/credit_card_response_methods_spec.rb",
|
201
|
+
"spec/responses/do_payment/response_methods_spec.rb",
|
178
202
|
"spec/responses/do_refund/response_methods_spec.rb",
|
179
203
|
"spec/responses/get_order_status/v1_response_methods_spec.rb",
|
180
204
|
"spec/responses/get_order_status/v2_response_methods_spec.rb",
|
@@ -190,6 +214,7 @@ extensibility in mind.
|
|
190
214
|
"examples/parse_financial_statement.rb",
|
191
215
|
"examples/parse_payment_report.rb",
|
192
216
|
"examples/process_challenged.rb",
|
217
|
+
"examples/recurring_do_payment.rb",
|
193
218
|
"examples/set_payment.rb",
|
194
219
|
"examples/test_connection.rb",
|
195
220
|
"examples/using_test_helper.rb"
|
@@ -201,23 +226,23 @@ extensibility in mind.
|
|
201
226
|
|
202
227
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
203
228
|
s.add_runtime_dependency(%q<httparty>, ["= 0.5.2"])
|
204
|
-
s.add_runtime_dependency(%q<builder>, ["
|
205
|
-
s.add_runtime_dependency(%q<fastercsv>, ["
|
206
|
-
s.add_runtime_dependency(%q<fixed_width>, ["
|
207
|
-
s.add_development_dependency(%q<fakeweb>, ["
|
229
|
+
s.add_runtime_dependency(%q<builder>, ["~> 2.0"])
|
230
|
+
s.add_runtime_dependency(%q<fastercsv>, ["~> 1.5"])
|
231
|
+
s.add_runtime_dependency(%q<fixed_width>, ["~> 0.2"])
|
232
|
+
s.add_development_dependency(%q<fakeweb>, ["~> 1.2"])
|
208
233
|
else
|
209
234
|
s.add_dependency(%q<httparty>, ["= 0.5.2"])
|
210
|
-
s.add_dependency(%q<builder>, ["
|
211
|
-
s.add_dependency(%q<fastercsv>, ["
|
212
|
-
s.add_dependency(%q<fixed_width>, ["
|
213
|
-
s.add_dependency(%q<fakeweb>, ["
|
235
|
+
s.add_dependency(%q<builder>, ["~> 2.0"])
|
236
|
+
s.add_dependency(%q<fastercsv>, ["~> 1.5"])
|
237
|
+
s.add_dependency(%q<fixed_width>, ["~> 0.2"])
|
238
|
+
s.add_dependency(%q<fakeweb>, ["~> 1.2"])
|
214
239
|
end
|
215
240
|
else
|
216
241
|
s.add_dependency(%q<httparty>, ["= 0.5.2"])
|
217
|
-
s.add_dependency(%q<builder>, ["
|
218
|
-
s.add_dependency(%q<fastercsv>, ["
|
219
|
-
s.add_dependency(%q<fixed_width>, ["
|
220
|
-
s.add_dependency(%q<fakeweb>, ["
|
242
|
+
s.add_dependency(%q<builder>, ["~> 2.0"])
|
243
|
+
s.add_dependency(%q<fastercsv>, ["~> 1.5"])
|
244
|
+
s.add_dependency(%q<fixed_width>, ["~> 0.2"])
|
245
|
+
s.add_dependency(%q<fakeweb>, ["~> 1.2"])
|
221
246
|
end
|
222
247
|
end
|
223
248
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module GlobalCollect::Builders::DoPayment
|
2
|
+
class Payment < Struct.new(:payment)
|
3
|
+
def build(node)
|
4
|
+
node.tag!("PAYMENT") do |payment_node|
|
5
|
+
payment_fields.each do |field|
|
6
|
+
payment_node.tag!(field, payment[field]) if payment[field]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# WDL §5.13.1 specifies general payment fields
|
12
|
+
def payment_fields
|
13
|
+
%w[
|
14
|
+
MERCHANTREFERENCE
|
15
|
+
ORDERID
|
16
|
+
EFFORTID
|
17
|
+
PAYMENTPRODUCTID
|
18
|
+
AMOUNT
|
19
|
+
AMOUNTSIGN
|
20
|
+
CURRENCYCODE
|
21
|
+
HOSTEDINDICATOR
|
22
|
+
RETURNURL
|
23
|
+
]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module GlobalCollect::RequestModels::DoPayment
|
2
|
+
class Payment < GlobalCollect::RequestModels::Base
|
3
|
+
def suggested_response_mixins
|
4
|
+
[
|
5
|
+
GlobalCollect::Responses::SuccessRow,
|
6
|
+
GlobalCollect::Responses::DoPayment::ResponseMethods
|
7
|
+
]
|
8
|
+
end
|
9
|
+
# WDL §5.13.1 specifies the full list of possible fields
|
10
|
+
def fields
|
11
|
+
super.merge({
|
12
|
+
"MERCHANTREFERENCE" => ["AN30" , "R"],
|
13
|
+
"ORDERID" => ["N10" , "R"],
|
14
|
+
"EFFORTID" => ["N5" , "O"],
|
15
|
+
"PAYMENTPRODUCTID" => ["N5" , "R"],
|
16
|
+
"AMOUNT" => ["N12" , "O"],
|
17
|
+
"AMOUNTSIGN" => ["AN1" , "O"],
|
18
|
+
"CURRENCYCODE" => ["AN3" , "R"],
|
19
|
+
"HOSTEDINDICATOR" => ["N1" , "O"],
|
20
|
+
"RETURNURL" => ["AN512", "O"]
|
21
|
+
})
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module GlobalCollect::RequestModels::DoPayment
|
2
|
+
class RecurringPayment < Payment
|
3
|
+
def suggested_response_mixins
|
4
|
+
super + [GlobalCollect::Responses::DoPayment::CreditCardResponseMethods]
|
5
|
+
end
|
6
|
+
def fields
|
7
|
+
# A recurring payment will never have the default EFFORTID of '1', hence
|
8
|
+
# it is a required field.
|
9
|
+
super.merge({
|
10
|
+
"EFFORTID" => ["N5", "R"]
|
11
|
+
})
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module GlobalCollect::RequestModels::InsertOrderWithPayment
|
2
|
+
class RecurringHostedCreditCardOnlinePayment < HostedCreditCardOnlinePayment
|
3
|
+
def initialize(attributes)
|
4
|
+
super(attributes)
|
5
|
+
# WDL Appendix F specifies the recurring payment CVVINDICATOR is '8'
|
6
|
+
@attributes["CVVINDICATOR"] = "8"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module GlobalCollect::Requests
|
2
|
+
class DoPayment < GlobalCollect::Requests::Composite
|
3
|
+
# WDL §5.13 requires at least a PAYMENT node in PARAMS, but may optionally
|
4
|
+
# include AIRLINEDATA, as well.
|
5
|
+
def initialize(payment_and_builder, *extra_pairs)
|
6
|
+
all_pairs = [payment_and_builder] + extra_pairs
|
7
|
+
super("DO_PAYMENT", all_pairs)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module GlobalCollect::Responses::DoPayment
|
2
|
+
# WDL §5.13.2 specifies the possible return keys
|
3
|
+
module CreditCardResponseMethods
|
4
|
+
[
|
5
|
+
"CURRENCYCODE" ,
|
6
|
+
"AMOUNT" ,
|
7
|
+
"PAYMENTREFERENCE" ,
|
8
|
+
"ADDITIONALREFERENCE" ,
|
9
|
+
"EXTERNALREFERENCE" ,
|
10
|
+
"STATUSID" ,
|
11
|
+
"STATUSDATE" ,
|
12
|
+
"AVSRESULT" ,
|
13
|
+
"CVVRESULT" ,
|
14
|
+
"FRAUDRESULT" ,
|
15
|
+
"FRAUDCODE" ,
|
16
|
+
"FRAUDNEURAL" ,
|
17
|
+
"FRAUDCRF" ,
|
18
|
+
"AUTHORISATIONCODE"
|
19
|
+
].each do |meth|
|
20
|
+
define_method meth.downcase.gsub(/\s+/, "_") do
|
21
|
+
row[meth.gsub(/\s+/, "")]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def payment_status
|
26
|
+
GlobalCollect::Const::PaymentStatus.from_code(statusid)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module GlobalCollect::Responses::DoPayment
|
2
|
+
# WDL §5.13.2 specifies the possible return keys
|
3
|
+
module ResponseMethods
|
4
|
+
[
|
5
|
+
"ORDERID" ,
|
6
|
+
"ATTEMPTID" ,
|
7
|
+
"EFFORTID"
|
8
|
+
].each do |meth|
|
9
|
+
define_method meth.downcase.gsub(/\s+/, "_") do
|
10
|
+
row[meth.gsub(/\s+/, "")]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/global_collect.rb
CHANGED
@@ -15,52 +15,63 @@ module GlobalCollect::Responses;end
|
|
15
15
|
|
16
16
|
lib_dir = File.dirname(__FILE__)
|
17
17
|
[
|
18
|
-
%w[api_client]
|
19
|
-
%w[builders
|
20
|
-
%w[builders
|
21
|
-
%w[builders
|
22
|
-
%w[builders
|
23
|
-
%w[builders insert_order_with_payment
|
24
|
-
%w[builders insert_order_with_payment
|
25
|
-
%w[builders
|
26
|
-
%w[
|
27
|
-
%w[
|
28
|
-
%w[
|
29
|
-
%w[
|
30
|
-
%w[
|
31
|
-
%w[
|
32
|
-
%w[
|
33
|
-
%w[log_parsing
|
34
|
-
%w[log_parsing
|
35
|
-
%w[log_parsing
|
36
|
-
%w[log_parsing
|
37
|
-
%w[
|
38
|
-
%w[
|
39
|
-
%w[
|
40
|
-
%w[
|
41
|
-
%w[request_models
|
42
|
-
%w[request_models
|
43
|
-
%w[request_models
|
44
|
-
%w[request_models
|
45
|
-
%w[request_models
|
46
|
-
%w[
|
47
|
-
%w[
|
48
|
-
%w[
|
49
|
-
%w[
|
50
|
-
%w[
|
51
|
-
%w[
|
52
|
-
%w[
|
53
|
-
%w[
|
54
|
-
%w[requests
|
55
|
-
%w[requests
|
56
|
-
%w[requests
|
57
|
-
%w[
|
58
|
-
%w[
|
59
|
-
%w[
|
60
|
-
%w[
|
61
|
-
%w[
|
62
|
-
%w[
|
63
|
-
%w[
|
18
|
+
%w[api_client] ,
|
19
|
+
%w[builders do_payment payment] ,
|
20
|
+
%w[builders do_payment recurring_payment] ,
|
21
|
+
%w[builders do_refund payment] ,
|
22
|
+
%w[builders do_refund credit_card_payment] ,
|
23
|
+
%w[builders insert_order_with_payment order] ,
|
24
|
+
%w[builders insert_order_with_payment recurring_order] ,
|
25
|
+
%w[builders insert_order_with_payment payment] ,
|
26
|
+
%w[builders insert_order_with_payment credit_card_online_payment] ,
|
27
|
+
%w[builders insert_order_with_payment hosted_credit_card_online_payment] ,
|
28
|
+
%w[builders insert_order_with_payment recurring_hosted_credit_card_online_payment] ,
|
29
|
+
%w[builders set_payment payment] ,
|
30
|
+
%w[const payment_product] ,
|
31
|
+
%w[const payment_status] ,
|
32
|
+
%w[field_validator] ,
|
33
|
+
%w[log_parsing collection_report fields] ,
|
34
|
+
%w[log_parsing collection_report parser] ,
|
35
|
+
%w[log_parsing collection_report report_file] ,
|
36
|
+
%w[log_parsing collection_report appendix_report_file] ,
|
37
|
+
%w[log_parsing financial_statement report_file] ,
|
38
|
+
%w[log_parsing payment_report fields] ,
|
39
|
+
%w[log_parsing payment_report parser] ,
|
40
|
+
%w[log_parsing payment_report report_file] ,
|
41
|
+
%w[request_models base] ,
|
42
|
+
%w[request_models insert_order_with_payment order] ,
|
43
|
+
%w[request_models insert_order_with_payment recurring_order] ,
|
44
|
+
%w[request_models insert_order_with_payment payment] ,
|
45
|
+
%w[request_models insert_order_with_payment credit_card_online_payment] ,
|
46
|
+
%w[request_models insert_order_with_payment hosted_credit_card_online_payment] ,
|
47
|
+
%w[request_models insert_order_with_payment recurring_hosted_credit_card_online_payment],
|
48
|
+
%w[request_models do_payment payment] ,
|
49
|
+
%w[request_models do_payment recurring_payment] ,
|
50
|
+
%w[request_models do_refund payment] ,
|
51
|
+
%w[request_models do_refund credit_card_payment] ,
|
52
|
+
%w[request_models do_refund paypal_payment] ,
|
53
|
+
%w[request_models set_payment payment] ,
|
54
|
+
%w[requests base] ,
|
55
|
+
%w[requests simple] ,
|
56
|
+
%w[requests composite] ,
|
57
|
+
%w[requests insert_order_with_payment] ,
|
58
|
+
%w[requests get_order_status] ,
|
59
|
+
%w[requests test_connection] ,
|
60
|
+
%w[requests do_payment] ,
|
61
|
+
%w[requests do_refund] ,
|
62
|
+
%w[requests set_payment] ,
|
63
|
+
%w[requests cancel_payment] ,
|
64
|
+
%w[requests process_challenged] ,
|
65
|
+
%w[requests convert_amount] ,
|
66
|
+
%w[responses base] ,
|
67
|
+
%w[responses success_row] ,
|
68
|
+
%w[responses insert_order_with_payment credit_card_online_payment_response_methods] ,
|
69
|
+
%w[responses insert_order_with_payment hosted_merchant_link_payment_response_methods] ,
|
70
|
+
%w[responses do_payment response_methods] ,
|
71
|
+
%w[responses do_payment credit_card_response_methods] ,
|
72
|
+
%w[responses do_refund response_methods] ,
|
73
|
+
%w[responses get_order_status v1_response_methods] ,
|
74
|
+
%w[responses get_order_status v2_response_methods] ,
|
64
75
|
%w[responses convert_amount response_methods]
|
65
76
|
|
66
77
|
].each do |f|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe "the DO_PAYMENT payment builder" do
|
4
|
+
before(:each) do
|
5
|
+
@node = Builder::XmlMarkup.new
|
6
|
+
end
|
7
|
+
it "should not build unknown keys" do
|
8
|
+
@builder = GlobalCollect::Builders::DoPayment::Payment.new('foo' => 'bar')
|
9
|
+
@builder.build(@node)
|
10
|
+
xml = @node.target!
|
11
|
+
|
12
|
+
xml.should have_xpath("/PAYMENT")
|
13
|
+
xml.should_not have_xpath("/PAYMENT/foo")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should build known keys" do
|
17
|
+
fields = %w[
|
18
|
+
MERCHANTREFERENCE
|
19
|
+
ORDERID
|
20
|
+
EFFORTID
|
21
|
+
PAYMENTPRODUCTID
|
22
|
+
AMOUNT
|
23
|
+
AMOUNTSIGN
|
24
|
+
CURRENCYCODE
|
25
|
+
HOSTEDINDICATOR
|
26
|
+
RETURNURL
|
27
|
+
]
|
28
|
+
@builder = GlobalCollect::Builders::DoRefund::Payment.new(
|
29
|
+
fields.inject({}) {|m,k| m[k] = k; m }
|
30
|
+
)
|
31
|
+
@builder.build(@node)
|
32
|
+
xml = @node.target!
|
33
|
+
xml.should have_xpath("/PAYMENT")
|
34
|
+
fields.each do |field|
|
35
|
+
xml.should match_xpath("/PAYMENT/#{field}", field)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe "the DO_PAYMENT recurring payment model" do
|
4
|
+
it "should not allow blank EFFORT_ID" do
|
5
|
+
GlobalCollect::RequestModels::DoPayment::RecurringPayment.new({
|
6
|
+
"MERCHANTREFERENCE" => "aasfd",
|
7
|
+
"ORDERID" => "123",
|
8
|
+
"PAYMENTPRODUCTID" => "1",
|
9
|
+
"AMOUNT" => "123",
|
10
|
+
"CURRENCYCODE" => "USD"
|
11
|
+
}).validate.should be_false
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment do
|
4
|
+
it "should set CVVINDICATOR to '8' when not provided" do
|
5
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
6
|
+
"PAYMENTPRODUCTID" => "1",
|
7
|
+
"AMOUNT" => "1",
|
8
|
+
"CURRENCYCODE" => "USD",
|
9
|
+
"LANGUAGECODE" => "en",
|
10
|
+
"COUNTRYCODE" => "US"
|
11
|
+
)
|
12
|
+
model["CVVINDICATOR"].should == "8"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should set CVVINDICATOR to '8' when it is set to something invalid" do
|
16
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
17
|
+
"PAYMENTPRODUCTID" => "1",
|
18
|
+
"AMOUNT" => "1",
|
19
|
+
"CURRENCYCODE" => "USD",
|
20
|
+
"LANGUAGECODE" => "en",
|
21
|
+
"COUNTRYCODE" => "US",
|
22
|
+
"CVVINDICATOR" => "2123123213"
|
23
|
+
)
|
24
|
+
model["CVVINDICATOR"].should == "8"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should set CVVINDICATOR to '8' when it is set to the wrong thing" do
|
28
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
29
|
+
"PAYMENTPRODUCTID" => "1",
|
30
|
+
"AMOUNT" => "1",
|
31
|
+
"CURRENCYCODE" => "USD",
|
32
|
+
"LANGUAGECODE" => "en",
|
33
|
+
"COUNTRYCODE" => "US",
|
34
|
+
"CVVINDICATOR" => "1"
|
35
|
+
)
|
36
|
+
model["CVVINDICATOR"].should == "8"
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder do
|
4
|
+
it "should set ORDERTYPE to '4' when not provided" do
|
5
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
6
|
+
"ORDERID" => "1",
|
7
|
+
"AMOUNT" => "1",
|
8
|
+
"CURRENCYCODE" => "USD",
|
9
|
+
"LANGUAGECODE" => "en",
|
10
|
+
"COUNTRYCODE" => "US"
|
11
|
+
)
|
12
|
+
model["ORDERTYPE"].should == "4"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should set ORDERTYPE to '4' when it is set to something invalid" do
|
16
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
17
|
+
"ORDERID" => "1",
|
18
|
+
"ORDERTYPE" => "1123",
|
19
|
+
"AMOUNT" => "1",
|
20
|
+
"CURRENCYCODE" => "USD",
|
21
|
+
"LANGUAGECODE" => "en",
|
22
|
+
"COUNTRYCODE" => "US"
|
23
|
+
)
|
24
|
+
model["ORDERTYPE"].should == "4"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should set ORDERTYPE to '4' when it is set to the wrong thing" do
|
28
|
+
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
29
|
+
"ORDERID" => "1",
|
30
|
+
"ORDERTYPE" => "1",
|
31
|
+
"AMOUNT" => "1",
|
32
|
+
"CURRENCYCODE" => "USD",
|
33
|
+
"LANGUAGECODE" => "en",
|
34
|
+
"COUNTRYCODE" => "US"
|
35
|
+
)
|
36
|
+
model["ORDERTYPE"].should == "4"
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe GlobalCollect::Responses::DoPayment::CreditCardResponseMethods do
|
4
|
+
before(:each) do
|
5
|
+
@response = parse_canned_response(:successful, :do_payment, :v1)
|
6
|
+
@response.extend(GlobalCollect::Responses::SuccessRow)
|
7
|
+
@response.extend(GlobalCollect::Responses::DoPayment::ResponseMethods)
|
8
|
+
@response.extend(GlobalCollect::Responses::DoPayment::CreditCardResponseMethods)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should see the methods" do
|
12
|
+
@response.statusid.should == "800"
|
13
|
+
@response.payment_status.should_not be_nil
|
14
|
+
@response.payment_status.code.should be(800)
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
describe GlobalCollect::Responses::DoPayment::ResponseMethods do
|
4
|
+
before(:each) do
|
5
|
+
@response = parse_canned_response(:successful, :do_payment, :v1)
|
6
|
+
@response.extend(GlobalCollect::Responses::SuccessRow)
|
7
|
+
@response.extend(GlobalCollect::Responses::DoPayment::ResponseMethods)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should see the methods" do
|
11
|
+
@response.orderid.should == "9998990013"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<XML>
|
3
|
+
<REQUEST>
|
4
|
+
<ACTION>DO_PAYMENT</ACTION>
|
5
|
+
<META>
|
6
|
+
<MERCHANTID>1</MERCHANTID>
|
7
|
+
<IPADDRESS>123.123.123.123</IPADDRESS>
|
8
|
+
<VERSION>1.0</VERSION>
|
9
|
+
<REQUESTIPADDRESS>123.123.123.123</REQUESTIPADDRESS>
|
10
|
+
</META>
|
11
|
+
<PARAMS>
|
12
|
+
<PAYMENT>
|
13
|
+
<ORDERID>1</ORDERID>
|
14
|
+
<EFFORTID>1</EFFORTID>
|
15
|
+
<PAYMENTPRODUCTID>1</PAYMENTPRODUCTID>
|
16
|
+
<AMOUNT>2345</AMOUNT>
|
17
|
+
<CURRENCYCODE>EUR</CURRENCYCODE>
|
18
|
+
<CREDITCARDNUMBER>4567350000427977</CREDITCARDNUMBER>
|
19
|
+
<EXPIRYDATE>1206</EXPIRYDATE>
|
20
|
+
<COUNTRYCODE>NL</COUNTRYCODE>
|
21
|
+
<LANGUAGECODE>nl</LANGUAGECODE>
|
22
|
+
</PAYMENT>
|
23
|
+
</PARAMS>
|
24
|
+
<RESPONSE>
|
25
|
+
<RESULT>OK</RESULT>
|
26
|
+
<META>
|
27
|
+
<RESPONSEDATETIME>20040718114145</RESPONSEDATETIME>
|
28
|
+
</META>
|
29
|
+
<ROW>
|
30
|
+
<REQUESTID>231</REQUESTID>
|
31
|
+
<ORDERID>9998990013</ORDERID>
|
32
|
+
<EFFORTID>1</EFFORTID>
|
33
|
+
<ATTEMPTID>1</ATTEMPTID>
|
34
|
+
<STATUSID>800</STATUSID>
|
35
|
+
<STATUSDATE>20030829171416</STATUSDATE>
|
36
|
+
<PAYMENTREFERENCE>185800005380</PAYMENTREFERENCE>
|
37
|
+
<ADDITIONALREFERENCE>19998990013</ADDITIONALREFERENCE>
|
38
|
+
</ROW>
|
39
|
+
</RESPONSE>
|
40
|
+
</REQUEST>
|
41
|
+
</XML>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<RESPONSE>
|
3
|
+
<RESULT>NOK</RESULT>
|
4
|
+
<META>
|
5
|
+
<RESPONSEDATETIME>20040718114145</RESPONSEDATETIME>
|
6
|
+
<REQUESTID>231</REQUESTID>
|
7
|
+
</META>
|
8
|
+
<ERROR>
|
9
|
+
<CODE>21000020</CODE>
|
10
|
+
<MESSAGE> REQUEST 1212121 VALUE 4567350000427976 OF FIELD CREDITCARDNUMBER DID NOTPASS THE LUHNCHECK</MESSAGE>
|
11
|
+
</ERROR>
|
12
|
+
</RESPONSE>
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 2
|
8
7
|
- 3
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Timon Karnezos
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-15 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
prerelease: false
|
37
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
segments:
|
42
42
|
- 2
|
@@ -49,13 +49,12 @@ dependencies:
|
|
49
49
|
prerelease: false
|
50
50
|
requirement: &id003 !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
segments:
|
55
55
|
- 1
|
56
56
|
- 5
|
57
|
-
|
58
|
-
version: 1.5.3
|
57
|
+
version: "1.5"
|
59
58
|
type: :runtime
|
60
59
|
version_requirements: *id003
|
61
60
|
- !ruby/object:Gem::Dependency
|
@@ -63,13 +62,12 @@ dependencies:
|
|
63
62
|
prerelease: false
|
64
63
|
requirement: &id004 !ruby/object:Gem::Requirement
|
65
64
|
requirements:
|
66
|
-
- -
|
65
|
+
- - ~>
|
67
66
|
- !ruby/object:Gem::Version
|
68
67
|
segments:
|
69
68
|
- 0
|
70
69
|
- 2
|
71
|
-
|
72
|
-
version: 0.2.1
|
70
|
+
version: "0.2"
|
73
71
|
type: :runtime
|
74
72
|
version_requirements: *id004
|
75
73
|
- !ruby/object:Gem::Dependency
|
@@ -77,13 +75,12 @@ dependencies:
|
|
77
75
|
prerelease: false
|
78
76
|
requirement: &id005 !ruby/object:Gem::Requirement
|
79
77
|
requirements:
|
80
|
-
- -
|
78
|
+
- - ~>
|
81
79
|
- !ruby/object:Gem::Version
|
82
80
|
segments:
|
83
81
|
- 1
|
84
82
|
- 2
|
85
|
-
|
86
|
-
version: 1.2.8
|
83
|
+
version: "1.2"
|
87
84
|
type: :development
|
88
85
|
version_requirements: *id005
|
89
86
|
description: |
|
@@ -113,18 +110,23 @@ files:
|
|
113
110
|
- examples/parse_financial_statement.rb
|
114
111
|
- examples/parse_payment_report.rb
|
115
112
|
- examples/process_challenged.rb
|
113
|
+
- examples/recurring_do_payment.rb
|
116
114
|
- examples/set_payment.rb
|
117
115
|
- examples/test_connection.rb
|
118
116
|
- examples/using_test_helper.rb
|
119
117
|
- global_collect.gemspec
|
120
118
|
- lib/global_collect.rb
|
121
119
|
- lib/global_collect/api_client.rb
|
120
|
+
- lib/global_collect/builders/do_payment/payment.rb
|
121
|
+
- lib/global_collect/builders/do_payment/recurring_payment.rb
|
122
122
|
- lib/global_collect/builders/do_refund/credit_card_payment.rb
|
123
123
|
- lib/global_collect/builders/do_refund/payment.rb
|
124
124
|
- lib/global_collect/builders/insert_order_with_payment/credit_card_online_payment.rb
|
125
125
|
- lib/global_collect/builders/insert_order_with_payment/hosted_credit_card_online_payment.rb
|
126
126
|
- lib/global_collect/builders/insert_order_with_payment/order.rb
|
127
127
|
- lib/global_collect/builders/insert_order_with_payment/payment.rb
|
128
|
+
- lib/global_collect/builders/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb
|
129
|
+
- lib/global_collect/builders/insert_order_with_payment/recurring_order.rb
|
128
130
|
- lib/global_collect/builders/set_payment/payment.rb
|
129
131
|
- lib/global_collect/const/payment_product.rb
|
130
132
|
- lib/global_collect/const/payment_status.rb
|
@@ -138,6 +140,8 @@ files:
|
|
138
140
|
- lib/global_collect/log_parsing/payment_report/parser.rb
|
139
141
|
- lib/global_collect/log_parsing/payment_report/report_file.rb
|
140
142
|
- lib/global_collect/request_models/base.rb
|
143
|
+
- lib/global_collect/request_models/do_payment/payment.rb
|
144
|
+
- lib/global_collect/request_models/do_payment/recurring_payment.rb
|
141
145
|
- lib/global_collect/request_models/do_refund/credit_card_payment.rb
|
142
146
|
- lib/global_collect/request_models/do_refund/payment.rb
|
143
147
|
- lib/global_collect/request_models/do_refund/paypal_payment.rb
|
@@ -145,11 +149,14 @@ files:
|
|
145
149
|
- lib/global_collect/request_models/insert_order_with_payment/hosted_credit_card_online_payment.rb
|
146
150
|
- lib/global_collect/request_models/insert_order_with_payment/order.rb
|
147
151
|
- lib/global_collect/request_models/insert_order_with_payment/payment.rb
|
152
|
+
- lib/global_collect/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment.rb
|
153
|
+
- lib/global_collect/request_models/insert_order_with_payment/recurring_order.rb
|
148
154
|
- lib/global_collect/request_models/set_payment/payment.rb
|
149
155
|
- lib/global_collect/requests/base.rb
|
150
156
|
- lib/global_collect/requests/cancel_payment.rb
|
151
157
|
- lib/global_collect/requests/composite.rb
|
152
158
|
- lib/global_collect/requests/convert_amount.rb
|
159
|
+
- lib/global_collect/requests/do_payment.rb
|
153
160
|
- lib/global_collect/requests/do_refund.rb
|
154
161
|
- lib/global_collect/requests/get_order_status.rb
|
155
162
|
- lib/global_collect/requests/insert_order_with_payment.rb
|
@@ -159,6 +166,8 @@ files:
|
|
159
166
|
- lib/global_collect/requests/test_connection.rb
|
160
167
|
- lib/global_collect/responses/base.rb
|
161
168
|
- lib/global_collect/responses/convert_amount/response_methods.rb
|
169
|
+
- lib/global_collect/responses/do_payment/credit_card_response_methods.rb
|
170
|
+
- lib/global_collect/responses/do_payment/response_methods.rb
|
162
171
|
- lib/global_collect/responses/do_refund/response_methods.rb
|
163
172
|
- lib/global_collect/responses/get_order_status/v1_response_methods.rb
|
164
173
|
- lib/global_collect/responses/get_order_status/v2_response_methods.rb
|
@@ -167,6 +176,7 @@ files:
|
|
167
176
|
- lib/global_collect/responses/success_row.rb
|
168
177
|
- lib/global_collect/test_helper.rb
|
169
178
|
- spec/api_client_spec.rb
|
179
|
+
- spec/builders/do_payment/payment_spec.rb
|
170
180
|
- spec/builders/do_refund/credit_card_payment_spec.rb
|
171
181
|
- spec/builders/do_refund/payment_spec.rb
|
172
182
|
- spec/builders/insert_order_with_payment/credit_card_online_payment_spec.rb
|
@@ -185,9 +195,11 @@ files:
|
|
185
195
|
- spec/log_parsing/payment_report/parser_spec.rb
|
186
196
|
- spec/log_parsing/payment_report/report_file_spec.rb
|
187
197
|
- spec/request_models/base_spec.rb
|
198
|
+
- spec/request_models/do_payment/recurring_payment_spec.rb
|
188
199
|
- spec/request_models/do_refund/paypal_payment_spec.rb
|
189
|
-
- spec/request_models/insert_order_with_payment/credit_card_online_payment_spec.rb
|
190
200
|
- spec/request_models/insert_order_with_payment/hosted_credit_card_online_payment_spec.rb
|
201
|
+
- spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb
|
202
|
+
- spec/request_models/insert_order_with_payment/recurring_order_spec.rb
|
191
203
|
- spec/requests/base_spec.rb
|
192
204
|
- spec/requests/composite_spec.rb
|
193
205
|
- spec/requests/convert_amount.rb
|
@@ -195,6 +207,8 @@ files:
|
|
195
207
|
- spec/requests/simple_spec.rb
|
196
208
|
- spec/responses/base_spec.rb
|
197
209
|
- spec/responses/convert_amount/response_methods_spec.rb
|
210
|
+
- spec/responses/do_payment/credit_card_response_methods_spec.rb
|
211
|
+
- spec/responses/do_payment/response_methods_spec.rb
|
198
212
|
- spec/responses/do_refund/response_methods_spec.rb
|
199
213
|
- spec/responses/get_order_status/v1_response_methods_spec.rb
|
200
214
|
- spec/responses/get_order_status/v2_response_methods_spec.rb
|
@@ -209,6 +223,7 @@ files:
|
|
209
223
|
- spec/support/challenged_iowp_v1_response.xml
|
210
224
|
- spec/support/successful_cancel_payment_v1_response.xml
|
211
225
|
- spec/support/successful_convert_amount_v1_response.xml
|
226
|
+
- spec/support/successful_do_payment_v1_response.xml
|
212
227
|
- spec/support/successful_do_refund_v1_response.xml
|
213
228
|
- spec/support/successful_get_order_status_v1_response.xml
|
214
229
|
- spec/support/successful_get_order_status_v2_response.xml
|
@@ -216,6 +231,7 @@ files:
|
|
216
231
|
- spec/support/successful_iowp_v1_response.xml
|
217
232
|
- spec/support/successful_process_challenged_response.xml
|
218
233
|
- spec/support/successful_set_payment_v1_response.xml
|
234
|
+
- spec/support/unsuccessful_do_payment_v1_response.xml
|
219
235
|
- spec/support/unsuccessful_do_refund_v1_response.xml
|
220
236
|
- spec/support/unsuccessful_iowp_v1_response.xml
|
221
237
|
- spec/support/unsuccessful_process_challenged_v1_response.xml
|
@@ -251,6 +267,7 @@ specification_version: 3
|
|
251
267
|
summary: A Ruby client to the Global Collect API
|
252
268
|
test_files:
|
253
269
|
- spec/api_client_spec.rb
|
270
|
+
- spec/builders/do_payment/payment_spec.rb
|
254
271
|
- spec/builders/do_refund/credit_card_payment_spec.rb
|
255
272
|
- spec/builders/do_refund/payment_spec.rb
|
256
273
|
- spec/builders/insert_order_with_payment/credit_card_online_payment_spec.rb
|
@@ -269,9 +286,11 @@ test_files:
|
|
269
286
|
- spec/log_parsing/payment_report/parser_spec.rb
|
270
287
|
- spec/log_parsing/payment_report/report_file_spec.rb
|
271
288
|
- spec/request_models/base_spec.rb
|
289
|
+
- spec/request_models/do_payment/recurring_payment_spec.rb
|
272
290
|
- spec/request_models/do_refund/paypal_payment_spec.rb
|
273
|
-
- spec/request_models/insert_order_with_payment/credit_card_online_payment_spec.rb
|
274
291
|
- spec/request_models/insert_order_with_payment/hosted_credit_card_online_payment_spec.rb
|
292
|
+
- spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb
|
293
|
+
- spec/request_models/insert_order_with_payment/recurring_order_spec.rb
|
275
294
|
- spec/requests/base_spec.rb
|
276
295
|
- spec/requests/composite_spec.rb
|
277
296
|
- spec/requests/convert_amount.rb
|
@@ -279,6 +298,8 @@ test_files:
|
|
279
298
|
- spec/requests/simple_spec.rb
|
280
299
|
- spec/responses/base_spec.rb
|
281
300
|
- spec/responses/convert_amount/response_methods_spec.rb
|
301
|
+
- spec/responses/do_payment/credit_card_response_methods_spec.rb
|
302
|
+
- spec/responses/do_payment/response_methods_spec.rb
|
282
303
|
- spec/responses/do_refund/response_methods_spec.rb
|
283
304
|
- spec/responses/get_order_status/v1_response_methods_spec.rb
|
284
305
|
- spec/responses/get_order_status/v2_response_methods_spec.rb
|
@@ -294,6 +315,7 @@ test_files:
|
|
294
315
|
- examples/parse_financial_statement.rb
|
295
316
|
- examples/parse_payment_report.rb
|
296
317
|
- examples/process_challenged.rb
|
318
|
+
- examples/recurring_do_payment.rb
|
297
319
|
- examples/set_payment.rb
|
298
320
|
- examples/test_connection.rb
|
299
321
|
- examples/using_test_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
|
2
|
-
|
3
|
-
describe "the credit card online payment model" do
|
4
|
-
it "should return the proper suggested mixins" do
|
5
|
-
model = GlobalCollect::RequestModels::InsertOrderWithPayment::CreditCardOnlinePayment.new({})
|
6
|
-
model.suggested_response_mixins.should == [
|
7
|
-
GlobalCollect::Responses::SuccessRow,
|
8
|
-
GlobalCollect::Responses::InsertOrderWithPayment::CreditCardOnlinePaymentResponseMethods
|
9
|
-
]
|
10
|
-
end
|
11
|
-
end
|