fix jamclass posa cards
This commit is contained in:
parent
a2fd9cb87a
commit
abf3c6f0f5
|
|
@ -154,6 +154,7 @@ module JamRuby
|
|||
|
||||
|
||||
if self.save
|
||||
UserWhitelist.card_create(user, 'posa')
|
||||
SaleLineItem.associate_user_for_posa(self, user)
|
||||
|
||||
# when you claim a POSA card, you are also making a LessonPackagePurchase
|
||||
|
|
|
|||
|
|
@ -22,6 +22,14 @@ module JamRuby
|
|||
APP_CONFIG.admin_root_url + "/admin/user_whitelists/" + id
|
||||
end
|
||||
|
||||
# if a user claims a gift card or posa card, whitelist their account so they don't get messed with by fraud code
|
||||
def self.card_create(user, notes)
|
||||
user_whitelist = UserWhitelist.new
|
||||
user_whitelist.user = user
|
||||
user_whitelist.notes = notes
|
||||
user_whitelist.save
|
||||
end
|
||||
|
||||
def to_s
|
||||
user
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ badCode = 'This is not a valid code. Please carefully re-enter the code and try
|
|||
|
||||
if errorText? && errorText.indexOf('must already be set') > -1
|
||||
errorText = 'This card has not been activated by a retailer and cannot currently be used. If you purchased this card from a store, please return to the store and have the store activate the card. Only the store where you purchased this card can activate it.'
|
||||
|
||||
if errorText? && errorText.indexOf('already claimed') > -1
|
||||
errorText = 'This card has already been claimed. If you believe this is in error, please email us at support@jamkazam.com to report this problem.'
|
||||
|
||||
buttonClassnames = classNames({'redeem-giftcard': true, 'button-orange': true, disabled: @state.processing || @state.done })
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1061,6 +1061,7 @@ class ApiUsersController < ApiController
|
|||
return
|
||||
else
|
||||
|
||||
UserWhitelist.card_create(current_user, 'giftcard')
|
||||
# apply gift card items to everything in shopping cart
|
||||
current_user.reload
|
||||
ShoppingCart.apply_gifted_jamtracks(current_user)
|
||||
|
|
|
|||
|
|
@ -451,5 +451,7 @@ if defined?(Bundler)
|
|||
# If you want to use the new JSON-based format in your application, you can add an initializer file with the following content:
|
||||
# This would transparently migrate your existing Marshal-serialized cookies into the new JSON-based format.
|
||||
config.action_dispatch.cookies_serializer = :hybrid
|
||||
|
||||
config.jam_class_card_wait_period_year = 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue