Braintree.Merchant.Account (Braintree v0.16.0)

Represents a merchant account in a marketplace.

For additional reference, see: https://developers.braintreepayments.com/reference/response/merchant-account/ruby

Summary

Functions

Create a merchant account or return an error response after failed validation

If you want to look up a single merchant using ID, use the find method.

Convert a map into a Braintree.Merchant.Account struct.

To update a merchant, use its ID along with new attributes. The same validations apply as when creating a merchant. Any attribute not passed will remain unchanged.

Types

t()

@type t() :: %Braintree.Merchant.Account{
  business: Braintree.Merchant.Business.t(),
  currency_iso_code: String.t(),
  default: boolean(),
  funding: Braintree.Merchant.Funding.t(),
  id: String.t(),
  individual: Braintree.Merchant.Individual.t(),
  master_merchant_account: String.t(),
  status: String.t()
}

Functions

create(params \\ %{}, opts \\ [])

@spec create(map(), Keyword.t()) :: {:ok, t()} | Braintree.HTTP.error()

Create a merchant account or return an error response after failed validation

Example

= Braintree.Merchant.Account.create(%{

tos_accepted: true,

})

find(id, opts \\ [])

@spec find(binary(), Keyword.t()) :: {:ok, t()} | Braintree.HTTP.error()

If you want to look up a single merchant using ID, use the find method.

Example

merchant = Braintree.Merchant.find("merchant_id")

new(params)

Convert a map into a Braintree.Merchant.Account struct.

update(id, params, opts \\ [])

@spec update(binary(), map(), Keyword.t()) :: {:ok, t()} | Braintree.HTTP.error()

To update a merchant, use its ID along with new attributes. The same validations apply as when creating a merchant. Any attribute not passed will remain unchanged.

Example

{:ok, merchant} = Braintree.Merchant.update("merchant_id", %{
  funding_details: %{account_number: "1234567890"}
})

merchant.funding_details.account_number # "1234567890"