class Lucid::Shopify::ActivateCharge

Public Class Methods

new(client: Container[:client]) click to toggle source

@param client [#post_json]

# File lib/lucid/shopify/activate_charge.rb, line 9
def initialize(client: Container[:client])
  @client = client
end

Public Instance Methods

call(credentials, charge) click to toggle source

Activate a recurring application charge.

@param credentials [Credentials] @param charge [#to_h] an accepted charge received from Shopify via callback

@return [Hash] the active charge

# File lib/lucid/shopify/activate_charge.rb, line 19
def call(credentials, charge)
  data = @client.post_json(credentials, "recurring_application_charges/#{charge.to_h['id']}/activate", charge.to_h)

  data['recurring_application_charge']
end