class Promisepay::PaypalAccount

Manage Paypal accounts

Public Instance Methods

deactivate() click to toggle source

Deletes a Paypal account for a user on a marketplace. Sets the account to in-active.

@see reference.promisepay.com/#redact-paypal-account

@return [Boolean]

# File lib/promisepay/models/paypal_account.rb, line 20
def deactivate
  @client.delete("paypal_accounts/#{id}")
  @attributes['active'] = false
  true
end
user() click to toggle source

Get the user the paypal account belongs to.

@see reference.promisepay.com/#show-paypal-account-user

@return [Promisepay::User]

# File lib/promisepay/models/paypal_account.rb, line 9
def user
  response = JSON.parse(@client.get("paypal_accounts/#{send(:id)}/users").body)
  Promisepay::User.new(@client, response['users'])
end