class Promisepay::CardAccountResource

Resource for the CardAccounts API

Public Instance Methods

create(attributes) click to toggle source

Create a card account for a user on a marketplace.

@see reference.promisepay.com/#create-card-account

@param attributes [Hash] Bank Account's attributes.

@return [Promisepay::CardAccount]

# File lib/promisepay/resources/card_account_resource.rb, line 27
def create(attributes)
  response = JSON.parse(@client.post('card_accounts', attributes).body)
  Promisepay::CardAccount.new(@client, response['card_accounts'])
end
find(id) click to toggle source

Get card account for a user on a marketplace.

@see reference.promisepay.com/#show-card-account

@param id [String] Bank Account ID.

@return [Promisepay::CardAccount]

# File lib/promisepay/resources/card_account_resource.rb, line 15
def find(id)
  response = JSON.parse(@client.get("card_accounts/#{id}").body)
  Promisepay::CardAccount.new(@client, response['card_accounts'])
end
model() click to toggle source
# File lib/promisepay/resources/card_account_resource.rb, line 4
def model
  Promisepay::CardAccount
end