paytrace 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ccf1d871047ae3784c7e7f6814a16c34e514f3a
4
- data.tar.gz: b1ca42c9b73bab40691eea64275bcbecca8c4445
3
+ metadata.gz: 1a1ca49cba1cedb8ec2188b5518437503b5a3628
4
+ data.tar.gz: 921d2725f730ee48299f28870dd227ea04097538
5
5
  SHA512:
6
- metadata.gz: 6db53e60c3ea789292f0c63cfce3708d84beef77bcff6de1b6fd3b30bd1056b249104e825c5a4ae8d0ab60116395ff82b92ee3dac8e7f6860cc5b46f12f1dc96
7
- data.tar.gz: 7fc4d7f0a56d071320bb9700e8eaa989d394484883deb74d3a9c9f548eb760407367080338f9604e6f57f90e6f5f8532c23c80a5aad749c639e5756682ea0e34
6
+ metadata.gz: fdf13ee3b065e4a18ccb92c62fb0949f19adcc2d793e0d263b47f216e1ae40b4bf32e62282a0e2dc378dbb305bb56f8e1a0edec60025097a443cfe951e4d90e5
7
+ data.tar.gz: d21c0c4bea1edaea7a6bd8a7dba5d015f3e75b177b4c9526e631d4964bd14cdf609fee93b15ea4a19e8750c0a08c4e679504c09c3c3e642b8f4730bbd2ef2a99
@@ -13,7 +13,7 @@ module PayTrace
13
13
  @@next_response = nil
14
14
  @@raise_exceptions = true
15
15
 
16
- def initialize(connection: nil)
16
+ def initialize(connection = nil)
17
17
  @connection = connection || PayTrace.configuration.connection
18
18
  end
19
19
 
@@ -17,8 +17,8 @@ module PayTrace
17
17
 
18
18
  def void(transaction_id)
19
19
  params = {transaction_id: transaction_id}
20
- t = Transaction.new(type: TransactionTypes::Void,
21
- optional:params)
20
+ t = Transaction.new({type: TransactionTypes::Void,
21
+ optional:params})
22
22
  t.response = send_request(t)
23
23
  t
24
24
  end
@@ -29,9 +29,8 @@ module PayTrace
29
29
  end
30
30
 
31
31
  def capture(transaction_id)
32
- params = {transaction_id: transaction_id}
33
- t = Transaction.new(type: TransactionTypes::Capture,
34
- optional:params)
32
+ t = Transaction.new({transaction_id: transaction_id, type: TransactionTypes::Capture,
33
+ optional:params})
35
34
  t.response = send_request(t)
36
35
  t
37
36
  end
@@ -54,11 +53,11 @@ module PayTrace
54
53
  cc = CreditCard.new(args.delete(:credit_card)) if args[:credit_card]
55
54
  customer = args.delete(:customer) if args[:customer]
56
55
 
57
- t = Transaction.new(amount: amount,
56
+ t = Transaction.new({amount: amount,
58
57
  credit_card: cc,
59
58
  customer: customer,
60
59
  type: type,
61
- optional:args)
60
+ optional:args})
62
61
 
63
62
  t.response = send_request(t)
64
63
  t
@@ -92,13 +91,13 @@ module PayTrace
92
91
 
93
92
 
94
93
 
95
- def initialize(amount: nil, credit_card: nil, customer: nil, type: nil, optional: nil, discretionary_data: {} )
96
- @amount = amount
97
- @credit_card = credit_card
98
- @type = type
99
- @customer = customer
100
- @discretionary_data = discretionary_data || {}
101
- include_optional(optional) if optional
94
+ def initialize(params = {})
95
+ @amount = params[:amount]
96
+ @credit_card = params[:credit_card]
97
+ @type = params[:type]
98
+ @customer = params[:customer]
99
+ @discretionary_data = params[:discretionary_data] || {}
100
+ include_optional(params[:optional]) if params[:optional]
102
101
  end
103
102
 
104
103
  def set_request(request)
@@ -1,3 +1,3 @@
1
1
  module PayTrace
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -27,7 +27,7 @@ describe PayTrace::API::Gateway do
27
27
  request = mock()
28
28
  request.stubs(:to_parms_string).returns("foo")
29
29
 
30
- gateway = PayTrace::API::Gateway.new(connection: connection)
30
+ gateway = PayTrace::API::Gateway.new(connection)
31
31
  r = gateway.send_request request
32
32
 
33
33
  faraday.verify_stubbed_calls
@@ -100,7 +100,7 @@ describe PayTrace::Transaction do
100
100
  end
101
101
  describe "adding address info" do
102
102
  it "can take a shipping address" do
103
- t = PayTrace::Transaction.new(
103
+ t = PayTrace::Transaction.new({
104
104
  optional:{
105
105
  shipping_address: {
106
106
  name: "Bob Smith",
@@ -110,9 +110,9 @@ describe PayTrace::Transaction do
110
110
  state:"WA",
111
111
  country:"USA",
112
112
  postal_code:"98107"
113
- }
114
113
  }
115
- )
114
+ }
115
+ })
116
116
  s = t.shipping_address
117
117
  s.name.must_equal "Bob Smith"
118
118
  s.street.must_equal "1234 happy lane"
@@ -124,7 +124,7 @@ describe PayTrace::Transaction do
124
124
 
125
125
  end
126
126
  it "can take a billing address" do
127
- t = PayTrace::Transaction.new(
127
+ t = PayTrace::Transaction.new({
128
128
  optional: {
129
129
  billing_address: {
130
130
  street: "1234 happy lane",
@@ -135,7 +135,7 @@ describe PayTrace::Transaction do
135
135
  postal_code:"98107"
136
136
  }
137
137
  }
138
- )
138
+ })
139
139
  b = t.billing_address
140
140
  b.street.must_equal "1234 happy lane"
141
141
  b.street2.must_equal "suit 234"
@@ -155,9 +155,9 @@ describe PayTrace::Transaction do
155
155
  postal_code:"98107"
156
156
  }
157
157
 
158
- t = PayTrace::Transaction.new(
158
+ t = PayTrace::Transaction.new({
159
159
  optional: { billing_address: address
160
- } )
160
+ } })
161
161
  t.set_shipping_same_as_billing
162
162
 
163
163
  t.shipping_address.must_equal t.billing_address
@@ -166,7 +166,7 @@ describe PayTrace::Transaction do
166
166
  end
167
167
 
168
168
  it "can be set to void a transaction" do
169
- t = PayTrace::Transaction.new(optional:{transaction_id:"11"})
169
+ t = PayTrace::Transaction.new({optional:{transaction_id:"11"}})
170
170
  end
171
171
 
172
172
  it "can create and send a void transaction" do
@@ -235,7 +235,7 @@ describe PayTrace::Transaction do
235
235
  end
236
236
 
237
237
  it "can include a billing address" do
238
- t = PayTrace::Transaction.new(
238
+ t = PayTrace::Transaction.new({
239
239
  optional:{
240
240
  billing_address:{
241
241
  name:"John Doe",
@@ -247,7 +247,7 @@ describe PayTrace::Transaction do
247
247
  postal_code:"98107"
248
248
  }
249
249
  }
250
- )
250
+ })
251
251
 
252
252
  t.shipping_address.must_be_nil
253
253
 
@@ -268,7 +268,7 @@ describe PayTrace::Transaction do
268
268
  end
269
269
 
270
270
  it "can include misc fields as well" do
271
- t = PayTrace::Transaction.new(
271
+ t = PayTrace::Transaction.new({
272
272
  optional: {
273
273
  email:"it@paytrace.com",
274
274
  description:"This is a test",
@@ -278,7 +278,7 @@ describe PayTrace::Transaction do
278
278
  custom_dba:"NewName"
279
279
  },
280
280
  discretionary_data: {hair_color: "red"}
281
- )
281
+ })
282
282
 
283
283
  r = PayTrace::API::Request.new
284
284
  t.set_request(r)
@@ -298,10 +298,10 @@ describe PayTrace::Transaction do
298
298
  cc = PayTrace::CreditCard.new( {
299
299
  swipe: '%B4055010000000005^J/SCOTT^1212101001020001000000701000000?;4055010000000005=12121010010270100001?'
300
300
  })
301
- t = PayTrace::Transaction.new(
301
+ t = PayTrace::Transaction.new({
302
302
  amount: '1.00',
303
303
  credit_card:cc
304
- )
304
+ })
305
305
 
306
306
  r = PayTrace::API::Request.new
307
307
  t.set_request(r)
@@ -316,10 +316,10 @@ describe PayTrace::Transaction do
316
316
 
317
317
  it "can do a reference sales request " do
318
318
 
319
- t = PayTrace::Transaction.new(
319
+ t = PayTrace::Transaction.new({
320
320
  amount: '1.00',
321
321
  optional:{transaction_id: '1234'}
322
- )
322
+ })
323
323
 
324
324
  r = PayTrace::API::Request.new
325
325
  t.set_request(r)
@@ -372,12 +372,12 @@ describe PayTrace::Transaction do
372
372
 
373
373
 
374
374
  }
375
- t = PayTrace::Transaction.new(
375
+ t = PayTrace::Transaction.new({
376
376
  amount: '1.00',
377
377
  credit_card:cc,
378
378
  type: PayTrace::TransactionTypes::SALE,
379
379
  optional:optional
380
- )
380
+ })
381
381
 
382
382
  r = PayTrace::API::Request.new
383
383
  t.set_request(r)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paytrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Redfern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-03 00:00:00.000000000 Z
11
+ date: 2014-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday