Module: Usps::Api::Endpoints::PTSTPod

Included in:
Usps::Api::Endpoints
Defined in:
lib/usps/api/endpoints/ptst_pod.rb

Instance Method Summary collapse

Instance Method Details

#ptst_pod(options = {}) ⇒ Object

Overview

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • ptst_pod_request (required, Hash)
    • :track_id (required, String)

    • :mp_suffix (required, integer)

    • :mp_date (required, String)

    • :request_type (required, String)

    • :first_name (required, String)

    • :last_name (required, String)

    • :email1 (String)

    • :email2 (String)

    • :email3 (String)

    • :cust_reg_id (required, String)

    • :table_code (required, String)

    • :client_ip (String)

    • :source_id (String)



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/usps/api/endpoints/ptst_pod.rb', line 25

def ptst_pod(options = {})
	throw ArgumentError.new('Required arguments :ptst_pod_request missing') if options[:ptst_pod_request].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :track_id missing') if options[:ptst_pod_request][:track_id].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :mp_suffix missing') if options[:ptst_pod_request][:mp_suffix].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :mp_date missing') if options[:ptst_pod_request][:mp_date].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :request_type missing') if options[:ptst_pod_request][:request_type].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :first_name missing') if options[:ptst_pod_request][:first_name].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :last_name missing') if options[:ptst_pod_request][:last_name].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :cust_reg_id missing') if options[:ptst_pod_request][:cust_reg_id].nil?
	throw ArgumentError.new('Required arguments :ptst_pod_request, :table_code missing') if options[:ptst_pod_request][:table_code].nil?

	request = build_request(:ptst_pod, options)
	get('https://secure.shippingapis.com/ShippingAPI.dll', {
		API: 'PTSTPod',
		XML: request,
	})
end