class Mollie::Partner

Attributes

is_commission_partner[RW]
partner_contract_signed_at[RW]
partner_contract_update_available[RW]
partner_type[RW]
user_agent_tokens[R]

Public Class Methods

current(options = {}) click to toggle source
# File lib/mollie/partner.rb, line 13
def self.current(options = {})
  response = Client.instance.perform_http_call('GET', 'organizations/me/partner', nil, {}, options)
  new(response)
end

Public Instance Methods

commission_partner?() click to toggle source
# File lib/mollie/partner.rb, line 22
def commission_partner?
  is_commission_partner
end
contract_signed_at() click to toggle source
# File lib/mollie/partner.rb, line 26
def contract_signed_at
  @contract_signed_at = begin
    Time.parse(partner_contract_signed_at)
  rescue StandardError
    nil
  end
end
contract_update_available?() click to toggle source
# File lib/mollie/partner.rb, line 34
def contract_update_available?
  partner_contract_update_available
end
type() click to toggle source
# File lib/mollie/partner.rb, line 18
def type
  partner_type
end
user_agent_tokens=(tokens) click to toggle source
# File lib/mollie/partner.rb, line 38
def user_agent_tokens=(tokens)
  @user_agent_tokens = tokens.map do |token|
    OpenStruct.new(
      token: token['token'],
      starts_at: Time.parse(token['starts_at']),
      ends_at: (Time.parse(token['ends_at']) unless token['ends_at'].nil?)
    )
  end
end