class Zoop::PaymentMethodCommon

Public Instance Methods

associate(customer_id) click to toggle source
# File lib/zoop/payment_method_common.rb, line 12
def associate(customer_id)
  raise RequestError.new('Invalid Token ID') unless token.present?
  self.class.associate(customer: customer_id.to_s, token: token.to_s)
end
create() click to toggle source
Calls superclass method Zoop::Model#create
# File lib/zoop/payment_method_common.rb, line 4
def create
  return super if self.token.present?

  token = Zoop::Token.create(to_hash)
  token.payment_method.token = token.id
  token.payment_method
end