Class: Unit::Card::CreateIndividualDebitCardRequest
- Inherits:
-
Object
- Object
- Unit::Card::CreateIndividualDebitCardRequest
- Defined in:
- lib/unit/models/card/create_individual_debit_card_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#additional_embossed_text ⇒ Object
readonly
Returns the value of attribute additional_embossed_text.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#design ⇒ Object
readonly
Returns the value of attribute design.
-
#expiry_date ⇒ Object
readonly
Returns the value of attribute expiry_date.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
-
#print_only_business_name ⇒ Object
readonly
Returns the value of attribute print_only_business_name.
-
#shipping_address ⇒ Object
readonly
Returns the value of attribute shipping_address.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(account_id, customer_id = nil, shipping_address = nil, design = nil, additional_embossed_text = nil, idempotency_key = nil, tags = nil, limits = nil, print_only_business_name = nil, expiry_date = nil) ⇒ CreateIndividualDebitCardRequest
constructor
A new instance of CreateIndividualDebitCardRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, customer_id = nil, shipping_address = nil, design = nil, additional_embossed_text = nil, idempotency_key = nil, tags = nil, limits = nil, print_only_business_name = nil, expiry_date = nil) ⇒ CreateIndividualDebitCardRequest
Returns a new instance of CreateIndividualDebitCardRequest.
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 21 def initialize(account_id, customer_id = nil, shipping_address = nil, design = nil, additional_embossed_text = nil, idempotency_key = nil, = nil, limits = nil, print_only_business_name = nil, expiry_date = nil) @account_id = account_id @customer_id = customer_id @shipping_address = shipping_address @design = design @additional_embossed_text = additional_embossed_text @idempotency_key = idempotency_key @tags = @limits = limits @print_only_business_name = print_only_business_name @expiry_date = expiry_date end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def account_id @account_id end |
#additional_embossed_text ⇒ Object (readonly)
Returns the value of attribute additional_embossed_text.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def additional_embossed_text @additional_embossed_text end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def customer_id @customer_id end |
#design ⇒ Object (readonly)
Returns the value of attribute design.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def design @design end |
#expiry_date ⇒ Object (readonly)
Returns the value of attribute expiry_date.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def expiry_date @expiry_date end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def idempotency_key @idempotency_key end |
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def limits @limits end |
#print_only_business_name ⇒ Object (readonly)
Returns the value of attribute print_only_business_name.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def print_only_business_name @print_only_business_name end |
#shipping_address ⇒ Object (readonly)
Returns the value of attribute shipping_address.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def shipping_address @shipping_address end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 8 def @tags end |
Instance Method Details
#to_json_api ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/unit/models/card/create_individual_debit_card_request.rb', line 35 def to_json_api payload = { "data": { "type": "individualDebitCard", "attributes": { "shippingAddress": shipping_address&.represent, "design": design, "additionalEmbossedText": additional_embossed_text, "idempotencyKey": idempotency_key, "tags": , "limits": limits, "printOnlyBusinessName": print_only_business_name, "expiryDate": expiry_date }, "relationships": { "account": Unit::Types::Relationship.new("depositAccount", account_id).to_hash } } } customer = { "customer": Unit::Types::Relationship.new("customer", customer_id).to_hash } unless customer_id.nil? payload[:data][:relationships].merge!(customer) unless customer.nil? payload[:data][:attributes].compact! payload.to_json end |