Module: Unit::Card
- Defined in:
- lib/unit/models/card/card.rb,
lib/unit/models/card/list_card_params.rb,
lib/unit/models/card/replace_card_request.rb,
lib/unit/models/card/patch_business_card_request.rb,
lib/unit/models/card/create_business_debit_card_request.rb,
lib/unit/models/card/patch_business_credit_card_request.rb,
lib/unit/models/card/create_business_credit_card_request.rb,
lib/unit/models/card/patch_business_virtual_card_request.rb,
lib/unit/models/card/create_individual_debit_card_request.rb,
lib/unit/models/card/create_individual_virtual_card_request.rb,
lib/unit/models/card/create_business_virtual_debit_card_request.rb,
lib/unit/models/card/patch_business_virtual_credit_card_request.rb,
lib/unit/models/card/create_business_virtual_credit_card_request.rb
Defined Under Namespace
Classes: CreateBusinessCreditCardRequest, CreateBusinessDebitCardRequest, CreateBusinessVirtualCreditCardRequest, CreateBusinessVirtualDebitCardRequest, CreateIndividualDebitCardRequest, CreateIndividualVirtualCardRequest, ListCardParams, PatchBusinessCardRequest, PatchBusinessCreditCardRequest, PatchBusinessVirtualCardRequest, PatchBusinessVirtualCreditCardRequest, ReplaceCardRequest
Constant Summary collapse
- CARD_LIST_LIMIT =
100
- CARD_LIST_OFFSET =
0
Class Method Summary collapse
-
.close_card(card_id:) ⇒ Object
Close a card by calling Unit’s API.
-
.create_business_credit_card(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) ⇒ Object
Create a new business credit card by calling Unit’s API.
-
.create_business_debit_card(account_id:, full_name:, date_of_birth:, address:, phone:, email:, shipping_address: nil, design: nil, additional_embossed_text: nil, idempotency_key: nil, tags: nil, limits: nil, print_only_business_name: nil, expiry_date: nil) ⇒ Object
Create a new business debit card by calling Unit’s API.
-
.create_business_virtual_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil) ⇒ Object
Create a new business virtual card by calling Unit’s API.
-
.create_business_virtual_credit_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil, expiry_date: nil) ⇒ Object
Create a new business virtual credit card by calling Unit’s API.
-
.create_individual_debit_card(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) ⇒ Object
Create a new individual debit card by calling Unit’s API.
-
.create_individual_virtual_card(account_id:, customer_id: nil, idempotency_key: nil, tags: nil, limits: nil) ⇒ Object
Create a new individual virtual card by calling Unit’s API.
-
.freeze_card(card_id:) ⇒ Object
Freeze a card by calling Unit’s API.
-
.get_card(card_id:) ⇒ Object
Get a card by id by calling Unit’s API.
-
.get_pin_status(card_id:) ⇒ Object
Get pin status by calling Unit’s API.
-
.limits(card_id:) ⇒ Object
Get a card limits by calling Unit’s API.
-
.list_cards(limit: CARD_LIST_LIMIT, offset: CARD_LIST_OFFSET, account_id: nil, customer_id: nil, tags: nil, status: nil, include: nil, sort: nil) ⇒ Object
List cards by calling Unit’s API.
-
.replace_card(card_id:, shipping_address: nil) ⇒ Object
Replace a card by calling Unit’s API.
-
.report_lost(card_id:) ⇒ Object
Report a card as a lost by calling Unit’s API.
-
.report_stolen(card_id:) ⇒ Object
Report a card as a stolen by calling Unit’s API.
-
.unfreeze_card(card_id:) ⇒ Object
Unfreeze a card by calling Unit’s API.
-
.update_business_credit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) ⇒ Object
Update a business credit card by calling Unit’s API.
-
.update_business_debit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) ⇒ Object
Update a business debit card by calling Unit’s API.
-
.update_business_virtual_credit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) ⇒ Object
Update a business virtual credit card by calling Unit’s API.
-
.update_business_virtual_debit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) ⇒ Object
Update a business virtual debit card by calling Unit’s API.
Class Method Details
.close_card(card_id:) ⇒ Object
Close a card by calling Unit’s API
195 196 197 |
# File 'lib/unit/models/card/card.rb', line 195 def close_card(card_id:) Unit::Resource::CardResource.close_card(card_id) end |
.create_business_credit_card(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) ⇒ Object
Create a new business credit card by calling Unit’s API
77 78 79 80 |
# File 'lib/unit/models/card/card.rb', line 77 def create_business_credit_card(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) request = CreateBusinessCreditCardRequest.new(account_id, full_name, date_of_birth, address, shipping_address, phone, email, design, additional_embossed_text, idempotency_key, , limits, print_only_business_name, expiry_date) Unit::Resource::CardResource.create_card(request) end |
.create_business_debit_card(account_id:, full_name:, date_of_birth:, address:, phone:, email:, shipping_address: nil, design: nil, additional_embossed_text: nil, idempotency_key: nil, tags: nil, limits: nil, print_only_business_name: nil, expiry_date: nil) ⇒ Object
Create a new business debit card by calling Unit’s API
54 55 56 57 58 59 |
# File 'lib/unit/models/card/card.rb', line 54 def create_business_debit_card(account_id:, full_name:, date_of_birth:, address:, phone:, email:, shipping_address: nil, design: nil, additional_embossed_text: nil, idempotency_key: nil, tags: nil, limits: nil, print_only_business_name: nil, expiry_date: nil) request = CreateBusinessDebitCardRequest.new(account_id, full_name, date_of_birth, address, shipping_address, phone, email, design, additional_embossed_text, idempotency_key, , limits, print_only_business_name, expiry_date) Unit::Resource::CardResource.create_card(request) end |
.create_business_virtual_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil) ⇒ Object
Create a new business virtual card by calling Unit’s API
169 170 171 172 |
# File 'lib/unit/models/card/card.rb', line 169 def create_business_virtual_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil) request = CreateBusinessVirtualDebitCardRequest.new(account_id, full_name, date_of_birth, address, phone, email, idempotency_key, , limits) Unit::Resource::CardResource.create_card(request) end |
.create_business_virtual_credit_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil, expiry_date: nil) ⇒ Object
Create a new business virtual credit card by calling Unit’s API
90 91 92 93 |
# File 'lib/unit/models/card/card.rb', line 90 def create_business_virtual_credit_card(account_id:, full_name:, date_of_birth:, address:, phone: nil, email: nil, idempotency_key: nil, tags: nil, limits: nil, expiry_date: nil) request = CreateBusinessVirtualCreditCardRequest.new(account_id, full_name, date_of_birth, address, phone, email, idempotency_key, , limits, expiry_date) Unit::Resource::CardResource.create_card(request) end |
.create_individual_debit_card(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) ⇒ Object
Create a new individual debit card by calling Unit’s API
32 33 34 35 36 37 |
# File 'lib/unit/models/card/card.rb', line 32 def create_individual_debit_card(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) request = CreateIndividualDebitCardRequest.new(account_id, customer_id, shipping_address, design, additional_embossed_text, idempotency_key, , limits, print_only_business_name, expiry_date) Unit::Resource::CardResource.create_card(request) end |
.create_individual_virtual_card(account_id:, customer_id: nil, idempotency_key: nil, tags: nil, limits: nil) ⇒ Object
Create a new individual virtual card by calling Unit’s API
157 158 159 160 |
# File 'lib/unit/models/card/card.rb', line 157 def create_individual_virtual_card(account_id:, customer_id: nil, idempotency_key: nil, tags: nil, limits: nil) request = CreateIndividualVirtualCardRequest.new(account_id, customer_id, idempotency_key, , limits) Unit::Resource::CardResource.create_card(request) end |
.freeze_card(card_id:) ⇒ Object
Freeze a card by calling Unit’s API
201 202 203 |
# File 'lib/unit/models/card/card.rb', line 201 def freeze_card(card_id:) Unit::Resource::CardResource.freeze_card(card_id) end |
.get_card(card_id:) ⇒ Object
Get a card by id by calling Unit’s API
221 222 223 |
# File 'lib/unit/models/card/card.rb', line 221 def get_card(card_id:) Unit::Resource::CardResource.get_card(card_id) end |
.get_pin_status(card_id:) ⇒ Object
Get pin status by calling Unit’s API
177 178 179 |
# File 'lib/unit/models/card/card.rb', line 177 def get_pin_status(card_id:) Unit::Resource::CardResource.get_pin_status(card_id) end |
.limits(card_id:) ⇒ Object
Get a card limits by calling Unit’s API
242 243 244 |
# File 'lib/unit/models/card/card.rb', line 242 def limits(card_id:) Unit::Resource::CardResource.limits(card_id) end |
.list_cards(limit: CARD_LIST_LIMIT, offset: CARD_LIST_OFFSET, account_id: nil, customer_id: nil, tags: nil, status: nil, include: nil, sort: nil) ⇒ Object
List cards by calling Unit’s API
234 235 236 237 238 |
# File 'lib/unit/models/card/card.rb', line 234 def list_cards(limit: CARD_LIST_LIMIT, offset: CARD_LIST_OFFSET, account_id: nil, customer_id: nil, tags: nil, status: nil, include: nil, sort: nil) request = ListCardParams.new(limit, offset, account_id, customer_id, , status, include, sort) Unit::Resource::CardResource.list_cards(request) end |
.replace_card(card_id:, shipping_address: nil) ⇒ Object
Replace a card by calling Unit’s API
214 215 216 217 |
# File 'lib/unit/models/card/card.rb', line 214 def replace_card(card_id:, shipping_address: nil) request = ReplaceCardRequest.new(card_id, shipping_address) Unit::Resource::CardResource.replace_card(request) end |
.report_lost(card_id:) ⇒ Object
Report a card as a lost by calling Unit’s API
189 190 191 |
# File 'lib/unit/models/card/card.rb', line 189 def report_lost(card_id:) Unit::Resource::CardResource.report_lost(card_id) end |
.report_stolen(card_id:) ⇒ Object
Report a card as a stolen by calling Unit’s API
183 184 185 |
# File 'lib/unit/models/card/card.rb', line 183 def report_stolen(card_id:) Unit::Resource::CardResource.report_stolen(card_id) end |
.unfreeze_card(card_id:) ⇒ Object
Unfreeze a card by calling Unit’s API
207 208 209 |
# File 'lib/unit/models/card/card.rb', line 207 def unfreeze_card(card_id:) Unit::Resource::CardResource.unfreeze_card(card_id) end |
.update_business_credit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) ⇒ Object
Update a business credit card by calling Unit’s API
120 121 122 123 |
# File 'lib/unit/models/card/card.rb', line 120 def update_business_credit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) request = PatchBusinessCreditCardRequest.new(card_id, shipping_address, address, phone, email, design, , limits) Unit::Resource::CardResource.update(request) end |
.update_business_debit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) ⇒ Object
Update a business debit card by calling Unit’s API
105 106 107 108 |
# File 'lib/unit/models/card/card.rb', line 105 def update_business_debit_card(card_id:, shipping_address: nil, address: nil, phone: nil, email: nil, design: nil, tags: nil, limits: nil) request = PatchBusinessCardRequest.new(card_id, shipping_address, address, phone, email, design, , limits) Unit::Resource::CardResource.update(request) end |
.update_business_virtual_credit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) ⇒ Object
Update a business virtual credit card by calling Unit’s API
146 147 148 149 |
# File 'lib/unit/models/card/card.rb', line 146 def update_business_virtual_credit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) request = PatchBusinessVirtualCreditCardRequest.new(card_id, address, phone, email, , limits) Unit::Resource::CardResource.update(request) end |
.update_business_virtual_debit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) ⇒ Object
Update a business virtual debit card by calling Unit’s API
133 134 135 136 |
# File 'lib/unit/models/card/card.rb', line 133 def update_business_virtual_debit_card(card_id:, address: nil, phone: nil, email: nil, tags: nil, limits: nil) request = PatchBusinessVirtualCardRequest.new(card_id, address, phone, email, , limits) Unit::Resource::CardResource.update(request) end |