Class: Pay::AwsMarketplace::Customer
- Inherits:
-
Customer
- Object
- Customer
- Pay::AwsMarketplace::Customer
- Defined in:
- lib/pay/aws_marketplace/customer.rb
Instance Method Summary collapse
- #add_payment_method(payment_method_id, default: false) ⇒ Object
- #api_record ⇒ Object
- #charge(amount, options = {}) ⇒ Object
- #checkout(product_id:) ⇒ Object
- #subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options) ⇒ Object
- #update_api_record(**attributes) ⇒ Object
Instance Method Details
#add_payment_method(payment_method_id, default: false) ⇒ Object
33 34 35 |
# File 'lib/pay/aws_marketplace/customer.rb', line 33 def add_payment_method(payment_method_id, default: false) raise PaymentMethodError end |
#api_record ⇒ Object
11 12 13 |
# File 'lib/pay/aws_marketplace/customer.rb', line 11 def api_record {customer_identifier: processor_id, customer_aws_account_id: aws_account_id}.compact end |
#charge(amount, options = {}) ⇒ Object
19 20 21 |
# File 'lib/pay/aws_marketplace/customer.rb', line 19 def charge(amount, = {}) raise ChargeError, "AWS Marketplace does not support one-off charges" end |
#checkout(product_id:) ⇒ Object
23 24 25 26 27 |
# File 'lib/pay/aws_marketplace/customer.rb', line 23 def checkout(product_id:) URI("https://aws.amazon.com/marketplace/procurement").tap do |url| url.query = URI.encode_www_form(productId: product_id) end.to_s end |
#subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **options) ⇒ Object
29 30 31 |
# File 'lib/pay/aws_marketplace/customer.rb', line 29 def subscribe(name: Pay.default_product_name, plan: Pay.default_plan_name, **) raise UpdateError end |
#update_api_record(**attributes) ⇒ Object
15 16 17 |
# File 'lib/pay/aws_marketplace/customer.rb', line 15 def update_api_record(**attributes) raise UpdateError, "AWS Marketplace does not allow updating customer information" end |