25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/ups/UpsInfo.rb', line 25
def initialize(access_options)
@order_cutoff_time = access_options[:order_cutoff_time] || DEFAULT_CUTOFF_TIME
@timeout = access_options[:timeout] || DEFAULT_TIMEOUT
@retry_count = access_options[:retry_count] || DEFAULT_CUTOFF_TIME
@access_xml = generate_xml({
:AccessRequest => {
:AccessLicenseNumber => access_options[:access_license_number],
:UserId => access_options[:user_id],
:Password => access_options[:password]
}
})
@transit_from_attributes = {
:AddressArtifactFormat => {
:PoliticalDivision2 => access_options[:sender_city],
:PoliticalDivision1 => access_options[:sender_state],
:CountryCode => access_options[:sender_country_code] || DEFAULT_COUNTRY_CODE,
:PostcodePrimaryLow => access_options[:sender_zip]
}
}
@rate_from_attributes = {
:Address => {
:City => access_options[:sender_city],
:StateProvinceCode => access_options[:sender_state],
:CountryCode => access_options[:sender_country_code] || DEFAULT_COUNTRY_CODE,
:PostalCode => access_options[:sender_zip]
}
}
end
|