Class: Unit::Resource::CashDepositResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Unit::Resource::CashDepositResource
- Defined in:
- lib/unit/api_resources/cash_deposit_resource.rb
Class Method Summary collapse
-
.generate_barcode(request) ⇒ UnitResponse, UnitError
Generate a barcode for cash deposit.
-
.get_image_by_barcode_number(barcode_number) ⇒ UnitResponse, UnitError
Get cash deposit image by barcode number.
-
.list_by_coordinates(params = nil) ⇒ UnitResponse, UnitError
List cash deposit store locations by coordinates.
-
.list_by_postal_code(params = nil) ⇒ UnitResponse, UnitError
List cash deposit store locations by postal code.
Methods inherited from BaseResource
file_response_handler, response_handler
Class Method Details
.generate_barcode(request) ⇒ UnitResponse, UnitError
Generate a barcode for cash deposit
15 16 17 18 19 |
# File 'lib/unit/api_resources/cash_deposit_resource.rb', line 15 def (request) payload = request.to_json_api response = HttpHelper.post("#{api_url}/cash-deposits/barcodes", body: payload, headers: headers) response_handler(response) end |
.get_image_by_barcode_number(barcode_number) ⇒ UnitResponse, UnitError
Get cash deposit image by barcode number
40 41 42 43 |
# File 'lib/unit/api_resources/cash_deposit_resource.rb', line 40 def () response = HttpHelper.get("#{api_url}/cash-deposits/barcodes/#{}/image", headers: headers, response_type: "image") file_response_handler(response) end |
.list_by_coordinates(params = nil) ⇒ UnitResponse, UnitError
List cash deposit store locations by coordinates
24 25 26 27 |
# File 'lib/unit/api_resources/cash_deposit_resource.rb', line 24 def list_by_coordinates(params = nil) response = HttpHelper.get("#{api_url}/store-locations", params: params&.to_hash, headers: headers) response_handler(response) end |
.list_by_postal_code(params = nil) ⇒ UnitResponse, UnitError
List cash deposit store locations by postal code
32 33 34 35 |
# File 'lib/unit/api_resources/cash_deposit_resource.rb', line 32 def list_by_postal_code(params = nil) response = HttpHelper.get("#{api_url}/store-locations", params: params.to_hash, headers: headers) response_handler(response) end |