op_cart 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/op_cart/order.rb +7 -0
- data/lib/op_cart/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ca5434d3f5d606baa79c1522cc15790b35956f7
|
4
|
+
data.tar.gz: 364fe087027256ebb9a3a0adb5e13d402f211cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0348f0513e4ff0b5c6ef740a383efdddbec84dddca1bd7973e1357b390535879aa0a3ee223ee51ea3f8fc1175778202bdb3bca2e11d5533bab4973d34dcba92b
|
7
|
+
data.tar.gz: f2437c3c71122d9ed9b0a6493c427231305f34d8ead0f496685422200136870ef226abcb0eabfd1337ec8758bbc6a172306292b120239242ead93baeac4cfcf9
|
data/app/models/op_cart/order.rb
CHANGED
@@ -41,6 +41,12 @@ module OpCart
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
def charge_description
|
45
|
+
line_items.select {|li| li.sellable_type == "OpCart::Product" }
|
46
|
+
.map{|li| "#{li.quantity} x #{li.sellable.name}" }
|
47
|
+
.to_sentence
|
48
|
+
end
|
49
|
+
|
44
50
|
def charge_customer
|
45
51
|
if processor_token.present?
|
46
52
|
customer.update_card processor_token
|
@@ -49,6 +55,7 @@ module OpCart
|
|
49
55
|
|
50
56
|
self.processor_response = Stripe::Charge.create(
|
51
57
|
amount: total,
|
58
|
+
description: charge_description,
|
52
59
|
currency: "usd",
|
53
60
|
customer: customer.processor_token
|
54
61
|
).to_hash
|
data/lib/op_cart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: op_cart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Boehs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|