Class: Unit::Card::CreateBusinessDebitCardRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/card/create_business_debit_card_request.rb

Direct Known Subclasses

CreateBusinessCreditCardRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id, full_name, date_of_birth, address, shipping_address = nil, phone = nil, email = nil, design = nil, additional_embossed_text = nil, idempotency_key = nil, tags = nil, limits = nil, print_only_business_name = nil, expiry_date = nil) ⇒ CreateBusinessDebitCardRequest

Returns a new instance of CreateBusinessDebitCardRequest.

Parameters:

  • account_id (String)
  • full_name (FullName)
  • date_of_birth (Date)
  • address (Address)
  • shipping_address (Address) (defaults to: nil)
    • optional

  • phone (Phone) (defaults to: nil)
    • optional

  • email (String) (defaults to: nil)
    • optional

  • design (String) (defaults to: nil)
    • optional

  • additional_embossed_text (String) (defaults to: nil)
    • optional

  • idempotency_key (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional

  • limits (Hash) (defaults to: nil)
    • optional

  • print_only_business_name (Boolean) (defaults to: nil)
    • optional

  • expiry_date (String) (defaults to: nil)
    • optional



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 25

def initialize(, full_name, date_of_birth, address, shipping_address = nil, phone = nil, email = nil, design = nil,
               additional_embossed_text = nil, idempotency_key = nil, tags = nil, limits = nil, print_only_business_name = nil, expiry_date = nil)
  @account_id = 
  @full_name = full_name
  @date_of_birth = date_of_birth
  @address = address
  @shipping_address = shipping_address
  @phone = phone
  @email = email
  @design = design
  @additional_embossed_text = additional_embossed_text
  @idempotency_key = idempotency_key
  @tags = tags
  @limits = limits
  @print_only_business_name = print_only_business_name
  @expiry_date = expiry_date
  @type = "businessDebitCard"
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def 
  @account_id
end

#additional_embossed_textObject (readonly)

Returns the value of attribute additional_embossed_text.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def additional_embossed_text
  @additional_embossed_text
end

#addressObject (readonly)

Returns the value of attribute address.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def address
  @address
end

#date_of_birthObject (readonly)

Returns the value of attribute date_of_birth.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def date_of_birth
  @date_of_birth
end

#designObject (readonly)

Returns the value of attribute design.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def design
  @design
end

#emailObject (readonly)

Returns the value of attribute email.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def email
  @email
end

#expiry_dateObject (readonly)

Returns the value of attribute expiry_date.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def expiry_date
  @expiry_date
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def full_name
  @full_name
end

#idempotency_keyObject (readonly)

Returns the value of attribute idempotency_key.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def idempotency_key
  @idempotency_key
end

#limitsObject (readonly)

Returns the value of attribute limits.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def limits
  @limits
end

#phoneObject (readonly)

Returns the value of attribute phone.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def phone
  @phone
end

Returns the value of attribute print_only_business_name.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def print_only_business_name
  @print_only_business_name
end

#shipping_addressObject (readonly)

Returns the value of attribute shipping_address.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def shipping_address
  @shipping_address
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def tags
  @tags
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 8

def type
  @type
end

Instance Method Details

#to_json_apiObject



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/unit/models/card/create_business_debit_card_request.rb', line 44

def to_json_api
  payload = {
    "data": {
      "type": type,
      "attributes": {
        "fullName": full_name&.represent,
        "dateOfBirth": date_of_birth,
        "address": address&.represent,
        "shippingAddress": shipping_address,
        "phone": phone&.represent,
        "email": email,
        "design": design,
        "additionalEmbossedText": additional_embossed_text,
        "idempotencyKey": idempotency_key,
        "tags": tags,
        "limits": limits,
        "printOnlyBusinessName": print_only_business_name,
        "expiryDate": expiry_date
      }.compact!,
      "relationships": {
        "account": Unit::Types::Relationship.new("account", ).to_hash
      }
    }
  }
  payload.to_json
end