caboose-cms 0.5.154 → 0.5.155

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDFjNWI1ZTNlNjM5ZTQ0NGM3NGJkNGI4NzNmOGQ0ZDY0YWU1YzVjZg==
4
+ ODgyOGM1NGVlNDY1ZmMxOGY3OGFkYjQ1MTU3ODQ5NjdmMmMyYjQyMA==
5
5
  data.tar.gz: !binary |-
6
- YTdiMWUzOTE5N2ZlNzMyNGFlN2QxM2ExNTUwMWIyODljZWM4MGE5Yw==
6
+ NWRhNjEwNDQ3YWUzZTEzYjgyYzkyYzM5Mzk5MjE5Njk2NzQwMmFiYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjVhZWEyYzFmZDEyZWViMjk3ODdlZmQ5NmRjMzM5ZTI2YzYwODU5ZTAyYWE1
10
- Yzg3OWViNmVjMGMyMDVkNzc0ZmNjYjA4ZGU1Mjg0OTk2ODMwNGVhM2YxNWNh
11
- MDEzNzNhZGZmOWEyOTBmNTBhMWE1ZjNjNjE5ZTQzYzIwNmUyOTI=
9
+ YzBmYTVjYjg0YzYwNjVmMjEwYWI2YmIwOTViZmI3MDU0NDZkNjQ4YjMwNzE1
10
+ ZWM5MDFkZmRmYjllNjAzNWY1ZDNiMTRhODcxMTE3Zjc3Yjg0ZjAwMzdlNDIw
11
+ ZWE1MDJmMzM5OTRjNDRiZTcwZThmMzk1ODg4ZTM2ZWY2Mzc1ODI=
12
12
  data.tar.gz: !binary |-
13
- MWJlZDE3NjA5MGNiNGYxN2YxNjRiZjQzZmIwOGQ1NTU5ZmQwNDlkZTBmMWM0
14
- NzI0MjgxNDg1YjZlOWM1MjdmZTVmNjk5NWU1ZGJiM2NmN2U0MTZjMGM3MmVh
15
- YjI1YTVmNzU3MjRiODhjNmY0OWEzN2YxNzdiNWY1OTBkOTVmMjM=
13
+ ODA3ZmQ0MzI0YTA1OWRjMjYwZWFiZDQ3NTBhYmU3MDA3NmQ3NWQ0ZjczNGNk
14
+ NzEzMjYxNjM3ODE4NjczNjRjMTZhNzQyYmQ2ZDkwMjAxNjVjMGQwOGZmOGZl
15
+ OWVkZTgzMzU0YWUyMTMxMjE4NTJkMmUzZjZmMmU4ZDE2ZjljMDg=
@@ -38,6 +38,7 @@ module Caboose
38
38
  def get_card_details(order)
39
39
  sc = order.site.store_config
40
40
  ot = order.order_transactions.where(:transaction_type => OrderTransaction::TYPE_AUTHORIZE, :success => true).first
41
+ return if ot.nil?
41
42
  case sc.pp_name
42
43
  when 'authorize.net'
43
44
  t = AuthorizeNet::Reporting::Transaction.new(sc.pp_username, sc.pp_password)
@@ -50,7 +51,7 @@ module Caboose
50
51
 
51
52
  def order_info(order)
52
53
  order_info = "Order Number: #{order.id}\n"
53
- order_info << "Order Date: #{order.date_created.strftime('%d %b %Y %H:%M:%S %p')}\n"
54
+ order_info << "Order Date: #{order.date_created ? order.date_created.strftime('%d %b %Y %H:%M:%S %p') : ''}\n"
54
55
  order_info << "Status: #{order.status.capitalize}\n"
55
56
  tbl = []
56
57
  tbl << [
@@ -65,41 +66,55 @@ module Caboose
65
66
  c = order.customer
66
67
  ba = order.billing_address
67
68
  billed_to = []
68
- billed_to << [
69
- { :content => "Name", :border_width => 0 },
70
- { :content => "#{ba.first_name} #{ba.last_name}", :border_width => 0}
71
- ]
72
- billed_to << [
73
- { :content => "Address", :border_width => 0 },
74
- { :content => "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}", :border_width => 0}
75
- ]
76
- billed_to << [
77
- { :content => "Email", :border_width => 0 },
78
- { :content => "#{c.email}", :border_width => 0}
79
- ]
80
- billed_to << [
81
- { :content => "Phone", :border_width => 0 },
82
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
83
- ]
84
-
69
+ if ba
70
+ billed_to << [
71
+ { :content => "Name", :border_width => 0 },
72
+ { :content => "#{ba.first_name} #{ba.last_name}", :border_width => 0}
73
+ ]
74
+ billed_to << [
75
+ { :content => "Address", :border_width => 0 },
76
+ { :content => "#{ba.address1}" + (ba.address2.blank? ? '' : "\n#{ba.address2}") + "\n#{ba.city}, #{ba.state} #{ba.zip}", :border_width => 0}
77
+ ]
78
+ billed_to << [
79
+ { :content => "Email", :border_width => 0 },
80
+ { :content => "#{c.email}", :border_width => 0}
81
+ ]
82
+ billed_to << [
83
+ { :content => "Phone", :border_width => 0 },
84
+ { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
85
+ ]
86
+ else
87
+ billed_to << [{ :content => "Name" , :border_width => 0 }]
88
+ billed_to << [{ :content => "Address" , :border_width => 0 }]
89
+ billed_to << [{ :content => "Email" , :border_width => 0 }]
90
+ billed_to << [{ :content => "Phone" , :border_width => 0 }]
91
+ end
92
+
85
93
  sa = order.shipping_address
86
94
  shipped_to = []
87
- shipped_to << [
88
- { :content => "Name", :border_width => 0 },
89
- { :content => "#{sa.first_name} #{sa.last_name}", :border_width => 0}
90
- ]
91
- shipped_to << [
92
- { :content => "Address", :border_width => 0 },
93
- { :content => "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}", :border_width => 0}
94
- ]
95
- shipped_to << [
96
- { :content => "Email", :border_width => 0 },
97
- { :content => "#{c.email}", :border_width => 0}
98
- ]
99
- shipped_to << [
100
- { :content => "Phone", :border_width => 0 },
101
- { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
102
- ]
95
+ if sa
96
+ shipped_to << [
97
+ { :content => "Name", :border_width => 0 },
98
+ { :content => "#{sa.first_name} #{sa.last_name}", :border_width => 0}
99
+ ]
100
+ shipped_to << [
101
+ { :content => "Address", :border_width => 0 },
102
+ { :content => "#{sa.address1}" + (sa.address2.blank? ? '' : "\n#{sa.address2}") + "\n#{sa.city}, #{sa.state} #{sa.zip}", :border_width => 0}
103
+ ]
104
+ shipped_to << [
105
+ { :content => "Email", :border_width => 0 },
106
+ { :content => "#{c.email}", :border_width => 0}
107
+ ]
108
+ shipped_to << [
109
+ { :content => "Phone", :border_width => 0 },
110
+ { :content => "#{self.formatted_phone(c.phone)}", :border_width => 0}
111
+ ]
112
+ else
113
+ shipped_to << [{ :content => "Name" , :border_width => 0 }]
114
+ shipped_to << [{ :content => "Address" , :border_width => 0 }]
115
+ shipped_to << [{ :content => "Email" , :border_width => 0 }]
116
+ shipped_to << [{ :content => "Phone" , :border_width => 0 }]
117
+ end
103
118
 
104
119
  tbl = []
105
120
  tbl << [
@@ -202,30 +217,40 @@ module Caboose
202
217
  tbl2 = []
203
218
  tbl3 = []
204
219
 
205
- tbl2 << [
206
- { :content => "Card Type", :width => 127, :border_width => 0 },
207
- { :content => self.card_type, :width => 128, :border_width => 0 }
208
- ]
209
- tbl2 << [
210
- { :content => "Transaction ID", :width => 127, :border_width => 0 },
211
- { :content => trans.transaction_id.to_s, :width => 128, :border_width => 0 }
212
- ]
213
- tbl2 << [
214
- { :content => "Gateway Response", :width => 127, :border_width => 0},
215
- { :content => trans.response_code.to_s, :width => 128, :border_width => 0 }
216
- ]
217
- tbl3 << [
218
- { :content => "Card Number", :width => 127, :border_width => 0},
219
- { :content => "XXXX XXXX XXXX " + self.card_number, :width => 128, :border_width => 0 }
220
- ]
221
- tbl3 << [
222
- { :content => "Transaction Time", :width => 127, :border_width => 0},
223
- { :content => trans.date_processed.strftime("%d %b %Y %H:%M:%S %p"), :width => 128, :border_width => 0 }
224
- ]
225
- tbl3 << [
226
- { :content => "Payment Process", :width => 127, :border_width => 0},
227
- { :content => trans.success ? "Successful" : "Failed", :width => 128, :border_width => 0 }
228
- ]
220
+ if trans
221
+ tbl2 << [
222
+ { :content => "Card Type", :width => 127, :border_width => 0 },
223
+ { :content => self.card_type, :width => 128, :border_width => 0 }
224
+ ]
225
+ tbl2 << [
226
+ { :content => "Transaction ID", :width => 127, :border_width => 0 },
227
+ { :content => trans.transaction_id.to_s, :width => 128, :border_width => 0 }
228
+ ]
229
+ tbl2 << [
230
+ { :content => "Gateway Response", :width => 127, :border_width => 0},
231
+ { :content => trans.response_code.to_s, :width => 128, :border_width => 0 }
232
+ ]
233
+ tbl3 << [
234
+ { :content => "Card Number", :width => 127, :border_width => 0},
235
+ { :content => "XXXX XXXX XXXX " + self.card_number, :width => 128, :border_width => 0 }
236
+ ]
237
+ tbl3 << [
238
+ { :content => "Transaction Time", :width => 127, :border_width => 0},
239
+ { :content => trans.date_processed.strftime("%d %b %Y %H:%M:%S %p"), :width => 128, :border_width => 0 }
240
+ ]
241
+ tbl3 << [
242
+ { :content => "Payment Process", :width => 127, :border_width => 0},
243
+ { :content => trans.success ? "Successful" : "Failed", :width => 128, :border_width => 0 }
244
+ ]
245
+ else
246
+ tbl2 << [{ :content => "Card Type" , :width => 127, :border_width => 0}]
247
+ tbl2 << [{ :content => "Transaction ID" , :width => 127, :border_width => 0}]
248
+ tbl2 << [{ :content => "Gateway Response" , :width => 127, :border_width => 0}]
249
+ tbl3 << [{ :content => "Card Number" , :width => 127, :border_width => 0}]
250
+ tbl3 << [{ :content => "Transaction Time" , :width => 127, :border_width => 0}]
251
+ tbl3 << [{ :content => "Payment Process" , :width => 127, :border_width => 0}]
252
+ end
253
+
229
254
  tbl << [
230
255
  { :content => "Authorization Details", :colspan => 2, :font_style => :bold }
231
256
  ]
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.154'
2
+ VERSION = '0.5.155'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.154
4
+ version: 0.5.155
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry