Class: EasyPost::Services::FedexRegistration
- Defined in:
- lib/easypost/services/fedex_registration.rb
Instance Method Summary collapse
-
#register_address(fedex_account_number, params = {}) ⇒ Object
Register the billing address for a FedEx account.
-
#request_pin(fedex_account_number, pin_method_option) ⇒ Object
Request a PIN for FedEx account verification.
-
#submit_invoice(fedex_account_number, params = {}) ⇒ Object
Submit invoice information to complete FedEx account registration.
-
#validate_pin(fedex_account_number, params = {}) ⇒ Object
Validate the PIN entered by the user for FedEx account verification.
Methods inherited from Service
Constructor Details
This class inherits a constructor from EasyPost::Services::Service
Instance Method Details
#register_address(fedex_account_number, params = {}) ⇒ Object
Register the billing address for a FedEx account.
7 8 9 10 11 12 13 14 |
# File 'lib/easypost/services/fedex_registration.rb', line 7 def register_address(fedex_account_number, params = {}) wrapped_params = wrap_address_validation(params) endpoint = "fedex_registrations/#{fedex_account_number}/address" response = @client.make_request(:post, endpoint, wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject) end |
#request_pin(fedex_account_number, pin_method_option) ⇒ Object
Request a PIN for FedEx account verification.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/easypost/services/fedex_registration.rb', line 17 def request_pin(fedex_account_number, pin_method_option) wrapped_params = { pin_method: { option: pin_method_option, }, } endpoint = "fedex_registrations/#{fedex_account_number}/pin" response = @client.make_request(:post, endpoint, wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject) end |
#submit_invoice(fedex_account_number, params = {}) ⇒ Object
Submit invoice information to complete FedEx account registration.
41 42 43 44 45 46 47 48 |
# File 'lib/easypost/services/fedex_registration.rb', line 41 def submit_invoice(fedex_account_number, params = {}) wrapped_params = wrap_invoice_validation(params) endpoint = "fedex_registrations/#{fedex_account_number}/invoice" response = @client.make_request(:post, endpoint, wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject) end |
#validate_pin(fedex_account_number, params = {}) ⇒ Object
Validate the PIN entered by the user for FedEx account verification.
31 32 33 34 35 36 37 38 |
# File 'lib/easypost/services/fedex_registration.rb', line 31 def validate_pin(fedex_account_number, params = {}) wrapped_params = wrap_pin_validation(params) endpoint = "fedex_registrations/#{fedex_account_number}/pin/validate" response = @client.make_request(:post, endpoint, wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, EasyPost::Models::EasyPostObject) end |