class Stripe::Customer

Overview

This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. Related guide: Save a card during payment

Included Modules

Defined in:

stripe/models/customer.cr

Constant Summary

ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [customer]."
ERROR_MESSAGE_FOR_TAX_EXEMPT = "invalid value for \"tax_exempt\", must be one of [exempt, none, reverse]."
MAX_LENGTH_FOR_CURRENCY = 5000
MAX_LENGTH_FOR_DESCRIPTION = 5000
MAX_LENGTH_FOR_EMAIL = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_INVOICE_PREFIX = 5000
MAX_LENGTH_FOR_NAME = 5000
MAX_LENGTH_FOR_PHONE = 5000
VALID_VALUES_FOR_OBJECT = String.static_array("customer")
VALID_VALUES_FOR_TAX_EXEMPT = String.static_array("exempt", "none", "reverse")

Constructors

Instance Method Summary

Instance methods inherited from module OpenApi::Json

after_initialize after_initialize, clone clone, eql?(o : self) eql?, to_hash : Hash(String, JSON::Any) to_hash, to_json_any : JSON::Any to_json_any

Class methods inherited from module OpenApi::Json

build_from_hash(hash : Hash) build_from_hash, build_from_json_any(json_any : JSON::Any) build_from_json_any

Instance methods inherited from module OpenApi::Validatable

list_invalid_properties : Array(String) list_invalid_properties, list_invalid_properties_for(key : String) : Array(String) list_invalid_properties_for, valid? : Bool valid?, validate : Nil validate

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(*, created : Int64 | Nil = nil, default_source : Stripe::CustomerDefaultSource | Nil = nil, description : String | Nil = nil, email : String | Nil = nil, id : String | Nil = nil, livemode : Bool | Nil = nil, object : String | Nil = nil, shipping : Stripe::CustomerShipping1 | Nil = nil, address : Stripe::CustomerAddress | Nil = nil, balance : Int64 | Nil = nil, cash_balance : Stripe::CustomerCashBalance | Nil = nil, currency : String | Nil = nil, delinquent : Bool | Nil = nil, discount : Stripe::CustomerDiscount | Nil = nil, invoice_credit_balance : Hash(String, Int32) | Nil = nil, invoice_prefix : String | Nil = nil, invoice_settings : Stripe::InvoiceSettingCustomerSetting | Nil = nil, metadata : Hash(String, String) | Nil = nil, name : String | Nil = nil, next_invoice_sequence : Int64 | Nil = nil, phone : String | Nil = nil, preferred_locales : Array(String) | Nil = nil, sources : Stripe::ApmsSourcesSourceList | Nil = nil, subscriptions : Stripe::SubscriptionList | Nil = nil, tax : Stripe::CustomerTax | Nil = nil, tax_exempt : String | Nil = nil, tax_ids : Stripe::TaxIDsList | Nil = nil, test_clock : Stripe::CustomerTestClock | Nil = nil) #

Initializes the object @param [Hash] attributes Model attributes in the form of hash


[View source]

Instance Method Detail

def ==(other : self) #

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code


def address : Stripe::CustomerAddress | Nil #

[View source]
def address=(new_value : Stripe::CustomerAddress | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] address Object to be assigned


[View source]
def address_present=(address_present : Bool) #

[View source]
def address_present? : Bool #

[View source]
def balance : Int64 | Nil #

[View source]
def balance=(new_value : Int64 | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] balance Object to be assigned


[View source]
def cash_balance : Stripe::CustomerCashBalance | Nil #

[View source]
def cash_balance=(new_value : Stripe::CustomerCashBalance | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] cash_balance Object to be assigned


[View source]
def cash_balance_present=(cash_balance_present : Bool) #

[View source]
def cash_balance_present? : Bool #

[View source]
def created : Int64 | Nil #

[View source]
def created=(new_value : Int64 | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned


[View source]
def currency : String | Nil #

[View source]
def currency=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned


[View source]
def currency_present=(currency_present : Bool) #

[View source]
def currency_present? : Bool #

[View source]
def default_source : Stripe::CustomerDefaultSource | Nil #

[View source]
def default_source=(new_value : Stripe::CustomerDefaultSource | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] default_source Object to be assigned


[View source]
def delinquent : Bool | Nil #

[View source]
def delinquent=(new_value : Bool | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] delinquent Object to be assigned


[View source]
def delinquent_present=(delinquent_present : Bool) #

[View source]
def delinquent_present? : Bool #

[View source]
def description : String | Nil #

[View source]
def description=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned


[View source]
def discount : Stripe::CustomerDiscount | Nil #

[View source]
def discount=(new_value : Stripe::CustomerDiscount | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] discount Object to be assigned


[View source]
def discount_present=(discount_present : Bool) #

[View source]
def discount_present? : Bool #

[View source]
def email : String | Nil #

[View source]
def email=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] email Object to be assigned


[View source]
def hash(hasher) #

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code


def id : String | Nil #

[View source]
def id=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned


[View source]
def invoice_credit_balance : Hash(String, Int32) | Nil #

[View source]
def invoice_credit_balance=(new_value : Hash(String, Int32) | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_credit_balance Object to be assigned


[View source]
def invoice_prefix : String | Nil #

[View source]
def invoice_prefix=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_prefix Object to be assigned


[View source]
def invoice_prefix_present=(invoice_prefix_present : Bool) #

[View source]
def invoice_prefix_present? : Bool #

[View source]
def invoice_settings : Stripe::InvoiceSettingCustomerSetting | Nil #

[View source]
def invoice_settings=(new_value : Stripe::InvoiceSettingCustomerSetting | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_settings Object to be assigned


[View source]
def list_invalid_properties : Array(String) #

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons


[View source]
def livemode : Bool | Nil #

[View source]
def livemode=(new_value : Bool | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned


[View source]
def metadata : Hash(String, String) | Nil #

[View source]
def metadata=(new_value : Hash(String, String) | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned


[View source]
def name : String | Nil #

[View source]
def name=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] name Object to be assigned


[View source]
def name_present=(name_present : Bool) #

[View source]
def name_present? : Bool #

[View source]
def next_invoice_sequence : Int64 | Nil #

[View source]
def next_invoice_sequence=(new_value : Int64 | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] next_invoice_sequence Object to be assigned


[View source]
def object : String | Nil #

[View source]
def object=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned


[View source]
def phone : String | Nil #

[View source]
def phone=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] phone Object to be assigned


[View source]
def phone_present=(phone_present : Bool) #

[View source]
def phone_present? : Bool #

[View source]
def preferred_locales : Array(String) | Nil #

[View source]
def preferred_locales=(new_value : Array(String) | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] preferred_locales Object to be assigned


[View source]
def preferred_locales_present=(preferred_locales_present : Bool) #

[View source]
def preferred_locales_present? : Bool #

[View source]
def shipping : Stripe::CustomerShipping1 | Nil #

[View source]
def shipping=(new_value : Stripe::CustomerShipping1 | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] shipping Object to be assigned


[View source]
def sources : Stripe::ApmsSourcesSourceList | Nil #

[View source]
def sources=(new_value : Stripe::ApmsSourcesSourceList | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] sources Object to be assigned


[View source]
def subscriptions : Stripe::SubscriptionList | Nil #

[View source]
def subscriptions=(new_value : Stripe::SubscriptionList | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] subscriptions Object to be assigned


[View source]
def tax : Stripe::CustomerTax | Nil #

[View source]
def tax=(new_value : Stripe::CustomerTax | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] tax Object to be assigned


[View source]
def tax_exempt : String | Nil #

[View source]
def tax_exempt=(new_value : String | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] tax_exempt Object to be assigned


[View source]
def tax_exempt_present=(tax_exempt_present : Bool) #

[View source]
def tax_exempt_present? : Bool #

[View source]
def tax_ids : Stripe::TaxIDsList | Nil #

[View source]
def tax_ids=(new_value : Stripe::TaxIDsList | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] tax_ids Object to be assigned


[View source]
def test_clock : Stripe::CustomerTestClock | Nil #

[View source]
def test_clock=(new_value : Stripe::CustomerTestClock | Nil) #

Custom attribute writer method checking allowed values (enum). @param [Object] test_clock Object to be assigned


[View source]
def test_clock_present=(test_clock_present : Bool) #

[View source]
def test_clock_present? : Bool #

[View source]
def valid? : Bool #

Check to see if the all the properties in the model are valid @return true if the model is valid


[View source]