global_collect 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -1,3 +1,7 @@
1
+ v0.4.0 (2010-09-19)
2
+ ===================
3
+ * Fix method names for DO_PAYMENT response to match idiom used in other responses.
4
+
1
5
  v0.3.0 (2010-09-15)
2
6
  ===================
3
7
  * Add recurring payment support via DO_PAYMENT method
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.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 = "5393"
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("777")
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 = "5393"
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?
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{global_collect}
8
- s.version = "0.3.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-15}
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.
@@ -7,7 +7,7 @@ module GlobalCollect::Builders::DoPayment
7
7
  end
8
8
  end
9
9
  end
10
-
10
+
11
11
  # WDL §5.13.1 specifies general payment fields
12
12
  def payment_fields
13
13
  %w[
@@ -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
- "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"
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(statusid)
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.statusid.should == "800"
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
- - 3
7
+ - 4
8
8
  - 0
9
- version: 0.3.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-15 00:00:00 -07:00
17
+ date: 2010-09-23 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency