class ShopifyAPI::RecurringApplicationCharge

Attributes

activated_on[R]
billing_on[R]
cancelled_on[R]
capped_amount[R]
confirmation_url[R]
created_at[R]
currency[R]
id[R]
name[R]
price[R]
return_url[R]
status[R]
terms[R]
test[R]
trial_days[R]
trial_ends_on[R]
updated_at[R]

Public Class Methods

all( since_id: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 137
def all(
  since_id: nil,
  fields: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {},
    params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[RecurringApplicationCharge])
end
current(session: ShopifyAPI::Context.active_session) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 156
def current(session: ShopifyAPI::Context.active_session)
  charges = all(session: session)
  charges.select { |charge| charge.status == "active" }.first
end
delete( id:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 116
def delete(
  id:,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id},
    params: {},
  )
end
find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 97
def find(
  id:,
  fields: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id},
    params: {fields: fields},
  )
  T.cast(result[0], T.nilable(RecurringApplicationCharge))
end
new(session: ShopifyAPI::Context.active_session, from_hash: nil) click to toggle source
Calls superclass method ShopifyAPI::Rest::Base::new
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @activated_on = T.let(nil, T.nilable(String))
  @billing_on = T.let(nil, T.nilable(String))
  @cancelled_on = T.let(nil, T.nilable(String))
  @capped_amount = T.let(nil, T.nilable(T.any(String, Integer)))
  @confirmation_url = T.let(nil, T.nilable(String))
  @created_at = T.let(nil, T.nilable(String))
  @currency = T.let(nil, T.nilable(Currency))
  @id = T.let(nil, T.nilable(Integer))
  @name = T.let(nil, T.nilable(String))
  @price = T.let(nil, T.nilable(T.any(String, Float)))
  @return_url = T.let(nil, T.nilable(String))
  @status = T.let(nil, T.nilable(String))
  @terms = T.let(nil, T.nilable(String))
  @test = T.let(nil, T.nilable(T::Boolean))
  @trial_days = T.let(nil, T.nilable(Integer))
  @trial_ends_on = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end

Public Instance Methods

customize( body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb, line 169
def customize(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :put,
    operation: :customize,
    session: @session,
    ids: {id: @id},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end