centaman 4.0.5 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/centaman/object/coupon_check.rb +20 -0
- data/lib/centaman/object/effect.rb +12 -0
- data/lib/centaman/service/purchase_membership.rb +2 -2
- data/lib/centaman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 294533b04ffeddf23c945591d3fa6417c026c61cc79a66256127a5a1aa948580
|
4
|
+
data.tar.gz: f619c092dfa90b48cc6ae6f6da988303af70e40315eb79f7d6933e7c9135a038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aae88015f47144cd77f984bb13dfd249ece5afca137132e7d82a810b366400aa7e692bc1d9c4cd4f60fc85546fb0e8ad891bb52e7d105f97f0c459ad1595eddb
|
7
|
+
data.tar.gz: 1dd84f04bf8e2f2716e026c1520f332655418f7f6db45d0b1e2933aab31ed8e4bfea99f865bd1571dcfdce2f36a739a9e098a298d342bbddf7fdb9e2bcc7fee7
|
@@ -30,6 +30,26 @@ module Centaman
|
|
30
30
|
centaman_key: 'UsesRemaining',
|
31
31
|
app_key: :uses_remaining,
|
32
32
|
type: :integer
|
33
|
+
),
|
34
|
+
Centaman::Attribute.new(
|
35
|
+
centaman_key: 'ConditionForUse',
|
36
|
+
app_key: :condition_for_use,
|
37
|
+
type: :string
|
38
|
+
),
|
39
|
+
Centaman::Attribute.new(
|
40
|
+
centaman_key: 'CouponStockID',
|
41
|
+
app_key: :coupon_stock_id,
|
42
|
+
type: :integer
|
43
|
+
),
|
44
|
+
Centaman::Attribute.new(
|
45
|
+
centaman_key: 'IsValidForNewMembership',
|
46
|
+
app_key: :is_valid_for_new_membership,
|
47
|
+
type: :boolean
|
48
|
+
),
|
49
|
+
Centaman::Attribute.new(
|
50
|
+
centaman_key: 'IsvalidForRenewMembership',
|
51
|
+
app_key: :is_valid_for_renew_membership,
|
52
|
+
type: :boolean
|
33
53
|
)
|
34
54
|
]
|
35
55
|
end
|
@@ -1,6 +1,18 @@
|
|
1
1
|
module Centaman
|
2
2
|
class Object::Effect < Centaman::Object
|
3
3
|
# rubocop:disable Metrics/MethodLength
|
4
|
+
def dollar_discount
|
5
|
+
effect_type == 'DiscountAmount'
|
6
|
+
end
|
7
|
+
|
8
|
+
def percent_discount
|
9
|
+
effect_type == 'DiscountPercent'
|
10
|
+
end
|
11
|
+
|
12
|
+
def override_discount
|
13
|
+
effect_type == 'PriceOverride'
|
14
|
+
end
|
15
|
+
|
4
16
|
def attributes
|
5
17
|
[
|
6
18
|
Centaman::Attribute.new(
|
@@ -48,9 +48,9 @@ module Centaman
|
|
48
48
|
return {} unless coupon_service.coupon_applies(add_on)
|
49
49
|
{
|
50
50
|
'Coupon': {
|
51
|
-
"CouponCode": coupon.
|
51
|
+
"CouponCode": coupon.coupon_code,
|
52
52
|
"DiscountAmount": coupon_service.amount_saved(add_on),
|
53
|
-
"StockID": coupon.
|
53
|
+
"StockID": coupon.coupon_stock_id
|
54
54
|
}
|
55
55
|
}
|
56
56
|
end
|
data/lib/centaman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centaman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- francirp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|