Class: Wiq::Commands::BillingProfiles

Inherits:
Base
  • Object
show all
Defined in:
lib/wiq/commands/billing_profiles.rb

Constant Summary collapse

VALID_PROFILE_TYPES =
%w[ParentProfile CoachProfile].freeze

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Instance Method Details

#show(profile_id) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/wiq/commands/billing_profiles.rb', line 32

def show(profile_id)
  params = {}
  params["for_update"] = true if options[:for_update]

  billing_profile = client.get(
    "/api/v1/billing_profiles/#{options[:profile_type]}/#{profile_id}",
    params
  )
  render(billing_profile,
         summary: "Billing profile #{billing_profile["id"]} for " \
                  "#{options[:profile_type]} #{profile_id}.",
         breadcrumbs: [
           { "cmd" => "wiq charges list --billing-profile #{billing_profile["id"]}",
             "description" => "Payment history for this family" },
           { "cmd" => "wiq charges list --billing-profile #{billing_profile["id"]} --status failed --since <date>",
             "description" => "Recent failed charges" }
         ])
end