Braintree.Merchant.Account (Braintree v0.13.0)

Represents a merchant account in a marketplace.

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

Link to this section 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.

Link to this section Types

@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()
}

Link to this section Functions

Link to this function

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

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

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

example

Example

= Braintree.Merchant.Account.create(%{

tos_accepted: true,

})

Link to this function

find(id, opts \\ [])

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

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

example

Example

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

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

Link to this function

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

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

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

Example

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

merchant.funding_details.account_number # "1234567890"