Class: LucidShopify::CreateCharge
- Inherits:
-
Object
- Object
- LucidShopify::CreateCharge
- Defined in:
- lib/lucid_shopify/create_charge.rb
Instance Method Summary collapse
-
#call(request_credentials, charge) ⇒ Hash
Create a new recurring application charge.
-
#initialize(client: Container[:client]) ⇒ CreateCharge
constructor
A new instance of CreateCharge.
Constructor Details
#initialize(client: Container[:client]) ⇒ CreateCharge
Returns a new instance of CreateCharge.
10 11 12 |
# File 'lib/lucid_shopify/create_charge.rb', line 10 def initialize(client: Container[:client]) @client = client end |
Instance Method Details
#call(request_credentials, charge) ⇒ Hash
Create a new recurring application charge.
22 23 24 25 26 27 28 |
# File 'lib/lucid_shopify/create_charge.rb', line 22 def call(request_credentials, charge) data = @client.post_json(request_credentials, 'recurring_application_charges', { 'return_url' => LucidShopify.config.billing_callback_uri }.merge(charge.transform_keys(&:to_s))) data['recurring_application_charge'] end |