Class: Pay::Purchasekit::Customer

Inherits:
Customer
  • Object
show all
Defined in:
app/models/pay/purchasekit/customer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.model_nameObject

Use base class name for dom_id to keep stream names consistent



5
6
7
# File 'app/models/pay/purchasekit/customer.rb', line 5

def self.model_name
  Pay::Customer.model_name
end

Instance Method Details

#add_payment_method(payment_method_id, default: false) ⇒ Object



17
18
19
# File 'app/models/pay/purchasekit/customer.rb', line 17

def add_payment_method(payment_method_id, default: false)
  raise Pay::Purchasekit::Error, "Payment methods managed by App Store or Google Play."
end

#charge(amount, options = {}) ⇒ Object



9
10
11
# File 'app/models/pay/purchasekit/customer.rb', line 9

def charge(amount, options = {})
  raise Pay::Purchasekit::Error, "One-time charges not supported. Use in-app purchases."
end

#subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options) ⇒ Object



13
14
15
# File 'app/models/pay/purchasekit/customer.rb', line 13

def subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options)
  raise Pay::Purchasekit::Error, "Subscriptions must be initiated through the native app."
end