global_collect 0.3.0 → 0.4.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/VERSION +1 -1
- data/examples/get_order_status.rb +2 -2
- data/examples/recurring_do_payment.rb +3 -3
- data/global_collect.gemspec +2 -2
- data/lib/global_collect/builders/do_payment/payment.rb +1 -1
- data/lib/global_collect/responses/do_payment/credit_card_response_methods.rb +16 -16
- data/spec/builders/do_payment/payment_spec.rb +2 -2
- data/spec/request_models/insert_order_with_payment/recurring_hosted_credit_card_online_payment_spec.rb +2 -2
- data/spec/request_models/insert_order_with_payment/recurring_order_spec.rb +2 -2
- data/spec/responses/do_payment/credit_card_response_methods_spec.rb +1 -1
- metadata +3 -3
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.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 = ""
|
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("53")
|
13
13
|
req.version = "2.0"
|
14
14
|
response = client.make_request(req)
|
15
15
|
p response.success?
|
@@ -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 = ""
|
5
5
|
GlobalCollect.authentication_scheme = :ip_check
|
6
6
|
GlobalCollect.environment = :test
|
7
7
|
GlobalCollect.ip_address = ""
|
@@ -41,7 +41,7 @@ puts "This is a multi-stage example. Please read the source for instructions."
|
|
41
41
|
# ]
|
42
42
|
# )
|
43
43
|
# )
|
44
|
-
# p response.success?
|
44
|
+
# p response.success?
|
45
45
|
|
46
46
|
# ===============================================================================
|
47
47
|
# Then you need to visit the FORMACTION URL in a browser, and fill in some
|
@@ -82,4 +82,4 @@ puts "This is a multi-stage example. Please read the source for instructions."
|
|
82
82
|
# ]
|
83
83
|
# )
|
84
84
|
# )
|
85
|
-
# p response.success?
|
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.4.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-09-
|
12
|
+
s.date = %q{2010-09-23}
|
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.
|
@@ -2,28 +2,28 @@ module GlobalCollect::Responses::DoPayment
|
|
2
2
|
# WDL §5.13.2 specifies the possible return keys
|
3
3
|
module CreditCardResponseMethods
|
4
4
|
[
|
5
|
-
"
|
6
|
-
"AMOUNT"
|
7
|
-
"
|
8
|
-
"
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
5
|
+
"CURRENCY CODE" ,
|
6
|
+
"AMOUNT" ,
|
7
|
+
"PAYMENT REFERENCE" ,
|
8
|
+
"ADDITIONAL REFERENCE" ,
|
9
|
+
"EXTERNAL REFERENCE" ,
|
10
|
+
"STATUS ID" ,
|
11
|
+
"STATUS DATE" ,
|
12
|
+
"AVS RESULT" ,
|
13
|
+
"CVV RESULT" ,
|
14
|
+
"FRAUD RESULT" ,
|
15
|
+
"FRAUD CODE" ,
|
16
|
+
"FRAUD NEURAL" ,
|
17
|
+
"FRAUD CRF" ,
|
18
|
+
"AUTHORISATION CODE"
|
19
19
|
].each do |meth|
|
20
20
|
define_method meth.downcase.gsub(/\s+/, "_") do
|
21
21
|
row[meth.gsub(/\s+/, "")]
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def payment_status
|
26
|
-
GlobalCollect::Const::PaymentStatus.from_code(
|
26
|
+
GlobalCollect::Const::PaymentStatus.from_code(status_id)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -8,11 +8,11 @@ describe "the DO_PAYMENT payment builder" do
|
|
8
8
|
@builder = GlobalCollect::Builders::DoPayment::Payment.new('foo' => 'bar')
|
9
9
|
@builder.build(@node)
|
10
10
|
xml = @node.target!
|
11
|
-
|
11
|
+
|
12
12
|
xml.should have_xpath("/PAYMENT")
|
13
13
|
xml.should_not have_xpath("/PAYMENT/foo")
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
it "should build known keys" do
|
17
17
|
fields = %w[
|
18
18
|
MERCHANTREFERENCE
|
@@ -11,7 +11,7 @@ describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCr
|
|
11
11
|
)
|
12
12
|
model["CVVINDICATOR"].should == "8"
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should set CVVINDICATOR to '8' when it is set to something invalid" do
|
16
16
|
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
17
17
|
"PAYMENTPRODUCTID" => "1",
|
@@ -23,7 +23,7 @@ describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCr
|
|
23
23
|
)
|
24
24
|
model["CVVINDICATOR"].should == "8"
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
it "should set CVVINDICATOR to '8' when it is set to the wrong thing" do
|
28
28
|
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringHostedCreditCardOnlinePayment.new(
|
29
29
|
"PAYMENTPRODUCTID" => "1",
|
@@ -11,7 +11,7 @@ describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder do
|
|
11
11
|
)
|
12
12
|
model["ORDERTYPE"].should == "4"
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should set ORDERTYPE to '4' when it is set to something invalid" do
|
16
16
|
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
17
17
|
"ORDERID" => "1",
|
@@ -23,7 +23,7 @@ describe GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder do
|
|
23
23
|
)
|
24
24
|
model["ORDERTYPE"].should == "4"
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
it "should set ORDERTYPE to '4' when it is set to the wrong thing" do
|
28
28
|
model = GlobalCollect::RequestModels::InsertOrderWithPayment::RecurringOrder.new(
|
29
29
|
"ORDERID" => "1",
|
@@ -9,7 +9,7 @@ describe GlobalCollect::Responses::DoPayment::CreditCardResponseMethods do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should see the methods" do
|
12
|
-
@response.
|
12
|
+
@response.status_id.should == "800"
|
13
13
|
@response.payment_status.should_not be_nil
|
14
14
|
@response.payment_status.code.should be(800)
|
15
15
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 4
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.4.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-09-
|
17
|
+
date: 2010-09-23 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|