paytrace 0.0.8 → 0.0.9

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: dc24d8b07a7ac3d137357a112e9f82722e8cdba9
4
- data.tar.gz: 6db8dc240022b174b1c519cbbfdf71dc8c4a1f4b
3
+ metadata.gz: 541b6857805eca64705171a6d79c1460b54c8b98
4
+ data.tar.gz: cf045536c93ad2b018349a7887e9a83d40a2a474
5
5
  SHA512:
6
- metadata.gz: 7f1cb13b0698362191da90230643f5bb13e3a6e85de366fe4727b3195d2681f74171d6cd629fc0fdf546c0ac5f522763dc22c6480f4fa1143275d7c4a72a84ea
7
- data.tar.gz: 43e763f160328816280a99dcb8d75701ce6ab827ca5b559c040e8557854df9f627c4710428a3437a49323a880b68b21305e83b864145f4dbd83926d7d82e1d2e
6
+ metadata.gz: f767d7578de6951c67de3d8c842daa25813bebf5c9c6bee57001cf6162582b472f3f459f9aac88a81f2b4f6364352cb387717254ab9b41b9a73133eef7a16703
7
+ data.tar.gz: aebf87dd95be3df42d42679105c059b683b33917f988efa6b6db09d96f7676517a6d6f2d1bfa9ce10cb2e61da5789160f6f0920c490adeee05e7acc870310300
@@ -9,6 +9,7 @@ module PayTrace
9
9
  @@debug = false
10
10
  @@last_request = nil
11
11
  @@last_response = nil
12
+ @@last_response_object = nil
12
13
  @@next_response = nil
13
14
  @@raise_exceptions = true
14
15
 
@@ -28,6 +29,10 @@ module PayTrace
28
29
  @@last_response
29
30
  end
30
31
 
32
+ def self.last_response_object
33
+ @@last_response_object
34
+ end
35
+
31
36
  def self.next_response=(next_response)
32
37
  @@next_response = next_response
33
38
  end
@@ -40,6 +45,7 @@ module PayTrace
40
45
  @@last_request = request.to_parms_string if @@debug
41
46
  unless (@@debug && @@next_response)
42
47
  res = @connection.post PayTrace.configuration.url, parmlist: request.to_parms_string
48
+ @@last_response_object = res
43
49
  raw_response = res.body
44
50
  else
45
51
  raw_response = @@next_response
@@ -1,3 +1,3 @@
1
1
  module PayTrace
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -49,8 +49,8 @@ extra = {
49
49
  fax: "206-555-1313",
50
50
  password: "foxtrot123",
51
51
  account_number: 123456789,
52
- routing_number: 12345678,
53
- discretionary_data: "Discretionary data."
52
+ routing_number: 325081403,
53
+ discretionary_data: {test: "test data"}
54
54
  }
55
55
 
56
56
  PayTrace::API::Gateway.debug = true
@@ -64,9 +64,15 @@ rescue PayTrace::Exceptions::ErrorResponse
64
64
  end
65
65
 
66
66
  log "Creating customer john_doe..."
67
- c = PayTrace::Customer.from_cc_info({customer_id: "john_doe", credit_card: cc, billing_address: ba}.merge(extra))
67
+ begin
68
+ c = PayTrace::Customer.from_cc_info({customer_id: "john_doe", credit_card: cc, billing_address: ba}.merge(extra))
69
+ dump_response_values(PayTrace::API::Gateway.last_response_object)
70
+ rescue
71
+ log "Failure; raw request: #{PayTrace::API::Gateway.last_request}"
72
+ raise
73
+ end
68
74
  log "Customer ID: #{c.id}"
69
- dump_response_values(PayTrace::API::Gateway.last_response)
75
+ dump_response_values(PayTrace::API::Gateway.last_response_object)
70
76
 
71
77
  log "Creating recurrence for john_doe..."
72
78
  params = {
@@ -81,10 +87,13 @@ params = {
81
87
  recur_type: "A"
82
88
  }
83
89
  recur_id = PayTrace::RecurringTransaction.create(params)
90
+ dump_response_values(PayTrace::API::Gateway.last_response_object)
84
91
  puts ">>>>>>> Recurrence ID: #{recur_id}"
85
92
 
86
93
  log "Deleting recurrence #{recur_id}..."
87
94
  PayTrace::RecurringTransaction.delete({recur_id: recur_id})
95
+ dump_response_values(PayTrace::API::Gateway.last_response_object)
88
96
 
89
97
  log "Deleting customer 'john_doe'..."
90
98
  c.delete()
99
+ dump_response_values(PayTrace::API::Gateway.last_response_object)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paytrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Redfern