View Source Chargebeex.Customer (chargebeex v0.1.0)

Link to this section Summary

Link to this section Types

@type t() :: %Chargebeex.Customer{
  allow_direct_debit: boolean(),
  auto_collection: String.t(),
  backup_payment_source_id: String.t(),
  billing_address: map(),
  business_customer_without_vat_number: boolean(),
  card_status: String.t(),
  channel: String.t(),
  company: String.t(),
  created_at: integer(),
  custom_fields: term(),
  deleted: boolean(),
  email: String.t(),
  excess_payments: integer(),
  first_name: String.t(),
  id: String.t(),
  last_name: String.t(),
  locale: String.t(),
  net_term_days: integer(),
  object: String.t(),
  pii_cleared: String.t(),
  preferred_currency_code: String.t(),
  primary_payment_source_id: String.t(),
  promotional_credits: integer(),
  refundable_credits: integer(),
  relationship: map(),
  resource_version: integer(),
  resources: term(),
  taxability: String.t(),
  unbilled_charges: integer(),
  updated_at: integer(),
  vat_number: term(),
  vat_number_status: term(),
  vat_number_validated_time: term()
}

Link to this section Functions

Link to this function

assign_payment_role(id, params)

View Source

Callback implementation for Chargebeex.Resource.build/1.

Link to this function

change_billing_date(id, params)

View Source
Link to this function

collect_payment(id, params)

View Source

Allows to create a Customer

examples

Examples

iex> Chargebeex.Customer.create(%{company: "MyCompany"})
  {:ok, %Chargebeex.Customer{
    allow_direct_debit: false,
    auto_collection: "on",
    business_customer_without_vat_number: false,
    card_status: "no_card",
    channel: "web",
    company: "MyCompany",
    created_at: 1648489755,
    custom_fields: %{
      "cf_internal_identifier" => "1234",
      "cf_other_custom_field" => "foobar"
    },
    deleted: false,
    email: nil,
    excess_payments: 0,
    id: "169ljDT1Op0yuxET",
    locale: nil,
    net_term_days: 0,
    object: "customer",
    pii_cleared: "active",
    preferred_currency_code: "EUR",
    promotional_credits: 0,
    refundable_credits: 0,
    resource_version: 1648489755361,
    resources: %{},
    taxability: "taxable",
    unbilled_charges: 0,
    updated_at: 1648489755
    }}

Deletes a Customer

examples

Examples

iex> Chargebeex.Customer.delete("169ljDT1Op0yuxET")
{:ok, %Chargebeex.Customer{
    allow_direct_debit: false,
    auto_collection: "on",
    business_customer_without_vat_number: false,
    card_status: "no_card",
    channel: "web",
    company: "MyUpdatedCompany",
    created_at: 1648489755,
    custom_fields: %{
      "cf_internal_identifier" => "1234",
      "cf_other_custom_field" => "foobar"
    },
    deleted: false,
    email: nil,
    excess_payments: 0,
    id: "169ljDT1Op0yuxET",
    locale: nil,
    net_term_days: 0,
    object: "customer",
    pii_cleared: "active",
    preferred_currency_code: "EUR",
    promotional_credits: 0,
    refundable_credits: 0,
    resource_version: 1648489755361,
    resources: %{
      "card" => %Chargebeex.Card{
        billing_addr1: "my_address",
        billing_addr2: nil,
        billing_city: "Paris",
        billing_country: "FR",
        billing_state: nil,
        billing_state_code: nil,
        billing_zip: "12345",
        card_type: "visa",
        created_at: 1648490053,
        customer_id: "169ljDT1Op0yuxET",
        expiry_month: 12,
        expiry_year: 2023,
        first_name: "John",
        funding_type: "credit",
        gateway: "chargebee",
        gateway_account_id: "gw_AzqPCGS1aaz5K3b",
        iin: "411111",
        ip_address: nil,
        issuing_country: nil,
        last4: "1111",
        last_name: "M",
        masked_number: "************1111",
        object: "card",
        payment_source_id: "pm_AzqYbtT1OqGcr5B1",
        powered_by: nil,
        ref_tx_id: nil,
        resource_version: 1648490053804,
        status: "valid",
        updated_at: 1648490053
      }
    },
    taxability: "taxable",
    unbilled_charges: 0,
    updated_at: 1648489755
    }}

Allows to list Customers

Available filters can be found here: https://apidocs.chargebee.com/docs/api/customers#list_customers

examples

Examples

iex> filters = %{limit: 2}
iex(2)> Chargebeex.Customer.list(filters)
{:ok, [%Chargebeex.Customer{...}, %Chargebeex.Customer{...}], %{"next_offset" => nil}}
Link to this function

record_excess_payment(id, params)

View Source
Link to this function

relationships(id, params)

View Source

Allows to retrieve a Customer

examples

Examples

iex> Chargebeex.Customer.retrieve("AzyzkCSvjSUpY4xuB")
{:ok, %Chargebeex.Customer{
    allow_direct_debit: false,
    auto_collection: "on",
    business_customer_without_vat_number: false,
    card_status: "no_card",
    channel: "web",
    company: "MyCompany",
    created_at: 1648489755,
    custom_fields: %{
      "cf_internal_identifier" => "1234",
      "cf_other_custom_field" => "foobar"
    },
    deleted: false,
    email: nil,
    excess_payments: 0,
    id: "169ljDT1Op0yuxET",
    locale: nil,
    net_term_days: 0,
    object: "customer",
    pii_cleared: "active",
    preferred_currency_code: "EUR",
    promotional_credits: 0,
    refundable_credits: 0,
    resource_version: 1648489755361,
    resources: %{
      "card" => %Chargebeex.Card{
        billing_addr1: "my_address",
        billing_addr2: nil,
        billing_city: "Paris",
        billing_country: "FR",
        billing_state: nil,
        billing_state_code: nil,
        billing_zip: "12345",
        card_type: "visa",
        created_at: 1648490053,
        customer_id: "169ljDT1Op0yuxET",
        expiry_month: 12,
        expiry_year: 2023,
        first_name: "John",
        funding_type: "credit",
        gateway: "chargebee",
        gateway_account_id: "gw_AzqPCGS1aaz5K3b",
        iin: "411111",
        ip_address: nil,
        issuing_country: nil,
        last4: "1111",
        last_name: "M",
        masked_number: "************1111",
        object: "card",
        payment_source_id: "pm_AzqYbtT1OqGcr5B1",
        powered_by: nil,
        ref_tx_id: nil,
        resource_version: 1648490053804,
        status: "valid",
        updated_at: 1648490053
      }
    },
    taxability: "taxable",
    unbilled_charges: 0,
    updated_at: 1648489755
    }}

Allows to update a Customer

examples

Examples

iex> Chargebeex.Customer.update("169ljDT1Op0yuxET", %{company: "MyUpdatedCompany"})
{:ok, %Chargebeex.Customer{
    allow_direct_debit: false,
    auto_collection: "on",
    business_customer_without_vat_number: false,
    card_status: "no_card",
    channel: "web",
    company: "MyUpdatedCompany",
    created_at: 1648489755,
    custom_fields: %{
      "cf_internal_identifier" => "1234",
      "cf_other_custom_field" => "foobar"
    },
    deleted: false,
    email: nil,
    excess_payments: 0,
    id: "169ljDT1Op0yuxET",
    locale: nil,
    net_term_days: 0,
    object: "customer",
    pii_cleared: "active",
    preferred_currency_code: "EUR",
    promotional_credits: 0,
    refundable_credits: 0,
    resource_version: 1648489755361,
    resources: %{
      "card" => %Chargebeex.Card{
        billing_addr1: "my_address",
        billing_addr2: nil,
        billing_city: "Paris",
        billing_country: "FR",
        billing_state: nil,
        billing_state_code: nil,
        billing_zip: "12345",
        card_type: "visa",
        created_at: 1648490053,
        customer_id: "169ljDT1Op0yuxET",
        expiry_month: 12,
        expiry_year: 2023,
        first_name: "John",
        funding_type: "credit",
        gateway: "chargebee",
        gateway_account_id: "gw_AzqPCGS1aaz5K3b",
        iin: "411111",
        ip_address: nil,
        issuing_country: nil,
        last4: "1111",
        last_name: "M",
        masked_number: "************1111",
        object: "card",
        payment_source_id: "pm_AzqYbtT1OqGcr5B1",
        powered_by: nil,
        ref_tx_id: nil,
        resource_version: 1648490053804,
        status: "valid",
        updated_at: 1648490053
      }
    },
    taxability: "taxable",
    unbilled_charges: 0,
    updated_at: 1648489755
    }}
Link to this function

update_billing_info(id, params)

View Source
Link to this function

update_hierarchy_settings(id, params)

View Source
Link to this function

update_payment_method(id, params)

View Source