ruby_psigate 0.7.3 → 0.7.4

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/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.7.4. fixed bug: account charges can now be registered
1
2
  v0.7.3. fixed bugs related to account information (address, name) not being passed through to server
2
3
  v0.7.2. updated project's dependency file
3
4
  v0.7.1. project's website points to github's repository instead
@@ -6,11 +6,12 @@ module RubyPsigate
6
6
  class RecurringCharge
7
7
 
8
8
  include HashVariables
9
- hashable %w( RBCID RBName Interval RBTrigger ProcessType Status StartTime EndTime )
9
+ hashable %w( StoreID RBCID RBName Interval RBTrigger ProcessType Status StartTime EndTime )
10
10
 
11
- attr_accessor :rbcid, :rbname, :interval, :rbtrigger, :status, :starttime, :endtime, :processtype
11
+ attr_accessor :storeid, :rbcid, :rbname, :interval, :rbtrigger, :status, :starttime, :endtime, :processtype
12
12
 
13
13
  def initialize(attributes = {})
14
+ @storeid = attributes[:storeid]
14
15
  @rbcid = attributes[:rbcid]
15
16
  @rbname = attributes[:rbname]
16
17
  @interval = attributes[:interval]
data/ruby_psigate.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ruby_psigate}
5
- s.version = "0.7.3"
5
+ s.version = "0.7.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simon Chiu"]
@@ -29,5 +29,46 @@ module RubyPsigate
29
29
  assert response.success?
30
30
  end
31
31
 
32
+ should "register a new charge on billing account" do
33
+ @response = setup_remote_account
34
+
35
+ @account = RubyPsigate::Account.new
36
+ @account.action = { :charges => :immediate }
37
+ @account.account_id = @response.accountid
38
+ @account.serial_no = @response.serialno
39
+
40
+ @recurring_charge = RecurringCharge.new(:rbname => "Immediate Payment", :storeid => "teststore")
41
+ @recurring_charge << valid_recurring_item
42
+
43
+ @account.rbcharge = @recurring_charge
44
+
45
+ @gateway.account = @account
46
+ response = @gateway.commit!
47
+ assert response.success?
48
+ end
49
+
50
+ private
51
+
52
+ def setup_remote_account
53
+ @account = RubyPsigate::Account.new
54
+ @account.action = { :account => :register }
55
+
56
+ @credit_card = RubyPsigate::CreditCard.new(
57
+ :number => "4111111111111111",
58
+ :month => "12",
59
+ :year => "2011",
60
+ :verification_value => "123",
61
+ :name => "Bob John"
62
+ )
63
+
64
+ @account.email = "bob@gmail.com"
65
+ @account.cc = @credit_card
66
+ @account.address = valid_address
67
+
68
+ @gateway.account = @account
69
+
70
+ @response = @gateway.commit!
71
+ end
72
+
32
73
  end
33
74
  end
@@ -358,6 +358,7 @@ module RubyPsigate
358
358
  :Charge => {
359
359
  :AccountID => "1234567890",
360
360
  :SerialNo => "1",
361
+ :StoreID => "teststore",
361
362
  :RBName => "Immediate Payment",
362
363
  :ItemInfo => [
363
364
  {
@@ -376,7 +377,7 @@ module RubyPsigate
376
377
  @account.account_id = "1234567890"
377
378
  @account.serial_no = "1"
378
379
 
379
- @recurring_charge = RecurringCharge.new(:rbname => "Immediate Payment")
380
+ @recurring_charge = RecurringCharge.new(:rbname => "Immediate Payment", :storeid => "teststore")
380
381
  @recurring_charge << valid_recurring_item
381
382
 
382
383
  @account.rbcharge = @recurring_charge
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 3
9
- version: 0.7.3
8
+ - 4
9
+ version: 0.7.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Simon Chiu