Class: Pay::Purchasekit::Customer
- Inherits:
-
Customer
- Object
- Customer
- Pay::Purchasekit::Customer
- Defined in:
- app/models/pay/purchasekit/customer.rb
Class Method Summary collapse
-
.model_name ⇒ Object
Use base class name for dom_id to keep stream names consistent.
Instance Method Summary collapse
- #add_payment_method(payment_method_id, default: false) ⇒ Object
- #charge(amount, options = {}) ⇒ Object
- #subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options) ⇒ Object
Class Method Details
.model_name ⇒ Object
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, = {}) 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, **) raise Pay::Purchasekit::Error, "Subscriptions must be initiated through the native app." end |