mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
remove reference to stripe in user creation workflow
This commit is contained in:
parent
7cfa2ca2c7
commit
27ac345588
@ -53,7 +53,7 @@ class User < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
before_create :assign_default_role
|
before_create :assign_default_role
|
||||||
after_commit :create_stripe_customer, on: [:create]
|
after_commit :create_gateway_customer, on: [:create]
|
||||||
after_commit :notify_admin_when_user_is_created, on: :create
|
after_commit :notify_admin_when_user_is_created, on: :create
|
||||||
after_create :init_dependencies
|
after_create :init_dependencies
|
||||||
after_update :notify_group_changed, if: :saved_change_to_group_id?
|
after_update :notify_group_changed, if: :saved_change_to_group_id?
|
||||||
@ -366,8 +366,8 @@ class User < ApplicationRecord
|
|||||||
errors.add(:cgu, I18n.t('activerecord.errors.messages.empty')) if cgu == '0'
|
errors.add(:cgu, I18n.t('activerecord.errors.messages.empty')) if cgu == '0'
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_stripe_customer
|
def create_gateway_customer
|
||||||
StripeWorker.perform_async(:create_stripe_customer, id)
|
PaymentGatewayService.new.create_user(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_devise_notification(notification, *args)
|
def send_devise_notification(notification, *args)
|
||||||
|
@ -23,6 +23,10 @@ class PaymentGatewayService
|
|||||||
@gateway.create_subscription(payment_schedule, gateway_object_id)
|
@gateway.create_subscription(payment_schedule, gateway_object_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_user(user_id)
|
||||||
|
@gateway.create_user(user_id)
|
||||||
|
end
|
||||||
|
|
||||||
def create_coupon(coupon_id)
|
def create_coupon(coupon_id)
|
||||||
@gateway.create_coupon(coupon_id)
|
@gateway.create_coupon(coupon_id)
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,8 @@ module Payment; end
|
|||||||
class Payment::Service
|
class Payment::Service
|
||||||
def create_subscription(_payment_schedule, _gateway_object_id); end
|
def create_subscription(_payment_schedule, _gateway_object_id); end
|
||||||
|
|
||||||
|
def create_user(_user_id); end
|
||||||
|
|
||||||
def create_coupon(_coupon_id); end
|
def create_coupon(_coupon_id); end
|
||||||
|
|
||||||
def delete_coupon(_coupon_id); end
|
def delete_coupon(_coupon_id); end
|
||||||
|
@ -49,6 +49,10 @@ class Stripe::Service < Payment::Service
|
|||||||
pgo.save!
|
pgo.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_user(user_id)
|
||||||
|
StripeWorker.perform_async(:create_stripe_customer, user_id)
|
||||||
|
end
|
||||||
|
|
||||||
def create_coupon(coupon_id)
|
def create_coupon(coupon_id)
|
||||||
coupon = Coupon.find(coupon_id)
|
coupon = Coupon.find(coupon_id)
|
||||||
stp_coupon = { id: coupon.code }
|
stp_coupon = { id: coupon.code }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user