ruby_psigate 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/lib/ruby_psigate/recurring_charge.rb +3 -2
- data/ruby_psigate.gemspec +1 -1
- data/test/remote/remote_account_test.rb +41 -0
- data/test/unit/account_test.rb +2 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -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
@@ -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
|
data/test/unit/account_test.rb
CHANGED
@@ -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
|