Module: Usps::Api::Endpoints::PTSRre

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

Instance Method Summary collapse

Instance Method Details

#pts_rre(options = {}) ⇒ Object

Overview

Parameters:

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

Options Hash (options):

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

    • :client_ip (String)

    • :source_id (String)

    • :mp_suffix (required, integer)

    • :mp_date (required, String)

    • :first_name (required, String)

    • :last_name (required, String)

    • :email1 (required, String)

    • :email2 (String)

    • :email3 (String)

    • :table_code (required, String)

    • :cust_reg_id (String)



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

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

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